https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69737

--- Comment #5 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Author: segher
Date: Wed Nov  1 16:40:42 2017
New Revision: 254315

URL: https://gcc.gnu.org/viewcvs?rev=254315&root=gcc&view=rev
Log:
combine: Fix bug in giving up placing REG_DEAD notes (PR82683)

When we have a REG_DEAD note for a reg that is set in the new I2, we
drop the note on the floor (we cannot find whether to place it on I2
or on I3).  But the code I added to do this has a bug and does not
always actually drop it.  This patch fixes it.

But that on its own is too pessimistic, it turns out, and we generate
worse code.  One case where we do know where to place the note is if
it came from I3 (it should go to I3 again).  Doing this fixes all of
the regressions.


        PR rtl-optimization/64682
        PR rtl-optimization/69567
        PR rtl-optimization/69737
        PR rtl-optimization/82683
        * combine.c (distribute_notes) <REG_DEAD>: If the new I2 sets the same
        register mentioned in the note, drop the note, unless it came from I3,
        in which case it should go to I3 again.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/combine.c

Reply via email to