]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/45051 (gcc.c-torture/execute/builtins/abs-2.c and abs-3.c...
authorBernd Schmidt <bernds@codesourcery.com>
Tue, 27 Jul 2010 09:34:51 +0000 (09:34 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Tue, 27 Jul 2010 09:34:51 +0000 (09:34 +0000)
PR rtl-optimization/45051
* reload1.c (delete_output_reload): Use refers_to_regno_p rather
than reg_mentioned_p.

From-SVN: r162558

gcc/ChangeLog
gcc/reload1.c

index 24e1a9cec8b7418d62f0bced8e78aae7a84e27c9..6983da721b4acc93ce962ca0d76708b26a49ced5 100644 (file)
@@ -3,6 +3,10 @@
        * postreload.c (reload_combine_recognize_const_pattern): Move test
        for limiting the insn movement to the right scope.
 
+       PR rtl-optimization/45051
+       * reload1.c (delete_output_reload): Use refers_to_regno_p rather
+       than reg_mentioned_p.
+
 2010-07-26  Richard Henderson  <rth@redhat.com>
 
        PR target/44132
index 437b8c2f286e1ce8cd857d74367efc152abf7752..5c49f3cf817aa7619e817afafc1ef5adc392ccd3 100644 (file)
@@ -8813,6 +8813,8 @@ delete_output_reload (rtx insn, int j, int last_reload_reg, rtx new_reload_reg)
   int n_inherited = 0;
   rtx i1;
   rtx substed;
+  unsigned regno;
+  int nregs;
 
   /* It is possible that this reload has been only used to set another reload
      we eliminated earlier and thus deleted this instruction too.  */
@@ -8864,6 +8866,12 @@ delete_output_reload (rtx insn, int j, int last_reload_reg, rtx new_reload_reg)
   if (n_occurrences > n_inherited)
     return;
 
+  regno = REGNO (reg);
+  if (regno >= FIRST_PSEUDO_REGISTER)
+    nregs = 1;
+  else
+    nregs = hard_regno_nregs[regno][GET_MODE (reg)];
+
   /* If the pseudo-reg we are reloading is no longer referenced
      anywhere between the store into it and here,
      and we're within the same basic block, then the value can only
@@ -8875,7 +8883,7 @@ delete_output_reload (rtx insn, int j, int last_reload_reg, rtx new_reload_reg)
       if (NOTE_INSN_BASIC_BLOCK_P (i1))
        return;
       if ((NONJUMP_INSN_P (i1) || CALL_P (i1))
-         && reg_mentioned_p (reg, PATTERN (i1)))
+         && refers_to_regno_p (regno, regno + nregs, PATTERN (i1), NULL))
        {
          /* If this is USE in front of INSN, we only have to check that
             there are no more references than accounted for by inheritance.  */