(find_reloads_address): If tem != ad, then create a new
authorRichard Stallman <rms@gnu.org>
Tue, 6 Oct 1992 00:19:55 +0000 (00:19 +0000)
committerRichard Stallman <rms@gnu.org>
Tue, 6 Oct 1992 00:19:55 +0000 (00:19 +0000)
mem to hold it and store it back into memrefloc.

From-SVN: r2330

gcc/reload.c

index b5f844ba3fa48fb104c6bca769df67e2bf698da7..459939b43cc92c9678c74294f8d2eab4280106ca 100644 (file)
@@ -3618,6 +3618,12 @@ find_reloads_address (mode, memrefloc, ad, loc, operand, ind_levels)
       tem = ad;
       find_reloads_address (GET_MODE (ad), &tem, XEXP (ad, 0), &XEXP (ad, 0),
                            operand, ind_levels == 0 ? 0 : ind_levels - 1);
+
+      /* 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);
+
       /* Check similar cases as for indirect addresses as above except
         that we can allow pseudos and a MEM since they should have been
         taken care of above.  */