This is the mail archive of the 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]
Other format: [Raw text]

Re: [PATCH, LRA] Remove REG_DEAD and REG_UNUSED notes.

> > 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
     around.  */


	pnote = &REG_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.

Eric Botcazou

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