https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109364
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> --- That is because -funreachable-traps is also enabled at -O0. And disabled for -O1 and above except for -Og. That changes all places where you either __builtin_unreachable or places which gcc inserts that like this place, gcc will cause a trap.