llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.9k stars 11.51k forks source link

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

Open llvmbot opened 12 years ago

llvmbot commented 12 years ago
Bugzilla Link 11919
Version trunk
OS MacOS X
Reporter LLVM Bugzilla Contributor
llvmbot 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: Checking the code generator...

*** 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 (<--- hangs) Expected output: bugpoint executes the new module and compares its output with the reference output.
llvmbot commented 12 years ago

testcase