summaryrefslogtreecommitdiff
path: root/gcc/jump.c
diff options
context:
space:
mode:
authorsteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-24 21:59:49 +0000
committersteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-24 21:59:49 +0000
commitc38b28e7f0876414e2ac8cbd06272f78169a3c68 (patch)
tree79fcd005a08d6ca51e2a25820e9ad881a4dc0e2c /gcc/jump.c
parent0b3f0f444150a9e3b64cc963ad1ef6bd44d7a70e (diff)
downloadgcc-c38b28e7f0876414e2ac8cbd06272f78169a3c68.tar.gz
PR bootstrap/59279
Revert previous commit. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205338 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/jump.c')
-rw-r--r--gcc/jump.c80
1 files changed, 23 insertions, 57 deletions
diff --git a/gcc/jump.c b/gcc/jump.c
index 87f9619d751..a27aaa94b8d 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -177,34 +177,6 @@ make_pass_cleanup_barriers (gcc::context *ctxt)
}
-/* Remove all REG_LABEL_OPERAND notes from INSN.
-
- REG_LABEL_TARGET notes (including the JUMP_LABEL field) are sticky and
- not reset here; that way we won't lose association with a label when
- e.g. the source for a target register disappears out of reach for targets
- that may use jump-target registers. Jump transformations are supposed to
- transform any REG_LABEL_TARGET notes. The target label reference in a
- branch may disappear from the branch (and from the instruction before it)
- for other reasons, like register allocation. */
-
-static void
-reset_insn_reg_label_operand_notes (rtx insn)
-{
- if (INSN_P (insn))
- {
- rtx note, next;
-
- for (note = REG_NOTES (insn); note; note = next)
- {
- next = XEXP (note, 1);
- if (REG_NOTE_KIND (note) == REG_LABEL_OPERAND
- && ! reg_mentioned_p (XEXP (note, 0), PATTERN (insn)))
- remove_note (insn, note);
- }
- }
-}
-
-
/* Initialize LABEL_NUSES and JUMP_LABEL fields, add REG_LABEL_TARGET
for remaining targets for JUMP_P. Delete any REG_LABEL_OPERAND
notes whose labels don't occur in the insn any more. */
@@ -214,38 +186,32 @@ init_label_info (rtx f)
{
rtx insn;
- if (current_ir_type () == IR_RTL_CFGLAYOUT)
+ for (insn = f; insn; insn = NEXT_INSN (insn))
{
- basic_block bb;
-
- FOR_EACH_BB (bb)
+ if (LABEL_P (insn))
+ LABEL_NUSES (insn) = (LABEL_PRESERVE_P (insn) != 0);
+
+ /* REG_LABEL_TARGET notes (including the JUMP_LABEL field) are
+ sticky and not reset here; that way we won't lose association
+ with a label when e.g. the source for a target register
+ disappears out of reach for targets that may use jump-target
+ registers. Jump transformations are supposed to transform
+ any REG_LABEL_TARGET notes. The target label reference in a
+ branch may disappear from the branch (and from the
+ instruction before it) for other reasons, like register
+ allocation. */
+
+ if (INSN_P (insn))
{
- /* Labels only appear between BB_HEAD and the basic block note,
- and in the basic block header and footer. */
- for (insn = BB_HEAD (bb);
- insn && LABEL_P (insn);
- insn = NEXT_INSN (insn))
- LABEL_NUSES (insn) = (LABEL_PRESERVE_P (insn) != 0);
- for (insn = BB_HEADER (bb); insn; insn = NEXT_INSN (insn))
- if (LABEL_P (insn))
- LABEL_NUSES (insn) = (LABEL_PRESERVE_P (insn) != 0);
- for (insn = BB_FOOTER (bb); insn; insn = NEXT_INSN (insn))
- if (LABEL_P (insn))
- LABEL_NUSES (insn) = (LABEL_PRESERVE_P (insn) != 0);
+ rtx note, next;
- FOR_BB_INSNS (bb, insn)
- if (INSN_P (insn))
- reset_insn_reg_label_operand_notes (insn);
- }
- }
- else
- {
- for (insn = f; insn; insn = NEXT_INSN (insn))
- {
- if (LABEL_P (insn))
- LABEL_NUSES (insn) = (LABEL_PRESERVE_P (insn) != 0);
- if (INSN_P (insn))
- reset_insn_reg_label_operand_notes (insn);
+ for (note = REG_NOTES (insn); note; note = next)
+ {
+ next = XEXP (note, 1);
+ if (REG_NOTE_KIND (note) == REG_LABEL_OPERAND
+ && ! reg_mentioned_p (XEXP (note, 0), PATTERN (insn)))
+ remove_note (insn, note);
+ }
}
}
}