Commit 57467646 by Jim Wilson

(copy_loop_body, JUMP_INSN case): When setting JUMP_LABEL field, verify that…

(copy_loop_body, JUMP_INSN case): When setting JUMP_LABEL field, verify that what we think is a label actually is.

(copy_loop_body, JUMP_INSN case): When setting
JUMP_LABEL field, verify that what we think is a label actually
is.  If it isn't then map the old JUMP_LABEL to find the new one.

From-SVN: r2275
parent 72f4648e
...@@ -1692,23 +1692,28 @@ copy_loop_body (copy_start, copy_end, map, exit_label, last_iteration, ...@@ -1692,23 +1692,28 @@ copy_loop_body (copy_start, copy_end, map, exit_label, last_iteration,
later passes of unroll_loop, if INSN had jump label set. */ later passes of unroll_loop, if INSN had jump label set. */
if (JUMP_LABEL (insn)) if (JUMP_LABEL (insn))
{ {
rtx label = 0;
/* Can't use the label_map for every insn, since this may be /* Can't use the label_map for every insn, since this may be
the backward branch, and hence the label was not mapped. */ the backward branch, and hence the label was not mapped. */
if (GET_CODE (pattern) == SET) if (GET_CODE (pattern) == SET)
{ {
tem = SET_SRC (pattern); tem = SET_SRC (pattern);
if (GET_CODE (tem) == LABEL_REF) if (GET_CODE (tem) == LABEL_REF)
JUMP_LABEL (copy) = XEXP (tem, 0); label = XEXP (tem, 0);
else if (GET_CODE (tem) == IF_THEN_ELSE) else if (GET_CODE (tem) == IF_THEN_ELSE)
{ {
if (XEXP (tem, 1) != pc_rtx) if (XEXP (tem, 1) != pc_rtx)
JUMP_LABEL (copy) = XEXP (XEXP (tem, 1), 0); label = XEXP (XEXP (tem, 1), 0);
else else
JUMP_LABEL (copy) = XEXP (XEXP (tem, 2), 0); label = XEXP (XEXP (tem, 2), 0);
} }
else else
abort (); abort ();
} }
if (label && GET_CODE (label) == CODE_LABEL)
JUMP_LABEL (copy) = label;
else else
{ {
/* An unrecognizable jump insn, probably the entry jump /* An unrecognizable jump insn, probably the entry jump
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment