Debian Codegraph @

gcc/testsuite/gcc.dg/torture/pr120944.c

raw
1 /* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
2 /* { dg-additional-options "-fdump-tree-optimized" } */
3
4 #include <stdlib.h>
5
6 typedef union {
7 int u32;
8 struct
9 {
10 int A:1;
11 int B:2;
12 int C:3;
13 };
14 } u_t;
15
16 typedef union {
17 volatile int u[3];
18 volatile struct {
19 u_t a;
20 int b;
21 int c;
22 };
23 } DATA;
24
25 void foo (volatile DATA *d)
26 {
27 d->a.u32 = ~0;
28 u_t u = d->a;
29 int v = u.A;
30 if (v)
31 abort();
32 }
33
34 /* { dg-final { scan-tree-dump-times "if \\\(" 1 "optimized" } } */