death to obstack hackery

Richard Henderson rth@cygnus.com
Wed Oct 25 17:00:00 GMT 2000


Mm, tasty.


r~


        * reload.c (find_reloads_address_part): Kill rtx obstack hackery.

Index: reload.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/reload.c,v
retrieving revision 1.130
diff -c -p -d -r1.130 reload.c
*** reload.c	2000/09/14 17:42:48	1.130
--- reload.c	2000/10/25 23:48:01
*************** find_reloads_address_part (x, loc, class
*** 5525,5542 ****
      {
        rtx tem;
  
!       /* If this is a CONST_INT, it could have been created by a
! 	 plus_constant call in eliminate_regs, which means it may be
! 	 on the reload_obstack.  reload_obstack will be freed later, so
! 	 we can't allow such RTL to be put in the constant pool.  There
! 	 is code in force_const_mem to check for this case, but it doesn't
! 	 work because we have already popped off the reload_obstack, so
! 	 rtl_obstack == saveable_obstack is true at this point.  */
!       if (GET_CODE (x) == CONST_INT)
! 	tem = x = force_const_mem (mode, GEN_INT (INTVAL (x)));
!       else
! 	tem = x = force_const_mem (mode, x);
! 
        find_reloads_address (mode, &tem, XEXP (tem, 0), &XEXP (tem, 0),
  			    opnum, type, ind_levels, 0);
      }
--- 5538,5544 ----
      {
        rtx tem;
  
!       tem = x = force_const_mem (mode, x);
        find_reloads_address (mode, &tem, XEXP (tem, 0), &XEXP (tem, 0),
  			    opnum, type, ind_levels, 0);
      }
*************** find_reloads_address_part (x, loc, class
*** 5548,5559 ****
      {
        rtx tem;
  
!       /* See comment above.  */
!       if (GET_CODE (XEXP (x, 1)) == CONST_INT)
! 	tem = force_const_mem (GET_MODE (x), GEN_INT (INTVAL (XEXP (x, 1))));
!       else
! 	tem = force_const_mem (GET_MODE (x), XEXP (x, 1));
! 
        x = gen_rtx_PLUS (GET_MODE (x), XEXP (x, 0), tem);
        find_reloads_address (mode, &tem, XEXP (tem, 0), &XEXP (tem, 0),
  			    opnum, type, ind_levels, 0);
--- 5550,5556 ----
      {
        rtx tem;
  
!       tem = force_const_mem (GET_MODE (x), XEXP (x, 1));
        x = gen_rtx_PLUS (GET_MODE (x), XEXP (x, 0), tem);
        find_reloads_address (mode, &tem, XEXP (tem, 0), &XEXP (tem, 0),
  			    opnum, type, ind_levels, 0);


More information about the Gcc-patches mailing list