aboutsummaryrefslogtreecommitdiff
path: root/gcc/unroll.c
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1992-09-28 14:25:53 -0700
committerJim Wilson <wilson@gcc.gnu.org>1992-09-28 14:25:53 -0700
commit7f11183e26572232a5efd5a3770aa2e1db79dcce (patch)
treeb45f23412d6c43c0da8b2f20e5b15e493409e5f2 /gcc/unroll.c
parent4024394c6fbb20caa295e33c372831866c097669 (diff)
downloadgcc-7f11183e26572232a5efd5a3770aa2e1db79dcce.zip
gcc-7f11183e26572232a5efd5a3770aa2e1db79dcce.tar.gz
gcc-7f11183e26572232a5efd5a3770aa2e1db79dcce.tar.bz2
(copy_loop_body...
(copy_loop_body, JUMP_INSN case): When invert jump insn, must first construct new insn before trying to invert it, so that validate_change will work properly. From-SVN: r2277
Diffstat (limited to 'gcc/unroll.c')
-rw-r--r--gcc/unroll.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/gcc/unroll.c b/gcc/unroll.c
index ae2f08f..7fa3a54 100644
--- a/gcc/unroll.c
+++ b/gcc/unroll.c
@@ -1659,27 +1659,21 @@ copy_loop_body (copy_start, copy_end, map, exit_label, last_iteration,
In this case, we want to change the original fall through
case to be a branch past the end of the loop, and the
original jump label case to fall_through. */
-
- int fall_through;
-
/* Never map the label in this case. */
- rtx tmp_pattern = copy_rtx (PATTERN (insn));
-
- /* Set the fall through case to the exit label. If we
- can't do this in place, abort for now. Maybe
- we can do something more sophisticated eventually. */
- if (! invert_exp (tmp_pattern, insn)
- || ! redirect_exp (&tmp_pattern, JUMP_LABEL (insn),
- exit_label, insn))
- abort ();
+ pattern = copy_rtx (PATTERN (insn));
+ copy = emit_jump_insn (pattern);
- pattern = tmp_pattern;
+ if (! invert_exp (pattern, copy)
+ || ! redirect_exp (&pattern, JUMP_LABEL (insn),
+ exit_label, copy))
+ abort ();
}
else
- pattern = copy_rtx_and_substitute (PATTERN (insn), map);
-
- copy = emit_jump_insn (pattern);
+ {
+ pattern = copy_rtx_and_substitute (PATTERN (insn), map);
+ copy = emit_jump_insn (pattern);
+ }
#ifdef HAVE_cc0
if (cc0_insn)