]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
(find_reloads): Change secondary reloads of class
authorRichard Kenner <kenner@gcc.gnu.org>
Tue, 14 Jun 1994 21:36:25 +0000 (17:36 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Tue, 14 Jun 1994 21:36:25 +0000 (17:36 -0400)
RELOAD_FOR_OPERAND_ADDRESS to RELOAD_FOR_OPADDR_ADDR.

From-SVN: r7461

gcc/reload.c

index 88fd64855e60afa5ffd0d9f44315fffc8c7340a4..7452b2a56ab656b8d0b297ffbe4290fcce0e458d 100644 (file)
@@ -3581,7 +3581,41 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
           || reload_when_needed[i] == RELOAD_FOR_OUTPUT_ADDRESS)
          && (operand_reloadnum[reload_opnum[i]] < 0
              || reload_optional[operand_reloadnum[reload_opnum[i]]]))
-       reload_when_needed[i] = RELOAD_FOR_OPERAND_ADDRESS;
+       {
+         /* If we have a secondary reload to go along with this reload,
+            change its type to RELOAD_FOR_OPADDR_ADDR. */
+
+         if (reload_when_needed[i] == RELOAD_FOR_INPUT_ADDRESS
+             && reload_secondary_in_reload[i] != -1)
+           {
+             int secondary_in_reload = reload_secondary_in_reload[i];
+
+             reload_when_needed[secondary_in_reload] = 
+               RELOAD_FOR_OPADDR_ADDR;
+
+             /* If there's a tertiary reload we have to change it also. */
+             if (secondary_in_reload > 0
+                 && reload_secondary_in_reload[secondary_in_reload] != -1)
+               reload_when_needed[reload_secondary_in_reload[secondary_in_reload]] 
+                 = RELOAD_FOR_OPADDR_ADDR;
+           }
+
+         if (reload_when_needed[i] == RELOAD_FOR_OUTPUT_ADDRESS
+             && reload_secondary_out_reload[i] != -1)
+           {
+             int secondary_out_reload = reload_secondary_out_reload[i];
+
+             reload_when_needed[secondary_out_reload] = 
+               RELOAD_FOR_OPADDR_ADDR;
+
+             /* If there's a tertiary reload we have to change it also. */
+             if (secondary_out_reload
+                 && reload_secondary_out_reload[secondary_out_reload] != -1)
+               reload_when_needed[reload_secondary_out_reload[secondary_out_reload]] 
+                 = RELOAD_FOR_OPADDR_ADDR;
+           }
+         reload_when_needed[i] = RELOAD_FOR_OPERAND_ADDRESS;
+       }
 
       if (reload_when_needed[i] == RELOAD_FOR_INPUT_ADDRESS
          && operand_reloadnum[reload_opnum[i]] >= 0