This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Don't delete REG_UNUSED
- To: law at cygnus dot com (Jeffrey A Law)
- Subject: Re: Don't delete REG_UNUSED
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Sat, 28 Nov 1998 17:58:06 GMT
- Cc: schwab at issan dot informatik dot uni-dortmund dot de (Andreas Schwab), egcs-patches at cygnus dot com, crux at pool dot informatik dot rwth-aachen dot de (Bernd Schmidt), amylaar at cygnus dot co dot uk (Joern Rennecke)
- Newsgroups: cygnus.egcs.patches
In article <13286.910245528.cygnus.egcs.patches@upchuck> you wrote:
Andreas:
: > Note that both pseudos 70 and 82 have been allocated to the same register,
: > which is ok, since the destination of the second set is not marked as
: > earlyclobber in the constraints for udivmodsi4. But the destination of
: > the first set must be reloaded, which effectively extends the lifetime of
: > pseudo 79 in %d0 until after the insn. Again, this is ok, since the store
: > to pseudo 82 in %d0 can be ignored. But that also means that register %d0
: > looks like being set by the insn if the REG_UNUSED note is deleted, when
: > in fact it isn't actually.
: >
: > Here is the source that triggers the bug, to be compiled with -O2 for
: > m68k-linux.
Jeff:
: Ugh. Conceptually I think the patch is OK. Do we need to worry about
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 can't think of any cases where REG_UNUSED notes were inaccurate after
: reload, so I doubt keeping them is going to hurt anything.
Even if you haven't seen such a case in the past, that doesn't mean that
it can't happen.
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 could
be made used by reload inheritance or reload_cse_regs.