------- Additional Comments From ian at airs dot com  2005-09-27 05:33 -------
Eric, your patch which caused the quadratic behaviour is here:
    http://gcc.gnu.org/ml/gcc-patches/2003-05/msg01358.html

I know this is a real long-shot, but do you have any recollection of what
problem you were solving?  That is, which test case was failing before you
checked in your patch?  And how was it failing?  The failure case looks
relatively benign to me--we think that a register lives longer than it really 
does.

To me that old code looks pretty much right--in fact it is one of the
suggestions I made in my previous comment.  In comment #20 you say there was a
comment in the code which indicated that it didn't always do the right thing,
and in fact you removed that comment in your patch:
-   - there are extremely rare cases (see distribute_regnotes) when a
-     REG_DEAD note is lost
But in fact that comment not only was correct but still is correct.  In some
cases, a REG_DEAD note will be lost, and in those cases the code sets a bit in
refresh_blocks and reruns life analysis.

Actually, I can see that there is a bug in the original code in some unusual
cases.  It relies on reg_set_p to see whether the register is set and therefore
the REG_DEAD note can be discarded.  But really we can only casually remove the
REG_DEAD note if the register is completely set, and reg_set_p can return true
if the register is partially set.  For example, if a STRICT_LOW_PART is used
when setting the register, we may wind up losing the REG_DEAD note incorrectly.
 I think that we can only ignore the register if dead_or_set_p returns true for 
it.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13931

Reply via email to