This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug sanitizer/84732] false-positive -Wstringop-truncation warning with -fsanitize-coverage=trace-pc


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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #2)
> I guess it somehow confuses VRP, Martin can you please take a look? Note
> that __builtin___sanitizer_cov_trace_pc is pure function, can't modify
> memory in original program.

No, __builtin___sanitizer_cov_trace_pc is certainly not pure and can't really
be, otherwise would optimize them all away (nothing uses their void return
value),
so the problem is that it invalidates all recorded string lengths, at least
those that escape (but in this testcase it is a global variable).
As __sanitizer_cov_trace_pc is a user-supplied function, I don't really think
we can assume anything on it (e.g. that it will not change any global or
escaped local variables, it can change them and most likely will do at least
some of them, otherwise it would be useless).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]