[Bug middle-end/90676] New: ambiguous GIMPLE after store merging

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu May 30 00:21:00 GMT 2019


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

            Bug ID: 90676
           Summary: ambiguous GIMPLE after store merging
           Product: gcc
           Version: 9.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: ---

Some stores do not show up in tree dumps.  It looks like the problem is the
result of store merging coalescing multiple trailing zero stores.  For example,
in the code below, even though each function writes different numbers of bytes,
they all look the same in the optimized GIMPLE.  Very confusing!

$ cat a.c && gcc -O2 -S -Wall -Wextra -fdump-tree-optimized=/dev/stdout a.c
char a[8];

void f2 (void)
{
  a[0] = 1;
  a[1] = 0;
}

void f4 (void)
{ 
  a[0] = 1;
  a[1] = 0;
  a[2] = 0;
  a[3] = 0;
}

void f8 (void)
{
  a[0] = 1;
  for (int i = 1; i != 8; ++i)
    a[i] = 0;
}

;; Function f2 (f2, funcdef_no=0, decl_uid=1907, cgraph_uid=1, symbol_order=1)

f2 ()
{
  <bb 2> [local count: 1073741824]:
  MEM[(char *)&a] = 1;
  return;

}



;; Function f4 (f4, funcdef_no=1, decl_uid=1910, cgraph_uid=2, symbol_order=2)

f4 ()
{
  <bb 2> [local count: 1073741824]:
  MEM[(char *)&a] = 1;
  return;

}



;; Function f8 (f8, funcdef_no=2, decl_uid=1913, cgraph_uid=3, symbol_order=3)

f8 ()
{
  <bb 2> [local count: 134217728]:
  MEM[(char *)&a] = 1;
  return;

}


More information about the Gcc-bugs mailing list