RFA: loop optimization bug

Jeffrey A Law law@redhat.com
Tue Jul 26 17:46:00 GMT 2005


On Mon, 2005-07-18 at 16:31 -0700, Dale Johannesen wrote:
> I'm seeing a case where the tree optimizers produce a loop with a 
> branch into its middle, like this (CFG at first RTL dump):
[ ... ]


> Before I get too deep, is it the intent of the tree optimizers to 
> produce only CFGs that conform to the loop optimizer's expectations,
> or should the RTL opts be handling this? 
The tree optimizers should (when possible) avoid creating irreducible
loops.

Can you look at the tree dumps to analyze which pass is creating a
loop with multiple entry points (I'm assuming that block blocks #7
and #8 are reachable from outside the loop, your CFG was incomplete
so I'm having to make some assumptions).

The most likely culprit would be DOM/jump threading -- it's got a fair
amount of code to try and avoid this kind of situation, but it's
certainly possible it's missing cases.

jeff





More information about the Gcc-patches mailing list