This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/64440] -Wdiv-by-zero false negative on const variables
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 30 Dec 2014 12:31:53 +0000
- Subject: [Bug c/64440] -Wdiv-by-zero false negative on const variables
- Auto-submitted: auto-generated
- References: <bug-64440-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64440
Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu.org
--- Comment #3 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> ---
(In reply to Chengnian Sun from comment #2)
> Thanks for your reply. It seems GCC sometimes does consider "const int" for
> other types of warnings (but not for -Wdiv-by-zero). See the following, with
> -O3, GCC warns that the left shift count is negative.
>
I wonder how this happens? The warning is still given by the FE!
Nonetheless, clang is able to warn without optimization because it has some
constant propagation pass in the FE. GCC does not have such a thing and current
developers are not convinced that it is worth it.
I think there are several PRs open about this, and it doesn't seem useful to
have one PR for each possible warning that could be improved by this.