[Bug c++/53294] New: Optimize out some exception code
glisse at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed May 9 10:40:00 GMT 2012
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.
More information about the Gcc-bugs
mailing list