Commit 85b94003 by Mark Mitchell Committed by Mark Mitchell

jump.c (jump_optimize_1): Tidy.

	* jump.c (jump_optimize_1): Tidy.
	(mark_jump_label): When changing the label in a LABEL_REF, change
	update any REG_EQUAL notes as well.

From-SVN: r42318
parent 572051a2
2001-05-19 Mark Mitchell <mark@codesourcery.com>
* jump.c (jump_optimize_1): Tidy.
(mark_jump_label): When changing the label in a LABEL_REF, change
update any REG_EQUAL notes as well.
2001-05-19 Joseph S. Myers <jsm28@cam.ac.uk> 2001-05-19 Joseph S. Myers <jsm28@cam.ac.uk>
* c-parse.in (parm_declarator): Split into * c-parse.in (parm_declarator): Split into
......
...@@ -236,14 +236,13 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, ...@@ -236,14 +236,13 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan,
if (GET_CODE (XEXP (insn, 0)) == CODE_LABEL) if (GET_CODE (XEXP (insn, 0)) == CODE_LABEL)
LABEL_NUSES (XEXP (insn, 0))++; LABEL_NUSES (XEXP (insn, 0))++;
if (! mark_labels_only)
delete_barrier_successors (f);
/* Quit now if we just wanted to rebuild the JUMP_LABEL and REG_LABEL /* Quit now if we just wanted to rebuild the JUMP_LABEL and REG_LABEL
notes and recompute LABEL_NUSES. */ notes and recompute LABEL_NUSES. */
if (mark_labels_only) if (mark_labels_only)
goto end; goto end;
delete_barrier_successors (f);
last_insn = delete_unreferenced_labels (f); last_insn = delete_unreferenced_labels (f);
if (noop_moves) if (noop_moves)
...@@ -2498,7 +2497,6 @@ mark_jump_label (x, insn, cross_jump, in_mem) ...@@ -2498,7 +2497,6 @@ mark_jump_label (x, insn, cross_jump, in_mem)
{ {
rtx label = XEXP (x, 0); rtx label = XEXP (x, 0);
rtx olabel = label; rtx olabel = label;
rtx note;
rtx next; rtx next;
/* Ignore remaining references to unreachable labels that /* Ignore remaining references to unreachable labels that
...@@ -2545,11 +2543,34 @@ mark_jump_label (x, insn, cross_jump, in_mem) ...@@ -2545,11 +2543,34 @@ mark_jump_label (x, insn, cross_jump, in_mem)
if (GET_CODE (insn) == JUMP_INSN) if (GET_CODE (insn) == JUMP_INSN)
JUMP_LABEL (insn) = label; JUMP_LABEL (insn) = label;
/* If we've changed OLABEL and we had a REG_LABEL note /* If we've changed the label, update notes accordingly. */
for it, update it as well. */ else if (label != olabel)
else if (label != olabel {
&& (note = find_reg_note (insn, REG_LABEL, olabel)) != 0) rtx note;
XEXP (note, 0) = label;
/* We may have a REG_LABEL note to indicate that this
instruction uses the label. */
note = find_reg_note (insn, REG_LABEL, olabel);
if (note)
XEXP (note, 0) = label;
/* We may also have a REG_EQUAL note to indicate that
a register is being set to the address of the
label. We cannot use find_reg_note as above
because the REG_EQUAL note will use a LABEL_REF,
not the actual CODE_LABEL. */
for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
if (REG_NOTE_KIND (note) == REG_EQUAL)
{
if (GET_CODE (XEXP (note, 0)) == LABEL_REF
&& XEXP (XEXP (note, 0), 0) == olabel)
XEXP (XEXP (note, 0), 0) = label;
/* There is only one REG_EQUAL note per
instruction, so we are done at this
point. */
break;
}
}
/* Otherwise, add a REG_LABEL note for LABEL unless there already /* Otherwise, add a REG_LABEL note for LABEL unless there already
is one. */ is one. */
......
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