[llvm-bugs] [Bug 36658] New: ARMConstantIslandPass.cpp:350: llvm_unreachable 'Constant pool entry out of range!' in Thumb1 mode

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Mar 8 20:52:57 PST 2018


https://bugs.llvm.org/show_bug.cgi?id=36658

            Bug ID: 36658
           Summary: ARMConstantIslandPass.cpp:350: llvm_unreachable
                    'Constant pool entry out of range!' in Thumb1 mode
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: llc
          Assignee: unassignedbugs at nondot.org
          Reporter: apazos at codeaurora.org
                CC: llvm-bugs at lists.llvm.org

Created attachment 20026
  --> https://bugs.llvm.org/attachment.cgi?id=20026&action=edit
failing test case

ARMConstantIslands::verify() fails with the attached Thumb1 test case.

2 TBBs are inserted by optimizeThumb2JumpTables() as expected and the BB sizes
look correct, but when isCPEntryInRange() computes UserOffset and CPEOffset,
CPEOffset turns out to be smaller then UserOffset, causing verify() to fail.

I understand the pass tries to synthesize Thumb1 TBB like it does Thumb2 TBB,
but there is no hardware instruction in Thumb1, and Thumb1 TBB
pseudoinstruction is later lowered to a sequence of  4 instructions.

tTBB_JT/tTBH_JT pseudoinstructions are defined with Size=2, while 
t2TBB_JT/t2TBH_JT pseudoinstructions are defined with Size=4. If I force
tTBB_JT pseudoinstruction Size=4, just like Thumb2, the issue is gone.

How to reproduce:
run llc bug-tbb-opt.ll -debug-only=arm-cp-islands

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180309/690e56f6/attachment.html>


More information about the llvm-bugs mailing list