aboutsummaryrefslogtreecommitdiff
path: root/gcc/flow.c
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1997-11-02 02:15:01 +0000
committerJeff Law <law@gcc.gnu.org>1997-11-01 19:15:01 -0700
commitf8671389c5c97971bc7b20babdf44c0cacf3f5a0 (patch)
tree2b13cc1ef8ffbb88154a5bf225b8d4efa7add794 /gcc/flow.c
parente67edc156e9b88eace27951f83420acdeecbc18e (diff)
downloadgcc-f8671389c5c97971bc7b20babdf44c0cacf3f5a0.zip
gcc-f8671389c5c97971bc7b20babdf44c0cacf3f5a0.tar.gz
gcc-f8671389c5c97971bc7b20babdf44c0cacf3f5a0.tar.bz2
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
Diffstat (limited to 'gcc/flow.c')
-rw-r--r--gcc/flow.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/gcc/flow.c b/gcc/flow.c
index 08dd4e8..e2c548d 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -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;