]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport a change to the 2.95 branch
authorBernd Schmidt <bernds@redhat.co.uk>
Thu, 30 Nov 2000 12:28:02 +0000 (12:28 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Thu, 30 Nov 2000 12:28:02 +0000 (12:28 +0000)
From-SVN: r37887

gcc/ChangeLog
gcc/reload.c
gcc/reload.h
gcc/reload1.c

index 16dde7299e9e5b59d986212a0f3014583a20686d..2924f0daf97a24e0896b4365146136541235778f 100644 (file)
@@ -1,5 +1,13 @@
 2000-11-30  Bernd Schmidt  <bernds@redhat.co.uk>
 
+       Wed Oct 27 03:09:23 1999  J"orn Rennecke  <amylaar@redhat.co.uk>
+       * reload.h (earlyclobber_operand_p): Declare.
+       * reload.c (earlyclobber_operand_p): Don't declare.  No longer static.
+       * reload1.c (reload_reg_free_for_value_p):  RELOAD_OTHER reloads with
+       an earlyclobbered output conflict with RELOAD_INPUT reloads - handle
+       case where the RELOAD_OTHER reload is new.  Use
+       earlyclobber_operand_p.
+
        2000-01-12  Bernd Schmidt  <bernds@redhat.co.uk>
        * reload1.c (reload_reg_unavailable): New static variable.
        (reload_reg_free_p): Test it.
index 689acaa2ec3c2bccd6adfb3325fe6198fba932da..72b38f3251659ee4363143cd20cb89b53460d28d 100644 (file)
@@ -322,7 +322,6 @@ static int find_reusable_reload     PROTO((rtx *, rtx, enum reg_class,
 static rtx find_dummy_reload   PROTO((rtx, rtx, rtx *, rtx *,
                                       enum machine_mode, enum machine_mode,
                                       enum reg_class, int, int));
-static int earlyclobber_operand_p PROTO((rtx));
 static int hard_reg_set_here_p PROTO((int, int, rtx));
 static struct decomposition decompose PROTO((rtx));
 static int immune_p            PROTO((rtx, rtx, struct decomposition));
@@ -2006,7 +2005,7 @@ find_dummy_reload (real_in, real_out, inloc, outloc,
 
 /* Return 1 if X is an operand of an insn that is being earlyclobbered.  */
 
-static int
+int
 earlyclobber_operand_p (x)
      rtx x;
 {
index 968d3124af49a54b6c2f008a33e39f49aabc8473..50526db8566fc58efca62a2eb58960d397ecd127 100644 (file)
@@ -342,3 +342,5 @@ extern void save_call_clobbered_regs PROTO((void));
 
 /* Replace (subreg (reg)) with the appropriate (reg) for any operands.  */
 extern void cleanup_subreg_operands PROTO ((rtx));
+
+extern int earlyclobber_operand_p PROTO((rtx));
index b49d9925551f4405ca27029cd067a00996ed7bfb..82c7cbe4b5c90903ffbf5c1cb6f538508ce506b8 100644 (file)
@@ -5206,6 +5206,10 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
      int ignore_address_reloads;
 {
   int time1;
+  /* Set if we see an input reload that must not share its reload register
+     with any new earlyclobber, but might otherwise share the reload
+     register with an output or input-output reload.  */
+  int check_earlyclobber = 0;
   int i;
   int copy = 0;
 
@@ -5333,6 +5337,7 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
                  break;
                case RELOAD_FOR_INPUT:
                  time2 = reload_opnum[i] * 4 + 4;
+                 check_earlyclobber = 1;
                  break;
                /* reload_opnum[i] * 4 + 4 <= (MAX_RECOG_OPERAND - 1) * 4 + 4
                   == MAX_RECOG_OPERAND * 4  */
@@ -5345,6 +5350,7 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
                  break;
                case RELOAD_FOR_OPERAND_ADDRESS:
                  time2 = MAX_RECOG_OPERANDS * 4 + 2;
+                 check_earlyclobber = 1;
                  break;
                case RELOAD_FOR_INSN:
                  time2 = MAX_RECOG_OPERANDS * 4 + 3;
@@ -5373,6 +5379,9 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
                  if (! reload_in[i] || rtx_equal_p (reload_in[i], value))
                    {
                      time2 = MAX_RECOG_OPERANDS * 4 + 4;
+                     /* Earlyclobbered outputs must conflict with inputs.  */
+                     if (earlyclobber_operand_p (reload_out[i]))
+                       time2 = MAX_RECOG_OPERANDS * 4 + 3;
                      break;
                    }
                  time2 = 1;
@@ -5395,6 +5404,11 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
            }
        }
     }
+
+  /* Earlyclobbered outputs must conflict with inputs.  */
+  if (check_earlyclobber && out && earlyclobber_operand_p (out))
+    return 0;
+
   return 1;
 }