[Bug tree-optimization/55060] False un-initialized variable warnings
manu at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Sep 15 12:01:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55060
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |9.0
--- Comment #6 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
This seems fixed in GCC 9, even with -O1, but a testcase should be added to the
testsuite to prevent regression:
/* {dg-options "-O1 -Wuninitialized" }*/
static void a(int *i) { }
static void b(int p) { }
int foo(void) {
int i;
a(&i);
b(i);
return 0;
}
static void c(int *i) { }
extern void d(int p);
int bar(void) {
int i;
c(&i);
d(i); /* dg-warning "uninitialized" */
return 0;
}
extern void e(int *i);
static void f(int p) {};
int baz(void) {
int i;
e(&i);
f(i);
return 0;
}
More information about the Gcc-bugs
mailing list