[llvm-bugs] [Bug 28803] New: Bugpoint's basic block extraction produce codes that get rejected by the verifier

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Aug 1 14:30:25 PDT 2016


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

            Bug ID: 28803
           Summary: Bugpoint's basic block extraction produce codes that
                    get rejected by the verifier
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: bugpoint
          Assignee: unassignedbugs at nondot.org
          Reporter: feishenniubi at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

This is a direct follow-up of https://llvm.org/bugs/show_bug.cgi?id=28799 

ResumeInst needs to be in a function with a personality. However, bugpoint
doesn't respect that constraint when trying to perform basic block extraction.

Here's how I got the error:
> bugpoint -run-llc -safe-run-llc test.ll -loop-unroll -gcc=clang++

And here's the output:

Read input file      : 'test.ll'
*** All input ok
Running selected passes on program to test for crash: Success!
Initializing execution environment: Found llc:
/home/grieve/LLVM/GSoC/Testing/debugBuild/bin/llc
Running the code generator to test for a crash: <llc>
Generating reference output from raw program: <llc><llc><CC><program>
Reference output is: bugpoint.reference.out-9b386e1

*** Checking the code generator...
<llc><CC><program>
*** Output matches: Debugging miscompilation!
Checking to see if '' compiles correctly: <llc><CC><program> yup.
Checking to see if '-loop-unroll' compiles correctly: <llc><CC><program> nope.

*** Found miscompiling pass: -loop-unroll
Emitted bitcode to 'bugpoint-passinput.bc'

*** You can reproduce the problem with: opt bugpoint-passinput.bc -loop-unroll
Checking to see if the program is misoptimized when these functions are run
through the pass: main _ZNSt5dequeIdSaIdEE18_M_fill_initializeERKd
_ZNSt11_Deque_baseIdSaIdEE17_M_initialize_mapEm
_ZNSt11_Deque_baseIdSaIdEE15_M_create_nodesEPPdS3_ __clang_call_terminate
  Optimizing functions being tested: done.
  Checking to see if the merged program executes correctly: <llc><CC><program>
nope.
Checking to see if the program is misoptimized when these functions are run
through the pass: _ZNSt11_Deque_baseIdSaIdEE17_M_initialize_mapEm
_ZNSt11_Deque_baseIdSaIdEE15_M_create_nodesEPPdS3_ __clang_call_terminate
  Optimizing functions being tested: done.
  Checking to see if the merged program executes correctly: <llc><CC><program>
yup.
Checking to see if the program is misoptimized when these functions are run
through the pass: main _ZNSt5dequeIdSaIdEE18_M_fill_initializeERKd
  Optimizing functions being tested: done.
  Checking to see if the merged program executes correctly: <llc><CC><program>
nope.
Checking to see if the program is misoptimized when this function is run
through the pass: _ZNSt5dequeIdSaIdEE18_M_fill_initializeERKd
  Optimizing functions being tested: done.
  Checking to see if the merged program executes correctly: <llc><CC><program>
yup.
Checking to see if the program is misoptimized when this function is run
through the pass: main
  Optimizing functions being tested: done.
  Checking to see if the merged program executes correctly: <llc><CC><program>
nope.

*** The following function is being miscompiled:  main
Extracted a loop from the breaking portion of the program.
<llc><CC><program>  Testing after loop extraction:
  Optimizing functions being tested: done.
  Checking to see if the merged program executes correctly: <llc><CC><program>
yup.
*** Loop extraction masked the problem.  Undoing.
Checking to see if the program is misoptimized when all blocks are extracted.
ResumeInst needs to be in a function with a personality
  resume { i8*, i32 } %eh.lpad-body
LLVM ERROR: Broken function found, compilation aborted!
*** Basic Block extraction failed, please report a bug!
Emitted bitcode to 'bugpoint-basicblockextractfail.bc'
Checking to see if the program is misoptimized when all but these 31 blocks are
extracted: entry for.cond.cleanup .noexc lpad.i lpad.i.ehcleanup_crit_edge
if.then.i.i26 if.then.i.i26.invoke.cont.i.i31_crit_edge
for.body.i.i.i30.preheader for.body.i.i.i30
for.body.i.i.i30.for.body.i.i.i30_crit_edge ...


I've attached both test.ll and bugpoint-basicblockextractfail.ll for reference.

-- 
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/20160801/e1ee45f4/attachment-0001.html>


More information about the llvm-bugs mailing list