[PATCH] D13217: [ARM] The Driver does not set the +strict-align flag when targeting armv6m + netbsd

Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 5 05:46:57 PDT 2015


This revision was automatically updated to reflect the committed changes.
Closed by commit rL249308: The Driver does not set the +strict-align flag when targeting (authored by alelab01).

Changed prior to commit:
  http://reviews.llvm.org/D13217?vs=35883&id=36507#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D13217

Files:
  cfe/trunk/lib/Basic/Targets.cpp
  cfe/trunk/lib/Driver/Tools.cpp
  cfe/trunk/test/Driver/arm-alignment.c

Index: cfe/trunk/test/Driver/arm-alignment.c
===================================================================
--- cfe/trunk/test/Driver/arm-alignment.c
+++ cfe/trunk/test/Driver/arm-alignment.c
@@ -59,6 +59,12 @@
 // 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
 
Index: cfe/trunk/lib/Basic/Targets.cpp
===================================================================
--- cfe/trunk/lib/Basic/Targets.cpp
+++ cfe/trunk/lib/Basic/Targets.cpp
@@ -4452,10 +4452,6 @@
       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: cfe/trunk/lib/Driver/Tools.cpp
===================================================================
--- cfe/trunk/lib/Driver/Tools.cpp
+++ cfe/trunk/lib/Driver/Tools.cpp
@@ -834,7 +834,8 @@
     // 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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13217.36507.patch
Type: text/x-patch
Size: 1844 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151005/a769b1c6/attachment.bin>


More information about the cfe-commits mailing list