public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug regression/42145]  New: Incorrect "may be used uninitialized warning" for a very specific test case
@ 2009-11-22 14:42 colin at reactos dot org
  2009-11-22 14:44 ` [Bug regression/42145] " colin at reactos dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: colin at reactos dot org @ 2009-11-22 14:42 UTC (permalink / raw)
  To: gcc-bugs

I'm compiling the attached test case with "gcc version 4.5.0 20091018
(experimental) [trunk revision 152966] (Ubuntu 20091018-0ubuntu1)".
When using the command line "gcc -Wuninitialized -Os -o test test_gccbug.c",
I'm getting the following incorrect warning:

test_gccbug.c: In function 'main':
test_gccbug.c:17:6: warning: 'ret' may be used uninitialized in this function

Same happens with different builds of GCC 4.4.2, 4.4.1 and 4.3.4.
No such warning occurs with builds of GCC 4.2.4 and 4.1.3.

This problem does not occur if one or more of the following is done:
- You change the optimization level to -O0 or -O1 (-O2 and -O3 still trigger
the bug in this GCC 4.5.0 version, but not always in older versions I've
tested)
- You comment out line 10 of the test case
- You change line 22 of the test case to just 'if (!argc)'


-- 
           Summary: Incorrect "may be used uninitialized warning" for a very
                    specific test case
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: regression
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: colin at reactos dot org


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


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

end of thread, other threads:[~2009-12-30 16:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-22 14:42 [Bug regression/42145] New: Incorrect "may be used uninitialized warning" for a very specific test case colin at reactos dot org
2009-11-22 14:44 ` [Bug regression/42145] " colin at reactos dot org
2009-11-22 14:44 ` colin at reactos dot org
2009-12-30 16:59 ` manu at gcc dot gnu dot 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).