]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/pr58145-2.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / pr58145-2.c
1 /* PR tree-optimization/58145 */
2 /* { dg-do compile { target { int32plus } } } */
3 /* { dg-options "-O2 -fdump-tree-optimized" } */
4
5 struct S { unsigned int data : 32; };
6 struct T { unsigned int data; };
7 volatile struct S s2;
8
9 static inline void
10 f1 (int val)
11 {
12 struct S s = { .data = val };
13 *(volatile struct S *) 0x880000UL = s;
14 }
15
16 static inline void
17 f2 (int val)
18 {
19 struct T t = { .data = val };
20 *(volatile struct T *) 0x880000UL = t;
21 }
22
23 static inline void
24 f3 (int val)
25 {
26 *(volatile unsigned int *) 0x880000UL = val;
27 }
28
29 static inline void
30 f4 (int val)
31 {
32 struct S s = { .data = val };
33 s2 = s;
34 }
35
36 void
37 f5 (void)
38 {
39 int i;
40 for (i = 0; i < 100; i++)
41 f1 (0);
42 for (i = 0; i < 100; i++)
43 f2 (0);
44 for (i = 0; i < 100; i++)
45 f3 (0);
46 for (i = 0; i < 100; i++)
47 f4 (0);
48 }
49
50 /* { dg-final { scan-tree-dump-times " ={v} " 4 "optimized" } } */