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]
Other format: [Raw text]

fix shared rtl problem (again)


I fixed this a while ago, but then Kenner made this copy conditional.

For the record, the sharing can be seen in execute/19990325-1.f on
i686, though it requires register allocation changes in my tree to
actively fail.  But hopefully this is the last problem with that patch,
so I'll get them committed before the end of the week.


r~


        * emit-rtl.c (adjust_address_1): Always copy address to avoid
        shared rtl.

Index: emit-rtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/emit-rtl.c,v
retrieving revision 1.237
diff -c -p -d -r1.237 emit-rtl.c
*** emit-rtl.c	2001/12/12 02:47:53	1.237
--- emit-rtl.c	2001/12/12 18:08:54
*************** adjust_address_1 (memref, mode, offset, 
*** 1966,1980 ****
    rtx size = 0;
    unsigned int memalign = MEM_ALIGN (memref);
  
!   if (adjust == 0 || offset == 0)
!     /* ??? Prefer to create garbage instead of creating shared rtl.  */
!     addr = copy_rtx (addr);
    /* If MEMREF is a LO_SUM and the offset is within the alignment of the
       object, we can merge it into the LO_SUM.  */
!   else if (GET_MODE (memref) != BLKmode && GET_CODE (addr) == LO_SUM
! 	   && offset >= 0
! 	   && (unsigned HOST_WIDE_INT) offset
! 	      < GET_MODE_ALIGNMENT (GET_MODE (memref)) / BITS_PER_UNIT)
      addr = gen_rtx_LO_SUM (Pmode, XEXP (addr, 0),
  			   plus_constant (XEXP (addr, 1), offset));
    else
--- 1966,1982 ----
    rtx size = 0;
    unsigned int memalign = MEM_ALIGN (memref);
  
!   /* ??? Prefer to create garbage instead of creating shared rtl.
!      This may happen even if adjust is non-zero -- consider
!      (plus (plus reg reg) const_int) -- so do this always.  */
!   addr = copy_rtx (addr);
! 
    /* If MEMREF is a LO_SUM and the offset is within the alignment of the
       object, we can merge it into the LO_SUM.  */
!   if (GET_MODE (memref) != BLKmode && GET_CODE (addr) == LO_SUM
!       && offset >= 0
!       && (unsigned HOST_WIDE_INT) offset
! 	  < GET_MODE_ALIGNMENT (GET_MODE (memref)) / BITS_PER_UNIT)
      addr = gen_rtx_LO_SUM (Pmode, XEXP (addr, 0),
  			   plus_constant (XEXP (addr, 1), offset));
    else


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