From: Jeffrey A Law Date: Sun, 2 Nov 1997 02:15:01 +0000 (+0000) Subject: flow.c (find_basic_blocks): If we delete the label for an exception handler... X-Git-Tag: releases/egcs-1.0.0~185 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8671389c5c97971bc7b20babdf44c0cacf3f5a0;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e153a19f67ed..566eeebc6fc1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +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 diff --git a/gcc/flow.c b/gcc/flow.c index 08dd4e885462..e2c548db2fa5 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;