This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/81876] [7 Regression] bogus -Wstrict-overflow warning with -O3
- From: "bunk at stusta dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 06 Dec 2017 10:35:50 +0000
- Subject: [Bug middle-end/81876] [7 Regression] bogus -Wstrict-overflow warning with -O3
- Auto-submitted: auto-generated
- References: <bug-81876-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81876
--- Comment #6 from Adrian Bunk <bunk at stusta dot de> ---
(In reply to Jeffrey A. Law from comment #4)
> WRT locations/diagnostics for things like ldist where GCC conjures up code
> that has little resemblance to what the user wrote. It's a real issue once
> we issue the warning -- the user has no clue what it meant.
>
> On the other hand those warnings (particularly those that result from ldist)
> are highlighting real issues. Bogus user code, poor optimization, even
> under-specified language from ISO. Examples of all can be found in BZ.
If in doubt, don't issue any warning to the user.
As far as I am aware, the testcase in this bug does not warrant any warning in
that line - even "comparison is always true" would be wrong.
If a warning option sometimes generates bogus warnings for issues not present
in the code, the only reasonable option for a user would be to always disable
this warning.