aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1998-08-18 09:34:59 +0000
committerJeff Law <law@gcc.gnu.org>1998-08-18 03:34:59 -0600
commit7b31b7d9bd976765848cdc282e0ea7e2617bb35b (patch)
tree3180812977ebe9db41f77114aa9ba5f1aebc0be6 /gcc
parent5a5325cb7288ba6ee85682f079aebc26131cceba (diff)
downloadgcc-7b31b7d9bd976765848cdc282e0ea7e2617bb35b.zip
gcc-7b31b7d9bd976765848cdc282e0ea7e2617bb35b.tar.gz
gcc-7b31b7d9bd976765848cdc282e0ea7e2617bb35b.tar.bz2
regmove.c (optimize_reg_copy_1): Update REG_N_CALLS_CROSSED and REG_LIVE_LENGTH as successful substitutions are made.
* regmove.c (optimize_reg_copy_1): Update REG_N_CALLS_CROSSED and REG_LIVE_LENGTH as successful substitutions are made. From-SVN: r21819
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/regmove.c41
2 files changed, 42 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d1c7cff..624be89 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Tue Aug 18 10:33:30 1998 Jeffrey A Law (law@cygnus.com)
+
+ * regmove.c (optimize_reg_copy_1): Update REG_N_CALLS_CROSSED
+ and REG_LIVE_LENGTH as successful substitutions are made.
+
Tue Aug 18 07:15:27 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* config/sparc/sparc.c (ultra_find_type): Add empty semicolon
diff --git a/gcc/regmove.c b/gcc/regmove.c
index def8c14..8786553 100644
--- a/gcc/regmove.c
+++ b/gcc/regmove.c
@@ -288,12 +288,45 @@ optimize_reg_copy_1 (insn, dest, src)
PATTERN (q))))
{
/* We assume that a register is used exactly once per
- insn in the updates below. If this is not correct,
- no great harm is done. */
+ insn in the REG_N_REFS updates below. If this is not
+ correct, no great harm is done.
+
+
+ We do not undo this substitution if something later
+ fails. Therefore, we must update the other REG_N_*
+ counters now to keep them accurate. */
if (sregno >= FIRST_PSEUDO_REGISTER)
- REG_N_REFS (sregno) -= loop_depth;
+ {
+ REG_N_REFS (sregno) -= loop_depth;
+
+ if (REG_LIVE_LENGTH (sregno) >= 0)
+ {
+ REG_LIVE_LENGTH (sregno) -= length;
+ /* REG_LIVE_LENGTH is only an approximation after
+ combine if sched is not run, so make sure that
+ we still have a reasonable value. */
+ if (REG_LIVE_LENGTH (sregno) < 2)
+ REG_LIVE_LENGTH (sregno) = 2;
+ }
+
+ REG_N_CALLS_CROSSED (sregno) -= n_calls;
+ }
+
if (dregno >= FIRST_PSEUDO_REGISTER)
- REG_N_REFS (dregno) += loop_depth;
+ {
+ REG_N_REFS (dregno) += loop_depth;
+
+ if (REG_LIVE_LENGTH (dregno) >= 0)
+ REG_LIVE_LENGTH (dregno) += d_length;
+
+ REG_N_CALLS_CROSSED (dregno) += d_n_calls;
+ }
+
+ /* We've done a substitution, clear the counters. */
+ length = 0;
+ d_length = 0;
+ n_calls = 0;
+ d_n_calls = 0;
}
else
{