Hi guys, On Thu, Nov 12, 2020 at 09:10:14PM -0700, Jeff Law wrote: > On 11/12/20 7:02 PM, Xionghu Luo via Gcc wrote: > > The output shows "REQ_EQUAL r118:DI+0x66546b64" is deleted by > > df_remove_dead_eq_notes, > > but r120:DI is not REG_DEAD here, so is it correct here to check insn use > > and find that > > r118:DI is dead then do the delete? > > It doesn't matter where the death occurs, any REG_DEAD note will cause > the REG_EQUAL note to be removed. So given the death note for r118, > then any REG_EQUAL note that references r118 will be removed. This is > overly pessimistic as the note may still be valid/useful at some > points. See > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92291
The note even *always* is valid where it is! As you say, the REG_EQUAL is only (necessarily) valid at *that* insn. And this insn *sets* the reg (that is the only case when a REG_EQ* is allowed at all), so if the eq reg is dead (i.e. unused) the whole insn is, and the insn can be removed. Removing all REG_EQUAL notes for regs that become dead anywhere seems to just be a thinko? All pseudos are dead somewhere! (Yeah okay, infinite loops, but other than that.) Segher