From: David S. Miller Date: Fri, 10 Jul 1998 14:00:58 +0000 (+0000) Subject: jump.c (jump_optimize): If after_regscan and our transformations generate new REGs... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a87ef3239984df32963b1d8cacd99e89077900f5;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3380061898a..11ccac4aba2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Fri Jul 10 12:53:58 1998 David S. Miller + + * 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 * config/i960/i960.c (i960_address_cost): MEMA operands with diff --git a/gcc/jump.c b/gcc/jump.c index c582d97526a..9956789e5aa 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -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.