[Bug c++/119141] ub sanitizer incorrect overflow detection

sjames at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Mar 7 03:43:23 GMT 2025


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119141

--- Comment #3 from Sam James <sjames at gcc dot gnu.org> ---
(In reply to Nikl Kelbon from comment #2)
> This is not a bug about the difference in behavior of different compilers.
> Of course they will behave the same, they have the same standard libraries
> and sanitizers.

No, it's not an "of course" at all. While libsanitizer is shared, the
instrumentation is done in the compiler itself, and even with that aside,
optimisations can affect opportunities for instrumentation.

As for standard libraries: also no, as Andrew's example shows using
-stdlib=libc++ (rather than libstdc++).


More information about the Gcc-bugs mailing list