Debian Codegraph @

gcc/testsuite/g++.dg/pr69123.C

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -g" } */
3
4 /* This was reduced from gcc/tree-vect-slp.c by H.J.Lu. */
5
6 struct xxx_def;
7 typedef xxx_def *xxx;
8
9 union rtxxx
10 {
11 const char *rt_str;
12 xxx rt_xxx;
13 };
14
15 struct xxx_def {
16 union u {
17 rtxxx fld[1];
18 } u;
19 };
20
21 extern xxx bar (void);
22 extern int foo1 (xxx);
23
24 static inline xxx
25 foo2 (xxx arg0, xxx arg1)
26 {
27 xxx rt;
28 rt = bar ();
29 (((rt)->u.fld[0]).rt_xxx) = arg0;
30 (((rt)->u.fld[1]).rt_xxx) = arg1;
31 return rt;
32 }
33
34 static inline xxx
35 foo4 (const char *arg0 )
36 {
37 xxx rt;
38 rt = bar ();
39 (((rt)->u.fld[0]).rt_str) = arg0;
40 (((rt)->u.fld[1]).rt_xxx) = (xxx) 0;
41 return rt;
42 }
43
44 extern xxx foo5 (long);
45
46 struct address_cost_data
47 {
48 unsigned costs[2][2][2][2];
49 };
50
51 void
52 get_address_cost (address_cost_data *data)
53 {
54 unsigned acost;
55 long i;
56 long rat, off = 0;
57 unsigned sym_p, var_p, off_p, rat_p;
58 xxx addr, base;
59 xxx reg0, reg1;
60
61 reg1 = bar ();
62 addr = foo2 (reg1, (xxx) 0);
63 rat = 1;
64 acost = 0;
65 reg0 = bar ();
66 reg1 = bar ();
67
68 for (i = 0; i < 16; i++)
69 {
70 sym_p = i & 1;
71 var_p = (i >> 1) & 1;
72 off_p = (i >> 2) & 1;
73 rat_p = (i >> 3) & 1;
74
75 addr = reg0;
76 if (rat_p)
77 addr = foo2 (addr, foo5 (rat)) ;
78
79 if (var_p)
80 addr = foo2 (addr, reg1);
81
82 if (sym_p)
83 base = foo4 ("");
84 else if (off_p)
85 base = foo5 (off);
86 else
87 base = (xxx) 0;
88
89 if (base)
90 addr = foo2 (addr, base);
91
92 acost = foo1 (addr);
93 data->costs[sym_p][var_p][off_p][rat_p] = acost;
94 }
95 }