[Bug c/37361] New: spurious 'uninitialized' warning

benoit dot hudson at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Sep 4 00:45:00 GMT 2008


I get a spurious warning on code that can't possibly have an uninitialized
reference; gcc should be able to figure it out just by propagating constants. 
The example is cut down from a larger program and is still a bit long, but is
quite brittle: every substantive irrelevant change I make to the test case
below eliminates the warning (such as removing the nitems field and testing
against items instead, or removing the call to cons, or replacing
freelist_alloc by malloc).  In the output, everything got inlined, but it's a
mess of spaghetti jumps that I can't decipher.

This bug happens identically in both gcc-4.2.1 and gcc-4.3.1.

http://idefix.uchicago.edu/~bhudson/stuff/gcc-4-spurious-warning.c

gcc gcc-4-spurious-warning.c -W -Wall -O2 -S
spurious-warning.c: In function 'cause_warning':
spurious-warning.c:74: warning: 'h.min_item' may be used uninitialized in this
function


-- 
           Summary: spurious 'uninitialized' warning
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: benoit dot hudson at gmail dot com


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



More information about the Gcc-bugs mailing list