User account creation filtered due to spam.

Bug 37361 - spurious 'uninitialized' warning
Summary: spurious 'uninitialized' warning
Status: RESOLVED DUPLICATE of bug 36296
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Keywords: diagnostic
Depends on:
Reported: 2008-09-04 00:44 UTC by benoit.hudson
Modified: 2008-12-25 03:00 UTC (History)
5 users (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description benoit.hudson 2008-09-04 00:44:20 UTC
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.

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
Comment 1 Manuel López-Ibáñez 2008-09-05 15:45:27 UTC
This may be the same issue (or one of the two issues) of PR 36296. Although I would need to check the dumps before and after VRP. 

Wuninitialized got some fixes in GCC 4.4, so we also need to test whether this has been fixed.
Comment 2 Andrew Pinski 2008-12-25 03:00:42 UTC
This is an dup of bug 36296.
This happens after SRAing of some variables which shows up that PR again.

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