This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/63445] [5 Regression] request: make -Wstrict-overflow avoid a class of false positives
- From: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 07 Oct 2014 14:01:15 +0000
- Subject: [Bug tree-optimization/63445] [5 Regression] request: make -Wstrict-overflow avoid a class of false positives
- Auto-submitted: auto-generated
- References: <bug-63445-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63445
--- Comment #5 from rguenther at suse dot de <rguenther at suse dot de> ---
On Tue, 7 Oct 2014, manu at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63445
>
> --- Comment #4 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> ---
> > i_15 could be negative and thus j_9 - i_15 could well overflow the input
> > range at the +INF side. (i_15 is [-INF, j_5(D) + -1])
>
> Actually, this is a very good point. There is indeed a potential integer
> overflow in the original code. Thus, the warning seems valid.
>
> Perhaps the warning message could say that the problem is that "j - i" can
> overflow if i is negative.
Sure - but we warn about the comparison against zero which doesn't
behave differently if overflow wraps or is undefined.