1 /* PR tree-optimization/80933 - redundant bzero/bcopy calls not eliminated
3 { dg-options "-O2 -fdump-tree-dse1" } */
7 void test_bcopy (const void *s
)
11 /* Bcopy is transformed into memmove before DSE runs, so this test
12 doesn't actually verify that DSE does its job. */
13 __builtin_bcopy (s
, d
, sizeof d
);
14 __builtin_bcopy (s
, d
, sizeof d
);
19 void test_bzero (void)
23 __builtin_bzero (d
, sizeof d
);
24 __builtin_bzero (d
, sizeof d
);
29 /* { dg-final { scan-tree-dump-times "builtin_memset" 1 "dse1" } } */
31 /* Merging the evrp folder into substitute_and_fold_engine shuffled
32 the order of gimple_fold a bit, so evrp is no longer folding the
33 memmove inline. This folding is instead done by forwprop. Thus, I
34 have remmoved the |memmove in the test below as this is not done
37 What happened was that the propagator engine only called gimple
38 fold if replace_uses_in() was successful. On the other hand, EVRP
39 called gimple fold regardless.
41 If we really care about previous behavior, we could put a call to
42 gimple ::fold_stmt into evrp_folder::fold_stmt(). */
43 /* { dg-final { scan-tree-dump-not "builtin_(bcopy|bzero|memcpy)" "dse1" } } */