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 c/64440] -Wdiv-by-zero false negative on const variables


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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
(In reply to Manuel LÃpez-IbÃÃez from comment #3)
> (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!

By using decl_constant_value_for_optimization.

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