https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113066
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Note -funreachable-traps works for what you want it to work at -O1 and above but not at -O0 due to ub_if_reached not being inlined ...