Commit 2b0cb007 by Bernd Schmidt Committed by Bernd Schmidt

re PR rtl-optimization/45051 (gcc.c-torture/execute/builtins/abs-2.c and abs-3.c…

re PR rtl-optimization/45051 (gcc.c-torture/execute/builtins/abs-2.c and abs-3.c due to "track subwords of DImode allocnos")

	PR rtl-optimization/45051
	* reload1.c (delete_output_reload): Use refers_to_regno_p rather
	than reg_mentioned_p.

From-SVN: r162558
parent fb55ca75
......@@ -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
......
......@@ -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. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment