[Bug c++/86465] [8/9/10 Regression] C++17 <optional> triggers: ‘<anonymous>’ may be used uninitialized in this function

law at redhat dot com gcc-bugzilla@gcc.gnu.org
Thu Mar 5 21:47:00 GMT 2020


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

--- Comment #9 from Jeffrey A. Law <law at redhat dot com> ---
So from the uninit analyzer's standpoint the clobber isn't considered an
initialization (which makes sense).  As a result the object really does appear
to be uninitialized.

  struct function D.35879;

[ ... ]
  MEM[(struct function *)&fo] ={v} {CLOBBER};
  MEM[(struct _Function_base *)&fo] ={v} {CLOBBER};
  MEM[(int (*<T24ca>) (void) *)&fo] = f1;
  MEM[(struct function *)&fo1] ={v} {CLOBBER};
  MEM[(struct _Function_base *)&fo1] ={v} {CLOBBER};
  MEM[(struct _Function_base *)&D.35879] ={v} {CLOBBER};
  __tmp = MEM[(union _Any_data & {ref-all})&fo];
  MEM[(union _Any_data * {ref-all})&fo] = MEM[(union _Any_data &
{ref-all})&D.35879];

That last statement reads from D.35879 which was never initialized


More information about the Gcc-bugs mailing list