aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1992-08-14 18:41:07 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1992-08-14 18:41:07 -0400
commita9d27cb2a3f5f2f3eafc18126957ba3f38d7cd9f (patch)
tree2d6850c51ab1fbad6664d2c0475548f6ae02f6a8 /gcc
parent4214a50578bcf9023b8a0744a1e8ba95de7d2266 (diff)
downloadgcc-a9d27cb2a3f5f2f3eafc18126957ba3f38d7cd9f.zip
gcc-a9d27cb2a3f5f2f3eafc18126957ba3f38d7cd9f.tar.gz
gcc-a9d27cb2a3f5f2f3eafc18126957ba3f38d7cd9f.tar.bz2
(copy_loop_body): Don't assume (pc) can be on either leg of jump; use
invert_exp and redirect_exp instead. From-SVN: r1843
Diffstat (limited to 'gcc')
-rw-r--r--gcc/unroll.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/gcc/unroll.c b/gcc/unroll.c
index 0be4bb9..9ff78f4 100644
--- a/gcc/unroll.c
+++ b/gcc/unroll.c
@@ -1662,23 +1662,18 @@ copy_loop_body (copy_start, copy_end, map, exit_label, last_iteration,
int fall_through;
/* Never map the label in this case. */
- pattern = copy_rtx (PATTERN (insn));
+ rtx tmp_pattern = copy_rtx (PATTERN (insn));
- /* Assume a conditional branch, since the code above
- does not let unconditional branches be copied. */
- if (! condjump_p (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 ();
- fall_through
- = (XEXP (SET_SRC (PATTERN (insn)), 2) == pc_rtx) + 1;
- /* Set the fall through case to the exit label. Must
- create a new label_ref since they can't be shared. */
- XEXP (SET_SRC (pattern), fall_through)
- = gen_rtx (LABEL_REF, VOIDmode, exit_label);
-
- /* Set the original branch case to fall through. */
- XEXP (SET_SRC (pattern), 3 - fall_through)
- = pc_rtx;
+ pattern = tmp_pattern;
}
else
pattern = copy_rtx_and_substitute (PATTERN (insn), map);