------- Comment #11 from steven at gcc dot gnu dot org 2010-03-17 08:23 ------- So why not just something like the following:
Note that uses in REG_EQUAL notes are taken into account in the computation of invariants. Hence it is safe to retain the note even if the note contains register references. */ - if (! inv->always_executed - && (note = find_reg_note (inv->insn, REG_EQUAL, NULL_RTX))) + note = find_reg_note (inv->insn, REG_EQUAL, NULL_RTX); + if (note + && (! inv->always_executed + || ! check_maybe_invariant (XEXP (note, 0))) remove_note (inv->insn, note); } else In other words, nuke the note if it is not always executed or if the note value is not invariant? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43360