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

--- Comment #2 from Carlos Galvez <carlosgalvezp at gmail dot com> ---
This is a general question which I hope can be answered without a full report.
My particular example gets a warning deep into Eigen-like code so it's not easy
to provide a minimal example.

My questions are code agnostic. Most importantly, I need to understand if this
warning is expected to produce false positives in it's default setting with
-Wall. The documentation says it catches subscripts that are "always" OOB. This
is not the case, as confirmed with other tools. So, is the documentation
accurate? Based on your experience with this warning, what type of code is it
expected to warn on? It would be good to add this as part of the documentation.

Finally, I ask if the subscript that GCC complains about is real or fictional
(namely, it "could" be OOB but GCC can't know it statically). We've seen other
warnings that complain about fictional numbers representing theoretical worst
case, for example the max number of an int when unrolling a loop, which is
possible in theory but unlikely in practice. Does this warning apply similar
heuristics?

Reply via email to