Bug 42724 - Trivial uninitialized variable not spotted
Summary: Trivial uninitialized variable not spotted
Status: RESOLVED DUPLICATE of bug 18501
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2010-01-13 13:13 UTC by Xavier Roche
Modified: 2010-01-13 16:33 UTC (History)
17 users (show)

See Also:
Host:
Target: x86_64-unknown-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Test case that should produce a warning with -O -Wuninitialized (112 bytes, text/plain)
2010-01-13 13:14 UTC, Xavier Roche
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xavier Roche 2010-01-13 13:13:01 UTC
Possibly related to BUG 39799

The attached very simple test case does not produce any warning on build, using '-W -Wall -Wextra -O3 -Wuninitialized -Werror'.

If the condition is not seen as false at build time, the compiler does not complaint.
Comment 1 Xavier Roche 2010-01-13 13:14:24 UTC
Created attachment 19570 [details]
Test case that should produce a warning with -O -Wuninitialized
Comment 2 Richard Biener 2010-01-13 13:39:49 UTC
The uninitialized use is optimized away before we would warn about it.
Comment 3 Manuel López-Ibáñez 2010-01-13 16:33:38 UTC
CCP removing the uninitialized value.

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