diff options
Diffstat (limited to 'gcc/loop-unswitch.c')
-rw-r--r-- | gcc/loop-unswitch.c | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/gcc/loop-unswitch.c b/gcc/loop-unswitch.c index 08780f0d58f..c39718b3f49 100644 --- a/gcc/loop-unswitch.c +++ b/gcc/loop-unswitch.c @@ -103,13 +103,11 @@ compare_and_jump_seq (rtx op0, rtx op1, enum rtx_code comp, rtx label, int prob, { /* A hack -- there seems to be no easy generic way how to make a conditional jump from a ccmode comparison. */ - if (!cinsn) - abort (); + gcc_assert (cinsn); cond = XEXP (SET_SRC (pc_set (cinsn)), 0); - if (GET_CODE (cond) != comp - || !rtx_equal_p (op0, XEXP (cond, 0)) - || !rtx_equal_p (op1, XEXP (cond, 1))) - abort (); + gcc_assert (GET_CODE (cond) == comp); + gcc_assert (rtx_equal_p (op0, XEXP (cond, 0))); + gcc_assert (rtx_equal_p (op1, XEXP (cond, 1))); emit_jump_insn (copy_insn (PATTERN (cinsn))); jump = get_last_insn (); JUMP_LABEL (jump) = JUMP_LABEL (cinsn); @@ -118,8 +116,7 @@ compare_and_jump_seq (rtx op0, rtx op1, enum rtx_code comp, rtx label, int prob, } else { - if (cinsn) - abort (); + gcc_assert (!cinsn); op0 = force_operand (op0, NULL_RTX); op1 = force_operand (op1, NULL_RTX); @@ -379,8 +376,7 @@ unswitch_single_loop (struct loops *loops, struct loop *loop, /* Unswitch the loop on this condition. */ nloop = unswitch_loop (loops, loop, bbs[i], cond, cinsn); - if (!nloop) - abort (); + gcc_assert (nloop); /* Invoke itself on modified loops. */ unswitch_single_loop (loops, nloop, rconds, num + 1); @@ -412,19 +408,17 @@ unswitch_loop (struct loops *loops, struct loop *loop, basic_block unswitch_on, rtx seq; /* Some sanity checking. */ - if (!flow_bb_inside_loop_p (loop, unswitch_on)) - abort (); - if (!unswitch_on->succ || !unswitch_on->succ->succ_next || - unswitch_on->succ->succ_next->succ_next) - abort (); - if (!just_once_each_iteration_p (loop, unswitch_on)) - abort (); - if (loop->inner) - abort (); - if (!flow_bb_inside_loop_p (loop, unswitch_on->succ->dest)) - abort (); - if (!flow_bb_inside_loop_p (loop, unswitch_on->succ->succ_next->dest)) - abort (); + gcc_assert (flow_bb_inside_loop_p (loop, unswitch_on)); + + gcc_assert (unswitch_on->succ); + gcc_assert (unswitch_on->succ->succ_next); + gcc_assert (!unswitch_on->succ->succ_next->succ_next); + + gcc_assert (just_once_each_iteration_p (loop, unswitch_on)); + gcc_assert (!loop->inner); + gcc_assert (flow_bb_inside_loop_p (loop, unswitch_on->succ->dest)); + gcc_assert (flow_bb_inside_loop_p (loop, + unswitch_on->succ->succ_next->dest)); entry = loop_preheader_edge (loop); |