2018-04-30 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-dse-30.c
blob1d1fe82fda02f67e1b824b8cbf5ffd8bae48487f
1 /* PR tree-optimization/80933 - redundant bzero/bcopy calls not eliminated
2 { dg-do compile }
3 { dg-options "-O2 -fdump-tree-dse1" } */
5 void sink (void*);
7 void test_bcopy (const void *s)
9 char d[33];
11 /* Bcopy is transformed into memmove and those calls are expanded
12 inline in EVRP, before DSE runs, so this test doesn't actually
13 verify that DSE does its job. */
14 __builtin_bcopy (s, d, sizeof d);
15 __builtin_bcopy (s, d, sizeof d);
17 sink (d);
20 void test_bzero (void)
22 char d[33];
24 __builtin_bzero (d, sizeof d);
25 __builtin_bzero (d, sizeof d);
27 sink (d);
30 /* { dg-final { scan-tree-dump-times "builtin_memset" 1 "dse1" } } */
31 /* { dg-final { scan-tree-dump-not "builtin_(bcopy|bzero|memcpy|memmove)" "dse1" } } */