OSDN Git Service

(find_reloads_address): Redo last change: copy the mem
authorrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 18 Oct 1992 00:49:34 +0000 (00:49 +0000)
committerrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 18 Oct 1992 00:49:34 +0000 (00:49 +0000)
in the same way it's usually done.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@2503 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/reload.c

index befe84e..f5afa5f 100644 (file)
@@ -3633,7 +3633,13 @@ find_reloads_address (mode, memrefloc, ad, loc, operand, ind_levels)
       /* If tem was changed, then we must create a new memory reference to
         hold it and store it back into memrefloc.  */
       if (tem != ad && memrefloc)
-       *memrefloc = gen_rtx (MEM, GET_MODE (*memrefloc), tem);
+       {
+         rtx oldref = *memrefloc;
+         *memrefloc = copy_rtx (*memrefloc);
+         loc = &XEXP (*memrefloc, 0);
+         if (operand == oldref)
+           operand = *memrefloc;
+       }
 
       /* Check similar cases as for indirect addresses as above except
         that we can allow pseudos and a MEM since they should have been