http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47290
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-17 14:49:53 UTC --- Created attachment 22995 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22995 gcc46-pr47290.patch Ugh, cddce pass for empty loop: <L0>: <bb 6>: goto <bb 6>; creates a preheader: <L0>: <bb 6>: <bb 7>: goto <bb 6>; so suddenly we have an empty infinite loop containing two bbs instead of one, on which cleanup_empty_eh keeps up oscillating between the landing pads on bb 6 and on bb 7 forever. There is a check already for empty infinite loops, but it covers just those containing just single bb, not more than that. I wonder if ehcleanup should be prepared for empty infinite loops containing arbitrary number of bbs, or if worst case two of them should be possible (that can be fixed by the attached patch) and why a preheader is created inside of the loop instead of before it.