]> granicus.if.org Git - clang/commitdiff
The Driver does not set the +strict-align flag when targeting
authorAlexandros Lamprineas <alexandros.lamprineas@arm.com>
Mon, 5 Oct 2015 12:45:10 +0000 (12:45 +0000)
committerAlexandros Lamprineas <alexandros.lamprineas@arm.com>
Mon, 5 Oct 2015 12:45:10 +0000 (12:45 +0000)
[ARM] armv6m + netbsd. Tests are misssing for armv6m + darwin as well.

Differential Revision: http://reviews.llvm.org/D13217

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249308 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets.cpp
lib/Driver/Tools.cpp
test/Driver/arm-alignment.c

index 87ecc57b0d7f49074a88481ab8c12381b0bf8a13..4397c7a677fd7b8cfe8f154d203d61bdd47b768c 100644 (file)
@@ -4452,10 +4452,6 @@ public:
       if (Feature[0] == '+')
         Features[Feature+1] = true; 
 
-    if (ArchVersion < 6  || 
-       (ArchVersion == 6 && ArchProfile == llvm::ARM::PK_M))
-      Features["strict-align"] = true;
-
     return TargetInfo::initFeatureMap(Features, Diags, CPU, FeaturesVec);
   }
 
index 1b42ff70f2b9e52fc4cb0d9b3b76ae8a5f080a0f..649f90784e99525605855ee3d3acdd1b4e51ead9 100644 (file)
@@ -834,7 +834,8 @@ static void getARMTargetFeatures(const ToolChain &TC,
     // The above behavior is consistent with GCC.
     int VersionNum = getARMSubArchVersionNumber(Triple);
     if (Triple.isOSDarwin() || Triple.isOSNetBSD()) {
-      if (VersionNum < 6)
+      if (VersionNum < 6 ||
+          Triple.getSubArch() == llvm::Triple::SubArchType::ARMSubArch_v6m)
         Features.push_back("+strict-align");
     } else if (Triple.isOSLinux() || Triple.isOSNaCl()) {
       if (VersionNum < 7)
index 21a29192a5667d1f3cf761f740089d4557b5cc4a..3e21652039563506c001b8cc0bac6dcbd7023e6a 100644 (file)
 // RUN: %clang -target armv6-unknown-nacl-gnueabihf -### %s 2> %t
 // RUN: FileCheck --check-prefix=CHECK-ALIGNED-ARM < %t %s
 
+// RUN: %clang -target armv6m-apple-darwin -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-ALIGNED-ARM < %t %s
+
+// RUN: %clang -target armv6m-netbsd-eabi -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-ALIGNED-ARM < %t %s
+
 // RUN: %clang -target aarch64-none-gnueabi -mno-unaligned-access -### %s 2> %t
 // RUN: FileCheck --check-prefix=CHECK-ALIGNED-AARCH64 < %t %s