diff options
author | Jan Hubicka <jh@suse.cz> | 2001-12-20 18:01:26 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2001-12-20 17:01:26 +0000 |
commit | d1ee6d9bb7d3726a5c76f7d530962d4efeaa6e4d (patch) | |
tree | ffbeb41028154325e873af71d0e57a9a277fe352 /gcc | |
parent | 37bef19770233ab36b2a61ce3c33febf83f17734 (diff) | |
download | gcc-d1ee6d9bb7d3726a5c76f7d530962d4efeaa6e4d.zip gcc-d1ee6d9bb7d3726a5c76f7d530962d4efeaa6e4d.tar.gz gcc-d1ee6d9bb7d3726a5c76f7d530962d4efeaa6e4d.tar.bz2 |
cfgcleanup.c (flow_find_cross_jump): Avoid incrementing of ninsns if one of block does not contain jump.
* cfgcleanup.c (flow_find_cross_jump): Avoid incrementing of ninsns
if one of block does not contain jump.
(outgoing_edge_math): Revert last path; require edges to be noncomplex
nonfake to match single exit edge; require conditional jumps to not
have side effect.
From-SVN: r48203
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/cfgcleanup.c | 20 |
2 files changed, 20 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f2e40d1..7ed306e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +Thu Dec 20 16:58:46 CET 2001 Jan Hubicka <jh@suse.cz> + + * cfgcleanup.c (flow_find_cross_jump): Avoid incrementing of ninsns + if one of block does not contain jump. + (outgoing_edge_math): Revert last path; require edges to be noncomplex + nonfake to match single exit edge; require conditional jumps to not + have side effect. + 2001-12-20 Turly O'Connor <turly@apple.com> * tm.texi (ASM_OUTPUT_OPERAND): Change documentation references to diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index b23def8..abb0217 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -855,9 +855,6 @@ flow_find_cross_jump (mode, bb1, bb2, f1, f2) || (returnjump_p (i1) && !side_effects_p (PATTERN (i1)))) { last1 = i1; - /* Count everything except for unconditional jump as insn. */ - if (!simplejump_p (i1) && !returnjump_p (i1)) - ninsns++; i1 = PREV_INSN (i1); } i2 = bb2->end; @@ -865,6 +862,9 @@ flow_find_cross_jump (mode, bb1, bb2, f1, f2) || (returnjump_p (i2) && !side_effects_p (PATTERN (i2)))) { last2 = i2; + /* Count everything except for unconditional jump as insn. */ + if (!simplejump_p (i2) && !returnjump_p (i2) && last1) + ninsns++; i2 = PREV_INSN (i2); } @@ -958,11 +958,13 @@ outgoing_edges_match (mode, bb1, bb2) /* If BB1 has only one successor, we may be looking at either an unconditional jump, or a fake edge to exit. */ - if (bb1->succ && !bb1->succ->succ_next) + if (bb1->succ && !bb1->succ->succ_next + && !(bb1->succ->flags & (EDGE_COMPLEX | EDGE_FAKE))) { - if (! bb2->succ || bb2->succ->succ_next) + if (! bb2->succ || bb2->succ->succ_next + || (bb2->succ->flags & (EDGE_COMPLEX | EDGE_FAKE))) return false; - return insns_match_p (mode, bb1->end, bb2->end); + return true; } /* Match conditional jumps - this may get tricky when fallthru and branch @@ -970,7 +972,8 @@ outgoing_edges_match (mode, bb1, bb2) if (bb1->succ && bb1->succ->succ_next && !bb1->succ->succ_next->succ_next - && any_condjump_p (bb1->end)) + && any_condjump_p (bb1->end) + && onlyjump_p (bb1->end)) { edge b1, f1, b2, f2; bool reverse, match; @@ -980,7 +983,8 @@ outgoing_edges_match (mode, bb1, bb2) if (!bb2->succ || !bb2->succ->succ_next || bb1->succ->succ_next->succ_next - || !any_condjump_p (bb2->end)) + || !any_condjump_p (bb2->end) + || !onlyjump_p (bb1->end)) return false; b1 = BRANCH_EDGE (bb1); |