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 applied to reload.c


Reviewed by Jim Wilson.

Thu Mar 18 19:09:50 1999  J"orn Rennecke <amylaar@cygnus.co.uk>

	* reload.c (find_reloads_toplev): When processing X recursively,
	don't alter it destructively except by filling in constants.

Index: reload.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/reload.c,v
retrieving revision 1.145.10.4
diff -p -r1.145.10.4 reload.c
*** reload.c	1999/03/10 22:36:34	1.145.10.4
--- reload.c	1999/03/18 01:00:28
*************** find_reloads_toplev (x, opnum, type, ind
*** 4324,4329 ****
--- 4324,4330 ----
  
    register char *fmt = GET_RTX_FORMAT (code);
    register int i;
+   int copied;
  
    if (code == REG)
      {
*************** find_reloads_toplev (x, opnum, type, ind
*** 4460,4470 ****
  					 insn);
      }
  
!   for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
      {
        if (fmt[i] == 'e')
! 	XEXP (x, i) = find_reloads_toplev (XEXP (x, i), opnum, type,
! 					   ind_levels, is_set_dest, insn);
      }
    return x;
  }
--- 4461,4484 ----
  					 insn);
      }
  
!   for (copied = 0, i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
      {
        if (fmt[i] == 'e')
! 	{
! 	  rtx new_part = find_reloads_toplev (XEXP (x, i), opnum, type,
! 					      ind_levels, is_set_dest, insn);
! 	  /* If we have replaced a reg with it's equivalent memory loc -
! 	     that can still be handled here e.g. if it's in a paradoxical
! 	     subreg - we must make the change in a copy, rather than using
! 	     a destructive change.  This way, find_reloads can still elect
! 	     not to do the change.  */
! 	  if (new_part != XEXP (x, i) && ! CONSTANT_P (new_part) && ! copied)
! 	    {
! 	      x = copy_rtx (x);
! 	      copied = 1;
! 	    }
! 	  XEXP (x, i) = new_part;
! 	}
      }
    return x;
  }


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