PR opt/8492

Eric Botcazou ebotcazou@libertysurf.fr
Mon Dec 2 02:52:00 GMT 2002


Hi,

This PR is a regression on the mainline: GCC spins forever compiling a loop. 
The problem originates in the GCSE pass: the case-that-can't-never-happen 
described in gcse.c:find_avail_set() happens, because the availability info 
provided by lcm.c is flawed.

The problem is that the last cprop pass of GCSE is allowed to cprop into 
conditional jumps, so its first sub-pass (local cprop pass) is allowed to do 
so as well. Now this first sub-pass causes a BB to become orphaned (no more 
predecessor), so the LCM code is fooled.

The ad-hoc fix is to clean up the CFG between the local cprop pass and the 
main cprop pass when edges have been purged.

Now the very problem is that the construct 

    if (count) {
      if (count)
        locked = 1;
      else
        locked = 1;

      if (!locked)
        continue;
    }

is not fully simplified by the CSE1+jump optimization pass. We end up with:

    if (count) {
      locked = 1;

      if (!locked)
        continue;
    }

which of course is caught by the local cprop subpass of GCSE.


So what to do ? Is the ad-hoc fix the way to go or is there anything to do 
before the GCSE pass ?

-- 
Eric Botcazou



More information about the Gcc mailing list