projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ARM: allow misaligned local variables in Thumb1 mode.
[oota-llvm.git]
/
lib
/
Target
/
ARM
/
Thumb1RegisterInfo.cpp
diff --git
a/lib/Target/ARM/Thumb1RegisterInfo.cpp
b/lib/Target/ARM/Thumb1RegisterInfo.cpp
index fb8aaff926955197cf6cd346838c4b3170dac3c7..d0626311dd1476072aec530e85c46d835c9f3da4 100644
(file)
--- a/
lib/Target/ARM/Thumb1RegisterInfo.cpp
+++ b/
lib/Target/ARM/Thumb1RegisterInfo.cpp
@@
-364,8
+364,6
@@
rewriteFrameIndex(MachineBasicBlock::iterator II, unsigned FrameRegIdx,
} else {
NumBits = 8;
Scale = 4;
} else {
NumBits = 8;
Scale = 4;
- assert((Offset & 3) == 0 &&
- "Thumb add/sub sp, #imm immediate must be multiple of 4!");
}
unsigned PredReg;
}
unsigned PredReg;
@@
-380,7
+378,7
@@
rewriteFrameIndex(MachineBasicBlock::iterator II, unsigned FrameRegIdx,
// Common case: small offset, fits into instruction.
unsigned Mask = (1 << NumBits) - 1;
// Common case: small offset, fits into instruction.
unsigned Mask = (1 << NumBits) - 1;
- if (((Offset / Scale) & ~Mask) == 0) {
+ if (
Offset % Scale == 0 &&
((Offset / Scale) & ~Mask) == 0) {
// Replace the FrameIndex with sp / fp
if (Opcode == ARM::tADDi3) {
MI.setDesc(TII.get(Opcode));
// Replace the FrameIndex with sp / fp
if (Opcode == ARM::tADDi3) {
MI.setDesc(TII.get(Opcode));