1 /* { dg-do compile { target arm*-*-* } } */
2 /* { dg-skip-if "incompatible options" { ! { arm_thumb1_ok || arm_thumb2_ok } } } */
3 /* { dg-options "-fno-short-enums -O2 -mthumb -march=armv7-a -mfpu=neon -mfloat-abi=softfp -mtune=cortex-a9 -fno-section-anchors -Wno-return-type" } */
4
5 typedef unsigned int size_t;
6 __extension__ typedef int __intptr_t;
7 typedef __intptr_t intptr_t;
8 typedef union tree_node *tree;
9 typedef const union tree_node *const_tree;
10 extern void *ggc_internal_cleared_alloc_stat (size_t )
11 __attribute__ ((__malloc__));
12 enum tree_code {
13 TREE_LIST=2,
14 FUNCTION_DECL,
15 MAX_TREE_CODES=254
16 };
17 extern unsigned char tree_contains_struct[MAX_TREE_CODES][64];
18 struct tree_base {
19 enum tree_code code : 16;
20 };
21 struct tree_common {
22 tree chain;
23 };
24 enum tree_node_structure_enum {
25 TS_COMMON,
26 TS_DECL_COMMON,
27 };
28 extern void tree_contains_struct_check_failed (const_tree,
29 const enum tree_node_structure_enum,
30 const char *, int, const char *)
31 __attribute__ ((__noreturn__));
32 extern void tree_check_failed (const_tree, const char *, int, const char *,
33 ...) __attribute__ ((__noreturn__));
34 struct tree_list {
35 tree value;
36 };
37 struct tree_decl_common {
38 tree initial;
39 };
40 struct tree_function_decl {
41 struct function *f;
42 };
43 union
44 tree_node {
45 struct tree_base base;
46 struct tree_common common;
47 struct tree_decl_common decl_common;
48 struct tree_function_decl function_decl;
49 struct tree_list list;
50 };
51 inline tree
tree_check(tree __t,const char * __f,int __l,const char * __g,enum tree_code __c)52 tree_check (tree __t, const char *__f, int __l, const char *__g, enum tree_code __c)
53 {
54 if (((enum tree_code) (__t)->base.code) != __c)
55 tree_check_failed (__t, __f, __l, __g, __c, 0);
56 }
57 inline tree
contains_struct_check(tree __t,const enum tree_node_structure_enum __s,const char * __f,int __l,const char * __g)58 contains_struct_check (tree __t, const enum tree_node_structure_enum __s,
59 const char *__f, int __l, const char *__g)
60 {
61 if (tree_contains_struct[((enum tree_code) (__t)->base.code)][__s] != 1)
62 tree_contains_struct_check_failed (__t, __s, __f, __l, __g);
63 }
64 struct function {
65 tree static_chain_decl;
66 };
67 enum gimple_code {
68 LAST_AND_UNUSED_GIMPLE_CODE
69 };
70 struct eh_catch_d
71 {
72 struct eh_catch_d *next_catch;
73 struct eh_catch_d *prev_catch;
74 tree type_list;
75 tree filter_list;
76 tree label;
77 };
78 struct eh_region_d
79 {
80 struct eh_region_d *outer;
81 struct eh_region_d *inner;
82 int index;
83 union eh_region_u {
84 struct eh_region_u_try {
85 struct eh_catch_d *first_catch;
86 } eh_try;
87 } u;
88 };
89 typedef struct eh_catch_d *eh_catch;
90 typedef struct eh_region_d *eh_region;
91 extern void add_type_for_runtime (tree);
92 enum LTO_tags
93 {
94 LTO_null = 0,
95 LTO_bb0 = 1 + MAX_TREE_CODES + LAST_AND_UNUSED_GIMPLE_CODE,
96 LTO_ert_cleanup,
97 LTO_NUM_TAGS
98 };
99 enum lto_section_type
100 {
101 LTO_section_function_body,
102 };
103 struct lto_input_block
104 {
105 const char *data;
106 unsigned int p;
107 unsigned int len;
108 };
109 extern void lto_section_overrun (struct lto_input_block *) __attribute__ ((__noreturn__));
110 extern void lto_value_range_error (const char *,
111 long long, long long,
112 long long) __attribute__ ((__noreturn__));
113 long long streamer_read_hwi (struct lto_input_block *);
114 static inline unsigned char
streamer_read_uchar(struct lto_input_block * ib)115 streamer_read_uchar (struct lto_input_block *ib)
116 {
117 if (ib->p >= ib->len)
118 lto_section_overrun (ib);
119 return (ib->data[ib->p++]);
120 }
121 static inline long long
streamer_read_hwi_in_range(struct lto_input_block * ib,const char * purpose,long long min,long long max)122 streamer_read_hwi_in_range (struct lto_input_block *ib,
123 const char *purpose,
124 long long min,
125 long long max)
126 {
127 long long range = max - min;
128 long long val = streamer_read_uchar (ib);
129 if (range >= 0xff)
130 val |= ((long long)streamer_read_uchar (ib)) << 8;
131 if (val < min || val > max)
132 lto_value_range_error (purpose, val, min, max);
133 return val;
134 }
135 static inline enum LTO_tags
streamer_read_record_start(struct lto_input_block * ib)136 streamer_read_record_start (struct lto_input_block *ib)
137 {
138 return (enum LTO_tags)streamer_read_hwi_in_range ((ib), "LTO_tags", 0, (int)(LTO_NUM_TAGS) - 1);
139 }
140 struct streamer_hooks {
141 tree (*read_tree) (struct lto_input_block *, struct data_in *);
142 };
143 extern struct streamer_hooks streamer_hooks;
144 static struct eh_catch_d *
lto_input_eh_catch_list(struct lto_input_block * ib,struct data_in * data_in,eh_catch * last_p)145 lto_input_eh_catch_list (struct lto_input_block *ib, struct data_in *data_in,
146 eh_catch *last_p)
147 {
148 eh_catch first;
149 enum LTO_tags tag;
150 *last_p = first = __null;
151 tag = streamer_read_record_start (ib);
152 while (tag)
153 {
154 tree list;
155 eh_catch n;
156 n = ((struct eh_catch_d *)(ggc_internal_cleared_alloc_stat (sizeof (struct eh_catch_d) )));
157 n->type_list = streamer_hooks.read_tree(ib, data_in);
158 n->filter_list = streamer_hooks.read_tree(ib, data_in);
159 n->label = streamer_hooks.read_tree(ib, data_in);
160 for (list = n->filter_list; list; list = ((contains_struct_check ((list), (TS_COMMON), "../../../gcc-4.8~svn195526/gcc/lto-streamer-in.c", 275, __FUNCTION__))->common.chain))
161 add_type_for_runtime (((tree_check ((list), "../../../gcc-4.8~svn195526/gcc/lto-streamer-in.c", 276, __FUNCTION__, (TREE_LIST)))->list.value));
162 if (*last_p)
163 (*last_p)->next_catch = n;
164 n->prev_catch = *last_p;
165 *last_p = n;
166 if (first == __null)
167 first = n;
168 tag = streamer_read_record_start (ib);
169 }
170 return first;
171 }
172 static eh_region
input_eh_region(struct lto_input_block * ib,struct data_in * data_in,int ix)173 input_eh_region (struct lto_input_block *ib, struct data_in *data_in, int ix)
174 {
175 enum LTO_tags tag;
176 eh_region r;
177 tag = streamer_read_record_start (ib);
178 if (tag == LTO_null)
179 return __null;
180 r = ((struct eh_region_d *)(ggc_internal_cleared_alloc_stat (sizeof (struct eh_region_d) )));
181 r->index = streamer_read_hwi (ib);
182 r->outer = (eh_region) (intptr_t) streamer_read_hwi (ib);
183 r->inner = (eh_region) (intptr_t) streamer_read_hwi (ib);
184 switch (tag)
185 {
186 case LTO_ert_cleanup:
187 {
188 struct eh_catch_d *last_catch;
189 r->u.eh_try.first_catch = lto_input_eh_catch_list (ib, data_in,
190 &last_catch);
191 }
192 {
193 tree l;
194 add_type_for_runtime (((tree_check ((l), "../../../gcc-4.8~svn195526/gcc/lto-streamer-in.c", 346, __FUNCTION__, (TREE_LIST)))->list.value));
195 }
196 }
197 }
198 static void
input_eh_regions(struct lto_input_block * ib,struct data_in * data_in,struct function * fn)199 input_eh_regions (struct lto_input_block *ib, struct data_in *data_in,
200 struct function *fn)
201 {
202 long long i, root_region, len;
203 enum LTO_tags tag;
204 tag = streamer_read_record_start (ib);
205 if (tag == LTO_null)
206 return;
207 len = streamer_read_hwi (ib);
208 if (len > 0)
209 {
210 for (i = 0; i < len; i++)
211 {
212 eh_region r = input_eh_region (ib, data_in, i);
213 }
214 }
215 }
216 static void
input_ssa_names(struct lto_input_block * ib,struct data_in * data_in,struct function * fn)217 input_ssa_names (struct lto_input_block *ib, struct data_in *data_in,
218 struct function *fn)
219 {
220 unsigned int i, size;
221 while (i)
222 {
223 }
224 }
225 static void
input_struct_function_base(struct function * fn,struct data_in * data_in,struct lto_input_block * ib)226 input_struct_function_base (struct function *fn, struct data_in *data_in,
227 struct lto_input_block *ib)
228 {
229 fn->static_chain_decl = streamer_hooks.read_tree(ib, data_in);
230 }
231 static void
input_function(tree fn_decl,struct data_in * data_in,struct lto_input_block * ib)232 input_function (tree fn_decl, struct data_in *data_in,
233 struct lto_input_block *ib)
234 {
235 struct function *fn;
236 enum LTO_tags tag;
237 fn = ((tree_check ((fn_decl), "../../../gcc-4.8~svn195526/gcc/lto-streamer-in.c", 807, __FUNCTION__, (FUNCTION_DECL)))->function_decl.f);
238 tag = streamer_read_record_start (ib);
239 input_struct_function_base (fn, data_in, ib);
240 input_ssa_names (ib, data_in, fn);
241 input_eh_regions (ib, data_in, fn);
242 ((contains_struct_check ((fn_decl), (TS_DECL_COMMON), "../../../gcc-4.8~svn195526/gcc/lto-streamer-in.c", 823, __FUNCTION__))->decl_common.initial) = streamer_hooks.read_tree(ib, data_in);
243 }
244 static void
lto_read_body(struct lto_file_decl_data * file_data,tree fn_decl,const char * data,enum lto_section_type section_type)245 lto_read_body (struct lto_file_decl_data *file_data, tree fn_decl,
246 const char *data, enum lto_section_type section_type)
247 {
248 struct data_in *data_in;
249 struct lto_input_block ib_main;
250 input_function (fn_decl, data_in, &ib_main);
251 }
252 void
lto_input_function_body(struct lto_file_decl_data * file_data,tree fn_decl,const char * data)253 lto_input_function_body (struct lto_file_decl_data *file_data,
254 tree fn_decl, const char *data)
255 {
256 lto_read_body (file_data, fn_decl, data, LTO_section_function_body);
257 }
258
259