From ca72f752bfe58121ad60f17434fa5f9906fb5c1a Mon Sep 17 00:00:00 2001 From: Richard Earnshaw Date: Mon, 17 Oct 1994 13:25:38 +0000 Subject: (copy_loop_body, case JUMP_INSN): Don't abort if invert_exp fails. (copy_loop_body, case JUMP_INSN): Don't abort if invert_exp fails. Instead, redirect the jump around an unconditional branch. From-SVN: r8282 --- gcc/unroll.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'gcc') diff --git a/gcc/unroll.c b/gcc/unroll.c index 7a3c4f9..7d4e2d9 100644 --- a/gcc/unroll.c +++ b/gcc/unroll.c @@ -1746,12 +1746,32 @@ copy_loop_body (copy_start, copy_end, map, exit_label, last_iteration, case to be a branch past the end of the loop, and the original jump label case to fall_through. */ - if (! invert_exp (pattern, copy) - || ! redirect_exp (&pattern, - map->label_map[CODE_LABEL_NUMBER - (JUMP_LABEL (insn))], - exit_label, copy)) - abort (); + if (invert_exp (pattern, copy)) + { + if (! redirect_exp (&pattern, + map->label_map[CODE_LABEL_NUMBER + (JUMP_LABEL (insn))], + exit_label, copy)) + abort (); + } + else + { + rtx jmp; + rtx lab = gen_label_rtx (); + /* Can't do it by reversing the jump (probably becasue we + couln't reverse the conditions), so emit a new + jump_insn after COPY, and redirect the jump around + that. */ + jmp = emit_jump_insn_after (gen_jump (exit_label), copy); + jmp = emit_barrier_after (jmp); + emit_label_after (lab, jmp); + LABEL_NUSES (lab) = 0; + if (! redirect_exp (&pattern, + map->label_map[CODE_LABEL_NUMBER + (JUMP_LABEL (insn))], + lab, copy)) + abort (); + } } #ifdef HAVE_cc0 -- cgit v1.1