https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112748
--- Comment #2 from Tavian Barnes <tavianator at gmail dot com> --- (In reply to Andrew Pinski from comment #1) > Does -fsanitize=address remove it? Yes, it's still removed with -fsanitize=address. While ASAN is necessary to check that the memory is really allocated, UBSAN should at least check that ptr is not NULL. So it shouldn't be removed in either case.