https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106568
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> --- >And the program does not take the exception path. Instead it segfaults. If I read the backtrace correctly, it is trying to resume an unwind because it didn't find a catch that would hit in main but the following code hits the assert while unwinding: /* Choose between continuing to process _Unwind_RaiseException or _Unwind_ForcedUnwind. */ if (exc->private_1 == 0) code = _Unwind_RaiseException_Phase2 (exc, &cur_context, &frames); else code = _Unwind_ForcedUnwind_Phase2 (exc, &cur_context, &frames); gcc_assert (code == _URC_INSTALL_CONTEXT); And then abort calls raise which then segfaults.