public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/53917] New: Warning message line about variable points to place where variable doesn't occur
@ 2012-07-10 16:13 Paulo.Matos at csr dot com
  2012-07-10 16:37 ` [Bug middle-end/53917] " Paulo.Matos at csr dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Paulo.Matos at csr dot com @ 2012-07-10 16:13 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-25 22:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-10 16:13 [Bug middle-end/53917] New: Warning message line about variable points to place where variable doesn't occur Paulo.Matos at csr dot com
2012-07-10 16:37 ` [Bug middle-end/53917] " Paulo.Matos at csr dot com
2012-07-10 16:38 ` Paulo.Matos at csr dot com
2021-03-25 22:40 ` [Bug middle-end/53917] Wuninitialized warning " msebor at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).