for gcc/ChangeLog from Alexandre Oliva PR tree-optimization/33735 PR tree-optimization/33572 * tree-inline.c (update_ssa_across_abnormal_edges): Revert 2007-10-09's change. * except.c (duplicate_eh_regions): Don't look for prev_try beyond ERT_ALLOWED_EXCEPTIONS with an empty list. for gcc/testsuite/ChangeLog from Alexandre Oliva PR tree-optimization/33735 * g++.dg/torture/pr33735.C: New. Index: gcc/tree-inline.c =================================================================== --- gcc/tree-inline.c.orig 2007-10-13 04:38:25.000000000 -0300 +++ gcc/tree-inline.c 2007-10-13 05:47:02.000000000 -0300 @@ -1055,8 +1055,7 @@ update_ssa_across_abnormal_edges (basic_ } re = find_edge (ret_bb, e->dest); - if (!re) - continue; + gcc_assert (re); gcc_assert ((re->flags & (EDGE_EH | EDGE_ABNORMAL)) == (e->flags & (EDGE_EH | EDGE_ABNORMAL))); Index: gcc/except.c =================================================================== --- gcc/except.c.orig 2007-09-28 00:02:42.000000000 -0300 +++ gcc/except.c 2007-10-13 05:24:54.000000000 -0300 @@ -1005,7 +1005,9 @@ duplicate_eh_regions (struct function *i for (prev_try = VEC_index (eh_region, cfun->eh->region_array, outer_region); prev_try && prev_try->type != ERT_TRY; prev_try = prev_try->outer) - if (prev_try->type == ERT_MUST_NOT_THROW) + if (prev_try->type == ERT_MUST_NOT_THROW + || (prev_try->type == ERT_ALLOWED_EXCEPTIONS + && !prev_try->u.allowed.type_list)) { prev_try = NULL; break; Index: gcc/testsuite/g++.dg/torture/pr33735.C =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ gcc/testsuite/g++.dg/torture/pr33735.C 2007-10-13 05:44:39.000000000 -0300 @@ -0,0 +1,21 @@ +// { dg-do compile } +#include +typedef struct _ts { } PyThreadState; +PyThreadState * Py_NewInterpreter(void); +void Py_EndInterpreter(PyThreadState *); +class ApplicationError { +public: + ApplicationError(std::string errormsg) : errormsg(errormsg) { } + std::string errormsg; +}; +void run() +{ + PyThreadState *py_state=__null; + try { + if (!(py_state=Py_NewInterpreter())) + throw ApplicationError("error"); + } + catch(ApplicationError e) { + Py_EndInterpreter(py_state); + } +}