1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
/* { dg-do compile } */ /* { dg-options "-O -fdump-tree-dse1-details" } */ struct A { char c[4]; } a, b; void f1 (void) { __builtin_memcpy (&a.c[0], "a", 1); a = b; } void f2 (void) { __builtin_memcpy (&a.c[0], "a", 1); __builtin_memcpy (&a.c[0], "cdef", 4); } /* { dg-final { scan-tree-dump-times "Deleted dead store" 2 "dse1" } } */ /* { dg-final { cleanup-tree-dump "dse1" } } */