http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57300
--- Comment #13 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Steven Bosscher from comment #9) > (In reply to Jakub Jelinek from comment #6) > > So supposedly > > bool > > split_dead_or_set_p (rtx insn, const_rtx x) > > { > > if (BLOCK_FOR_INSN (insn) == NULL) > > return false; /* If cfg is gone, be conservative. */ > > if (df_note == NULL) > > { > > df_note_add_problem (); > > df_analyze (); > > } > > return dead_or_set_p (insn, x); > > } > > > > could work. Steven, comments? > > I don't think this will work. The fact that df_note != NULL does not > mean the notes are up-to-date. > > It seems to me that after freeing the CFG, no pass should rely on the > REG_DEAD and REG_UNUSED notes if Eric's comment in PR57281 is correct: > That each pass is responsible for re-computing the notes if it needs > them. But I would much rather have the passes at least discard the > notes if the pass can't update them. After all, it's not just this > dead_or_set_p function that relies on these notes, but also single_set > and a bunch of other functions. I agree that possibly bogus IL is a smoking gun that waits for this kind of bugs to appear. If we do not want to pay the price of removing notes can we at least have a flag that tells whether the NOTE problem is up-to-date (and add verification that it indeed is - at least has no bogus notes - when that flag is set)? We could introduce a new PROP_rtl_notes for that. As for the case in question in PR57281 - it shouldn't be hard for postreload to remove REG_DEAD notes from all uses when it propagates equivalencies, no? Btw, as alternative to computing the NOTE problem at the start of split we can also remove all notes which should be cheaper.