On Wed, Sep 5, 2012 at 1:42 PM, Matthew Gretton-Dann wrote: > Whilst this fix works for this particular case I am not sure it is the > best fix for the general issue, and so if others have a better idea how > to fix this I would be very happy.
postreload-gcse.c is broken in "interesting" ways. Look at this gem for example: static bool reg_changed_after_insn_p (rtx x, int cuid) { unsigned int regno, end_regno; regno = REGNO (x); end_regno = END_HARD_REGNO (x); do if (reg_avail_info[regno] > cuid) return true; while (++regno < end_regno); return false; } So the more conservative the fix, the better :-) The patch looks correct to me. But perhaps the pass should just punt on blocks not ending in a simple jump in bb_has_well_behaved_predecessors? Ciao! Steven