X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;ds=sidebyside;f=gcc%2Floop-doloop.c;h=ef42c609198cabe29f76cc85d8f97ea0c6832916;hb=0664b4250483d9a279da4d63f157c4a3b2e8b966;hp=a1ec4b0f15577149d3101f5ee15d50157370c58f;hpb=9cab63d0c603dcfa825f9f59e261de6e1263a2a0;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/loop-doloop.c b/gcc/loop-doloop.c index a1ec4b0f155..ef42c609198 100644 --- a/gcc/loop-doloop.c +++ b/gcc/loop-doloop.c @@ -248,7 +248,7 @@ add_test (rtx cond, edge *e, basic_block dest) do_compare_rtx_and_jump (op0, op1, code, 0, mode, NULL_RTX, NULL_RTX, label); jump = get_last_insn (); - if (!JUMP_P (jump)) + if (!jump || !JUMP_P (jump)) { /* The condition is always false and the jump was optimized out. */ end_sequence (); @@ -257,7 +257,11 @@ add_test (rtx cond, edge *e, basic_block dest) seq = get_insns (); end_sequence (); - bb = loop_split_edge_with (*e, seq); + + /* There always is at least the jump insn in the sequence. */ + gcc_assert (seq != NULL_RTX); + + bb = split_edge_and_insert (*e, seq); *e = single_succ_edge (bb); if (any_uncondjump_p (jump)) @@ -372,9 +376,9 @@ doloop_modify (struct loop *loop, struct niter_desc *desc, rtx ass = copy_rtx (desc->noloop_assumptions); basic_block preheader = loop_preheader_edge (loop)->src; basic_block set_zero - = loop_split_edge_with (loop_preheader_edge (loop), NULL_RTX); + = split_edge (loop_preheader_edge (loop)); basic_block new_preheader - = loop_split_edge_with (loop_preheader_edge (loop), NULL_RTX); + = split_edge (loop_preheader_edge (loop)); edge te; /* Expand the condition testing the assumptions and if it does not pass, @@ -406,7 +410,6 @@ doloop_modify (struct loop *loop, struct niter_desc *desc, { /* All the conditions were simplified to false, remove the unreachable set_zero block. */ - remove_bb_from_loops (set_zero); delete_basic_block (set_zero); } else @@ -532,8 +535,7 @@ doloop_optimize (struct loop *loop) { if (dump_file) fprintf (dump_file, - "Doloop: number of iterations (%u) too costly to compute.\n", - est_niter); + "Doloop: number of iterations too costly to compute.\n"); return false; } @@ -614,20 +616,16 @@ doloop_optimize (struct loop *loop) return true; } -/* This is the main entry point. Process all LOOPS using doloop_optimize. */ +/* This is the main entry point. Process all loops using doloop_optimize. */ void -doloop_optimize_loops (struct loops *loops) +doloop_optimize_loops (void) { - unsigned i; + loop_iterator li; struct loop *loop; - for (i = 1; i < loops->num; i++) + FOR_EACH_LOOP (li, loop, 0) { - loop = loops->parray[i]; - if (!loop) - continue; - doloop_optimize (loop); } @@ -635,7 +633,7 @@ doloop_optimize_loops (struct loops *loops) #ifdef ENABLE_CHECKING verify_dominators (CDI_DOMINATORS); - verify_loop_structure (loops); + verify_loop_structure (); #endif } #endif /* HAVE_doloop_end */