This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/13127] New: [tree-ssa] Inlining causes spurious "might be used uninitialized" warnings


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]