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

            Bug ID: 94447
           Summary: Not handling CONSTRUCTOR tree code
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: dmalcolm at gcc dot gnu.org
  Target Milestone: ---

Consider e.g.:

struct foo
{
  int *v;
};

int test (void)
{
  struct foo f = {};
  return *f.v;
}

This currently reports
t.c: In function ‘test’:
t.c:9:10: warning: use of uninitialized value ‘<unknown>’ [CWE-457]
[-Wanalyzer-use-of-uninitialized-value]
    9 |   return *f.v;
      |          ^~~~
  ‘test’: event 1
    |
    |

when it should be a NULL dereference.

The f = {}; shows up as f = {}; in the gimple dump, a CONSTRUCTOR, and
region_model::on_assignment is hitting a TODO for that tree code.

Reply via email to