[Bug middle-end/96300] missing -Wuninitialized reading a struct member by a conditionally assigned pointer

manu at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jul 29 16:13:40 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96300

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
                 CC|                            |manu at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-07-29

--- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
This seems some kind of weird missed optimization because this variant does
warn:


struct S { int i; };

int g (int i, int yy)
{
  struct S x, y={yy}, *p = i ? &x : &y;
  return p->i;   // missing -Wuninitialized
}


More information about the Gcc-bugs mailing list