Bugzilla – Bug 116
[adce] ADCE considers blocks without postdominators to be unreachable
Last modified: 2003-11-16 15:47:31
You need to log in before you can comment on or make changes to this bug.
I reduced ed, which has not worked for the longest time, into a test case. It turned out to be kind of interesting: ed's main() has a loop involving a goto and a sigsetjmp. Unfortunately, I am now pretty tired, so I'm going to make this brief: the LLVM program which I am going to attach to this bug is supposed to print "ok\n", and it loops infinitely instead if you apply opt -adce.
Created an attachment (id=23) [details] test case This is the test case, reduced beyond recognition from ed-0.2/main.c
This bug is caused by the code doing basically this: ... while (1) exit(0); ... No post-dominance information exists for this loop because it cannot reach the exit node of the CFG (a return or unwind instruction). ADCE should obviously not delete these blocks though. I'm preparing a patch. -Chris
Fixed like this (comments in the patch): http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20031110/009564.html Thanks for taking the time to reduce this testcase. This is a _bad_ miscompilation. :( -Chris
Oh yeah, the testcase is here: llvm/test/Regression/Transforms/ADCE/2003-11-16-MissingPostDominanceInfo.ll