Bug in loop discovery code

Jan Hubicka jh@suse.cz
Sat Sep 22 08:39:00 GMT 2001


Hi,
I've been investigating the irreducible regions branch prediction code
complains about in combine.c compilation and found that they are not
real irreducible regions, just problem comming from loop discovery.

The problem can be seen at function "expand_field_assignment" and few others.
(Search for "Irreducible" in the .life dump)
That function contains 3 loops, first two share headers and last one is nested
in the first one (not second), but the loop nest tree claim they are all
sibbling loops.

This is caused by fact, that the loop discovery code always examinate just the
previous loop for possible nest, not other ones.  I've worked around by
modifying it to examine all of them, but I am quite sure that it is not proper
fix as you seems to be pretty confident in the code that checking the last
one is enought.

Can you please take a look at it? The bug causes intermost loops to be ignored
in case there are muliple nonnested loops in the code thats quite common.

Thanks,
Honza



More information about the Gcc-bugs mailing list