https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107866
--- Comment #2 from Li Shaohua <shaohua.li at inf dot ethz.ch> --- (In reply to Jakub Jelinek from comment #1) > This isn't reported since r12-3918-g5b8b1522e04adc20980f396571be1929a32d148a > I wonder what is the point of -O3 -fsanitize=undefined, -fsanitize= severely > slows down the code for instrumentation and at the same time you ask for as > many optimizations as possible. I understand that optimization could optimize away UBs in a program. However, in this case, if you check the assembly code, the NULL pointer is still there and UBSAN is called to check it. So I believe this is a sanitizer issue. Many fuzzing tools these days are still using -O3 -fsanitize=xxx to compile programs for fast execution speed. So I believe no matter that optimization lever is used, as long as the UB is not optimized away, sanitizers should warn properly.