diff options
author | Bob Wilson <bob.wilson@apple.com> | 2009-09-15 17:56:18 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2009-09-15 17:56:18 +0000 |
commit | 967bf27de2123c98f538aeb80cea8c17dcefdffb (patch) | |
tree | 6fe73830a19c459658e83bf979a0a94846bc2619 | |
parent | f3369c22a78474fef6902552ddf12a210a9293ed (diff) | |
download | bcm5719-llvm-967bf27de2123c98f538aeb80cea8c17dcefdffb.tar.gz bcm5719-llvm-967bf27de2123c98f538aeb80cea8c17dcefdffb.zip |
Handle AddrMode4 for Thumb2 in rewriteT2FrameIndex. This occurs for
VLDM/VSTM instructions, and without this check, the code assumes that an
offset is allowed, as it would be with VLDR/VSTR. The asm printer,
however, silently drops the offset, producing incorrect code. Since the
address register in this case is either the stack or frame pointer, the
spill location ends up conflicting with some other stack slot or with
outgoing arguments on the stack.
llvm-svn: 81879
-rw-r--r-- | llvm/lib/Target/ARM/Thumb2InstrInfo.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp b/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp index 8c09ebd3e00..264601bf414 100644 --- a/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp +++ b/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp @@ -383,6 +383,11 @@ bool llvm::rewriteT2FrameIndex(MachineInstr &MI, unsigned FrameRegIdx, "Bit extraction didn't work?"); MI.getOperand(FrameRegIdx+1).ChangeToImmediate(ThisImmVal); } else { + + // AddrMode4 cannot handle any offset. + if (AddrMode == ARMII::AddrMode4) + return false; + // AddrModeT2_so cannot handle any offset. If there is no offset // register then we change to an immediate version. unsigned NewOpc = Opcode; |