Commit f8671389 by Jeffrey A Law Committed by Jeff Law

flow.c (find_basic_blocks): If we delete the label for an exception handler...

        * flow.c (find_basic_blocks): If we delete the label for an
        exception handler, remove it from the EH label list and remove
        the EH_BEGIN/EH_END notes for that EH region.

From-SVN: r16265
parent e67edc15
Sat Nov 1 19:15:28 1997 Jeffrey A Law (law@cygnus.com)
* flow.c (find_basic_blocks): If we delete the label for an
exception handler, remove it from the EH label list and remove
the EH_BEGIN/EH_END notes for that EH region.
Sat Nov 1 16:44:49 1997 Jason Merrill (jason@cygnus.com)
* flow.c (find_basic_blocks): Generate correct flow control
......
......@@ -674,6 +674,51 @@ find_basic_blocks (f, nonlocal_label_list)
/* Turn the head into a deleted insn note. */
if (GET_CODE (insn) == BARRIER)
abort ();
/* If the head of this block is a CODE_LABEL, then it might
be the label for an exception handler which can't be
reached.
We need to remove the label from the exception_handler_label
list and remove the associated NOTE_EH_REGION_BEG and
NOTE_EH_REGION_END notes. */
if (GET_CODE (insn) == CODE_LABEL)
{
rtx x, *prev = &exception_handler_labels;
for (x = exception_handler_labels; x; x = XEXP (x, 1))
{
if (XEXP (x, 0) == insn)
{
/* Found a match, splice this label out of the
EH label list. */
*prev = XEXP (x, 1);
XEXP (x, 1) = NULL_RTX;
XEXP (x, 0) = NULL_RTX;
/* Now we have to find the EH_BEG and EH_END notes
associated with this label and remove them. */
for (x = get_insns (); x; x = NEXT_INSN (x))
{
if (GET_CODE (x) == NOTE
&& ((NOTE_LINE_NUMBER (x)
== NOTE_INSN_EH_REGION_BEG)
|| (NOTE_LINE_NUMBER (x)
== NOTE_INSN_EH_REGION_END))
&& (NOTE_BLOCK_NUMBER (x)
== CODE_LABEL_NUMBER (insn)))
{
NOTE_LINE_NUMBER (x) = NOTE_INSN_DELETED;
NOTE_SOURCE_FILE (x) = 0;
}
}
break;
}
prev = &XEXP (x, 1);
}
}
PUT_CODE (insn, NOTE);
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
NOTE_SOURCE_FILE (insn) = 0;
......
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