From 5d7ef82a5dcfba9ab3d4080fd229449a9b7f2207 Mon Sep 17 00:00:00 2001 From: Bernd Schmidt Date: Thu, 17 May 2001 12:38:47 +0000 Subject: [PATCH] Correctly count substitutions if eliminations are going on. From-SVN: r42198 --- gcc/ChangeLog | 3 +++ gcc/reload1.c | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 72ea1fd02c2c..15b445d205f6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -3,6 +3,9 @@ * stmt.c (expand_asm_operands): For inout operands, make sure the substitution of '=' for '+' makes it into the rtl. + * reload1.c (delete_output_reload): Call eliminate_regs on substed. + (reload_as_needed): Call update_eliminable_offsets a bit later. + 2001-05-17 Gerald Pfeifer * gcc.texi (gccbug): Refer to the web pages for detailed information diff --git a/gcc/reload1.c b/gcc/reload1.c index dbf99d62dacb..ccf7619df845 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -3874,9 +3874,6 @@ reload_as_needed (live_known) spill_reg_order); } - if (num_eliminable && chain->need_elim) - update_eliminable_offsets (); - if (n_reloads > 0) { rtx next = NEXT_INSN (insn); @@ -3923,6 +3920,10 @@ reload_as_needed (live_known) NOTE_LINE_NUMBER (p) = NOTE_INSN_DELETED; } } + + if (num_eliminable && chain->need_elim) + update_eliminable_offsets (); + /* Any previously reloaded spilled pseudo reg, stored in this insn, is no longer validly lying around to save a future reload. Note that this does not detect pseudos that were reloaded @@ -7599,7 +7600,9 @@ delete_output_reload (insn, j, last_reload_reg) } n_occurrences = count_occurrences (PATTERN (insn), reg, 0); if (substed) - n_occurrences += count_occurrences (PATTERN (insn), substed, 0); + n_occurrences += count_occurrences (PATTERN (insn), + eliminate_regs (substed, 0, + NULL_RTX), 0); if (n_occurrences > n_inherited) return; -- 2.43.5