public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug regression/39799]  New: missing 'may be used uninitialized' warning
@ 2009-04-17 17:55 alexvod at google dot com
  2009-04-17 20:56 ` [Bug tree-optimization/39799] [4.3/4.4/4.5 Regression] " rguenth at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: alexvod at google dot com @ 2009-04-17 17:55 UTC (permalink / raw)
  To: gcc-bugs

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

The following code:

inline int foo(int x)
{
  return x;
}
static void bar(int a, int *ptr)
{
  do
  {
    int b;
    if (b < 40)
    {
      ptr[0] = b;
    }
    b += 1;
    ptr++;
  }
  while (--a != 0);
}
void foobar(int a, int *ptr)
{
  bar(foo(a), ptr);
}

generates correct warning when compiled by gcc 4.2.4:
$ gcc -O3 -Wall -Werror -c 1.c
cc1: warnings being treated as errors
1.c: In function ‘foobar’:
1.c:9: warning: ‘b’ may be used uninitialized in this function
1.c:9: note: ‘b’ was declared here

But it compiles without any warning with gcc 4.4.0. The bug reproduces on gcc
4.3.1 as well.


-- 
           Summary: missing 'may be used uninitialized' warning
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: regression
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: alexvod at google dot com
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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


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

end of thread, other threads:[~2010-07-01 17:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-17 17:55 [Bug regression/39799] New: missing 'may be used uninitialized' warning alexvod at google dot com
2009-04-17 20:56 ` [Bug tree-optimization/39799] [4.3/4.4/4.5 Regression] " rguenth at gcc dot gnu dot org
2009-04-20  7:39 ` jakub at gcc dot gnu dot org
2009-04-20  9:32 ` rguenth at gcc dot gnu dot org
2009-04-22 13:37 ` rguenth at gcc dot gnu dot org
2009-08-04 12:48 ` rguenth at gcc dot gnu dot org
2010-05-22 18:32 ` [Bug tree-optimization/39799] [4.3/4.4/4.5/4.6 " rguenth at gcc dot gnu dot org
2010-06-30 14:17 ` bernds at gcc dot gnu dot org
2010-06-30 23:36 ` matt at use dot net
2010-07-01 17:14 ` danglin 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).