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]

adjust_address tweak


I've been playing with some post-reload register allocation cleanups.
In the process I discovered that many of our DImode splitters create
shared rtl, which of course plays royal hell with anything trying to
make any substantial changes to instructions.

Tested on i686 linux.


r~


        * emit-rtl.c (adjust_address): Make a copy of the memory address.

Index: emit-rtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/emit-rtl.c,v
retrieving revision 1.195
diff -c -p -d -r1.195 emit-rtl.c
*** emit-rtl.c	2001/07/22 21:42:34	1.195
--- emit-rtl.c	2001/07/29 01:34:08
*************** adjust_address (memref, mode, offset)
*** 1636,1641 ****
--- 1636,1644 ----
       will do memref tracking.  */
    rtx addr = XEXP (memref, 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.  */
    if (GET_MODE (memref) != BLKmode && GET_CODE (addr) == LO_SUM


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