summaryrefslogtreecommitdiff
path: root/gcc/except.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-05 18:33:13 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-05 18:33:13 +0000
commit0f656a57dac5f9f0fe413b8d0c72d77df5c12222 (patch)
tree4f93df0c2ba4fa10a2b50ba85da732b1679db504 /gcc/except.c
parent20fcf76b910071ada0d01cb586aba15f8336e25e (diff)
downloadgcc-0f656a57dac5f9f0fe413b8d0c72d77df5c12222.tar.gz
* except.c (sjlj_find_directly_reachable_regions): Be ready for removed toplevel
regions. (sjlj_mark_call_sites): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145565 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/except.c')
-rw-r--r--gcc/except.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/gcc/except.c b/gcc/except.c
index 2651e99f2d4..e0e90d2a1fd 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -1930,6 +1930,8 @@ sjlj_find_directly_reachable_regions (struct sjlj_lp_info *lp_info)
continue;
region = VEC_index (eh_region, cfun->eh->region_array, INTVAL (XEXP (note, 0)));
+ if (!region)
+ continue;
type_thrown = NULL_TREE;
if (region->type == ERT_THROW)
@@ -2040,7 +2042,17 @@ sjlj_mark_call_sites (struct sjlj_lp_info *lp_info)
continue;
note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
- if (!note)
+
+ /* Calls that are known to not throw need not be marked. */
+ if (note && INTVAL (XEXP (note, 0)) <= 0)
+ continue;
+
+ if (note)
+ region = VEC_index (eh_region, cfun->eh->region_array, INTVAL (XEXP (note, 0)));
+ else
+ region = NULL;
+
+ if (!region)
{
/* Calls (and trapping insns) without notes are outside any
exception handling region in this function. Mark them as
@@ -2053,14 +2065,7 @@ sjlj_mark_call_sites (struct sjlj_lp_info *lp_info)
continue;
}
else
- {
- /* Calls that are known to not throw need not be marked. */
- if (INTVAL (XEXP (note, 0)) <= 0)
- continue;
-
- region = VEC_index (eh_region, cfun->eh->region_array, INTVAL (XEXP (note, 0)));
- this_call_site = lp_info[region->region_number].call_site_index;
- }
+ this_call_site = lp_info[region->region_number].call_site_index;
if (this_call_site == last_call_site)
continue;