From 41573804f278a6ff3bbc43217c6d4b3bb415df73 Mon Sep 17 00:00:00 2001 From: Ana Pazos Date: Fri, 23 Mar 2018 17:53:27 +0000 Subject: [ARM] Fix "Constant pool entry out of range!" in Thumb1 mode This patch fixes PR36658, "Constant pool entry out of range!" in Thumb1 mode. In ARMConstantIslands::optimizeThumb2JumpTables() in Thumb1 mode, adjustBBOffsetsAfter() is not calculating postOffset correctly by properly accounting for the padding that is required for the constant pool that immediately follows the jump table branch instruction. Reviewers: t.p.northover, eli.friedman Reviewed By: t.p.northover Subscribers: chrib, tstellar, javed.absar, kristof.beyls, llvm-commits Differential Revision: https://reviews.llvm.org/D44709 llvm-svn: 328341 --- llvm/lib/Target/ARM/ARMComputeBlockSize.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'llvm/lib/Target/ARM/ARMComputeBlockSize.cpp') diff --git a/llvm/lib/Target/ARM/ARMComputeBlockSize.cpp b/llvm/lib/Target/ARM/ARMComputeBlockSize.cpp index 2e97b99b05a..b263e9d86c4 100644 --- a/llvm/lib/Target/ARM/ARMComputeBlockSize.cpp +++ b/llvm/lib/Target/ARM/ARMComputeBlockSize.cpp @@ -35,6 +35,7 @@ mayOptimizeThumb2Instruction(const MachineInstr *MI) { case ARM::tBcc: // optimizeThumb2JumpTables. case ARM::t2BR_JT: + case ARM::tBR_JTr: return true; } return false; -- cgit v1.2.3