https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82046
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- At least for warnings that require optimizations in order to avoid false positives like these, I think you need to accept some false positives with sanitizers, which necessarily cause fewer optimizations (otherwise they wouldn't be able to diagnose what they need to). So don't use -Werror with -fsanitize=undefined... I'd close this as WONTFIX.