aboutsummaryrefslogtreecommitdiff
path: root/gcc/local-alloc.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1996-03-22 09:11:37 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1996-03-22 09:11:37 -0500
commitc7b1ed2b88ec0e8079c07ce759c73b83ded3b41c (patch)
treecdf04df88173348b8dc41cbb84125e2ecba605b3 /gcc/local-alloc.c
parent55e442880910dbb1be014c09f2d84f0fb48d27c4 (diff)
downloadgcc-c7b1ed2b88ec0e8079c07ce759c73b83ded3b41c.zip
gcc-c7b1ed2b88ec0e8079c07ce759c73b83ded3b41c.tar.gz
gcc-c7b1ed2b88ec0e8079c07ce759c73b83ded3b41c.tar.bz2
(optimize_reg_copy_1): Only update reg_live_length if it is
non-negative. From-SVN: r11596
Diffstat (limited to 'gcc/local-alloc.c')
-rw-r--r--gcc/local-alloc.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c
index c36aca8..bde83b2 100644
--- a/gcc/local-alloc.c
+++ b/gcc/local-alloc.c
@@ -818,18 +818,24 @@ optimize_reg_copy_1 (insn, dest, src)
{
if (sregno >= FIRST_PSEUDO_REGISTER)
{
- 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;
+ 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_live_length[dregno] += d_length;
+ if (reg_live_length[dregno] >= 0)
+ reg_live_length[dregno] += d_length;
+
reg_n_calls_crossed[dregno] += d_n_calls;
}