aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/cfgcleanup.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.8/gcc/cfgcleanup.c')
-rw-r--r--gcc-4.8/gcc/cfgcleanup.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc-4.8/gcc/cfgcleanup.c b/gcc-4.8/gcc/cfgcleanup.c
index 8a120bf90..ba62cb95a 100644
--- a/gcc-4.8/gcc/cfgcleanup.c
+++ b/gcc-4.8/gcc/cfgcleanup.c
@@ -1293,7 +1293,6 @@ flow_find_cross_jump (basic_block bb1, basic_block bb2, rtx *f1, rtx *f2,
{
rtx i1, i2, last1, last2, afterlast1, afterlast2;
int ninsns = 0;
- rtx p1;
enum replace_direction dir, last_dir, afterlast_dir;
bool follow_fallthru, did_fallthru;
@@ -1321,8 +1320,9 @@ flow_find_cross_jump (basic_block bb1, basic_block bb2, rtx *f1, rtx *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)
+ /* Count everything except for unconditional jump as insn.
+ Don't count any jumps if dir_p is NULL. */
+ if (!simplejump_p (i2) && !returnjump_p (i2) && last1 && dir_p)
ninsns++;
i2 = PREV_INSN (i2);
}
@@ -1373,8 +1373,8 @@ flow_find_cross_jump (basic_block bb1, basic_block bb2, rtx *f1, rtx *f2,
last1 = i1, last2 = i2;
afterlast_dir = last_dir;
last_dir = dir;
- p1 = PATTERN (i1);
- if (!(GET_CODE (p1) == USE || GET_CODE (p1) == CLOBBER))
+ if (GET_CODE (PATTERN (i1)) != USE
+ && GET_CODE (PATTERN (i1)) != CLOBBER)
ninsns++;
}
@@ -1420,7 +1420,8 @@ flow_find_cross_jump (basic_block bb1, basic_block bb2, rtx *f1, rtx *f2,
/* Like flow_find_cross_jump, except start looking for a matching sequence from
the head of the two blocks. Do not include jumps at the end.
If STOP_AFTER is nonzero, stop after finding that many matching
- instructions. */
+ instructions. If STOP_AFTER is zero, count all INSN_P insns, if it is
+ non-zero, only count active insns. */
int
flow_find_head_matching_sequence (basic_block bb1, basic_block bb2, rtx *f1,
@@ -1492,6 +1493,9 @@ flow_find_head_matching_sequence (basic_block bb1, basic_block bb2, rtx *f1,
beforelast1 = last1, beforelast2 = last2;
last1 = i1, last2 = i2;
+ if (!stop_after
+ || (GET_CODE (PATTERN (i1)) != USE
+ && GET_CODE (PATTERN (i1)) != CLOBBER))
ninsns++;
}