diff --git a/lib/Target/ARM/ARMBaseRegisterInfo.cpp b/lib/Target/ARM/ARMBaseRegisterInfo.cpp index c93473d62e6..41b061a1237 100644 --- a/lib/Target/ARM/ARMBaseRegisterInfo.cpp +++ b/lib/Target/ARM/ARMBaseRegisterInfo.cpp @@ -1121,18 +1121,22 @@ eliminateFrameIndex(MachineBasicBlock::iterator II, break; } case ARMII::AddrModeT2_i12: { - ImmIdx = i+2; + ImmIdx = i+1; InstrOffs = MI.getOperand(ImmIdx).getImm(); NumBits = 12; break; } - case ARMII::AddrModeT2_so: case ARMII::AddrModeT2_i8: { - ImmIdx = i+2; + ImmIdx = i+1; InstrOffs = MI.getOperand(ImmIdx).getImm(); NumBits = 8; break; } + case ARMII::AddrModeT2_so: { + ImmIdx = i+2; + InstrOffs = MI.getOperand(ImmIdx).getImm(); + break; + } default: LLVM_UNREACHABLE("Unsupported addressing mode!"); break;