https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89561
--- Comment #2 from bugsthecode at mail dot ru --- (In reply to Andrew Pinski from comment #1) > -fsantize=undefined does exactly what 6ou want. No, -fsanitize=undefined adds code to detect and report UB at runtime. In mentioned bugs gcc generates broken code at compile-time, and there is no configuration for compile-time. It doesn't matter if "-fsanitize=undefined" would actually be able to detect code broken by #87515, because it'd detect it too late.