r120333 changed the opcode for the Thumb1 stuff from ARM::tMOVr to
authorBill Wendling <isanbard@gmail.com>
Sat, 18 Dec 2010 02:13:59 +0000 (02:13 +0000)
committerBill Wendling <isanbard@gmail.com>
Sat, 18 Dec 2010 02:13:59 +0000 (02:13 +0000)
ARM::tMOVgpr2gpr. But this check didn't change. As a result, we were getting
misaligned references to the jump table from an ADR instruction.

There is a test case, but unfortunately it's sensitive to random code changes.

<rdar://problem/8782223>

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

lib/Target/ARM/ARMAsmPrinter.cpp

index 1c5997e959842b6917ea40bc1dcd0b4028017c9d..ba88106ca57e638aa90b9580b454698e83c62f7a 100644 (file)
@@ -1025,7 +1025,7 @@ void ARMAsmPrinter::EmitInstruction(const MachineInstr *MI) {
     OutStreamer.EmitInstruction(TmpInst);
 
     // Make sure the Thumb jump table is 4-byte aligned.
-    if (Opc == ARM::tMOVr)
+    if (Opc == ARM::tMOVgpr2gpr)
       EmitAlignment(2);
 
     // Output the data for the jump table itself