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
Keywords: diagnostic
Depends on:
Reported: 2010-01-13 13:13 UTC by Xavier Roche
Modified: 2010-01-13 16:33 UTC (History)
17 users (show)

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

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

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 ***