Commit 692dc9c6 by J"orn Rennecke Committed by Joern Rennecke

jump.c (delete_computation): Re-instate deletion of feeding insn.

	* jump.c (delete_computation): Re-instate deletion of feeding insn.
	(delete_insn): Look for REG_LABEL notes.
	(redirect_tablejump): Delete feeding insns.

From-SVN: r37714
parent 90d10fb9
Fri Nov 24 19:48:09 2000 J"orn Rennecke <amylaar@redhat.com>
* jump.c (delete_computation): Re-instate deletion of feeding insn.
(delete_insn): Look for REG_LABEL notes.
(redirect_tablejump): Delete feeding insns.
2000-11-24 Bernd Schmidt <bernds@redhat.co.uk> 2000-11-24 Bernd Schmidt <bernds@redhat.co.uk>
* config/i386/i386.md (call_pop_0, call_pop_1, call_value_pop_0, * config/i386/i386.md (call_pop_0, call_pop_1, call_value_pop_0,
......
...@@ -2705,17 +2705,6 @@ delete_computation (insn) ...@@ -2705,17 +2705,6 @@ delete_computation (insn)
} }
#endif #endif
#ifdef INSN_SCHEDULING
/* ?!? The schedulers do not keep REG_DEAD notes accurate after
reload has completed. The schedulers need to be fixed. Until
they are, we must not rely on the death notes here. */
if (reload_completed && flag_schedule_insns_after_reload)
{
delete_insn (insn);
return;
}
#endif
for (note = REG_NOTES (insn); note; note = next) for (note = REG_NOTES (insn); note; note = next)
{ {
next = XEXP (note, 1); next = XEXP (note, 1);
...@@ -2745,6 +2734,7 @@ delete_insn (insn) ...@@ -2745,6 +2734,7 @@ delete_insn (insn)
register rtx prev = PREV_INSN (insn); register rtx prev = PREV_INSN (insn);
register int was_code_label = (GET_CODE (insn) == CODE_LABEL); register int was_code_label = (GET_CODE (insn) == CODE_LABEL);
register int dont_really_delete = 0; register int dont_really_delete = 0;
rtx note;
while (next && INSN_DELETED_P (next)) while (next && INSN_DELETED_P (next))
next = NEXT_INSN (next); next = NEXT_INSN (next);
...@@ -2864,6 +2854,13 @@ delete_insn (insn) ...@@ -2864,6 +2854,13 @@ delete_insn (insn)
return next; return next;
} }
/* Likewise for an ordinary INSN / CALL_INSN with a REG_LABEL note. */
if (GET_CODE (insn) == INSN || GET_CODE (insn) == CALL_INSN)
for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
if (REG_NOTE_KIND (note) == REG_LABEL)
if (--LABEL_NUSES (XEXP (note, 0)) == 0)
delete_insn (XEXP (note, 0));
while (prev && (INSN_DELETED_P (prev) || GET_CODE (prev) == NOTE)) while (prev && (INSN_DELETED_P (prev) || GET_CODE (prev) == NOTE))
prev = PREV_INSN (prev); prev = PREV_INSN (prev);
...@@ -3327,6 +3324,7 @@ redirect_tablejump (jump, nlabel) ...@@ -3327,6 +3324,7 @@ redirect_tablejump (jump, nlabel)
rtx jump, nlabel; rtx jump, nlabel;
{ {
register rtx olabel = JUMP_LABEL (jump); register rtx olabel = JUMP_LABEL (jump);
rtx *notep, note, next;
/* Add this jump to the jump_chain of NLABEL. */ /* Add this jump to the jump_chain of NLABEL. */
if (jump_chain && INSN_UID (nlabel) < max_jump_chain if (jump_chain && INSN_UID (nlabel) < max_jump_chain
...@@ -3336,6 +3334,22 @@ redirect_tablejump (jump, nlabel) ...@@ -3336,6 +3334,22 @@ redirect_tablejump (jump, nlabel)
jump_chain[INSN_UID (nlabel)] = jump; jump_chain[INSN_UID (nlabel)] = jump;
} }
for (notep = &REG_NOTES (jump), note = *notep; note; note = next)
{
next = XEXP (note, 1);
if (REG_NOTE_KIND (note) != REG_DEAD
/* Verify that the REG_NOTE is legitimate. */
|| GET_CODE (XEXP (note, 0)) != REG
|| ! reg_mentioned_p (XEXP (note, 0), PATTERN (jump)))
notep = &XEXP (note, 1);
else
{
delete_prior_computation (note, jump);
*notep = next;
}
}
PATTERN (jump) = gen_jump (nlabel); PATTERN (jump) = gen_jump (nlabel);
JUMP_LABEL (jump) = nlabel; JUMP_LABEL (jump) = nlabel;
++LABEL_NUSES (nlabel); ++LABEL_NUSES (nlabel);
......
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