It would be wonderful if someone would enhance bugpoint to prune down the list of global var initializers when some are required to provoke a compiler crash. Domagoj Babic produced a patch that does exactly this: http://lists.cs.uiuc.edu/pipermail/llvmbugs/2006-October/002004.html ... but his patch does not use the list reducer. It would be great if someone could pick this up and finish it. -Chris
I have a potential patch for this (it compiles! Ship it!). Is there a test case that I can use to verify this against Domagoj's patch? -bw
I'd suggest going into lib/CodeGen/AsmPrinter.cpp. In the AsmPrinter::EmitGlobalConstant method, add: assert(CV->isNullValue()); you just inserted a 'bug'. Recompile llc, then use: bugpoint -run-llc myprogram.bc Which should reduce it down to just one global that has a non-zero initializer. -Chris
Putting that line in didn't work. Bugpoint didn't even execute that method. :-( -bw
Right, bugpoint doesn't run the code generator. however, it should fork off llc, which should. Make sure you have a complex-enough .bc file, and use bugpoint -run-llc.
I did run it with -run-llc, but nothing. I thought that the file was complex enough. Anyway, Domagoj checked and it did produce the same result as his patch. I submitted the patch. It can stand some improvement (like not cloning the Module each time). -bw
Here's the patch: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20061023/039047.html
Isn't this done, if so, shouldn't it be closed? -Chris
Good point. Fixed here: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20061023/039047.html