diff options
author | Jan Hubicka <jh@suse.cz> | 2003-01-25 21:10:37 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2003-01-25 20:10:37 +0000 |
commit | 1649d92fb3790548b583dbc6a93e0383a90b9fea (patch) | |
tree | c5e3692b8273c08f9bd23aee25159170edc35911 /gcc/gcse.c | |
parent | 6ca86a1a1e15bb16d112991c130acee8e13686ab (diff) | |
download | gcc-1649d92fb3790548b583dbc6a93e0383a90b9fea.zip gcc-1649d92fb3790548b583dbc6a93e0383a90b9fea.tar.gz gcc-1649d92fb3790548b583dbc6a93e0383a90b9fea.tar.bz2 |
re PR rtl-optimization/8492 (GCC spins forever compiling loop)
PR opt/8492
* gcse.c (one_cprop_pass): Delete unreachable blocks.
Co-Authored-By: Eric Botcazou <ebotcazou@libertysurf.fr>
From-SVN: r61798
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r-- | gcc/gcse.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -4378,6 +4378,7 @@ local_cprop_pass (alter_jumps) rtx insn; struct reg_use *reg_used; rtx libcall_stack[MAX_NESTED_LIBCALLS + 1], *libcall_sp; + bool changed = false; cselib_init (); libcall_sp = &libcall_stack[MAX_NESTED_LIBCALLS]; @@ -4409,13 +4410,19 @@ local_cprop_pass (alter_jumps) reg_used++, reg_use_count--) if (do_local_cprop (reg_used->reg_rtx, insn, alter_jumps, libcall_sp)) - break; + { + changed = true; + break; + } } while (reg_use_count); } cselib_process_insn (insn); } cselib_finish (); + /* Global analysis may get into infinite loops for unreachable blocks. */ + if (changed && alter_jumps) + delete_unreachable_blocks (); } /* Forward propagate copies. This includes copies and constants. Return @@ -4506,6 +4513,9 @@ one_cprop_pass (pass, cprop_jumps, bypass_jumps) fprintf (gcse_file, "%d const props, %d copy props\n\n", const_prop_count, copy_prop_count); } + /* Global analysis may get into infinite loops for unreachable blocks. */ + if (changed && cprop_jumps) + delete_unreachable_blocks (); return changed; } |