public inbox for libstdc++-cvs@sourceware.org help / color / mirror / Atom feed
From: Jason Merrill <jason@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r14-1465] libstdc++: optimize EH phase 2 Date: Thu, 1 Jun 2023 12:49:50 +0000 (GMT) [thread overview] Message-ID: <20230601124950.70FF63858401@sourceware.org> (raw) https://gcc.gnu.org/g:5d9c9119079ef14798b0a4fc771fd8d3905ec746 commit r14-1465-g5d9c9119079ef14798b0a4fc771fd8d3905ec746 Author: Jason Merrill <jason@redhat.com> Date: Wed May 31 15:02:05 2023 -0400 libstdc++: optimize EH phase 2 In the ABI's two-phase EH model, first we walk the stack looking for a handler, then we walk the stack running cleanups until we reach that handler. In the cleanup phase, we shouldn't redundantly check the handlers along the way, e.g. when walking through g(): void f() { throw 42; } void g() { try { f(); } catch (void *) { } } int main() { try { g(); } catch (int) { } } libstdc++-v3/ChangeLog: * libsupc++/eh_personality.cc (PERSONALITY_FUNCTION): Don't check handlers in the cleanup phase. Diff: --- libstdc++-v3/libsupc++/eh_personality.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libstdc++-v3/libsupc++/eh_personality.cc b/libstdc++-v3/libsupc++/eh_personality.cc index 12391e563d6..cc6bc048892 100644 --- a/libstdc++-v3/libsupc++/eh_personality.cc +++ b/libstdc++-v3/libsupc++/eh_personality.cc @@ -592,6 +592,10 @@ PERSONALITY_FUNCTION (int version, // Zero filter values are cleanups. saw_cleanup = true; } + else if (actions == _UA_CLEANUP_PHASE) + // We checked the handlers in the search phase; if one of them + // matched, actions would also have _UA_HANDLER_FRAME set. + ; else if (ar_filter > 0) { // Positive filter values are handlers.
reply other threads:[~2023-06-01 12:49 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230601124950.70FF63858401@sourceware.org \ --to=jason@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ --cc=libstdc++-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).