public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/61409] New: [4.9 regression] -Wmaybe-uninitialized false-positive with -O2
@ 2014-06-04  7:40 eggert at gnu dot org
  2014-06-04  9:29 ` [Bug c/61409] " manu at gcc dot gnu.org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: eggert at gnu dot org @ 2014-06-04  7:40 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61409
           Summary: [4.9 regression] -Wmaybe-uninitialized false-positive
                    with -O2
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eggert at gnu dot org

Created attachment 32887
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32887&action=edit
sample program illustrating the false positive

GCC 4.9.0 x86-64.  I do not observe the bug with GCC 4.8.2.

I discovered this bug when compiling GNU Emacs, and abstracted it into the
simplest test case I could easily generate.  When I compile the attached
program g.i with the command:

gcc -Wmaybe-uninitialized -O2 -c g.i

GCC warns:

g.i:607:21: warning: 'mw' may be used uninitialized in this function
[-Wmaybe-uninitialized]
       mw->pixel_top = rw->pixel_height;

But mw cannot possibly be uninitialized here.  Also, mw was used in the
previous line, with no warning.

The bug may be related to lines 602 and 603, which are long and which do not
mention mw, as removing these lines makes the diagnostic go away.


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

end of thread, other threads:[~2015-06-26 20:35 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-04  7:40 [Bug c/61409] New: [4.9 regression] -Wmaybe-uninitialized false-positive with -O2 eggert at gnu dot org
2014-06-04  9:29 ` [Bug c/61409] " manu at gcc dot gnu.org
2014-06-04  9:59 ` manu at gcc dot gnu.org
2014-06-04 10:31 ` [Bug middle-end/61409] [4.9/4.10 " rguenth at gcc dot gnu.org
2014-06-04 15:28 ` eggert at gnu dot org
2014-06-04 15:57 ` manu at gcc dot gnu.org
2014-06-25 13:26 ` jakub at gcc dot gnu.org
2014-06-25 13:30 ` jakub at gcc dot gnu.org
2014-06-26 12:45 ` rguenth at gcc dot gnu.org
2014-07-16 13:31 ` jakub at gcc dot gnu.org
2014-10-30 10:43 ` [Bug middle-end/61409] [4.9/5 " jakub at gcc dot gnu.org
2015-02-12 23:04 ` law at redhat dot com
2015-02-12 23:54 ` law at redhat dot com
2015-02-13  2:39 ` law at redhat dot com
2015-02-13  3:34 ` law at redhat dot com
2015-03-02 19:25 ` manu at gcc dot gnu.org
2015-06-26 20:09 ` [Bug middle-end/61409] [4.9/5/6 " jakub at gcc dot gnu.org
2015-06-26 20:35 ` jakub 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).