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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org
           Assignee|rguenth at gcc dot gnu.org         |unassigned at gcc dot 
gnu.org

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
The testcase is now fixed.  We're still not merging adjacent memset/bzero
calls.\
Modified testcase:

void f (void*);
void h (void)
{
  char a[8];
  __builtin_memset (a, 0, 1);
  __builtin_memset (a + 1, 0, 3);
  __builtin_memset (a + 4, 0, 4);

  f (a);
}

results in

;; Function h (h, funcdef_no=1, decl_uid=1962, cgraph_uid=1, symbol_order=1)

h ()
{
  char a[8];

  <bb 2> [local count: 1073741825]:
  MEM[(void *)&a] = 0;
  __builtin_memset (&MEM[(void *)&a + 1B], 0, 3);
  __builtin_memset (&MEM[(void *)&a + 4B], 0, 4);
  f (&a);
  a ={v} {CLOBBER};
  return;

}

note we have to deal with merging with stores as well.  Given the
original testcase was ultimatively solved by making only stores
available to store-merging the obvious thing to do is to teach
store-merging about memset()/bzero() and consider memset() for
code-generation as well(?).

No longer mine.

Reply via email to