diff options
author | David S. Miller <davem@pierdol.cobaltmicro.com> | 1998-07-10 14:00:58 +0000 |
---|---|---|
committer | David S. Miller <davem@gcc.gnu.org> | 1998-07-10 07:00:58 -0700 |
commit | a87ef3239984df32963b1d8cacd99e89077900f5 (patch) | |
tree | 4035a819ae8c94bf112f0fbbadf2f27fdbe3ecc7 | |
parent | 3410b2f3891c179f9dcd1f89b35bda224780501b (diff) | |
download | gcc-a87ef3239984df32963b1d8cacd99e89077900f5.zip gcc-a87ef3239984df32963b1d8cacd99e89077900f5.tar.gz gcc-a87ef3239984df32963b1d8cacd99e89077900f5.tar.bz2 |
jump.c (jump_optimize): If after_regscan and our transformations generate new REGs, rerun reg_scan.
* jump.c (jump_optimize): If after_regscan and our transformations
generate new REGs, rerun reg_scan.
From-SVN: r21052
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/jump.c | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3380061..11ccac4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Fri Jul 10 12:53:58 1998 David S. Miller <davem@pierdol.cobaltmicro.com> + + * jump.c (jump_optimize): If after_regscan and our transformations + generate new REGs, rerun reg_scan. + Fri Jul 10 11:50:43 EDT 1998 Andrew MacLeod <amacleod@cygnus.com> * config/i960/i960.c (i960_address_cost): MEMA operands with @@ -151,6 +151,7 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan) { register rtx insn, next, note; int changed; + int old_max_reg; int first = 1; int max_uid = 0; rtx last_insn; @@ -591,6 +592,7 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan) /* Now iterate optimizing jumps until nothing changes over one pass. */ changed = 1; + old_max_reg = max_reg_num (); while (changed) { changed = 0; @@ -602,6 +604,16 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan) rtx nlabel; int this_is_simplejump, this_is_condjump, reversep = 0; int this_is_condjump_in_parallel; + + /* If one of our transformations has created more REGs we + must rerun reg_scan or else we risk missed optimizations, + erroneous optimizations, or even worse a crash. */ + if (after_regscan && + old_max_reg < max_reg_num ()) + { + reg_scan (f, max_reg_num (), 0); + old_max_reg = max_reg_num (); + } #if 0 /* If NOT the first iteration, if this is the last jump pass (just before final), do the special peephole optimizations. |