https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100047
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Component|c++ |tree-optimization CC| |msebor at gcc dot gnu.org Blocks| |78394, 82738 Last reconfirmed| |2021-04-12 Known to fail| |10.2.0, 11.0, 8.3.0, 9.3.0 --- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> --- Confirmed with GCC 11 and 10 and -Og only with the GCC 11 IL below. The warning depends on a number of optimizations only a few of which are enabled at -Og so it has a higher rate of false positives there. For GCC 12 with -Og we might consider removing -Wmaybe-uninitialized from -Wall. <bb 2> [local count: 1073741824]: # .MEM_10 = VDEF <.MEM_1(D)> D.56209 = D.55716; # .MEM_11 = VDEF <.MEM_10> D.51082 ={v} {CLOBBER}; # .MEM_12 = VDEF <.MEM_11> MEM[(union _Storage *)&D.51082] ={v} {CLOBBER}; # .MEM_13 = VDEF <.MEM_12> MEM[(struct _Optional_payload_base *)&D.51082]._M_engaged = 0; <<< store # .MEM_14 = VDEF <.MEM_13> D.56209 ={v} {CLOBBER}; # VUSE <.MEM_14> _34 = MEM[(const struct _Optional_base *)&D.51082]._M_payload.D.50287.D.50137._M_engaged; <<< read if (_34 != 0) <<< not folded goto <bb 3>; [100.00%] else goto <bb 5>; [0.00%] <bb 3> [local count: 1073741824]: # VUSE <.MEM_14> _36 = get (&MEM[(const struct packet_buffer *)&D.51082].m_ptr); # VUSE <.MEM_14> _37 = MEM[(const struct packet_buffer *)&D.51082].m_size; <<< -Wmaybe-uninitialized Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78394 [Bug 78394] False positives of maybe-uninitialized with -Og https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82738 [Bug 82738] [meta-bug] issues with the -Og optimization level