This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH, LRA] Remove REG_DEAD and REG_UNUSED notes.
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Steven Bosscher <stevenb dot gcc at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Yvan Roux <yvan dot roux at linaro dot org>, Vladimir Makarov <vmakarov at redhat dot com>, Patch Tracking <patches at linaro dot org>
- Date: Wed, 25 Sep 2013 22:53:21 +0200
- Subject: Re: [PATCH, LRA] Remove REG_DEAD and REG_UNUSED notes.
- Authentication-results: sourceware.org; auth=none
- References: <CAD57uCdOYQAkj+M3pVncqNpadeBFrxqn=yuRETHJ=Uy_GBoYow at mail dot gmail dot com> <4163413 dot 18cp2JSUdS at polaris> <CABu31nN2wF3R=DAf2dP9CS7prkrLtGeQw_yvU3VF--4AP5e1=A at mail dot gmail dot com>
> > The description is too terse. In the RTL middle-end, you shouldn't have
> > to manually deal with the REG_DEAD and REG_UNUSED notes (unlike
> > REG_EQUAL and REG_EQUIV notes), as the DF framework is supposed to do
> > it for you.
> Unfortunately LRA uses its own DF framework.
In fact reload does just the same:
/* Make a pass over all the insns and delete all USEs which we inserted
only to tag a REG_EQUAL note on them. Remove all REG_DEAD and REG_UNUSED
notes. Delete all CLOBBER insns, except those that refer to the return
value and the special mem:BLK CLOBBERs added to prevent the scheduler
from misarranging variable-array code, and simplify (subreg (reg))
operands. Strip and regenerate REG_INC notes that may have been moved
pnote = ®_NOTES (insn);
while (*pnote != 0)
if (REG_NOTE_KIND (*pnote) == REG_DEAD
|| REG_NOTE_KIND (*pnote) == REG_UNUSED
|| REG_NOTE_KIND (*pnote) == REG_INC)
*pnote = XEXP (*pnote, 1);
pnote = &XEXP (*pnote, 1);
so I guess LRA is entitled to do it as well. But the proper fix to this is to
recompute the REG_DEAD/REG_UNUSED notes at the beginning of postreload.