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: problem with REG_DEAD


Richard Henderson wrote :
> 
> On Mon, Jan 29, 2001 at 09:52:14PM +0000, Herman ten Brugge wrote:
> > 	* regmove.c (try_auto_increment): Change REG_DEAD into REG_UNUSED
> > 	when register dies in the insn.
> 
> Looks reasonable.
> 
> > +		  if (note)
> > +		    {
> > +		      remove_note (insn, note);
> > +		      REG_NOTES (insn)
> > +			    = gen_rtx_EXPR_LIST (REG_UNUSED,
> > +						 reg, REG_NOTES (insn));
> 
> You do not, however, need to remove the note and create
> and new one.  Just update the type with PUT_MODE.

Ok. Here is the new patch. I do not have write permission so could some
one please install this patch after aproval. All torture tests for the c4x 
target pass.

	Herman.



2001-01-30 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>

	* regmove.c (try_auto_increment): Change REG_DEAD into REG_UNUSED
	when register dies in the insn.


--- regmove.c.org	Sat Jan 27 21:20:52 2001
+++ regmove.c	Tue Jan 30 17:11:20 2001
@@ -146,6 +146,15 @@ try_auto_increment (insn, inc_insn, inc_
 			       gen_rtx_fmt_e (inc_code, Pmode, reg), 1);
 	      if (apply_change_group ())
 		{
+		  /* Change any REG_DEAD note for register reg because
+		     it will be changed into REG_UNUSED by flow. We have
+		     to do this here or else this will causes problems in the
+		     scheduling pass where we compare the number of
+		     REG_DEAD's.  */
+		  rtx note = find_reg_note (insn, REG_DEAD, reg);
+		  if (note)
+		    PUT_MODE (note, REG_UNUSED);
+
 		  REG_NOTES (insn)
 		    = gen_rtx_EXPR_LIST (REG_INC,
 					 reg, REG_NOTES (insn));

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