From 2b0cb007fa96ea4ea95de5505cfe481b2aedcf80 Mon Sep 17 00:00:00 2001 From: Bernd Schmidt Date: Tue, 27 Jul 2010 09:34:51 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 4 ++++ gcc/reload1.c | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 24e1a9cec8b..6983da721b4 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 PR target/44132 diff --git a/gcc/reload1.c b/gcc/reload1.c index 437b8c2f286..5c49f3cf817 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. */ -- 2.30.2