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

            Bug ID: 99959
           Summary: missing -Wuninitialized for an esra variable with
                    TREE_NO_WARNING
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

GCC fails to issue -Wuninitialized for the following test case derived from
pr99945.  The warning detects the uninitialized use but the SR.3 variable has
the TREE_NO_WARNING bit set which suppresses it.

$ cat z.c && gcc -O2 -S -Wall -fdump-tree-esra=/dev/stdout z.c
void g (void)
{
  int i;

  void f (int *t)
  {
    __builtin_printf ("%i", i);   // missing -Wuninitialized
  }

  int t __attribute__ ((cleanup (f))) = 0;
}


;; Function f (f.0, funcdef_no=1, decl_uid=1947, cgraph_uid=1, symbol_order=0)

void f (int * t)
{
  int _3;

  <bb 2> :
  _3 = CHAIN.1_2(D)->i;
  __builtin_printf ("%i", _3);
  return;

}



;; Function g (g, funcdef_no=0, decl_uid=1943, cgraph_uid=2, symbol_order=1)

Created a replacement for FRAME.0 offset: 0, size: 32: SR.3D.1962
void g ()
{
  int SR.3;
  struct FRAME.g FRAME.0;
  int t;
  void * _3;
  int _8;

  <bb 2> :
  _3 = __builtin_dwarf_cfa (0);
  FRAME.0.FRAME_BASE.PARENT = _3;
  _8 = SR.3_10(D);
  __builtin_printf ("%i", _8);
  return;

}

Reply via email to