https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81714
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail|6.4.0, 7.3.0, 8.0 |10.2.0, 11.0, 6.3.0, 7.0.1,
| |8.3.0, 9.3.0
Last reconfirmed|2018-02-02 00:00:00 |2021-4-2
--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
Reconfirmed with GCC 11. This doesn't look like a problem with -Wuninitialized
but rather much earlier. The Gimple dump already has the wrong column number:
$ cat pr81714.c && gcc -S -Wall -fdump-tree-gimple-lineno=/dev/stdout -xc++
pr81714.c
int f0 ()
{
int i;
return i + 1;
}
int f1 ()
{
int i;
return 2 + i;
}
int f0 ()
[pr81714.c:4:15] {
int D.2352;
int i;
[pr81714.c:4:14] D.2352 = i + 1;
[pr81714.c:4:14] return D.2352;
}
int f1 ()
[pr81714.c:10:15] {
int D.2354;
int i;
[pr81714.c:10:14] D.2354 = i + 2;
[pr81714.c:10:14] return D.2354;
}
pr81714.c: In function ‘int f0()’:
pr81714.c:4:14: warning: ‘i’ is used uninitialized [-Wuninitialized]
4 | return i + 1;
| ^
pr81714.c:3:7: note: ‘i’ was declared here
3 | int i;
| ^
pr81714.c: In function ‘int f1()’:
pr81714.c:10:14: warning: ‘i’ is used uninitialized [-Wuninitialized]
10 | return 2 + i;
| ^
pr81714.c:9:7: note: ‘i’ was declared here
9 | int i;
| ^
Other middle-end warnings are also affected (e.g., -Warray-bounds).