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/52904] New: -Wstrict-overflow false alarm with bounded loop


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52904

             Bug #: 52904
           Summary: -Wstrict-overflow false alarm with bounded loop
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: eggert@gnu.org


Created attachment 27113
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27113
simplified version of Emacs code, illustrating the bug

I ran into this problem when trying to build GNU Emacs with -Wstrict-overflow.

Compiling the attached program 'v.i' with the following command:

gcc -c -Wstrict-overflow -O2 v.i

generates the diagnostic:

v.i: In function 'wait_reading_process_output':
v.i:14:6: error: assuming signed overflow does not occur when simplifying
conditional to constant [-Werror=strict-overflow]

The diagnostic is obviously incorrect, since the variable 'nfds' cannot
possibly exceed 1024.

I will also attach the output of "gcc -v -c -Wstrict-overflow -O2 v.i".


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