This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Don't delete REG_UNUSED


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]