https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69930
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED CC| |jakub at gcc dot gnu.org Resolution|--- |INVALID --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- That is intentional. The address sanitization is performed quite late and is testing violations after many optimizations have done its job. In this case, the cddce1 pass turned the endless loop into an empty endless loop, which is a valid transformation in that case. If you want to catch violations that are closer to what you have in the source code, use -O0 instead with -fsanitize=address.