[Bug tree-optimization/94130] [8/9/10 Regression] Unintended result with optimization option when assigning two structures, memset and 0

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Mar 11 12:21:32 GMT 2020


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Even simpler testcase:
int
main ()
{
  int a[8];
  char *b = __builtin_memset (a, 0, sizeof (a));
  a[0] = 1;
  a[1] = 2;
  a[2] = 3;
  if (b != (char *) a)
    __builtin_abort ();
  else
    asm volatile ("" : : "g" (a) : "memory");
  return 0;
}


More information about the Gcc-bugs mailing list