public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/35609]  New: [4.3/4.4 Regression] bogus "is used uninitialized in this function" warning
@ 2008-03-16 21:19 bunk at stusta dot de
  2008-03-16 21:30 ` [Bug tree-optimization/35609] [4.3/4.4 Regression] "is used uninitialized in this function" should be may warning pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: bunk at stusta dot de @ 2008-03-16 21:19 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1040 bytes --]

<--  snip  -->

$ cat test.c
int foo, bar;

void decode_reloc(int reloc, int *is_alt)
{
  if (reloc >= 20)
      *is_alt = 1;
  else if (reloc >= 10)
      *is_alt = 0;
}

void testfunc()
{
  int alt_reloc;

  decode_reloc(foo, &alt_reloc);

  if (alt_reloc)
    bar = 42;
}
$ gcc -O2 -Wall -c test.c
test.c: In function ‘testfunc’:
test.c:17: warning: ‘alt_reloc’ is used uninitialized in this function
$ 

<--  snip  -->

A "may be used uninitialized in this function" warning might be appropriate
here, but gcc seems to wrongly think it can prove "alt_reloc" was for sure
uninitialized here.


-- 
           Summary: [4.3/4.4 Regression] bogus "is used uninitialized in
                    this function" warning
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bunk at stusta dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35609


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

end of thread, other threads:[~2008-03-25 10:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-16 21:19 [Bug c/35609] New: [4.3/4.4 Regression] bogus "is used uninitialized in this function" warning bunk at stusta dot de
2008-03-16 21:30 ` [Bug tree-optimization/35609] [4.3/4.4 Regression] "is used uninitialized in this function" should be may warning pinskia at gcc dot gnu dot org
2008-03-16 21:30 ` pinskia at gcc dot gnu dot org
2008-03-16 21:33 ` rguenth at gcc dot gnu dot org
2008-03-18 16:54 ` rguenth at gcc dot gnu dot org
2008-03-19 10:46 ` rguenth at gcc dot gnu dot org
2008-03-19 10:46 ` [Bug tree-optimization/35609] [4.3 " rguenth at gcc dot gnu dot org
2008-03-25 10:10 ` rguenth at gcc dot gnu dot org
2008-03-25 10:11 ` rguenth at gcc dot gnu dot 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).