This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/53917] New: Warning message line about variable points to place where variable doesn't occur
- From: "Paulo.Matos at csr dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 10 Jul 2012 16:13:24 +0000
- Subject: [Bug middle-end/53917] New: Warning message line about variable points to place where variable doesn't occur
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53917
Bug #: 53917
Summary: Warning message line about variable points to place
where variable doesn't occur
Classification: Unclassified
Product: gcc
Version: 4.6.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: Paulo.Matos@csr.com
Created attachment 27771
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27771
Testcase
Hi,
I have noticed that when compiling the following test case (will attach to the
bug):
test1.c:
int a, b;
void fn1 ();
typedef enum
{
READ_WRITE
} TAG_STATE;
TAG_STATE fn2 ();
void
fn3 ()
{
int c;
if (a)
c = 0;
else
switch (fn2 ())
case 0:
c = 1;
b = c;
if (b)
fn1 ();
}
gcc says:
$ gcc -Os -S -Wall test1.c
test1.c: In function 'fn3':
test1.c:19:8: warning: 'c' may be used uninitialized in this function
[-Wuninitialized]
However line 19 is 'if (b)'.
Used gcc46 but also reproducible with gcc47.