diff options
author | Richard Earnshaw <erich@gnu.org> | 1994-10-17 13:25:38 +0000 |
---|---|---|
committer | Richard Earnshaw <erich@gnu.org> | 1994-10-17 13:25:38 +0000 |
commit | ca72f752bfe58121ad60f17434fa5f9906fb5c1a (patch) | |
tree | 82a7b21fa9e5dbc15e1a06dcb24ccc2014a519ed /gcc/unroll.c | |
parent | 6782074d401945dd4aab38addde10a447cb44767 (diff) | |
download | gcc-ca72f752bfe58121ad60f17434fa5f9906fb5c1a.zip gcc-ca72f752bfe58121ad60f17434fa5f9906fb5c1a.tar.gz gcc-ca72f752bfe58121ad60f17434fa5f9906fb5c1a.tar.bz2 |
(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
Diffstat (limited to 'gcc/unroll.c')
-rw-r--r-- | gcc/unroll.c | 32 |
1 files changed, 26 insertions, 6 deletions
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 |