This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
PR 8805: EH vs. CFG
- From: Mark Mitchell <mark at codesourcery dot com>
- To: rth at redhat dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 23 Feb 2003 17:02:08 -0800
- Subject: PR 8805: EH vs. CFG
- Reply-to: mark at codesourcery dot com
This test case ends up generating a function with huge number of
exception handlers. Essentially, the function looks like:
try {
construct ();
try {
construct ();
} catch (...) {
destroy ();
}
} catch (...) {
destroy ();
}
with many, many levels of nesting.
This results in quadratic blow-up in the compiler. The reason seems
to be that reachable_handlers returns a long list of handlers for each
place that can throw an exception. That seems weird; why not just
stop after finding the first one?
The cause, in the code, is that reachable_next_level stops when it
finds a RNL_CAUGHT region -- but cleanup handlers are only
RNL_MAYBE_CAUGHT regions. It seems to me that we should stop after
RNL_MAYBE_CAUGHT regions too, in this case; each cleanup handler
should have an edge to the places it can transfer control to next,
so we don't need them from the original place.
In that case, we could introduce RNL_CLEANUP -- which would be treated
like RNL_MAYBE_CAUGHT in most places, but like RNL_CAUGHT in
reachable_next_level.
Thoughts?
--
Mark Mitchell mark at codesourcery dot com
CodeSourcery, LLC http://www.codesourcery.com