On Oct 12, 2007, Alexandre Oliva wrote: > On Oct 11, 2007, "Richard Guenther" wrote: >> The extra checking triggers PR33735. > Thanks. This is an interesting testcase. It is a variant of the > problem H-P had reported, but I hadn't realized there was a lingering > bug then. So the patch below reverts the work around for H-P's testcase, and fixes the problem explained below. > The problem is that an exception thrown during stack unwinding is > supposed to call terminate(), but AFAICT, when we inline the dtor of > temporaries (other than the exception object) in the throw expression > itself, calls that are brought in as part of the destructor get EH > edges as if they were before the throw expression, escaping the > requirement to call terminate in case they throw. > Now, since there aren't edges from the original dtor call to enclosing > catch or clean-up points, when we look for such edges at the time of > adjusting the PHI nodes, we don't find them. Oops. The patch below recognizes an ERT_ALLOWED_EXCEPTIONS EH region with an empty type list and prevents the enclosing try block from being regarded as reachable from within. With it, both testcases compile correctly. libstdc++ builds with it; starting bootstrap and regtesting on x86_64-linux-gnu right now. Ok to install?