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]

Bug in my previous register elimination patch


The patch below corrects a bug in the register elimination code.  We
copy the body of an insn with copy_insn, but we don't copy the reg notes.
That causes at least one problem: find_reloads can no longer find the
REG_UNUSED note for a SCRATCH during the first passes.  This means we
get RELOAD_OTHER reloads for these SCRATCHES during the first passes,
and RELOAD_FOR_INSN reloads in the last pass.

Bernd

	* reload1.c (eliminate_regs_in_insn): Also copy reg notes. 

Index: reload1.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/reload1.c,v
retrieving revision 1.178
diff -c -p -r1.178 reload1.c
*** reload1.c	1999/10/29 17:51:38	1.178
--- reload1.c	1999/11/02 15:26:41
*************** eliminate_regs_in_insn (insn, replace)
*** 3515,3521 ****
  	 and one is inside RTL that has been copied while the other is not.  */
        new_body = old_body;
        if (! replace)
! 	new_body = copy_insn (old_body);
        PATTERN (insn) = new_body;
  
        /* If we had a move insn but now we don't, rerecognize it.  This will
--- 3071,3081 ----
  	 and one is inside RTL that has been copied while the other is not.  */
        new_body = old_body;
        if (! replace)
! 	{
! 	  new_body = copy_insn (old_body);
! 	  if (REG_NOTES (insn))
! 	    REG_NOTES (insn) = copy_insn_1 (REG_NOTES (insn));
! 	}
        PATTERN (insn) = new_body;
  
        /* If we had a move insn but now we don't, rerecognize it.  This will


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