Don't delete REG_UNUSED
Jeffrey A Law
law@cygnus.com
Sat Nov 28 11:32:00 GMT 1998
In message < 199811281758.RAA15326@phal.cygnus.co.uk >you write:
> I think the actual problem is that flow didn't handle the PARALLEL
> correctly. If a register is set in an instruction but the value is not
> used, a REG_UNUSED note should be added, no matter if the previous value
> of the register is used in the insn or not.
I understand your point. But I do not think it is safe or correct in the
case that Andreas showed. Though I'm willing to reconsider.
> Even if you haven't seen such a case in the past, that doesn't mean that
> it can't happen.
Correct. Maybe I should have been clearer. I'm not aware of a case where a
a REG_UNUSED note could be inaccurate after reload and any code which created
an inaccurate REG_UNUSED note would have to be reconsidered if we were to make
the change Andreas suggested.
> For example, consider a PARALLEL that sets an UNUSED register to a constant.
> This constant could be needed for a reg_equiv_constant or secondary address
> reload of a later instruction, and thus the previously unused register coul> d
> be made used by reload inheritance or reload_cse_regs.
That would be a problem. Depending on what we decide to do with Andreas's
patch we may (or may not) have to disable that kind of optimization if the
register has a REG_UNUSED note. Or have reload remove the inaccurate note.
Or find another way to fix Andreas's problem.
Jeff
More information about the Gcc-patches
mailing list