This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/82504] Optimize away exception allocation and throws handled by catch(...){}
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 10 Oct 2017 14:21:13 +0000
- Subject: [Bug middle-end/82504] Optimize away exception allocation and throws handled by catch(...){}
- Auto-submitted: auto-generated
- References: <bug-82504-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82504
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The example isn't very interesting because it's not very realistic code. To be
useful we need this to happen after inlining:
void foo() {
throw 1;
}
void bar()
try {
foo();
} catch(...) {}
}
If we can elide the exception when foo() is inlined into bar() then I agree it
would be a valuable optimization.