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]

patch to reload1.c to delete REG_LIBALL and REG_RETVAL notes


Hi guys,

  This is just a quick note to say that I have applied the following
  patch to relaod1.c to delete the REG_RETVAL and REG_LIBCALL notes
  after reload is completed.

Cheers
	Nick


Mon Dec 14 14:09:34 1998  Nick Clifton  <nickc@cygnus.com>

	* reload1.c (reload): Delete REG_RETVAL and REG_LIBCALL notes
          after completeing reload.

	* rtl.texi: Document that REG_RETVAL and REG_LIBCALL are
          deleted after reload.

Index: reload1.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/reload1.c,v
retrieving revision 1.112
retrieving revision 1.114
diff -p -r1.112 -r1.114
*** reload1.c	1998/12/11 04:59:25	1.112
--- reload1.c	1998/12/14 14:13:25	1.114
*************** compute_use_by_pseudos (to, from)
*** 536,545 ****
         int r = reg_renumber[regno];
         int nregs;
         if (r < 0)
! 	 abort ();
!        nregs = HARD_REGNO_NREGS (r, PSEUDO_REGNO_MODE (regno));
!        while (nregs-- > 0)
! 	 SET_HARD_REG_BIT (*to, r + nregs);
       });
  }
  
--- 536,555 ----
         int r = reg_renumber[regno];
         int nregs;
         if (r < 0)
! 	 {
! 	   /* reload_combine uses the information from
! 	      basic_block_live_at_start, which might still contain registers
! 	      that have not actually been allocated since they have an
! 	      equivalence.  */
! 	   if (! reload_completed)
! 	     abort ();
! 	 }
!        else
! 	 {
! 	   nregs = HARD_REGNO_NREGS (r, PSEUDO_REGNO_MODE (regno));
! 	   while (nregs-- > 0)
! 	     SET_HARD_REG_BIT (*to, r + nregs);
! 	 }
       });
  }
  
*************** reload (first, global, dumpfile)
*** 1108,1114 ****
  
    /* 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 and simplify (subreg (reg)) operands.  */
  
    for (insn = first; insn; insn = NEXT_INSN (insn))
      if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
--- 1118,1126 ----
  
    /* 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 and simplify (subreg (reg)) operands.
!      Also remove all REG_RETVAL and REG_LIBCALL notes since they are no longer
!      useful or accurate.  */
  
    for (insn = first; insn; insn = NEXT_INSN (insn))
      if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
*************** reload (first, global, dumpfile)
*** 1129,1135 ****
  	while (*pnote != 0)
  	  {
  	    if (REG_NOTE_KIND (*pnote) == REG_DEAD
! 		|| REG_NOTE_KIND (*pnote) == REG_UNUSED)
  	      *pnote = XEXP (*pnote, 1);
  	    else
  	      pnote = &XEXP (*pnote, 1);
--- 1141,1149 ----
  	while (*pnote != 0)
  	  {
  	    if (REG_NOTE_KIND (*pnote) == REG_DEAD
! 		|| REG_NOTE_KIND (*pnote) == REG_UNUSED
! 		|| REG_NOTE_KIND (*pnote) == REG_RETVAL
! 		|| REG_NOTE_KIND (*pnote) == REG_LIBCALL)
  	      *pnote = XEXP (*pnote, 1);
  	    else
  	      pnote = &XEXP (*pnote, 1);


Index: rtl.texi
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/rtl.texi,v
retrieving revision 1.41
diff -p -r1.41 rtl.texi
*** rtl.texi	1998/11/23 08:14:21	1.41
--- rtl.texi	1998/12/11 00:49:07
*************** delete such sequences whose results are 
*** 2664,2673 ****
--- 2664,2679 ----
  A @code{REG_EQUAL} note will also usually be attached to this insn to 
  provide the expression being computed by the sequence.
  
+ These notes will be deleted after reload, since they are no longer
+ accurate or useful.
+ 
  @findex REG_LIBCALL
  @item REG_LIBCALL
  This is the inverse of @code{REG_RETVAL}: it is placed on the first
  insn of a multi-insn sequence, and it points to the last one.
+ 
+ These notes are deleted after reload, since they are no longer useful or 
+ accurate. 
  
  @findex REG_CC_SETTER
  @findex REG_CC_USER


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