https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113878
--- Comment #9 from Richard Biener ---
I'd very much appreciate getting rid of TYPE_OVERFLOW_SANITIZED checks by doing
instrumentation in the frontends.
Note we do
#define TYPE_OVERFLOW_UNDEFINED(TYPE) \
(POINTER_TY
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113878
--- Comment #8 from uecker at gcc dot gnu.org ---
(In reply to Jakub Jelinek from comment #7)
> (In reply to uecker from comment #6)
> > My idea would be to explicitly add either traps or __builtin_unreachable
> > whenever there is UB that can be
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113878
--- Comment #7 from Jakub Jelinek ---
(In reply to uecker from comment #6)
> My idea would be to explicitly add either traps or __builtin_unreachable
> whenever there is UB that can be checked for in the C FE, and not add
> sanitizer calls (that
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113878
--- Comment #6 from uecker at gcc dot gnu.org ---
My idea would be to explicitly add either traps or __builtin_unreachable
whenever there is UB that can be checked for in the C FE, and not add sanitizer
calls (that may return). Just a lightweigh
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113878
--- Comment #5 from Jakub Jelinek ---
Different instrumentations are done at different times.
Some ubsan instrumentations are already done in the FEs (e.g. shifts, division,
...), others are added in the ubsan pass (the idea is that catching up
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.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113878
--- Comment #3 from Jakub Jelinek ---
The sanitizers don't turn on -fwrapv.
There is just TYPE_OVERFLOW_SANITIZED which inhibits various optimizations, in
the constant folder and match.pd etc. so that stuff can be instrumented
properly, doesn't
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113878
uecker at gcc dot gnu.org changed:
What|Removed |Added
CC||uecker at gcc dot gnu.org
--
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113878
Andrew Pinski changed:
What|Removed |Added
Component|middle-end |sanitizer
CC|