https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64501
--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> --- There are a lot of possible optimizations related to exceptions, and most compilers perform almost none :-( The compiler could notice that t is nothrow, but it doesn't. If you mark it explicitly (add throw() for instance) main will be simplified. PR 53294 would also let it simplify for different reasons.