summaryrefslogtreecommitdiffstats
path: root/gcc/cfgcleanup.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2001-12-20 17:01:26 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2001-12-20 17:01:26 +0000
commit3bf090f766bd5cb75c6c9bf1432561b832269436 (patch)
treeffbeb41028154325e873af71d0e57a9a277fe352 /gcc/cfgcleanup.c
parentebf49ed96fd68b3a6998a831533e2cf0df68d2db (diff)
downloadppe42-gcc-3bf090f766bd5cb75c6c9bf1432561b832269436.tar.gz
ppe42-gcc-3bf090f766bd5cb75c6c9bf1432561b832269436.zip
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48203 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgcleanup.c')
-rw-r--r--gcc/cfgcleanup.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index b23def8b3bc..abb0217711c 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);
OpenPOWER on IntegriCloud