+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
/* 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;