public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/52904] New: -Wstrict-overflow false alarm with bounded loop
@ 2012-04-08  8:59 eggert at gnu dot org
  2012-04-08  8:59 ` [Bug c/52904] " eggert at gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: eggert at gnu dot org @ 2012-04-08  8:59 UTC (permalink / raw)
  To: gcc-bugs

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".


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-09-14  7:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-08  8:59 [Bug c/52904] New: -Wstrict-overflow false alarm with bounded loop eggert at gnu dot org
2012-04-08  8:59 ` [Bug c/52904] " eggert at gnu dot org
2012-04-08  9:02 ` eggert at gnu dot org
2012-04-08 10:05 ` [Bug tree-optimization/52904] " pinskia at gcc dot gnu.org
2012-04-10 12:18 ` rguenth at gcc dot gnu.org
2013-12-12 17:12 ` Laurent.Rineau__gcc at normalesup dot org
2013-12-12 18:19 ` Laurent.Rineau__gcc at normalesup dot org
2013-12-12 19:34 ` eggert at gnu dot org
2014-08-08 10:21 ` kugan at gcc dot gnu.org
2014-08-08 22:16 ` kugan at gcc dot gnu.org
2014-08-18  6:29 ` kugan at gcc dot gnu.org
2021-09-14  7:09 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).