> I don't think we want to do that. A REG_EQUAL/REG_EQUIV note can use a > pseudo that isn't live and still be valid. Consider a simple example > like this: > > a = b + 3 > // b dies here > c = a {REG_EQUAL b+3} > > The REG_EQUAL note is valid and may help optimization. Removing it > just because b is dead at that point would be unnecessarily > pessimistic.
But if you have a REG_DEAD note for b on the first insn, then you cannot rematerialize the REG_EQUAL note after it, otherwise bad things can happen. See PR rtl-optimization/51505 for an example. -- Eric Botcazou