Debian Codegraph @

gcc/testsuite/gcc.dg/tree-ssa/modref-dse-5.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-dse1-details" } */
3 struct a {int a,b,c;};
4 __attribute__ ((noinline))
5 void
6 kill_me (struct a *a)
7 {
8 a->a=0;
9 a->b=0;
10 a->c=0;
11 }
12 __attribute__ ((noinline))
13 int
14 wrap(int b, struct a *a)
15 {
16 kill_me (a);
17 return b;
18 }
19 __attribute__ ((noinline))
20 void
21 my_pleasure (struct a *a)
22 {
23 a->a=1;
24 a->c=2;
25 }
26 __attribute__ ((noinline))
27 int
28 wrap2(int b, struct a *a)
29 {
30 my_pleasure (a);
31 return b;
32 }
33
34 int
35 set (struct a *a)
36 {
37 wrap (0, a);
38 int ret = wrap2 (0, a);
39 a->b=1;
40 return ret;
41 }
42 /* { dg-final { scan-tree-dump "Deleted dead store: wrap" "dse1" } } */