Debian Codegraph @

gcc/testsuite/gcc.dg/tree-ssa/pr47059.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-Os -fno-tree-vectorize -fdump-tree-optimized" } */
3
4
5 struct struct1
6 {
7 void *data;
8 unsigned short f1;
9 unsigned short f2;
10 };
11 typedef struct struct1 S1;
12
13 struct struct2
14 {
15 int f3;
16 S1 f4;
17 };
18 typedef struct struct2 S2;
19
20
21 extern void foo (S1 *ptr);
22 extern S2 gstruct2_var;
23 extern S1 gstruct1_var;
24
25 static inline S1 bar (const S1 *ptr) __attribute__ ((always_inline));
26
27 static inline S1
28 bar (const S1 *ptr)
29 {
30 S1 ls_var = *ptr;
31 foo (&ls_var);
32 return ls_var;
33 }
34
35 int
36 main ()
37 {
38 S2 *ps_var;
39
40 ps_var = &gstruct2_var;
41 ps_var->f4 = bar (&gstruct1_var);
42
43 return 0;
44 }
45 /* { dg-final { scan-tree-dump-times "short unsigned int\[^*\]*;" 0 "optimized"} } */