aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/reload1.c10
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 24e1a9c..6983da7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 437b8c2..5c49f3c 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -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. */