Add support for -mstrict-align compiler option for ARM targets.
rdar://12340498


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167620 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp
index 3b9558b..65cc49e 100644
--- a/lib/Target/ARM/ARMISelLowering.cpp
+++ b/lib/Target/ARM/ARMISelLowering.cpp
@@ -9119,7 +9119,8 @@
 
 bool ARMTargetLowering::allowsUnalignedMemoryAccesses(EVT VT) const {
   // The AllowsUnaliged flag models the SCTLR.A setting in ARM cpus
-  bool AllowsUnaligned = Subtarget->allowsUnalignedMem();
+  bool AllowsUnaligned = Subtarget->allowsUnalignedMem() &&
+    !getTargetMachine().Options.StrictAlign;
 
   switch (VT.getSimpleVT().SimpleTy) {
   default: