[Bug tree-optimization/81809] missing -Wuninitialized due to alias analysis limitation

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jul 14 22:16:10 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81809

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |10.1.0, 11.0, 8.2.0, 9.2.0

--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> ---
Another test case for the same underlying bug.

$ cat z.c && gcc -O2 -S -Wall z.c
void f (const int*, const int*);

void g (void)
{
  int a = 0, b;
  f (&a, &b);
}

void h (void)
{
  int a = 0, b;
  f (&a, 0);
  f (&b, 0);
}
z.c: In function ‘g’:
z.c:6:3: warning: ‘b’ may be used uninitialized [-Wmaybe-uninitialized]
    6 |   f (&a, &b);
      |   ^~~~~~~~~~
z.c:1:6: note: by argument 2 of type ‘const int *’ to ‘f’ declared here
    1 | void f (const int*, const int*);
      |      ^
z.c:5:14: note: ‘b’ declared here
    5 |   int a = 0, b;
      |              ^


More information about the Gcc-bugs mailing list