diff options
author | Jan Hubicka <jh@suse.cz> | 2002-01-09 22:49:02 +0100 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2002-01-09 13:49:02 -0800 |
commit | 7d5ab30eb3543198da068bb2b4757fdbf5ba9a8c (patch) | |
tree | 90fe835abd86ef54cd1b3a43111a43e1d2075c56 /gcc/gcse.c | |
parent | ffb9c594d3891ce2dd3231689832e584339bbb42 (diff) | |
download | gcc-7d5ab30eb3543198da068bb2b4757fdbf5ba9a8c.tar.gz |
* gcse.c (cprop_jump): Delete insn if simplified jump is no-op.
From-SVN: r48694
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r-- | gcc/gcse.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/gcc/gcse.c b/gcc/gcse.c index e91b61a4845..e8361fc5aab 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -4037,28 +4037,20 @@ cprop_jump (bb, insn, from, src) if (rtx_equal_p (new, SET_SRC (set))) return 0; - /* If this is now a no-op leave it that way, but update LABEL_NUSED if - necessary. */ + /* If this is now a no-op delete it, otherwise this must be a valid insn. */ if (new == pc_rtx) + delete_insn (insn); + else { - SET_SRC (set) = new; - - if (JUMP_LABEL (insn) != 0) - { - --LABEL_NUSES (JUMP_LABEL (insn)); - JUMP_LABEL (insn) = NULL_RTX; - } - } - - /* Otherwise, this must be a valid instruction. */ - else if (! validate_change (insn, &SET_SRC (set), new, 0)) - return 0; + if (! validate_change (insn, &SET_SRC (set), new, 0)) + return 0; - /* If this has turned into an unconditional jump, - then put a barrier after it so that the unreachable - code will be deleted. */ - if (GET_CODE (SET_SRC (set)) == LABEL_REF) - emit_barrier_after (insn); + /* If this has turned into an unconditional jump, + then put a barrier after it so that the unreachable + code will be deleted. */ + if (GET_CODE (SET_SRC (set)) == LABEL_REF) + emit_barrier_after (insn); + } run_jump_opt_after_gcse = 1; |