This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/13127] New: [tree-ssa] Inlining causes spurious "might be used uninitialized" warnings
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Nov 2003 15:05:44 -0000
- Subject: [Bug middle-end/13127] New: [tree-ssa] Inlining causes spurious "might be used uninitialized" warnings
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
While looking at Bug 13000 I noticed this bug. Consider:
static int foo (int a) { }
int main (void) { return foo (0); }
Compile this with "-O2 -Wall" and you can see that when finalizing
`main' (after inlining foo of course), we produce this strange warning:
t.i:2: warning: '({anonymous})' might be used uninitialized in this function
Wtf :-)
Of course this is a regression from mainline and older GCCs.
--------------
$ cat t.i
static int foo (int a) { }
int main (void) { return foo (0); }
$ cc1 --version
GNU C version 3.5-tree-ssa 20031119 (merged 20031111) (i686-pc-linux-gnu)
compiled by GNU C version 3.5-tree-ssa 20031119 (merged 20031111).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
$ cc1 -O -Wall t.i
foo
t.i: In function `foo':
t.i:1: warning: control reaches end of non-void function
main
$ cc1 -O2 -Wall t.i
main
t.i: In function `main':
t.i:2: warning: '({anonymous})' might be used uninitialized in this function
--
Summary: [tree-ssa] Inlining causes spurious "might be used
uninitialized" warnings
Product: gcc
Version: tree-ssa
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P2
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: steven at gcc dot gnu dot org
CC: dnovillo at redhat dot com,gcc-bugs at gcc dot gnu dot
org
GCC host triplet: any
BugsThisDependsOn: 13000
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13127