https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87950
--- Comment #10 from Martin Liška <marxin at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #9) > (In reply to Martin Liška from comment #8) > > Thank you Andrew for clarification of the behavior. Apparently it's quite > > common question. One note that I have about C behavior is that we can maybe > > also add -fstrict-enums to behave the same as in C++. Thoughts? > > No, we try not to add extensions which change well defined behavior to be > undefined behavior. Adding -fstrict-enums for C would cause just that. Good, then as mentioned explicit usage of __builtin_unreachable() will enable desired optimization. Then, let's close this as invalid?