https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104642
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Richard Biener from comment #1) > Not sure, people will still see the surprising behavior at -O1+ then Sure, but we can justify that as optimizing away the checks. But giving a predictable crash at -O0 and confusing nonsense at -O1+ is easier to debug than confusing nonsense at all levels. > I'd rather have -funreachable-traps or so, enabled by default at -O0, rather > than special-casing the return case btw. That would be even better, yes.