Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

bugpoint generates invalid module with a blockaddress in a global initializer #10970

Open Quuxplusone opened 12 years ago

Quuxplusone commented 12 years ago
Bugzilla Link PR11919
Status NEW
Importance P normal
Reported by dreynaud@apple.com
Reported on 2012-02-03 17:43:10 -0800
Last modified on 2012-02-16 09:45:59 -0800
Version trunk
Hardware Macintosh MacOS X
CC dreynaud@apple.com, llvm-bugs@lists.llvm.org, rafael@espindo.la
Fixed by commit(s)
Attachments bad.ll (779 bytes, application/octet-stream)
Blocks
Blocked by
See also
Quuxplusone commented 12 years ago

Attached bad.ll (779 bytes, application/octet-stream): testcase

Quuxplusone commented 12 years ago
I hit this issue when debugging a code generator problem. When bugpoint splits
the module in two halves, the safe module contains the global initializers but
not the functions bodies. If a global initializer contains a blockaddress, the
module is invalid.

To reproduce with r149717 (the -output flag is needed to force bugpoint down
the debugCodeGenerator path):

$ lli bad.ll
the answer is 3.
$ echo "some random string" > out
$ bugpoint bad.ll -run-llc -safe-run-llc -output=out
Read input file      : 'bad.ll'
*** All input ok
Initializing execution environment: Found gcc: /usr/bin/gcc
Running the code generator to test for a crash: <llc>
*** Checking the code generator...
<llc><gcc><program>
*** Input program does not match reference diff!
Debugging code generator problem!
Checking to see if the program is misoptimized when these functions are run
through the passes: foo main
<llc>  (<--- hangs)

Expected output: bugpoint executes the new module and compares its output with
the reference output.