This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53294] New: Optimize out some exception code
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 09 May 2012 10:37:04 +0000
- Subject: [Bug c++/53294] New: Optimize out some exception code
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53294
Bug #: 53294
Summary: Optimize out some exception code
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: glisse@gcc.gnu.org
Hello,
it would be great if the compiler could transform code like:
try {
throw 42;
} catch(...) {
}
into nothing (or in practice into a simple goto, since there will be code
around). It already knows to remove the code after "throw", it could statically
check that the exception will be caught locally and thus skip the __cxa_throw,
__cxa_begin_catch game.
Filed as C++ front-end, but it might be for the middle-end, since it would be
best if this optimization happened after inlining.