https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113878
--- Comment #4 from uecker at gcc dot gnu.org --- Would it make sense to add the instrumentation earlier? Then it could be optimized as usual which may give better results. Just adding a test explicitly shows that this works: https://godbolt.org/z/av15nheTG Anyway, I am generally not super convinced about how the sanitizers (bloated library, unfortunate interaction with warnings, missing cases, poor optimization...) I am somewhat tempted to try putting a light-weight instrumentation directly into the C FE. That does not seem to hard and would avoid all those problems. But I am probably missing something.... And I have no idea whether something like this would be acceptable to GCC.