reload.c (combine_reloads): Don't combine an output reload if there are other reloads...
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>
Sat, 3 Nov 2001 15:56:17 +0000 (15:56 +0000)
committerRichard Kenner <kenner@gcc.gnu.org>
Sat, 3 Nov 2001 15:56:17 +0000 (10:56 -0500)
* reload.c (combine_reloads): Don't combine an output reload if there
are other reloads around for part of the output.

From-SVN: r46734

gcc/ChangeLog
gcc/reload.c

index de15b86295fb0e8986c9679b45a1ac0d95cb665e..bbdb844fca46ca27a45867c6bb1bd27056089509 100644 (file)
@@ -1,5 +1,16 @@
 Sat Nov  3 10:37:56 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
+       * reload.c (combine_reloads): Don't combine an output reload if there
+       are other reloads around for part of the output.
+
+       * emit-rtl.c (set_mem_attributes): Set RTX_UNCHANGINGP_P if T is a
+       constant expression.
+       (set_mem_decl): New function.
+       * expr.h (set_mem_decl): New declaration.
+       * final.c (get_decl_from_op): Don't use ORIGINAL_REGNO if not pseudo.
+       (output_asm_operand_names): Add tab.
+       * reload1.c (alter_reg): Set decl of MEM from REG_DECL.
+
        * builtins.c (get_memory_rtx): Properly set MEM alias set and
        attributes.
 
index 9ed9cd09948ea1d80c68fbd603076070b7a5270c..ad884ae4c786bb713bc50e0c09c73ffd9bbf3d34 100644 (file)
@@ -1641,6 +1641,16 @@ combine_reloads ()
   if (earlyclobber_operand_p (rld[output_reload].out))
     return;
 
+  /* If there is a reload for part of the address of this operand, we would
+     need to chnage it to RELOAD_FOR_OTHER_ADDRESS.  But that would extend
+     its life to the point where doing this combine would not lower the
+     number of spill registers needed.  */
+  for (i = 0; i < n_reloads; i++)
+    if ((rld[i].when_needed == RELOAD_FOR_OUTPUT_ADDRESS
+        || rld[i].when_needed == RELOAD_FOR_OUTADDR_ADDRESS)
+       && rld[i].opnum == rld[output_reload].opnum)
+      return;
+
   /* Check each input reload; can we combine it?  */
 
   for (i = 0; i < n_reloads; i++)