public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/49848] New: False positive warning triggered by -Wmaybe-uninitialized
@ 2011-07-26  1:29 lacombar at gmail dot com
  2011-07-26  1:31 ` [Bug c/49848] " lacombar at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: lacombar at gmail dot com @ 2011-07-26  1:29 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: False positive warning triggered by
                    -Wmaybe-uninitialized
           Product: gcc
           Version: 4.5.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: lacombar@gmail.com


Considering the attached reduced-testcase, gcc will trigger the following
warning:

% gcc -m32 -Wall -Os -c -S -o /dev/null foo.c                                   
foo.c: In function 'foo':
foo.c:9:12: warning: 'b' may be used uninitialized in this function

Affected gcc is:

% gcc -v                                     
Using built-in specs.
[...]
Thread model: posix
gcc version 4.5.1 20100924 (Red Hat 4.5.1-4) (GCC)

however, gcc from trunk (as of 20110609) also produces the warning:

/src/x86-64/obj/destdir/bin/x86_64-none-linux-gcc -m32 -Wall -Os -c -S -o
/dev/null foo.c
foo.c: In function 'foo':
foo.c:14:21: warning: 'b' may be used uninitialized in this function
[-Wmaybe-uninitialized]

This warning only shows up at -Os.

Mailing list reference: http://gcc.gnu.org/ml/gcc-help/2011-07/msg00243.html


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

* [Bug c/49848] False positive warning triggered by -Wmaybe-uninitialized
  2011-07-26  1:29 [Bug c/49848] New: False positive warning triggered by -Wmaybe-uninitialized lacombar at gmail dot com
@ 2011-07-26  1:31 ` lacombar at gmail dot com
  2011-07-26  2:16 ` [Bug middle-end/49848] " pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: lacombar at gmail dot com @ 2011-07-26  1:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Arnaud Lacombe <lacombar at gmail dot com> 2011-07-26 01:31:07 UTC ---
Created attachment 24834
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24834
reduced testcase


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

* [Bug middle-end/49848] False positive warning triggered by -Wmaybe-uninitialized
  2011-07-26  1:29 [Bug c/49848] New: False positive warning triggered by -Wmaybe-uninitialized lacombar at gmail dot com
  2011-07-26  1:31 ` [Bug c/49848] " lacombar at gmail dot com
@ 2011-07-26  2:16 ` pinskia at gcc dot gnu.org
  2012-10-25  0:13 ` manu at gcc dot gnu.org
  2013-11-20  1:13 ` law at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-07-26  2:16 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |middle-end

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-07-26 02:15:38 UTC ---
This is a semi standard issue with uninitialized variable warnings.


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

* [Bug middle-end/49848] False positive warning triggered by -Wmaybe-uninitialized
  2011-07-26  1:29 [Bug c/49848] New: False positive warning triggered by -Wmaybe-uninitialized lacombar at gmail dot com
  2011-07-26  1:31 ` [Bug c/49848] " lacombar at gmail dot com
  2011-07-26  2:16 ` [Bug middle-end/49848] " pinskia at gcc dot gnu.org
@ 2012-10-25  0:13 ` manu at gcc dot gnu.org
  2013-11-20  1:13 ` law at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: manu at gcc dot gnu.org @ 2012-10-25  0:13 UTC (permalink / raw)
  To: gcc-bugs


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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-10-25
                 CC|                            |manu at gcc dot gnu.org
             Blocks|                            |24639
     Ever Confirmed|0                           |1

--- Comment #3 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-10-25 00:12:34 UTC ---
Still present in GCC 4.8.0pr49848.c: In function ‘foo’:
pr49848.c:14:21: warning: ‘b’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
  if (a != NULL && b != NULL)
                     ^


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

* [Bug middle-end/49848] False positive warning triggered by -Wmaybe-uninitialized
  2011-07-26  1:29 [Bug c/49848] New: False positive warning triggered by -Wmaybe-uninitialized lacombar at gmail dot com
                   ` (2 preceding siblings ...)
  2012-10-25  0:13 ` manu at gcc dot gnu.org
@ 2013-11-20  1:13 ` law at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: law at redhat dot com @ 2013-11-20  1:13 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |law at redhat dot com
         Resolution|---                         |DUPLICATE

--- Comment #4 from Jeffrey A. Law <law at redhat dot com> ---
Another case where throttling optimizations inhibits accurate warnings.

*** This bug has been marked as a duplicate of bug 42145 ***


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

end of thread, other threads:[~2013-11-20  1:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-26  1:29 [Bug c/49848] New: False positive warning triggered by -Wmaybe-uninitialized lacombar at gmail dot com
2011-07-26  1:31 ` [Bug c/49848] " lacombar at gmail dot com
2011-07-26  2:16 ` [Bug middle-end/49848] " pinskia at gcc dot gnu.org
2012-10-25  0:13 ` manu at gcc dot gnu.org
2013-11-20  1:13 ` law at redhat dot com

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