http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54804
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2012-10-04 CC| |manu at gcc dot gnu.org Component|c |middle-end Blocks| |24639 Ever Confirmed|0 |1 --- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-10-04 08:07:35 UTC --- Confirmed. early SRA creates a scalar replacement for the struct but not for the union: ;; Function yyparse (yyparse, funcdef_no=0, decl_uid=1710, cgraph_uid=0) yyparse () { union YYSTYPE yylval; union YYSTYPE D.1720; <bb 2>: [pr54804.c : 6:6] D.1720 = yylval; yylval ={v} {CLOBBER}; [pr54804.c : 6:6] return D.1720; } ;; Function yyparse_with_struct (yyparse_with_struct, funcdef_no=1, decl_uid=1716, cgraph_uid=1) Created a replacement for xxlval offset: 0, size: 32: xxlval$ival Symbols to be put in SSA form { xxlval$ival } Incremental SSA update started at block: 0 Number of blocks in CFG: 3 Number of blocks to update: 2 ( 67%) yyparse_with_struct () { int xxlval$ival; struct s xxlval; struct s D.1723; <bb 2>: [pr54804.c : 15:6] [pr54804.c : 15] MEM[(struct s *)&D.1723] = xxlval$ival_3(D); [pr54804.c : 15:6] return D.1723; } Alternatively, one may see the problem as Wuninitialized not working with anything that leaves in memory (structs/union/arrays) unless SRA is applied. There are a few PRs about that.