https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108085
--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> --- Created attachment 54153 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54153&action=edit pr108085.c.216t.uncprop1.dot.svg So no, it's a real issue where we optimize out .ASAN_CHECK (6, &f, 4, 8); in the exit block. As seen in the dump file, we have the very ASAN_CHECK in bb_3: .ASAN_CHECK (7, &f, 4, 8), however, there are 2 ASAN_MARK (POISON, &f, 4) calls that are on the path from bb_3 to the exit block. @Jakub: Can you please take a look at the optimization algorithm why the check is not preserved?