File: | build/gcc/varasm.cc |
Warning: | line 4458, column 28 The result of the left shift is undefined because the right operand is negative |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | /* Output variables, constants and external declarations, for GNU compiler. | ||||
2 | Copyright (C) 1987-2023 Free Software Foundation, Inc. | ||||
3 | |||||
4 | This file is part of GCC. | ||||
5 | |||||
6 | GCC is free software; you can redistribute it and/or modify it under | ||||
7 | the terms of the GNU General Public License as published by the Free | ||||
8 | Software Foundation; either version 3, or (at your option) any later | ||||
9 | version. | ||||
10 | |||||
11 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY | ||||
12 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||||
13 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||||
14 | for more details. | ||||
15 | |||||
16 | You should have received a copy of the GNU General Public License | ||||
17 | along with GCC; see the file COPYING3. If not see | ||||
18 | <http://www.gnu.org/licenses/>. */ | ||||
19 | |||||
20 | |||||
21 | /* This file handles generation of all the assembler code | ||||
22 | *except* the instructions of a function. | ||||
23 | This includes declarations of variables and their initial values. | ||||
24 | |||||
25 | We also output the assembler code for constants stored in memory | ||||
26 | and are responsible for combining constants with the same value. */ | ||||
27 | |||||
28 | #include "config.h" | ||||
29 | #include "system.h" | ||||
30 | #include "coretypes.h" | ||||
31 | #include "backend.h" | ||||
32 | #include "target.h" | ||||
33 | #include "rtl.h" | ||||
34 | #include "tree.h" | ||||
35 | #include "predict.h" | ||||
36 | #include "memmodel.h" | ||||
37 | #include "tm_p.h" | ||||
38 | #include "stringpool.h" | ||||
39 | #include "regs.h" | ||||
40 | #include "emit-rtl.h" | ||||
41 | #include "cgraph.h" | ||||
42 | #include "diagnostic-core.h" | ||||
43 | #include "fold-const.h" | ||||
44 | #include "stor-layout.h" | ||||
45 | #include "varasm.h" | ||||
46 | #include "version.h" | ||||
47 | #include "flags.h" | ||||
48 | #include "stmt.h" | ||||
49 | #include "expr.h" | ||||
50 | #include "expmed.h" | ||||
51 | #include "optabs.h" | ||||
52 | #include "output.h" | ||||
53 | #include "langhooks.h" | ||||
54 | #include "debug.h" | ||||
55 | #include "common/common-target.h" | ||||
56 | #include "stringpool.h" | ||||
57 | #include "attribs.h" | ||||
58 | #include "asan.h" | ||||
59 | #include "rtl-iter.h" | ||||
60 | #include "file-prefix-map.h" /* remap_debug_filename() */ | ||||
61 | #include "alloc-pool.h" | ||||
62 | #include "toplev.h" | ||||
63 | #include "opts.h" | ||||
64 | |||||
65 | /* The (assembler) name of the first globally-visible object output. */ | ||||
66 | extern GTY(()) const char *first_global_object_name; | ||||
67 | extern GTY(()) const char *weak_global_object_name; | ||||
68 | |||||
69 | const char *first_global_object_name; | ||||
70 | const char *weak_global_object_name; | ||||
71 | |||||
72 | class addr_const; | ||||
73 | class constant_descriptor_rtx; | ||||
74 | struct rtx_constant_pool; | ||||
75 | |||||
76 | #define n_deferred_constants((&x_rtl)->varasm.deferred_constants) (crtl(&x_rtl)->varasm.deferred_constants) | ||||
77 | |||||
78 | /* Number for making the label on the next | ||||
79 | constant that is stored in memory. */ | ||||
80 | |||||
81 | static GTY(()) int const_labelno; | ||||
82 | |||||
83 | /* Carry information from ASM_DECLARE_OBJECT_NAME | ||||
84 | to ASM_FINISH_DECLARE_OBJECT. */ | ||||
85 | |||||
86 | int size_directive_output; | ||||
87 | |||||
88 | /* The last decl for which assemble_variable was called, | ||||
89 | if it did ASM_DECLARE_OBJECT_NAME. | ||||
90 | If the last call to assemble_variable didn't do that, | ||||
91 | this holds 0. */ | ||||
92 | |||||
93 | tree last_assemble_variable_decl; | ||||
94 | |||||
95 | /* The following global variable indicates if the first basic block | ||||
96 | in a function belongs to the cold partition or not. */ | ||||
97 | |||||
98 | bool first_function_block_is_cold; | ||||
99 | |||||
100 | /* Whether we saw any functions with no_split_stack. */ | ||||
101 | |||||
102 | static bool saw_no_split_stack; | ||||
103 | |||||
104 | static const char *strip_reg_name (const char *); | ||||
105 | static int contains_pointers_p (tree); | ||||
106 | #ifdef ASM_OUTPUT_EXTERNAL | ||||
107 | static bool incorporeal_function_p (tree); | ||||
108 | #endif | ||||
109 | static void decode_addr_const (tree, class addr_const *); | ||||
110 | static hashval_t const_hash_1 (const tree); | ||||
111 | static int compare_constant (const tree, const tree); | ||||
112 | static void output_constant_def_contents (rtx); | ||||
113 | static void output_addressed_constants (tree, int); | ||||
114 | static unsigned HOST_WIDE_INTlong output_constant (tree, unsigned HOST_WIDE_INTlong, | ||||
115 | unsigned int, bool, bool); | ||||
116 | static void globalize_decl (tree); | ||||
117 | static bool decl_readonly_section_1 (enum section_category); | ||||
118 | #ifdef BSS_SECTION_ASM_OP"\t.bss" | ||||
119 | #ifdef ASM_OUTPUT_ALIGNED_BSS | ||||
120 | static void asm_output_aligned_bss (FILE *, tree, const char *, | ||||
121 | unsigned HOST_WIDE_INTlong, int) | ||||
122 | ATTRIBUTE_UNUSED__attribute__ ((__unused__)); | ||||
123 | #endif | ||||
124 | #endif /* BSS_SECTION_ASM_OP */ | ||||
125 | static void mark_weak (tree); | ||||
126 | static void output_constant_pool (const char *, tree); | ||||
127 | static void handle_vtv_comdat_section (section *, const_tree); | ||||
128 | |||||
129 | /* Well-known sections, each one associated with some sort of *_ASM_OP. */ | ||||
130 | section *text_section; | ||||
131 | section *data_section; | ||||
132 | section *readonly_data_section; | ||||
133 | section *sdata_section; | ||||
134 | section *ctors_section; | ||||
135 | section *dtors_section; | ||||
136 | section *bss_section; | ||||
137 | section *sbss_section; | ||||
138 | |||||
139 | /* Various forms of common section. All are guaranteed to be nonnull. */ | ||||
140 | section *tls_comm_section; | ||||
141 | section *comm_section; | ||||
142 | section *lcomm_section; | ||||
143 | |||||
144 | /* A SECTION_NOSWITCH section used for declaring global BSS variables. | ||||
145 | May be null. */ | ||||
146 | section *bss_noswitch_section; | ||||
147 | |||||
148 | /* The section that holds the main exception table, when known. The section | ||||
149 | is set either by the target's init_sections hook or by the first call to | ||||
150 | switch_to_exception_section. */ | ||||
151 | section *exception_section; | ||||
152 | |||||
153 | /* The section that holds the DWARF2 frame unwind information, when known. | ||||
154 | The section is set either by the target's init_sections hook or by the | ||||
155 | first call to switch_to_eh_frame_section. */ | ||||
156 | section *eh_frame_section; | ||||
157 | |||||
158 | /* asm_out_file's current section. This is NULL if no section has yet | ||||
159 | been selected or if we lose track of what the current section is. */ | ||||
160 | section *in_section; | ||||
161 | |||||
162 | /* True if code for the current function is currently being directed | ||||
163 | at the cold section. */ | ||||
164 | bool in_cold_section_p; | ||||
165 | |||||
166 | /* The following global holds the "function name" for the code in the | ||||
167 | cold section of a function, if hot/cold function splitting is enabled | ||||
168 | and there was actually code that went into the cold section. A | ||||
169 | pseudo function name is needed for the cold section of code for some | ||||
170 | debugging tools that perform symbolization. */ | ||||
171 | tree cold_function_name = NULL_TREE(tree) nullptr; | ||||
172 | |||||
173 | /* A linked list of all the unnamed sections. */ | ||||
174 | static GTY(()) section *unnamed_sections; | ||||
175 | |||||
176 | /* Return a nonzero value if DECL has a section attribute. */ | ||||
177 | #define IN_NAMED_SECTION(DECL)((((enum tree_code) (DECL)->base.code) == VAR_DECL || ((enum tree_code) (DECL)->base.code) == FUNCTION_DECL) && decl_section_name (DECL) != nullptr) \ | ||||
178 | (VAR_OR_FUNCTION_DECL_P (DECL)(((enum tree_code) (DECL)->base.code) == VAR_DECL || ((enum tree_code) (DECL)->base.code) == FUNCTION_DECL) && DECL_SECTION_NAME (DECL)decl_section_name (DECL) != NULLnullptr) | ||||
179 | |||||
180 | struct section_hasher : ggc_ptr_hash<section> | ||||
181 | { | ||||
182 | typedef const char *compare_type; | ||||
183 | |||||
184 | static hashval_t hash (section *); | ||||
185 | static bool equal (section *, const char *); | ||||
186 | }; | ||||
187 | |||||
188 | /* Hash table of named sections. */ | ||||
189 | static GTY(()) hash_table<section_hasher> *section_htab; | ||||
190 | |||||
191 | struct object_block_hasher : ggc_ptr_hash<object_block> | ||||
192 | { | ||||
193 | typedef const section *compare_type; | ||||
194 | |||||
195 | static hashval_t hash (object_block *); | ||||
196 | static bool equal (object_block *, const section *); | ||||
197 | }; | ||||
198 | |||||
199 | /* A table of object_blocks, indexed by section. */ | ||||
200 | static GTY(()) hash_table<object_block_hasher> *object_block_htab; | ||||
201 | |||||
202 | /* The next number to use for internal anchor labels. */ | ||||
203 | static GTY(()) int anchor_labelno; | ||||
204 | |||||
205 | /* A pool of constants that can be shared between functions. */ | ||||
206 | static GTY(()) struct rtx_constant_pool *shared_constant_pool; | ||||
207 | |||||
208 | /* Helper routines for maintaining section_htab. */ | ||||
209 | |||||
210 | bool | ||||
211 | section_hasher::equal (section *old, const char *new_name) | ||||
212 | { | ||||
213 | return strcmp (old->named.name, new_name) == 0; | ||||
214 | } | ||||
215 | |||||
216 | hashval_t | ||||
217 | section_hasher::hash (section *old) | ||||
218 | { | ||||
219 | return htab_hash_string (old->named.name); | ||||
220 | } | ||||
221 | |||||
222 | /* Return a hash value for section SECT. */ | ||||
223 | |||||
224 | static hashval_t | ||||
225 | hash_section (section *sect) | ||||
226 | { | ||||
227 | if (sect->common.flags & SECTION_NAMED) | ||||
228 | return htab_hash_string (sect->named.name); | ||||
229 | return sect->common.flags & ~SECTION_DECLARED; | ||||
230 | } | ||||
231 | |||||
232 | /* Helper routines for maintaining object_block_htab. */ | ||||
233 | |||||
234 | inline bool | ||||
235 | object_block_hasher::equal (object_block *old, const section *new_section) | ||||
236 | { | ||||
237 | return old->sect == new_section; | ||||
238 | } | ||||
239 | |||||
240 | hashval_t | ||||
241 | object_block_hasher::hash (object_block *old) | ||||
242 | { | ||||
243 | return hash_section (old->sect); | ||||
244 | } | ||||
245 | |||||
246 | /* Return a new unnamed section with the given fields. */ | ||||
247 | |||||
248 | section * | ||||
249 | get_unnamed_section (unsigned int flags, void (*callback) (const char *), | ||||
250 | const char *data) | ||||
251 | { | ||||
252 | section *sect; | ||||
253 | |||||
254 | sect = ggc_alloc<section> (); | ||||
255 | sect->unnamed.common.flags = flags | SECTION_UNNAMED; | ||||
256 | sect->unnamed.callback = callback; | ||||
257 | sect->unnamed.data = data; | ||||
258 | sect->unnamed.next = unnamed_sections; | ||||
259 | |||||
260 | unnamed_sections = sect; | ||||
261 | return sect; | ||||
262 | } | ||||
263 | |||||
264 | /* Return a SECTION_NOSWITCH section with the given fields. */ | ||||
265 | |||||
266 | static section * | ||||
267 | get_noswitch_section (unsigned int flags, noswitch_section_callback callback) | ||||
268 | { | ||||
269 | section *sect; | ||||
270 | |||||
271 | sect = ggc_alloc<section> (); | ||||
272 | sect->noswitch.common.flags = flags | SECTION_NOSWITCH; | ||||
273 | sect->noswitch.callback = callback; | ||||
274 | |||||
275 | return sect; | ||||
276 | } | ||||
277 | |||||
278 | /* Return the named section structure associated with NAME. Create | ||||
279 | a new section with the given fields if no such structure exists. | ||||
280 | When NOT_EXISTING, then fail if the section already exists. Return | ||||
281 | the existing section if the SECTION_RETAIN bit doesn't match. Set | ||||
282 | the SECTION_WRITE | SECTION_RELRO bits on the existing section | ||||
283 | if one of the section flags is SECTION_WRITE | SECTION_RELRO and the | ||||
284 | other has none of these flags in named sections and either the section | ||||
285 | hasn't been declared yet or has been declared as writable. */ | ||||
286 | |||||
287 | section * | ||||
288 | get_section (const char *name, unsigned int flags, tree decl, | ||||
289 | bool not_existing) | ||||
290 | { | ||||
291 | section *sect, **slot; | ||||
292 | |||||
293 | slot = section_htab->find_slot_with_hash (name, htab_hash_string (name), | ||||
294 | INSERT); | ||||
295 | flags |= SECTION_NAMED; | ||||
296 | if (decl != nullptr | ||||
297 | && DECL_P (decl)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (decl)->base.code))] == tcc_declaration) | ||||
298 | && lookup_attribute ("retain", DECL_ATTRIBUTES (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 298, __FUNCTION__))->decl_common.attributes))) | ||||
299 | flags |= SECTION_RETAIN; | ||||
300 | if (*slot == NULLnullptr) | ||||
301 | { | ||||
302 | sect = ggc_alloc<section> (); | ||||
303 | sect->named.common.flags = flags; | ||||
304 | sect->named.name = ggc_strdup (name)ggc_alloc_string ((name), -1 ); | ||||
305 | sect->named.decl = decl; | ||||
306 | *slot = sect; | ||||
307 | } | ||||
308 | else | ||||
309 | { | ||||
310 | if (not_existing) | ||||
311 | internal_error ("section already exists: %qs", name); | ||||
312 | |||||
313 | sect = *slot; | ||||
314 | /* It is fine if one of the sections has SECTION_NOTYPE as long as | ||||
315 | the other has none of the contrary flags (see the logic at the end | ||||
316 | of default_section_type_flags, below). */ | ||||
317 | if (((sect->common.flags ^ flags) & SECTION_NOTYPE) | ||||
318 | && !((sect->common.flags | flags) | ||||
319 | & (SECTION_CODE | SECTION_BSS | SECTION_TLS | SECTION_ENTSIZE | ||||
320 | | (HAVE_COMDAT_GROUP1 ? SECTION_LINKONCE : 0)))) | ||||
321 | { | ||||
322 | sect->common.flags |= SECTION_NOTYPE; | ||||
323 | flags |= SECTION_NOTYPE; | ||||
324 | } | ||||
325 | if ((sect->common.flags & ~SECTION_DECLARED) != flags | ||||
326 | && ((sect->common.flags | flags) & SECTION_OVERRIDE) == 0) | ||||
327 | { | ||||
328 | /* It is fine if one of the section flags is | ||||
329 | SECTION_WRITE | SECTION_RELRO and the other has none of these | ||||
330 | flags (i.e. read-only) in named sections and either the | ||||
331 | section hasn't been declared yet or has been declared as writable. | ||||
332 | In that case just make sure the resulting flags are | ||||
333 | SECTION_WRITE | SECTION_RELRO, ie. writable only because of | ||||
334 | relocations. */ | ||||
335 | if (((sect->common.flags ^ flags) & (SECTION_WRITE | SECTION_RELRO)) | ||||
336 | == (SECTION_WRITE | SECTION_RELRO) | ||||
337 | && (sect->common.flags | ||||
338 | & ~(SECTION_DECLARED | SECTION_WRITE | SECTION_RELRO)) | ||||
339 | == (flags & ~(SECTION_WRITE | SECTION_RELRO)) | ||||
340 | && ((sect->common.flags & SECTION_DECLARED) == 0 | ||||
341 | || (sect->common.flags & SECTION_WRITE))) | ||||
342 | { | ||||
343 | sect->common.flags |= (SECTION_WRITE | SECTION_RELRO); | ||||
344 | return sect; | ||||
345 | } | ||||
346 | /* If the SECTION_RETAIN bit doesn't match, return and switch | ||||
347 | to a new section later. */ | ||||
348 | if ((sect->common.flags & SECTION_RETAIN) | ||||
349 | != (flags & SECTION_RETAIN)) | ||||
350 | return sect; | ||||
351 | /* Sanity check user variables for flag changes. */ | ||||
352 | if (sect->named.decl != NULLnullptr | ||||
353 | && DECL_P (sect->named.decl)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (sect->named.decl)->base.code))] == tcc_declaration) | ||||
354 | && decl != sect->named.decl) | ||||
355 | { | ||||
356 | if (decl != NULLnullptr && DECL_P (decl)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (decl)->base.code))] == tcc_declaration)) | ||||
357 | error ("%+qD causes a section type conflict with %qD", | ||||
358 | decl, sect->named.decl); | ||||
359 | else | ||||
360 | error ("section type conflict with %qD", sect->named.decl); | ||||
361 | inform (DECL_SOURCE_LOCATION (sect->named.decl)((contains_struct_check ((sect->named.decl), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 361, __FUNCTION__))->decl_minimal.locus), | ||||
362 | "%qD was declared here", sect->named.decl); | ||||
363 | } | ||||
364 | else if (decl != NULLnullptr && DECL_P (decl)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (decl)->base.code))] == tcc_declaration)) | ||||
365 | error ("%+qD causes a section type conflict", decl); | ||||
366 | else | ||||
367 | error ("section type conflict"); | ||||
368 | /* Make sure we don't error about one section multiple times. */ | ||||
369 | sect->common.flags |= SECTION_OVERRIDE; | ||||
370 | } | ||||
371 | } | ||||
372 | return sect; | ||||
373 | } | ||||
374 | |||||
375 | /* Return true if the current compilation mode benefits from having | ||||
376 | objects grouped into blocks. */ | ||||
377 | |||||
378 | static bool | ||||
379 | use_object_blocks_p (void) | ||||
380 | { | ||||
381 | return flag_section_anchorsglobal_options.x_flag_section_anchors; | ||||
382 | } | ||||
383 | |||||
384 | /* Return the object_block structure for section SECT. Create a new | ||||
385 | structure if we haven't created one already. Return null if SECT | ||||
386 | itself is null. Return also null for mergeable sections since | ||||
387 | section anchors can't be used in mergeable sections anyway, | ||||
388 | because the linker might move objects around, and using the | ||||
389 | object blocks infrastructure in that case is both a waste and a | ||||
390 | maintenance burden. */ | ||||
391 | |||||
392 | static struct object_block * | ||||
393 | get_block_for_section (section *sect) | ||||
394 | { | ||||
395 | struct object_block *block; | ||||
396 | |||||
397 | if (sect == NULLnullptr) | ||||
398 | return NULLnullptr; | ||||
399 | |||||
400 | if (sect->common.flags & SECTION_MERGE) | ||||
401 | return NULLnullptr; | ||||
402 | |||||
403 | object_block **slot | ||||
404 | = object_block_htab->find_slot_with_hash (sect, hash_section (sect), | ||||
405 | INSERT); | ||||
406 | block = *slot; | ||||
407 | if (block == NULLnullptr) | ||||
408 | { | ||||
409 | block = ggc_cleared_alloc<object_block> (); | ||||
410 | block->sect = sect; | ||||
411 | *slot = block; | ||||
412 | } | ||||
413 | return block; | ||||
414 | } | ||||
415 | |||||
416 | /* Create a symbol with label LABEL and place it at byte offset | ||||
417 | OFFSET in BLOCK. OFFSET can be negative if the symbol's offset | ||||
418 | is not yet known. LABEL must be a garbage-collected string. */ | ||||
419 | |||||
420 | static rtx | ||||
421 | create_block_symbol (const char *label, struct object_block *block, | ||||
422 | HOST_WIDE_INTlong offset) | ||||
423 | { | ||||
424 | rtx symbol; | ||||
425 | unsigned int size; | ||||
426 | |||||
427 | /* Create the extended SYMBOL_REF. */ | ||||
428 | size = RTX_HDR_SIZE__builtin_offsetof(struct rtx_def, u) + sizeof (struct block_symbol); | ||||
429 | symbol = (rtx) ggc_internal_alloc (size); | ||||
430 | |||||
431 | /* Initialize the normal SYMBOL_REF fields. */ | ||||
432 | memset (symbol, 0, size); | ||||
433 | PUT_CODE (symbol, SYMBOL_REF)((symbol)->code = (SYMBOL_REF)); | ||||
434 | PUT_MODE (symbol, Pmode(global_options.x_ix86_pmode == PMODE_DI ? (scalar_int_mode ( (scalar_int_mode::from_int) E_DImode)) : (scalar_int_mode ((scalar_int_mode ::from_int) E_SImode)))); | ||||
435 | XSTR (symbol, 0)(((symbol)->u.fld[0]).rt_str) = label; | ||||
436 | SYMBOL_REF_FLAGS (symbol)(__extension__ ({ __typeof ((symbol)) const _rtx = ((symbol)) ; if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("SYMBOL_REF_FLAGS", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 436, __FUNCTION__); _rtx; }) ->u2.symbol_ref_flags) = SYMBOL_FLAG_HAS_BLOCK_INFO(1 << 7); | ||||
437 | |||||
438 | /* Initialize the block_symbol stuff. */ | ||||
439 | SYMBOL_REF_BLOCK (symbol)((&(symbol)->u.block_sym)->block) = block; | ||||
440 | SYMBOL_REF_BLOCK_OFFSET (symbol)((&(symbol)->u.block_sym)->offset) = offset; | ||||
441 | |||||
442 | return symbol; | ||||
443 | } | ||||
444 | |||||
445 | /* Return a section with a particular name and with whatever SECTION_* | ||||
446 | flags section_type_flags deems appropriate. The name of the section | ||||
447 | is taken from NAME if nonnull, otherwise it is taken from DECL's | ||||
448 | DECL_SECTION_NAME. DECL is the decl associated with the section | ||||
449 | (see the section comment for details) and RELOC is as for | ||||
450 | section_type_flags. */ | ||||
451 | |||||
452 | section * | ||||
453 | get_named_section (tree decl, const char *name, int reloc) | ||||
454 | { | ||||
455 | unsigned int flags; | ||||
456 | |||||
457 | if (name == NULLnullptr) | ||||
458 | { | ||||
459 | gcc_assert (decl && DECL_P (decl) && DECL_SECTION_NAME (decl))((void)(!(decl && (tree_code_type_tmpl <0>::tree_code_type [(int) (((enum tree_code) (decl)->base.code))] == tcc_declaration ) && decl_section_name (decl)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 459, __FUNCTION__), 0 : 0)); | ||||
460 | name = DECL_SECTION_NAME (decl)decl_section_name (decl); | ||||
461 | } | ||||
462 | |||||
463 | flags = targetm.section_type_flags (decl, name, reloc); | ||||
464 | return get_section (name, flags, decl); | ||||
465 | } | ||||
466 | |||||
467 | /* Worker for resolve_unique_section. */ | ||||
468 | |||||
469 | static bool | ||||
470 | set_implicit_section (struct symtab_node *n, void *data ATTRIBUTE_UNUSED__attribute__ ((__unused__))) | ||||
471 | { | ||||
472 | n->implicit_section = true; | ||||
473 | return false; | ||||
474 | } | ||||
475 | |||||
476 | /* If required, set DECL_SECTION_NAME to a unique name. */ | ||||
477 | |||||
478 | void | ||||
479 | resolve_unique_section (tree decl, int reloc ATTRIBUTE_UNUSED__attribute__ ((__unused__)), | ||||
480 | int flag_function_or_data_sections) | ||||
481 | { | ||||
482 | if (DECL_SECTION_NAME (decl)decl_section_name (decl) == NULLnullptr | ||||
483 | && targetm_common.have_named_sections | ||||
484 | && (flag_function_or_data_sections | ||||
485 | || lookup_attribute ("retain", DECL_ATTRIBUTES (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 485, __FUNCTION__))->decl_common.attributes)) | ||||
486 | || DECL_COMDAT_GROUP (decl)decl_comdat_group (decl))) | ||||
487 | { | ||||
488 | targetm.asm_out.unique_section (decl, reloc); | ||||
489 | if (DECL_SECTION_NAME (decl)decl_section_name (decl)) | ||||
490 | symtab_node::get (decl)->call_for_symbol_and_aliases | ||||
491 | (set_implicit_section, NULLnullptr, true); | ||||
492 | } | ||||
493 | } | ||||
494 | |||||
495 | #ifdef BSS_SECTION_ASM_OP"\t.bss" | ||||
496 | |||||
497 | #ifdef ASM_OUTPUT_ALIGNED_BSS | ||||
498 | |||||
499 | /* Utility function for targets to use in implementing | ||||
500 | ASM_OUTPUT_ALIGNED_BSS. | ||||
501 | ??? It is believed that this function will work in most cases so such | ||||
502 | support is localized here. */ | ||||
503 | |||||
504 | static void | ||||
505 | asm_output_aligned_bss (FILE *file, tree decl ATTRIBUTE_UNUSED__attribute__ ((__unused__)), | ||||
506 | const char *name, unsigned HOST_WIDE_INTlong size, | ||||
507 | int align) | ||||
508 | { | ||||
509 | switch_to_section (bss_section); | ||||
510 | ASM_OUTPUT_ALIGN (file, floor_log2 (align / BITS_PER_UNIT))if ((floor_log2 (align / (8))) != 0) fprintf ((file), "\t.align %d\n" , 1 << (floor_log2 (align / (8)))); | ||||
511 | #ifdef ASM_DECLARE_OBJECT_NAME | ||||
512 | last_assemble_variable_decl = decl; | ||||
513 | ASM_DECLARE_OBJECT_NAME (file, name, decl)do { long size; if (global_options.x_flag_gnu_unique && (decl_comdat_group (decl) != (tree) nullptr && (((decl )->base.public_flag) || ((contains_struct_check ((decl), ( TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 513, __FUNCTION__))->decl_common.decl_flag_1))) && (!((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 513, __FUNCTION__))->decl_common.artificial_flag) || !(( non_type_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 513, __FUNCTION__))->base.readonly_flag))) do { fputs ("\t.type\t" , file); assemble_name (file, name); fputs (", ", file); fprintf (file, "@%s", "gnu_unique_object"); putc ('\n', file); } while (0); else do { fputs ("\t.type\t", file); assemble_name (file , name); fputs (", ", file); fprintf (file, "@%s", "object"); putc ('\n', file); } while (0); size_directive_output = 0; if (!global_options.x_flag_inhibit_size_directive && (decl ) && ((contains_struct_check ((decl), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 513, __FUNCTION__))->decl_common.size)) { size_directive_output = 1; size = tree_to_uhwi (((contains_struct_check ((decl), ( TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 513, __FUNCTION__))->decl_common.size_unit)); do { long size_ = (size); fputs ("\t.size\t", file); assemble_name (file, name ); fprintf (file, ", " "%" "l" "d" "\n", size_); } while (0); } do { assemble_name ((file), (name)); fputs (":\n", (file)) ; } while (0); } while (0); | ||||
514 | #else | ||||
515 | /* Standard thing is just output label for the object. */ | ||||
516 | ASM_OUTPUT_LABEL (file, name)do { assemble_name ((file), (name)); fputs (":\n", (file)); } while (0); | ||||
517 | #endif /* ASM_DECLARE_OBJECT_NAME */ | ||||
518 | ASM_OUTPUT_SKIP (file, size ? size : 1)fprintf ((file), "%s" "%" "l" "u" "\n", "\t.zero\t", (size ? size : 1)); | ||||
519 | } | ||||
520 | |||||
521 | #endif | ||||
522 | |||||
523 | #endif /* BSS_SECTION_ASM_OP */ | ||||
524 | |||||
525 | #ifndef USE_SELECT_SECTION_FOR_FUNCTIONS | ||||
526 | /* Return the hot section for function DECL. Return text_section for | ||||
527 | null DECLs. */ | ||||
528 | |||||
529 | static section * | ||||
530 | hot_function_section (tree decl) | ||||
531 | { | ||||
532 | if (decl != NULL_TREE(tree) nullptr | ||||
533 | && DECL_SECTION_NAME (decl)decl_section_name (decl) != NULLnullptr | ||||
534 | && targetm_common.have_named_sections) | ||||
535 | return get_named_section (decl, NULLnullptr, 0); | ||||
536 | else | ||||
537 | return text_section; | ||||
538 | } | ||||
539 | #endif | ||||
540 | |||||
541 | /* Return section for TEXT_SECTION_NAME if DECL or DECL_SECTION_NAME (DECL) | ||||
542 | is NULL. | ||||
543 | |||||
544 | When DECL_SECTION_NAME is non-NULL and it is implicit section and | ||||
545 | NAMED_SECTION_SUFFIX is non-NULL, then produce section called | ||||
546 | concatenate the name with NAMED_SECTION_SUFFIX. | ||||
547 | Otherwise produce "TEXT_SECTION_NAME.IMPLICIT_NAME". */ | ||||
548 | |||||
549 | section * | ||||
550 | get_named_text_section (tree decl, | ||||
551 | const char *text_section_name, | ||||
552 | const char *named_section_suffix) | ||||
553 | { | ||||
554 | if (decl && DECL_SECTION_NAME (decl)decl_section_name (decl)) | ||||
555 | { | ||||
556 | if (named_section_suffix) | ||||
557 | { | ||||
558 | const char *dsn = DECL_SECTION_NAME (decl)decl_section_name (decl); | ||||
559 | const char *stripped_name; | ||||
560 | char *name, *buffer; | ||||
561 | |||||
562 | name = (char *) alloca (strlen (dsn) + 1)__builtin_alloca(strlen (dsn) + 1); | ||||
563 | memcpy (name, dsn, | ||||
564 | strlen (dsn) + 1); | ||||
565 | |||||
566 | stripped_name = targetm.strip_name_encoding (name); | ||||
567 | |||||
568 | buffer = ACONCAT ((stripped_name, named_section_suffix, NULL))(libiberty_concat_ptr = (char *) __builtin_alloca(concat_length (stripped_name, named_section_suffix, nullptr) + 1), concat_copy2 (stripped_name, named_section_suffix, nullptr)); | ||||
569 | return get_named_section (decl, buffer, 0); | ||||
570 | } | ||||
571 | else if (symtab_node::get (decl)->implicit_section) | ||||
572 | { | ||||
573 | const char *name; | ||||
574 | |||||
575 | /* Do not try to split gnu_linkonce functions. This gets somewhat | ||||
576 | slipperly. */ | ||||
577 | if (DECL_COMDAT_GROUP (decl)decl_comdat_group (decl) && !HAVE_COMDAT_GROUP1) | ||||
578 | return NULLnullptr; | ||||
579 | name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl))((const char *) (tree_check ((decl_assembler_name (decl)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 579, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str ); | ||||
580 | name = targetm.strip_name_encoding (name); | ||||
581 | return get_named_section (decl, ACONCAT ((text_section_name, ".",(libiberty_concat_ptr = (char *) __builtin_alloca(concat_length (text_section_name, ".", name, nullptr) + 1), concat_copy2 ( text_section_name, ".", name, nullptr)) | ||||
582 | name, NULL))(libiberty_concat_ptr = (char *) __builtin_alloca(concat_length (text_section_name, ".", name, nullptr) + 1), concat_copy2 ( text_section_name, ".", name, nullptr)), 0); | ||||
583 | } | ||||
584 | else | ||||
585 | return NULLnullptr; | ||||
586 | } | ||||
587 | return get_named_section (decl, text_section_name, 0); | ||||
588 | } | ||||
589 | |||||
590 | /* Choose named function section based on its frequency. */ | ||||
591 | |||||
592 | section * | ||||
593 | default_function_section (tree decl, enum node_frequency freq, | ||||
594 | bool startup, bool exit) | ||||
595 | { | ||||
596 | #if defined HAVE_LD_EH_GC_SECTIONS1 && defined HAVE_LD_EH_GC_SECTIONS_BUG | ||||
597 | /* Old GNU linkers have buggy --gc-section support, which sometimes | ||||
598 | results in .gcc_except_table* sections being garbage collected. */ | ||||
599 | if (decl | ||||
600 | && symtab_node::get (decl)->implicit_section) | ||||
601 | return NULLnullptr; | ||||
602 | #endif | ||||
603 | |||||
604 | if (!flag_reorder_functionsglobal_options.x_flag_reorder_functions | ||||
605 | || !targetm_common.have_named_sections) | ||||
606 | return NULLnullptr; | ||||
607 | /* Startup code should go to startup subsection unless it is | ||||
608 | unlikely executed (this happens especially with function splitting | ||||
609 | where we can split away unnecessary parts of static constructors. */ | ||||
610 | if (startup && freq != NODE_FREQUENCY_UNLIKELY_EXECUTED) | ||||
611 | { | ||||
612 | /* During LTO the tp_first_run profiling will naturally place all | ||||
613 | initialization code first. Using separate section is counter-productive | ||||
614 | because startup only code may call functions which are no longer | ||||
615 | startup only. */ | ||||
616 | if (!in_lto_pglobal_options.x_in_lto_p | ||||
617 | || !cgraph_node::get (decl)->tp_first_run | ||||
618 | || !opt_for_fn (decl, flag_profile_reorder_functions)(opts_for_fn (decl)->x_flag_profile_reorder_functions)) | ||||
619 | return get_named_text_section (decl, ".text.startup", NULLnullptr); | ||||
620 | else | ||||
621 | return NULLnullptr; | ||||
622 | } | ||||
623 | |||||
624 | /* Similarly for exit. */ | ||||
625 | if (exit && freq != NODE_FREQUENCY_UNLIKELY_EXECUTED) | ||||
626 | return get_named_text_section (decl, ".text.exit", NULLnullptr); | ||||
627 | |||||
628 | /* Group cold functions together, similarly for hot code. */ | ||||
629 | switch (freq) | ||||
630 | { | ||||
631 | case NODE_FREQUENCY_UNLIKELY_EXECUTED: | ||||
632 | return get_named_text_section (decl, ".text.unlikely", NULLnullptr); | ||||
633 | case NODE_FREQUENCY_HOT: | ||||
634 | return get_named_text_section (decl, ".text.hot", NULLnullptr); | ||||
635 | /* FALLTHRU */ | ||||
636 | default: | ||||
637 | return NULLnullptr; | ||||
638 | } | ||||
639 | } | ||||
640 | |||||
641 | /* Return the section for function DECL. | ||||
642 | |||||
643 | If DECL is NULL_TREE, return the text section. We can be passed | ||||
644 | NULL_TREE under some circumstances by dbxout.cc at least. | ||||
645 | |||||
646 | If FORCE_COLD is true, return cold function section ignoring | ||||
647 | the frequency info of cgraph_node. */ | ||||
648 | |||||
649 | static section * | ||||
650 | function_section_1 (tree decl, bool force_cold) | ||||
651 | { | ||||
652 | section *section = NULLnullptr; | ||||
653 | enum node_frequency freq = NODE_FREQUENCY_NORMAL; | ||||
654 | bool startup = false, exit = false; | ||||
655 | |||||
656 | if (decl) | ||||
657 | { | ||||
658 | struct cgraph_node *node = cgraph_node::get (decl); | ||||
659 | |||||
660 | if (node) | ||||
661 | { | ||||
662 | freq = node->frequency; | ||||
663 | startup = node->only_called_at_startup; | ||||
664 | exit = node->only_called_at_exit; | ||||
665 | } | ||||
666 | } | ||||
667 | if (force_cold) | ||||
668 | freq = NODE_FREQUENCY_UNLIKELY_EXECUTED; | ||||
669 | |||||
670 | #ifdef USE_SELECT_SECTION_FOR_FUNCTIONS | ||||
671 | if (decl != NULL_TREE(tree) nullptr | ||||
672 | && DECL_SECTION_NAME (decl)decl_section_name (decl) != NULLnullptr) | ||||
673 | { | ||||
674 | if (targetm.asm_out.function_section) | ||||
675 | section = targetm.asm_out.function_section (decl, freq, | ||||
676 | startup, exit); | ||||
677 | if (section) | ||||
678 | return section; | ||||
679 | return get_named_section (decl, NULLnullptr, 0); | ||||
680 | } | ||||
681 | else | ||||
682 | return targetm.asm_out.select_section | ||||
683 | (decl, freq == NODE_FREQUENCY_UNLIKELY_EXECUTED, | ||||
684 | symtab_node::get (decl)->definition_alignment ()); | ||||
685 | #else | ||||
686 | if (targetm.asm_out.function_section) | ||||
687 | section = targetm.asm_out.function_section (decl, freq, startup, exit); | ||||
688 | if (section) | ||||
689 | return section; | ||||
690 | return hot_function_section (decl); | ||||
691 | #endif | ||||
692 | } | ||||
693 | |||||
694 | /* Return the section for function DECL. | ||||
695 | |||||
696 | If DECL is NULL_TREE, return the text section. We can be passed | ||||
697 | NULL_TREE under some circumstances by dbxout.cc at least. */ | ||||
698 | |||||
699 | section * | ||||
700 | function_section (tree decl) | ||||
701 | { | ||||
702 | /* Handle cases where function splitting code decides | ||||
703 | to put function entry point into unlikely executed section | ||||
704 | despite the fact that the function itself is not cold | ||||
705 | (i.e. it is called rarely but contains a hot loop that is | ||||
706 | better to live in hot subsection for the code locality). */ | ||||
707 | return function_section_1 (decl, | ||||
708 | first_function_block_is_cold); | ||||
709 | } | ||||
710 | |||||
711 | /* Return the section for the current function, take IN_COLD_SECTION_P | ||||
712 | into account. */ | ||||
713 | |||||
714 | section * | ||||
715 | current_function_section (void) | ||||
716 | { | ||||
717 | return function_section_1 (current_function_decl, in_cold_section_p); | ||||
718 | } | ||||
719 | |||||
720 | /* Tell assembler to switch to unlikely-to-be-executed text section. */ | ||||
721 | |||||
722 | section * | ||||
723 | unlikely_text_section (void) | ||||
724 | { | ||||
725 | return function_section_1 (current_function_decl, true); | ||||
726 | } | ||||
727 | |||||
728 | /* When called within a function context, return true if the function | ||||
729 | has been assigned a cold text section and if SECT is that section. | ||||
730 | When called outside a function context, return true if SECT is the | ||||
731 | default cold section. */ | ||||
732 | |||||
733 | bool | ||||
734 | unlikely_text_section_p (section *sect) | ||||
735 | { | ||||
736 | return sect == function_section_1 (current_function_decl, true); | ||||
737 | } | ||||
738 | |||||
739 | /* Switch to the other function partition (if inside of hot section | ||||
740 | into cold section, otherwise into the hot section). */ | ||||
741 | |||||
742 | void | ||||
743 | switch_to_other_text_partition (void) | ||||
744 | { | ||||
745 | in_cold_section_p = !in_cold_section_p; | ||||
746 | switch_to_section (current_function_section ()); | ||||
747 | } | ||||
748 | |||||
749 | /* Return the read-only or relocated read-only data section | ||||
750 | associated with function DECL. */ | ||||
751 | |||||
752 | section * | ||||
753 | default_function_rodata_section (tree decl, bool relocatable) | ||||
754 | { | ||||
755 | const char* sname; | ||||
756 | unsigned int flags; | ||||
757 | |||||
758 | flags = 0; | ||||
759 | |||||
760 | if (relocatable) | ||||
761 | { | ||||
762 | sname = ".data.rel.ro.local"; | ||||
763 | flags = (SECTION_WRITE | SECTION_RELRO); | ||||
764 | } | ||||
765 | else | ||||
766 | sname = ".rodata"; | ||||
767 | |||||
768 | if (decl && DECL_SECTION_NAME (decl)decl_section_name (decl)) | ||||
769 | { | ||||
770 | const char *name = DECL_SECTION_NAME (decl)decl_section_name (decl); | ||||
771 | |||||
772 | if (DECL_COMDAT_GROUP (decl)decl_comdat_group (decl) && HAVE_COMDAT_GROUP1) | ||||
773 | { | ||||
774 | const char *dot; | ||||
775 | size_t len; | ||||
776 | char* rname; | ||||
777 | |||||
778 | dot = strchr (name + 1, '.'); | ||||
779 | if (!dot) | ||||
780 | dot = name; | ||||
781 | len = strlen (dot) + strlen (sname) + 1; | ||||
782 | rname = (char *) alloca (len)__builtin_alloca(len); | ||||
783 | |||||
784 | strcpy (rname, sname); | ||||
785 | strcat (rname, dot); | ||||
786 | return get_section (rname, (SECTION_LINKONCE | flags), decl); | ||||
787 | } | ||||
788 | /* For .gnu.linkonce.t.foo we want to use .gnu.linkonce.r.foo or | ||||
789 | .gnu.linkonce.d.rel.ro.local.foo if the jump table is relocatable. */ | ||||
790 | else if (DECL_COMDAT_GROUP (decl)decl_comdat_group (decl) | ||||
791 | && startswith (name, ".gnu.linkonce.t.")) | ||||
792 | { | ||||
793 | size_t len; | ||||
794 | char *rname; | ||||
795 | |||||
796 | if (relocatable) | ||||
797 | { | ||||
798 | len = strlen (name) + strlen (".rel.ro.local") + 1; | ||||
799 | rname = (char *) alloca (len)__builtin_alloca(len); | ||||
800 | |||||
801 | strcpy (rname, ".gnu.linkonce.d.rel.ro.local"); | ||||
802 | strcat (rname, name + 15); | ||||
803 | } | ||||
804 | else | ||||
805 | { | ||||
806 | len = strlen (name) + 1; | ||||
807 | rname = (char *) alloca (len)__builtin_alloca(len); | ||||
808 | |||||
809 | memcpy (rname, name, len); | ||||
810 | rname[14] = 'r'; | ||||
811 | } | ||||
812 | return get_section (rname, (SECTION_LINKONCE | flags), decl); | ||||
813 | } | ||||
814 | /* For .text.foo we want to use .rodata.foo. */ | ||||
815 | else if (flag_function_sectionsglobal_options.x_flag_function_sections && flag_data_sectionsglobal_options.x_flag_data_sections | ||||
816 | && startswith (name, ".text.")) | ||||
817 | { | ||||
818 | size_t len = strlen (name) + 1; | ||||
819 | char *rname = (char *) alloca (len + strlen (sname) - 5)__builtin_alloca(len + strlen (sname) - 5); | ||||
820 | |||||
821 | memcpy (rname, sname, strlen (sname)); | ||||
822 | memcpy (rname + strlen (sname), name + 5, len - 5); | ||||
823 | return get_section (rname, flags, decl); | ||||
824 | } | ||||
825 | } | ||||
826 | |||||
827 | if (relocatable) | ||||
828 | return get_section (sname, flags, decl); | ||||
829 | else | ||||
830 | return readonly_data_section; | ||||
831 | } | ||||
832 | |||||
833 | /* Return the read-only data section associated with function DECL | ||||
834 | for targets where that section should be always the single | ||||
835 | readonly data section. */ | ||||
836 | |||||
837 | section * | ||||
838 | default_no_function_rodata_section (tree, bool) | ||||
839 | { | ||||
840 | return readonly_data_section; | ||||
841 | } | ||||
842 | |||||
843 | /* A subroutine of mergeable_string_section and mergeable_constant_section. */ | ||||
844 | |||||
845 | static const char * | ||||
846 | function_mergeable_rodata_prefix (void) | ||||
847 | { | ||||
848 | section *s = targetm.asm_out.function_rodata_section (current_function_decl, | ||||
849 | false); | ||||
850 | if (SECTION_STYLE (s)((s)->common.flags & SECTION_STYLE_MASK) == SECTION_NAMED) | ||||
851 | return s->named.name; | ||||
852 | else | ||||
853 | return targetm.asm_out.mergeable_rodata_prefix; | ||||
854 | } | ||||
855 | |||||
856 | /* Return the section to use for string merging. */ | ||||
857 | |||||
858 | static section * | ||||
859 | mergeable_string_section (tree decl ATTRIBUTE_UNUSED__attribute__ ((__unused__)), | ||||
860 | unsigned HOST_WIDE_INTlong align ATTRIBUTE_UNUSED__attribute__ ((__unused__)), | ||||
861 | unsigned int flags ATTRIBUTE_UNUSED__attribute__ ((__unused__))) | ||||
862 | { | ||||
863 | HOST_WIDE_INTlong len; | ||||
864 | |||||
865 | if (HAVE_GAS_SHF_MERGE1 && flag_merge_constantsglobal_options.x_flag_merge_constants | ||||
866 | && TREE_CODE (decl)((enum tree_code) (decl)->base.code) == STRING_CST | ||||
867 | && TREE_CODE (TREE_TYPE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 867, __FUNCTION__))->typed.type))->base.code) == ARRAY_TYPE | ||||
868 | && align <= 256 | ||||
869 | && (len = int_size_in_bytes (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 869, __FUNCTION__))->typed.type))) > 0 | ||||
870 | && TREE_STRING_LENGTH (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 870, __FUNCTION__, (STRING_CST)))->string.length) == len) | ||||
871 | { | ||||
872 | scalar_int_mode mode; | ||||
873 | unsigned int modesize; | ||||
874 | const char *str; | ||||
875 | HOST_WIDE_INTlong i; | ||||
876 | int j, unit; | ||||
877 | const char *prefix = function_mergeable_rodata_prefix (); | ||||
878 | char *name = (char *) alloca (strlen (prefix) + 30)__builtin_alloca(strlen (prefix) + 30); | ||||
879 | |||||
880 | mode = SCALAR_INT_TYPE_MODE (TREE_TYPE (TREE_TYPE (decl)))(as_a <scalar_int_mode> ((tree_class_check ((((contains_struct_check ((((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 880, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 880, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 880, __FUNCTION__))->type_common.mode)); | ||||
881 | modesize = GET_MODE_BITSIZE (mode); | ||||
882 | if (modesize >= 8 && modesize <= 256 | ||||
883 | && (modesize & (modesize - 1)) == 0) | ||||
884 | { | ||||
885 | if (align < modesize) | ||||
886 | align = modesize; | ||||
887 | |||||
888 | if (!HAVE_LD_ALIGNED_SHF_MERGE1 && align > 8) | ||||
889 | return readonly_data_section; | ||||
890 | |||||
891 | str = TREE_STRING_POINTER (decl)((const char *)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 891, __FUNCTION__, (STRING_CST)))->string.str)); | ||||
892 | unit = GET_MODE_SIZE (mode); | ||||
893 | |||||
894 | /* Check for embedded NUL characters. */ | ||||
895 | for (i = 0; i < len; i += unit) | ||||
896 | { | ||||
897 | for (j = 0; j < unit; j++) | ||||
898 | if (str[i + j] != '\0') | ||||
899 | break; | ||||
900 | if (j == unit) | ||||
901 | break; | ||||
902 | } | ||||
903 | if (i == len - unit || (unit == 1 && i == len)) | ||||
904 | { | ||||
905 | sprintf (name, "%s.str%d.%d", prefix, | ||||
906 | modesize / 8, (int) (align / 8)); | ||||
907 | flags |= (modesize / 8) | SECTION_MERGE | SECTION_STRINGS; | ||||
908 | return get_section (name, flags, NULLnullptr); | ||||
909 | } | ||||
910 | } | ||||
911 | } | ||||
912 | |||||
913 | return readonly_data_section; | ||||
914 | } | ||||
915 | |||||
916 | /* Return the section to use for constant merging. */ | ||||
917 | |||||
918 | section * | ||||
919 | mergeable_constant_section (machine_mode mode ATTRIBUTE_UNUSED__attribute__ ((__unused__)), | ||||
920 | unsigned HOST_WIDE_INTlong align ATTRIBUTE_UNUSED__attribute__ ((__unused__)), | ||||
921 | unsigned int flags ATTRIBUTE_UNUSED__attribute__ ((__unused__))) | ||||
922 | { | ||||
923 | if (HAVE_GAS_SHF_MERGE1 && flag_merge_constantsglobal_options.x_flag_merge_constants | ||||
924 | && mode != VOIDmode((void) 0, E_VOIDmode) | ||||
925 | && mode != BLKmode((void) 0, E_BLKmode) | ||||
926 | && known_le (GET_MODE_BITSIZE (mode), align)(!maybe_lt (align, GET_MODE_BITSIZE (mode))) | ||||
927 | && align >= 8 | ||||
928 | && align <= 256 | ||||
929 | && (align & (align - 1)) == 0 | ||||
930 | && (HAVE_LD_ALIGNED_SHF_MERGE1 ? 1 : align == 8)) | ||||
931 | { | ||||
932 | const char *prefix = function_mergeable_rodata_prefix (); | ||||
933 | char *name = (char *) alloca (strlen (prefix) + 30)__builtin_alloca(strlen (prefix) + 30); | ||||
934 | |||||
935 | sprintf (name, "%s.cst%d", prefix, (int) (align / 8)); | ||||
936 | flags |= (align / 8) | SECTION_MERGE; | ||||
937 | return get_section (name, flags, NULLnullptr); | ||||
938 | } | ||||
939 | return readonly_data_section; | ||||
940 | } | ||||
941 | |||||
942 | /* Given NAME, a putative register name, discard any customary prefixes. */ | ||||
943 | |||||
944 | static const char * | ||||
945 | strip_reg_name (const char *name) | ||||
946 | { | ||||
947 | #ifdef REGISTER_PREFIX | ||||
948 | if (!strncmp (name, REGISTER_PREFIX, strlen (REGISTER_PREFIX))) | ||||
949 | name += strlen (REGISTER_PREFIX); | ||||
950 | #endif | ||||
951 | if (name[0] == '%' || name[0] == '#') | ||||
952 | name++; | ||||
953 | return name; | ||||
954 | } | ||||
955 | |||||
956 | /* The user has asked for a DECL to have a particular name. Set (or | ||||
957 | change) it in such a way that we don't prefix an underscore to | ||||
958 | it. */ | ||||
959 | void | ||||
960 | set_user_assembler_name (tree decl, const char *name) | ||||
961 | { | ||||
962 | char *starred = (char *) alloca (strlen (name) + 2)__builtin_alloca(strlen (name) + 2); | ||||
963 | starred[0] = '*'; | ||||
964 | strcpy (starred + 1, name); | ||||
965 | symtab->change_decl_assembler_name (decl, get_identifier (starred)(__builtin_constant_p (starred) ? get_identifier_with_length ( (starred), strlen (starred)) : get_identifier (starred))); | ||||
966 | SET_DECL_RTL (decl, NULL_RTX)set_decl_rtl (decl, (rtx) 0); | ||||
967 | } | ||||
968 | |||||
969 | /* Decode an `asm' spec for a declaration as a register name. | ||||
970 | Return the register number, or -1 if nothing specified, | ||||
971 | or -2 if the ASMSPEC is not `cc' or `memory' and is not recognized, | ||||
972 | or -3 if ASMSPEC is `cc' and is not recognized, | ||||
973 | or -4 if ASMSPEC is `memory' and is not recognized. | ||||
974 | Accept an exact spelling or a decimal number. | ||||
975 | Prefixes such as % are optional. */ | ||||
976 | |||||
977 | int | ||||
978 | decode_reg_name_and_count (const char *asmspec, int *pnregs) | ||||
979 | { | ||||
980 | /* Presume just one register is clobbered. */ | ||||
981 | *pnregs = 1; | ||||
982 | |||||
983 | if (asmspec != 0) | ||||
984 | { | ||||
985 | int i; | ||||
986 | |||||
987 | /* Get rid of confusing prefixes. */ | ||||
988 | asmspec = strip_reg_name (asmspec); | ||||
989 | |||||
990 | /* Allow a decimal number as a "register name". */ | ||||
991 | for (i = strlen (asmspec) - 1; i >= 0; i--) | ||||
992 | if (! ISDIGIT (asmspec[i])(_sch_istable[(asmspec[i]) & 0xff] & (unsigned short) (_sch_isdigit))) | ||||
993 | break; | ||||
994 | if (asmspec[0] != 0 && i < 0) | ||||
995 | { | ||||
996 | i = atoi (asmspec); | ||||
997 | if (i < FIRST_PSEUDO_REGISTER76 && i >= 0 && reg_names(this_target_hard_regs->x_reg_names)[i][0]) | ||||
998 | return i; | ||||
999 | else | ||||
1000 | return -2; | ||||
1001 | } | ||||
1002 | |||||
1003 | for (i = 0; i < FIRST_PSEUDO_REGISTER76; i++) | ||||
1004 | if (reg_names(this_target_hard_regs->x_reg_names)[i][0] | ||||
1005 | && ! strcmp (asmspec, strip_reg_name (reg_names(this_target_hard_regs->x_reg_names)[i]))) | ||||
1006 | return i; | ||||
1007 | |||||
1008 | #ifdef OVERLAPPING_REGISTER_NAMES | ||||
1009 | { | ||||
1010 | static const struct | ||||
1011 | { | ||||
1012 | const char *const name; | ||||
1013 | const int number; | ||||
1014 | const int nregs; | ||||
1015 | } table[] = OVERLAPPING_REGISTER_NAMES; | ||||
1016 | |||||
1017 | for (i = 0; i < (int) ARRAY_SIZE (table)(sizeof (table) / sizeof ((table)[0])); i++) | ||||
1018 | if (table[i].name[0] | ||||
1019 | && ! strcmp (asmspec, table[i].name)) | ||||
1020 | { | ||||
1021 | *pnregs = table[i].nregs; | ||||
1022 | return table[i].number; | ||||
1023 | } | ||||
1024 | } | ||||
1025 | #endif /* OVERLAPPING_REGISTER_NAMES */ | ||||
1026 | |||||
1027 | #ifdef ADDITIONAL_REGISTER_NAMES{ { "eax", 0 }, { "edx", 1 }, { "ecx", 2 }, { "ebx", 3 }, { "esi" , 4 }, { "edi", 5 }, { "ebp", 6 }, { "esp", 7 }, { "rax", 0 } , { "rdx", 1 }, { "rcx", 2 }, { "rbx", 3 }, { "rsi", 4 }, { "rdi" , 5 }, { "rbp", 6 }, { "rsp", 7 }, { "al", 0 }, { "dl", 1 }, { "cl", 2 }, { "bl", 3 }, { "sil", 4 }, { "dil", 5 }, { "bpl", 6 }, { "spl", 7 }, { "ah", 0 }, { "dh", 1 }, { "ch", 2 }, { "bh" , 3 }, { "ymm0", 20 }, { "ymm1", 21 }, { "ymm2", 22 }, { "ymm3" , 23 }, { "ymm4", 24 }, { "ymm5", 25 }, { "ymm6", 26 }, { "ymm7" , 27 }, { "ymm8", 44 }, { "ymm9", 45 }, { "ymm10", 46 }, { "ymm11" , 47 }, { "ymm12", 48 }, { "ymm13", 49 }, { "ymm14", 50 }, { "ymm15" , 51 }, { "ymm16", 52 }, { "ymm17", 53 }, { "ymm18", 54 }, { "ymm19" , 55 }, { "ymm20", 56 }, { "ymm21", 57 }, { "ymm22", 58 }, { "ymm23" , 59 }, { "ymm24", 60 }, { "ymm25", 61 }, { "ymm26", 62 }, { "ymm27" , 63 }, { "ymm28", 64 }, { "ymm29", 65 }, { "ymm30", 66 }, { "ymm31" , 67 }, { "zmm0", 20 }, { "zmm1", 21 }, { "zmm2", 22 }, { "zmm3" , 23 }, { "zmm4", 24 }, { "zmm5", 25 }, { "zmm6", 26 }, { "zmm7" , 27 }, { "zmm8", 44 }, { "zmm9", 45 }, { "zmm10", 46 }, { "zmm11" , 47 }, { "zmm12", 48 }, { "zmm13", 49 }, { "zmm14", 50 }, { "zmm15" , 51 }, { "zmm16", 52 }, { "zmm17", 53 }, { "zmm18", 54 }, { "zmm19" , 55 }, { "zmm20", 56 }, { "zmm21", 57 }, { "zmm22", 58 }, { "zmm23" , 59 }, { "zmm24", 60 }, { "zmm25", 61 }, { "zmm26", 62 }, { "zmm27" , 63 }, { "zmm28", 64 }, { "zmm29", 65 }, { "zmm30", 66 }, { "zmm31" , 67 } } | ||||
1028 | { | ||||
1029 | static const struct { const char *const name; const int number; } table[] | ||||
1030 | = ADDITIONAL_REGISTER_NAMES{ { "eax", 0 }, { "edx", 1 }, { "ecx", 2 }, { "ebx", 3 }, { "esi" , 4 }, { "edi", 5 }, { "ebp", 6 }, { "esp", 7 }, { "rax", 0 } , { "rdx", 1 }, { "rcx", 2 }, { "rbx", 3 }, { "rsi", 4 }, { "rdi" , 5 }, { "rbp", 6 }, { "rsp", 7 }, { "al", 0 }, { "dl", 1 }, { "cl", 2 }, { "bl", 3 }, { "sil", 4 }, { "dil", 5 }, { "bpl", 6 }, { "spl", 7 }, { "ah", 0 }, { "dh", 1 }, { "ch", 2 }, { "bh" , 3 }, { "ymm0", 20 }, { "ymm1", 21 }, { "ymm2", 22 }, { "ymm3" , 23 }, { "ymm4", 24 }, { "ymm5", 25 }, { "ymm6", 26 }, { "ymm7" , 27 }, { "ymm8", 44 }, { "ymm9", 45 }, { "ymm10", 46 }, { "ymm11" , 47 }, { "ymm12", 48 }, { "ymm13", 49 }, { "ymm14", 50 }, { "ymm15" , 51 }, { "ymm16", 52 }, { "ymm17", 53 }, { "ymm18", 54 }, { "ymm19" , 55 }, { "ymm20", 56 }, { "ymm21", 57 }, { "ymm22", 58 }, { "ymm23" , 59 }, { "ymm24", 60 }, { "ymm25", 61 }, { "ymm26", 62 }, { "ymm27" , 63 }, { "ymm28", 64 }, { "ymm29", 65 }, { "ymm30", 66 }, { "ymm31" , 67 }, { "zmm0", 20 }, { "zmm1", 21 }, { "zmm2", 22 }, { "zmm3" , 23 }, { "zmm4", 24 }, { "zmm5", 25 }, { "zmm6", 26 }, { "zmm7" , 27 }, { "zmm8", 44 }, { "zmm9", 45 }, { "zmm10", 46 }, { "zmm11" , 47 }, { "zmm12", 48 }, { "zmm13", 49 }, { "zmm14", 50 }, { "zmm15" , 51 }, { "zmm16", 52 }, { "zmm17", 53 }, { "zmm18", 54 }, { "zmm19" , 55 }, { "zmm20", 56 }, { "zmm21", 57 }, { "zmm22", 58 }, { "zmm23" , 59 }, { "zmm24", 60 }, { "zmm25", 61 }, { "zmm26", 62 }, { "zmm27" , 63 }, { "zmm28", 64 }, { "zmm29", 65 }, { "zmm30", 66 }, { "zmm31" , 67 } }; | ||||
1031 | |||||
1032 | for (i = 0; i < (int) ARRAY_SIZE (table)(sizeof (table) / sizeof ((table)[0])); i++) | ||||
1033 | if (table[i].name[0] | ||||
1034 | && ! strcmp (asmspec, table[i].name) | ||||
1035 | && reg_names(this_target_hard_regs->x_reg_names)[table[i].number][0]) | ||||
1036 | return table[i].number; | ||||
1037 | } | ||||
1038 | #endif /* ADDITIONAL_REGISTER_NAMES */ | ||||
1039 | |||||
1040 | if (!strcmp (asmspec, "memory")) | ||||
1041 | return -4; | ||||
1042 | |||||
1043 | if (!strcmp (asmspec, "cc")) | ||||
1044 | return -3; | ||||
1045 | |||||
1046 | return -2; | ||||
1047 | } | ||||
1048 | |||||
1049 | return -1; | ||||
1050 | } | ||||
1051 | |||||
1052 | int | ||||
1053 | decode_reg_name (const char *name) | ||||
1054 | { | ||||
1055 | int count; | ||||
1056 | return decode_reg_name_and_count (name, &count); | ||||
1057 | } | ||||
1058 | |||||
1059 | |||||
1060 | /* Return true if DECL's initializer is suitable for a BSS section. */ | ||||
1061 | |||||
1062 | bool | ||||
1063 | bss_initializer_p (const_tree decl, bool named) | ||||
1064 | { | ||||
1065 | /* Do not put non-common constants into the .bss section, they belong in | ||||
1066 | a readonly section, except when NAMED is true. */ | ||||
1067 | return ((!TREE_READONLY (decl)((non_type_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1067, __FUNCTION__))->base.readonly_flag) || DECL_COMMON (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1067, __FUNCTION__))->decl_with_vis.common_flag) || named) | ||||
1068 | && (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1068, __FUNCTION__))->decl_common.initial) == NULLnullptr | ||||
1069 | /* In LTO we have no errors in program; error_mark_node is used | ||||
1070 | to mark offlined constructors. */ | ||||
1071 | || (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1071, __FUNCTION__))->decl_common.initial) == error_mark_nodeglobal_trees[TI_ERROR_MARK] | ||||
1072 | && !in_lto_pglobal_options.x_in_lto_p) | ||||
1073 | || (flag_zero_initialized_in_bssglobal_options.x_flag_zero_initialized_in_bss | ||||
1074 | && initializer_zerop (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1074, __FUNCTION__))->decl_common.initial)) | ||||
1075 | /* A decl with the "persistent" attribute applied and | ||||
1076 | explicitly initialized to 0 should not be treated as a BSS | ||||
1077 | variable. */ | ||||
1078 | && !DECL_PERSISTENT_P (decl)((tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code) (decl)->base.code))] == tcc_declaration) && (lookup_attribute ("persistent", ((contains_struct_check ((decl ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1078, __FUNCTION__))->decl_common.attributes)) != (tree) nullptr))))); | ||||
1079 | } | ||||
1080 | |||||
1081 | /* Compute the alignment of variable specified by DECL. | ||||
1082 | DONT_OUTPUT_DATA is from assemble_variable. */ | ||||
1083 | |||||
1084 | void | ||||
1085 | align_variable (tree decl, bool dont_output_data) | ||||
1086 | { | ||||
1087 | unsigned int align = DECL_ALIGN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1087, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1087, __FUNCTION__))->decl_common.align) - 1) : 0); | ||||
1088 | |||||
1089 | /* In the case for initialing an array whose length isn't specified, | ||||
1090 | where we have not yet been able to do the layout, | ||||
1091 | figure out the proper alignment now. */ | ||||
1092 | if (dont_output_data && DECL_SIZE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1092, __FUNCTION__))->decl_common.size) == 0 | ||||
1093 | && TREE_CODE (TREE_TYPE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1093, __FUNCTION__))->typed.type))->base.code) == ARRAY_TYPE) | ||||
1094 | align = MAX (align, TYPE_ALIGN (TREE_TYPE (TREE_TYPE (decl))))((align) > ((((tree_class_check ((((contains_struct_check ( (((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1094, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1094, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1094, __FUNCTION__))->type_common.align) ? ((unsigned)1) << (((tree_class_check ((((contains_struct_check ((((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1094, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1094, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1094, __FUNCTION__))->type_common.align) - 1) : 0)) ? (align ) : ((((tree_class_check ((((contains_struct_check ((((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1094, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1094, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1094, __FUNCTION__))->type_common.align) ? ((unsigned)1) << (((tree_class_check ((((contains_struct_check ((((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1094, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1094, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1094, __FUNCTION__))->type_common.align) - 1) : 0))); | ||||
1095 | |||||
1096 | /* Some object file formats have a maximum alignment which they support. | ||||
1097 | In particular, a.out format supports a maximum alignment of 4. */ | ||||
1098 | if (align > MAX_OFILE_ALIGNMENT(((unsigned int) 1 << 28) * 8)) | ||||
1099 | { | ||||
1100 | error ("alignment of %q+D is greater than maximum object " | ||||
1101 | "file alignment %d", decl, | ||||
1102 | MAX_OFILE_ALIGNMENT(((unsigned int) 1 << 28) * 8)/BITS_PER_UNIT(8)); | ||||
1103 | align = MAX_OFILE_ALIGNMENT(((unsigned int) 1 << 28) * 8); | ||||
1104 | } | ||||
1105 | |||||
1106 | if (! DECL_USER_ALIGN (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1106, __FUNCTION__))->base.u.bits.user_align)) | ||||
1107 | { | ||||
1108 | #ifdef DATA_ABI_ALIGNMENT | ||||
1109 | unsigned int data_abi_align | ||||
1110 | = DATA_ABI_ALIGNMENT (TREE_TYPE (decl), align)ix86_data_alignment ((((contains_struct_check ((decl), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1110, __FUNCTION__))->typed.type)), (align), false); | ||||
1111 | /* For backwards compatibility, don't assume the ABI alignment for | ||||
1112 | TLS variables. */ | ||||
1113 | if (! DECL_THREAD_LOCAL_P (decl)((((decl)->base.static_flag) || ((contains_struct_check (( decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1113, __FUNCTION__))->decl_common.decl_flag_1)) && decl_tls_model (decl) >= TLS_MODEL_REAL) || data_abi_align <= BITS_PER_WORD((8) * (((global_options.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) | ||||
1114 | align = data_abi_align; | ||||
1115 | #endif | ||||
1116 | |||||
1117 | /* On some machines, it is good to increase alignment sometimes. | ||||
1118 | But as DECL_ALIGN is used both for actually emitting the variable | ||||
1119 | and for code accessing the variable as guaranteed alignment, we | ||||
1120 | can only increase the alignment if it is a performance optimization | ||||
1121 | if the references to it must bind to the current definition. */ | ||||
1122 | if (decl_binds_to_current_def_p (decl) | ||||
1123 | && !DECL_VIRTUAL_P (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1123, __FUNCTION__))->decl_common.virtual_flag)) | ||||
1124 | { | ||||
1125 | #ifdef DATA_ALIGNMENT | ||||
1126 | unsigned int data_align = DATA_ALIGNMENT (TREE_TYPE (decl), align)ix86_data_alignment ((((contains_struct_check ((decl), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1126, __FUNCTION__))->typed.type)), (align), true); | ||||
1127 | /* Don't increase alignment too much for TLS variables - TLS space | ||||
1128 | is too precious. */ | ||||
1129 | if (! DECL_THREAD_LOCAL_P (decl)((((decl)->base.static_flag) || ((contains_struct_check (( decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1129, __FUNCTION__))->decl_common.decl_flag_1)) && decl_tls_model (decl) >= TLS_MODEL_REAL) || data_align <= BITS_PER_WORD((8) * (((global_options.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) | ||||
1130 | align = data_align; | ||||
1131 | #endif | ||||
1132 | if (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1132, __FUNCTION__))->decl_common.initial) != 0 | ||||
1133 | /* In LTO we have no errors in program; error_mark_node is used | ||||
1134 | to mark offlined constructors. */ | ||||
1135 | && (in_lto_pglobal_options.x_in_lto_p || DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1135, __FUNCTION__))->decl_common.initial) != error_mark_nodeglobal_trees[TI_ERROR_MARK])) | ||||
1136 | { | ||||
1137 | unsigned int const_align | ||||
1138 | = targetm.constant_alignment (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1138, __FUNCTION__))->decl_common.initial), align); | ||||
1139 | /* Don't increase alignment too much for TLS variables - TLS | ||||
1140 | space is too precious. */ | ||||
1141 | if (! DECL_THREAD_LOCAL_P (decl)((((decl)->base.static_flag) || ((contains_struct_check (( decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1141, __FUNCTION__))->decl_common.decl_flag_1)) && decl_tls_model (decl) >= TLS_MODEL_REAL) || const_align <= BITS_PER_WORD((8) * (((global_options.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) | ||||
1142 | align = const_align; | ||||
1143 | } | ||||
1144 | } | ||||
1145 | } | ||||
1146 | |||||
1147 | /* Reset the alignment in case we have made it tighter, so we can benefit | ||||
1148 | from it in get_pointer_alignment. */ | ||||
1149 | SET_DECL_ALIGN (decl, align)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1149, __FUNCTION__))->decl_common.align) = ffs_hwi (align )); | ||||
1150 | } | ||||
1151 | |||||
1152 | /* Return DECL_ALIGN (decl), possibly increased for optimization purposes | ||||
1153 | beyond what align_variable returned. */ | ||||
1154 | |||||
1155 | static unsigned int | ||||
1156 | get_variable_align (tree decl) | ||||
1157 | { | ||||
1158 | unsigned int align = DECL_ALIGN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1158, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1158, __FUNCTION__))->decl_common.align) - 1) : 0); | ||||
1159 | |||||
1160 | /* For user aligned vars or static vars align_variable already did | ||||
1161 | everything. */ | ||||
1162 | if (DECL_USER_ALIGN (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1162, __FUNCTION__))->base.u.bits.user_align) || !TREE_PUBLIC (decl)((decl)->base.public_flag)) | ||||
1163 | return align; | ||||
1164 | |||||
1165 | #ifdef DATA_ABI_ALIGNMENT | ||||
1166 | if (DECL_THREAD_LOCAL_P (decl)((((decl)->base.static_flag) || ((contains_struct_check (( decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1166, __FUNCTION__))->decl_common.decl_flag_1)) && decl_tls_model (decl) >= TLS_MODEL_REAL)) | ||||
1167 | align = DATA_ABI_ALIGNMENT (TREE_TYPE (decl), align)ix86_data_alignment ((((contains_struct_check ((decl), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1167, __FUNCTION__))->typed.type)), (align), false); | ||||
1168 | #endif | ||||
1169 | |||||
1170 | /* For decls that bind to the current definition, align_variable | ||||
1171 | did also everything, except for not assuming ABI required alignment | ||||
1172 | of TLS variables. For other vars, increase the alignment here | ||||
1173 | as an optimization. */ | ||||
1174 | if (!decl_binds_to_current_def_p (decl)) | ||||
1175 | { | ||||
1176 | /* On some machines, it is good to increase alignment sometimes. */ | ||||
1177 | #ifdef DATA_ALIGNMENT | ||||
1178 | unsigned int data_align = DATA_ALIGNMENT (TREE_TYPE (decl), align)ix86_data_alignment ((((contains_struct_check ((decl), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1178, __FUNCTION__))->typed.type)), (align), true); | ||||
1179 | /* Don't increase alignment too much for TLS variables - TLS space | ||||
1180 | is too precious. */ | ||||
1181 | if (! DECL_THREAD_LOCAL_P (decl)((((decl)->base.static_flag) || ((contains_struct_check (( decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1181, __FUNCTION__))->decl_common.decl_flag_1)) && decl_tls_model (decl) >= TLS_MODEL_REAL) || data_align <= BITS_PER_WORD((8) * (((global_options.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) | ||||
1182 | align = data_align; | ||||
1183 | #endif | ||||
1184 | if (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1184, __FUNCTION__))->decl_common.initial) != 0 | ||||
1185 | /* In LTO we have no errors in program; error_mark_node is used | ||||
1186 | to mark offlined constructors. */ | ||||
1187 | && (in_lto_pglobal_options.x_in_lto_p || DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1187, __FUNCTION__))->decl_common.initial) != error_mark_nodeglobal_trees[TI_ERROR_MARK])) | ||||
1188 | { | ||||
1189 | unsigned int const_align | ||||
1190 | = targetm.constant_alignment (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1190, __FUNCTION__))->decl_common.initial), align); | ||||
1191 | /* Don't increase alignment too much for TLS variables - TLS space | ||||
1192 | is too precious. */ | ||||
1193 | if (! DECL_THREAD_LOCAL_P (decl)((((decl)->base.static_flag) || ((contains_struct_check (( decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1193, __FUNCTION__))->decl_common.decl_flag_1)) && decl_tls_model (decl) >= TLS_MODEL_REAL) || const_align <= BITS_PER_WORD((8) * (((global_options.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) | ||||
1194 | align = const_align; | ||||
1195 | } | ||||
1196 | } | ||||
1197 | |||||
1198 | return align; | ||||
1199 | } | ||||
1200 | |||||
1201 | /* Compute reloc for get_variable_section. The return value | ||||
1202 | is a mask for which bit 1 indicates a global relocation, and bit 0 | ||||
1203 | indicates a local relocation. */ | ||||
1204 | |||||
1205 | int | ||||
1206 | compute_reloc_for_var (tree decl) | ||||
1207 | { | ||||
1208 | int reloc; | ||||
1209 | |||||
1210 | if (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1210, __FUNCTION__))->decl_common.initial) == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
1211 | reloc = contains_pointers_p (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1211, __FUNCTION__))->typed.type)) ? 3 : 0; | ||||
1212 | else if (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1212, __FUNCTION__))->decl_common.initial)) | ||||
1213 | reloc = compute_reloc_for_constant (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1213, __FUNCTION__))->decl_common.initial)); | ||||
1214 | else | ||||
1215 | reloc = 0; | ||||
1216 | |||||
1217 | return reloc; | ||||
1218 | } | ||||
1219 | |||||
1220 | /* Return the section into which the given VAR_DECL or CONST_DECL | ||||
1221 | should be placed. PREFER_NOSWITCH_P is true if a noswitch | ||||
1222 | section should be used wherever possible. */ | ||||
1223 | |||||
1224 | section * | ||||
1225 | get_variable_section (tree decl, bool prefer_noswitch_p) | ||||
1226 | { | ||||
1227 | addr_space_t as = ADDR_SPACE_GENERIC0; | ||||
1228 | int reloc; | ||||
1229 | varpool_node *vnode = varpool_node::get (decl); | ||||
1230 | if (vnode) | ||||
1231 | { | ||||
1232 | vnode = vnode->ultimate_alias_target (); | ||||
1233 | decl = vnode->decl; | ||||
1234 | } | ||||
1235 | |||||
1236 | if (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1236, __FUNCTION__))->typed.type) != error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
1237 | as = TYPE_ADDR_SPACE (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1237, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1237, __FUNCTION__))->base.u.bits.address_space); | ||||
1238 | |||||
1239 | /* We need the constructor to figure out reloc flag. */ | ||||
1240 | if (vnode) | ||||
1241 | vnode->get_constructor (); | ||||
1242 | |||||
1243 | if (DECL_COMMON (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1243, __FUNCTION__))->decl_with_vis.common_flag) | ||||
1244 | && !lookup_attribute ("retain", DECL_ATTRIBUTES (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1244, __FUNCTION__))->decl_common.attributes))) | ||||
1245 | { | ||||
1246 | /* If the decl has been given an explicit section name, or it resides | ||||
1247 | in a non-generic address space, then it isn't common, and shouldn't | ||||
1248 | be handled as such. */ | ||||
1249 | gcc_assert (DECL_SECTION_NAME (decl) == NULL((void)(!(decl_section_name (decl) == nullptr && ((as ) == 0)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1250, __FUNCTION__), 0 : 0)) | ||||
1250 | && ADDR_SPACE_GENERIC_P (as))((void)(!(decl_section_name (decl) == nullptr && ((as ) == 0)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1250, __FUNCTION__), 0 : 0)); | ||||
1251 | if (DECL_THREAD_LOCAL_P (decl)((((decl)->base.static_flag) || ((contains_struct_check (( decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1251, __FUNCTION__))->decl_common.decl_flag_1)) && decl_tls_model (decl) >= TLS_MODEL_REAL)) | ||||
1252 | return tls_comm_section; | ||||
1253 | else if (TREE_PUBLIC (decl)((decl)->base.public_flag) && bss_initializer_p (decl)) | ||||
1254 | return comm_section; | ||||
1255 | } | ||||
1256 | |||||
1257 | reloc = compute_reloc_for_var (decl); | ||||
1258 | |||||
1259 | resolve_unique_section (decl, reloc, flag_data_sectionsglobal_options.x_flag_data_sections); | ||||
1260 | if (IN_NAMED_SECTION (decl)((((enum tree_code) (decl)->base.code) == VAR_DECL || ((enum tree_code) (decl)->base.code) == FUNCTION_DECL) && decl_section_name (decl) != nullptr)) | ||||
1261 | { | ||||
1262 | section *sect = get_named_section (decl, NULLnullptr, reloc); | ||||
1263 | |||||
1264 | if ((sect->common.flags & SECTION_BSS) | ||||
1265 | && !bss_initializer_p (decl, true)) | ||||
1266 | { | ||||
1267 | error_at (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1267, __FUNCTION__))->decl_minimal.locus), | ||||
1268 | "only zero initializers are allowed in section %qs", | ||||
1269 | sect->named.name); | ||||
1270 | DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1270, __FUNCTION__))->decl_common.initial) = error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
1271 | } | ||||
1272 | return sect; | ||||
1273 | } | ||||
1274 | |||||
1275 | if (ADDR_SPACE_GENERIC_P (as)((as) == 0) | ||||
1276 | && !DECL_THREAD_LOCAL_P (decl)((((decl)->base.static_flag) || ((contains_struct_check (( decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1276, __FUNCTION__))->decl_common.decl_flag_1)) && decl_tls_model (decl) >= TLS_MODEL_REAL) | ||||
1277 | && !DECL_NOINIT_P (decl)((tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code) (decl)->base.code))] == tcc_declaration) && (lookup_attribute ("noinit", ((contains_struct_check ((decl) , (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1277, __FUNCTION__))->decl_common.attributes)) != (tree) nullptr)) | ||||
1278 | && !(prefer_noswitch_p && targetm.have_switchable_bss_sections) | ||||
1279 | && bss_initializer_p (decl)) | ||||
1280 | { | ||||
1281 | if (!TREE_PUBLIC (decl)((decl)->base.public_flag) | ||||
1282 | && !((flag_sanitizeglobal_options.x_flag_sanitize & SANITIZE_ADDRESS) | ||||
1283 | && asan_protect_global (decl))) | ||||
1284 | return lcomm_section; | ||||
1285 | if (bss_noswitch_section) | ||||
1286 | return bss_noswitch_section; | ||||
1287 | } | ||||
1288 | |||||
1289 | return targetm.asm_out.select_section (decl, reloc, | ||||
1290 | get_variable_align (decl)); | ||||
1291 | } | ||||
1292 | |||||
1293 | /* Return the block into which object_block DECL should be placed. */ | ||||
1294 | |||||
1295 | static struct object_block * | ||||
1296 | get_block_for_decl (tree decl) | ||||
1297 | { | ||||
1298 | section *sect; | ||||
1299 | |||||
1300 | if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)) | ||||
1301 | { | ||||
1302 | /* The object must be defined in this translation unit. */ | ||||
1303 | if (DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1303, __FUNCTION__))->decl_common.decl_flag_1)) | ||||
1304 | return NULLnullptr; | ||||
1305 | |||||
1306 | /* There's no point using object blocks for something that is | ||||
1307 | isolated by definition. */ | ||||
1308 | if (DECL_COMDAT_GROUP (decl)decl_comdat_group (decl)) | ||||
1309 | return NULLnullptr; | ||||
1310 | } | ||||
1311 | |||||
1312 | /* We can only calculate block offsets if the decl has a known | ||||
1313 | constant size. */ | ||||
1314 | if (DECL_SIZE_UNIT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1314, __FUNCTION__))->decl_common.size_unit) == NULLnullptr) | ||||
1315 | return NULLnullptr; | ||||
1316 | if (!tree_fits_uhwi_p (DECL_SIZE_UNIT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1316, __FUNCTION__))->decl_common.size_unit))) | ||||
1317 | return NULLnullptr; | ||||
1318 | |||||
1319 | /* Find out which section should contain DECL. We cannot put it into | ||||
1320 | an object block if it requires a standalone definition. */ | ||||
1321 | if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)) | ||||
1322 | align_variable (decl, 0); | ||||
1323 | sect = get_variable_section (decl, true); | ||||
1324 | if (SECTION_STYLE (sect)((sect)->common.flags & SECTION_STYLE_MASK) == SECTION_NOSWITCH) | ||||
1325 | return NULLnullptr; | ||||
1326 | |||||
1327 | if (bool (lookup_attribute ("retain", DECL_ATTRIBUTES (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1327, __FUNCTION__))->decl_common.attributes))) | ||||
1328 | != bool (sect->common.flags & SECTION_RETAIN)) | ||||
1329 | return NULLnullptr; | ||||
1330 | |||||
1331 | return get_block_for_section (sect); | ||||
1332 | } | ||||
1333 | |||||
1334 | /* Make sure block symbol SYMBOL is in block BLOCK. */ | ||||
1335 | |||||
1336 | static void | ||||
1337 | change_symbol_block (rtx symbol, struct object_block *block) | ||||
1338 | { | ||||
1339 | if (block != SYMBOL_REF_BLOCK (symbol)((&(symbol)->u.block_sym)->block)) | ||||
1340 | { | ||||
1341 | gcc_assert (SYMBOL_REF_BLOCK_OFFSET (symbol) < 0)((void)(!(((&(symbol)->u.block_sym)->offset) < 0 ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1341, __FUNCTION__), 0 : 0)); | ||||
1342 | SYMBOL_REF_BLOCK (symbol)((&(symbol)->u.block_sym)->block) = block; | ||||
1343 | } | ||||
1344 | } | ||||
1345 | |||||
1346 | /* Return true if it is possible to put DECL in an object_block. */ | ||||
1347 | |||||
1348 | static bool | ||||
1349 | use_blocks_for_decl_p (tree decl) | ||||
1350 | { | ||||
1351 | struct symtab_node *snode; | ||||
1352 | |||||
1353 | /* Don't create object blocks if each DECL is placed into a separate | ||||
1354 | section because that will uselessly create a section anchor for | ||||
1355 | each DECL. */ | ||||
1356 | if (flag_data_sectionsglobal_options.x_flag_data_sections) | ||||
1357 | return false; | ||||
1358 | |||||
1359 | /* Only data DECLs can be placed into object blocks. */ | ||||
1360 | if (!VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && TREE_CODE (decl)((enum tree_code) (decl)->base.code) != CONST_DECL) | ||||
1361 | return false; | ||||
1362 | |||||
1363 | /* DECL_INITIAL (decl) set to decl is a hack used for some decls that | ||||
1364 | are never used from code directly and we never want object block handling | ||||
1365 | for those. */ | ||||
1366 | if (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1366, __FUNCTION__))->decl_common.initial) == decl) | ||||
1367 | return false; | ||||
1368 | |||||
1369 | /* If this decl is an alias, then we don't want to emit a | ||||
1370 | definition. */ | ||||
1371 | if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) | ||||
1372 | && (snode = symtab_node::get (decl)) != NULLnullptr | ||||
1373 | && snode->alias) | ||||
1374 | return false; | ||||
1375 | |||||
1376 | return targetm.use_blocks_for_decl_p (decl); | ||||
1377 | } | ||||
1378 | |||||
1379 | /* Follow the IDENTIFIER_TRANSPARENT_ALIAS chain starting at *ALIAS | ||||
1380 | until we find an identifier that is not itself a transparent alias. | ||||
1381 | Modify the alias passed to it by reference (and all aliases on the | ||||
1382 | way to the ultimate target), such that they do not have to be | ||||
1383 | followed again, and return the ultimate target of the alias | ||||
1384 | chain. */ | ||||
1385 | |||||
1386 | static inline tree | ||||
1387 | ultimate_transparent_alias_target (tree *alias) | ||||
1388 | { | ||||
1389 | tree target = *alias; | ||||
1390 | |||||
1391 | if (IDENTIFIER_TRANSPARENT_ALIAS (target)((tree_check ((target), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1391, __FUNCTION__, (IDENTIFIER_NODE)))->base.deprecated_flag )) | ||||
1392 | { | ||||
1393 | gcc_assert (TREE_CHAIN (target))((void)(!(((contains_struct_check ((target), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1393, __FUNCTION__))->common.chain)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1393, __FUNCTION__), 0 : 0)); | ||||
1394 | target = ultimate_transparent_alias_target (&TREE_CHAIN (target)((contains_struct_check ((target), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1394, __FUNCTION__))->common.chain)); | ||||
1395 | gcc_assert (! IDENTIFIER_TRANSPARENT_ALIAS (target)((void)(!(! ((tree_check ((target), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1395, __FUNCTION__, (IDENTIFIER_NODE)))->base.deprecated_flag ) && ! ((contains_struct_check ((target), (TS_COMMON) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1396, __FUNCTION__))->common.chain)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1396, __FUNCTION__), 0 : 0)) | ||||
1396 | && ! TREE_CHAIN (target))((void)(!(! ((tree_check ((target), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1395, __FUNCTION__, (IDENTIFIER_NODE)))->base.deprecated_flag ) && ! ((contains_struct_check ((target), (TS_COMMON) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1396, __FUNCTION__))->common.chain)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1396, __FUNCTION__), 0 : 0)); | ||||
1397 | *alias = target; | ||||
1398 | } | ||||
1399 | |||||
1400 | return target; | ||||
1401 | } | ||||
1402 | |||||
1403 | /* Return true if REGNUM is mentioned in ELIMINABLE_REGS as a from | ||||
1404 | register number. */ | ||||
1405 | |||||
1406 | static bool | ||||
1407 | eliminable_regno_p (int regnum) | ||||
1408 | { | ||||
1409 | static const struct | ||||
1410 | { | ||||
1411 | const int from; | ||||
1412 | const int to; | ||||
1413 | } eliminables[] = ELIMINABLE_REGS{{ 16, 7}, { 16, 6}, { 19, 7}, { 19, 6}}; | ||||
1414 | for (size_t i = 0; i < ARRAY_SIZE (eliminables)(sizeof (eliminables) / sizeof ((eliminables)[0])); i++) | ||||
1415 | if (regnum == eliminables[i].from) | ||||
1416 | return true; | ||||
1417 | return false; | ||||
1418 | } | ||||
1419 | |||||
1420 | /* Create the DECL_RTL for a VAR_DECL or FUNCTION_DECL. DECL should | ||||
1421 | have static storage duration. In other words, it should not be an | ||||
1422 | automatic variable, including PARM_DECLs. | ||||
1423 | |||||
1424 | There is, however, one exception: this function handles variables | ||||
1425 | explicitly placed in a particular register by the user. | ||||
1426 | |||||
1427 | This is never called for PARM_DECL nodes. */ | ||||
1428 | |||||
1429 | void | ||||
1430 | make_decl_rtl (tree decl) | ||||
1431 | { | ||||
1432 | const char *name = 0; | ||||
1433 | int reg_number; | ||||
1434 | tree id; | ||||
1435 | rtx x; | ||||
1436 | |||||
1437 | /* Check that we are not being given an automatic variable. */ | ||||
1438 | gcc_assert (TREE_CODE (decl) != PARM_DECL((void)(!(((enum tree_code) (decl)->base.code) != PARM_DECL && ((enum tree_code) (decl)->base.code) != RESULT_DECL ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1439, __FUNCTION__), 0 : 0)) | ||||
1439 | && TREE_CODE (decl) != RESULT_DECL)((void)(!(((enum tree_code) (decl)->base.code) != PARM_DECL && ((enum tree_code) (decl)->base.code) != RESULT_DECL ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1439, __FUNCTION__), 0 : 0)); | ||||
1440 | |||||
1441 | /* A weak alias has TREE_PUBLIC set but not the other bits. */ | ||||
1442 | gcc_assert (!VAR_P (decl)((void)(!(!(((enum tree_code) (decl)->base.code) == VAR_DECL ) || ((decl)->base.static_flag) || ((decl)->base.public_flag ) || ((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1445, __FUNCTION__))->decl_common.decl_flag_1) || ((contains_struct_check ((decl), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1446, __FUNCTION__))->decl_common.decl_flag_0)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1446, __FUNCTION__), 0 : 0)) | ||||
1443 | || TREE_STATIC (decl)((void)(!(!(((enum tree_code) (decl)->base.code) == VAR_DECL ) || ((decl)->base.static_flag) || ((decl)->base.public_flag ) || ((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1445, __FUNCTION__))->decl_common.decl_flag_1) || ((contains_struct_check ((decl), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1446, __FUNCTION__))->decl_common.decl_flag_0)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1446, __FUNCTION__), 0 : 0)) | ||||
1444 | || TREE_PUBLIC (decl)((void)(!(!(((enum tree_code) (decl)->base.code) == VAR_DECL ) || ((decl)->base.static_flag) || ((decl)->base.public_flag ) || ((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1445, __FUNCTION__))->decl_common.decl_flag_1) || ((contains_struct_check ((decl), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1446, __FUNCTION__))->decl_common.decl_flag_0)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1446, __FUNCTION__), 0 : 0)) | ||||
1445 | || DECL_EXTERNAL (decl)((void)(!(!(((enum tree_code) (decl)->base.code) == VAR_DECL ) || ((decl)->base.static_flag) || ((decl)->base.public_flag ) || ((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1445, __FUNCTION__))->decl_common.decl_flag_1) || ((contains_struct_check ((decl), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1446, __FUNCTION__))->decl_common.decl_flag_0)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1446, __FUNCTION__), 0 : 0)) | ||||
1446 | || DECL_REGISTER (decl))((void)(!(!(((enum tree_code) (decl)->base.code) == VAR_DECL ) || ((decl)->base.static_flag) || ((decl)->base.public_flag ) || ((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1445, __FUNCTION__))->decl_common.decl_flag_1) || ((contains_struct_check ((decl), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1446, __FUNCTION__))->decl_common.decl_flag_0)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1446, __FUNCTION__), 0 : 0)); | ||||
1447 | |||||
1448 | /* And that we were not given a type or a label. */ | ||||
1449 | gcc_assert (TREE_CODE (decl) != TYPE_DECL((void)(!(((enum tree_code) (decl)->base.code) != TYPE_DECL && ((enum tree_code) (decl)->base.code) != LABEL_DECL ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1450, __FUNCTION__), 0 : 0)) | ||||
1450 | && TREE_CODE (decl) != LABEL_DECL)((void)(!(((enum tree_code) (decl)->base.code) != TYPE_DECL && ((enum tree_code) (decl)->base.code) != LABEL_DECL ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1450, __FUNCTION__), 0 : 0)); | ||||
1451 | |||||
1452 | /* For a duplicate declaration, we can be called twice on the | ||||
1453 | same DECL node. Don't discard the RTL already made. */ | ||||
1454 | if (DECL_RTL_SET_P (decl)(((tree_contains_struct[(((enum tree_code) (decl)->base.code ))][(TS_DECL_WRTL)])) && (contains_struct_check ((decl ), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1454, __FUNCTION__))->decl_with_rtl.rtl != nullptr)) | ||||
1455 | { | ||||
1456 | /* If the old RTL had the wrong mode, fix the mode. */ | ||||
1457 | x = DECL_RTL (decl)((contains_struct_check ((decl), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1457, __FUNCTION__))->decl_with_rtl.rtl ? (decl)->decl_with_rtl .rtl : (make_decl_rtl (decl), (decl)->decl_with_rtl.rtl)); | ||||
1458 | if (GET_MODE (x)((machine_mode) (x)->mode) != DECL_MODE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1458, __FUNCTION__))->decl_common.mode)) | ||||
1459 | SET_DECL_RTL (decl, adjust_address_nv (x, DECL_MODE (decl), 0))set_decl_rtl (decl, adjust_address_1 (x, ((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1459, __FUNCTION__))->decl_common.mode), 0, 0, 1, 0, 0)); | ||||
1460 | |||||
1461 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != FUNCTION_DECL && DECL_REGISTER (decl)((contains_struct_check ((decl), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1461, __FUNCTION__))->decl_common.decl_flag_0)) | ||||
1462 | return; | ||||
1463 | |||||
1464 | /* ??? Another way to do this would be to maintain a hashed | ||||
1465 | table of such critters. Instead of adding stuff to a DECL | ||||
1466 | to give certain attributes to it, we could use an external | ||||
1467 | hash map from DECL to set of attributes. */ | ||||
1468 | |||||
1469 | /* Let the target reassign the RTL if it wants. | ||||
1470 | This is necessary, for example, when one machine specific | ||||
1471 | decl attribute overrides another. */ | ||||
1472 | targetm.encode_section_info (decl, DECL_RTL (decl)((contains_struct_check ((decl), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1472, __FUNCTION__))->decl_with_rtl.rtl ? (decl)->decl_with_rtl .rtl : (make_decl_rtl (decl), (decl)->decl_with_rtl.rtl)), false); | ||||
1473 | |||||
1474 | /* If the symbol has a SYMBOL_REF_BLOCK field, update it based | ||||
1475 | on the new decl information. */ | ||||
1476 | if (MEM_P (x)(((enum rtx_code) (x)->code) == MEM) | ||||
1477 | && GET_CODE (XEXP (x, 0))((enum rtx_code) ((((x)->u.fld[0]).rt_rtx))->code) == SYMBOL_REF | ||||
1478 | && SYMBOL_REF_HAS_BLOCK_INFO_P (XEXP (x, 0))(((__extension__ ({ __typeof (((((x)->u.fld[0]).rt_rtx))) const _rtx = (((((x)->u.fld[0]).rt_rtx))); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("SYMBOL_REF_FLAGS" , _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1478, __FUNCTION__); _rtx; }) ->u2.symbol_ref_flags) & (1 << 7)) != 0)) | ||||
1479 | change_symbol_block (XEXP (x, 0)(((x)->u.fld[0]).rt_rtx), get_block_for_decl (decl)); | ||||
1480 | |||||
1481 | return; | ||||
1482 | } | ||||
1483 | |||||
1484 | /* If this variable belongs to the global constant pool, retrieve the | ||||
1485 | pre-computed RTL or recompute it in LTO mode. */ | ||||
1486 | if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_IN_CONSTANT_POOL (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1486, __FUNCTION__, (VAR_DECL)))->decl_with_vis.in_constant_pool )) | ||||
1487 | { | ||||
1488 | SET_DECL_RTL (decl, output_constant_def (DECL_INITIAL (decl), 1))set_decl_rtl (decl, output_constant_def (((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1488, __FUNCTION__))->decl_common.initial), 1)); | ||||
1489 | return; | ||||
1490 | } | ||||
1491 | |||||
1492 | id = DECL_ASSEMBLER_NAME (decl)decl_assembler_name (decl); | ||||
1493 | name = IDENTIFIER_POINTER (id)((const char *) (tree_check ((id), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1493, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str ); | ||||
1494 | |||||
1495 | if (name[0] != '*' && TREE_CODE (decl)((enum tree_code) (decl)->base.code) != FUNCTION_DECL | ||||
1496 | && DECL_REGISTER (decl)((contains_struct_check ((decl), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1496, __FUNCTION__))->decl_common.decl_flag_0)) | ||||
1497 | { | ||||
1498 | error ("register name not specified for %q+D", decl); | ||||
1499 | } | ||||
1500 | else if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != FUNCTION_DECL && DECL_REGISTER (decl)((contains_struct_check ((decl), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1500, __FUNCTION__))->decl_common.decl_flag_0)) | ||||
1501 | { | ||||
1502 | const char *asmspec = name+1; | ||||
1503 | machine_mode mode = DECL_MODE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1503, __FUNCTION__))->decl_common.mode); | ||||
1504 | reg_number = decode_reg_name (asmspec); | ||||
1505 | /* First detect errors in declaring global registers. */ | ||||
1506 | if (reg_number == -1) | ||||
1507 | error ("register name not specified for %q+D", decl); | ||||
1508 | else if (reg_number < 0) | ||||
1509 | error ("invalid register name for %q+D", decl); | ||||
1510 | else if (mode == BLKmode((void) 0, E_BLKmode)) | ||||
1511 | error ("data type of %q+D isn%'t suitable for a register", | ||||
1512 | decl); | ||||
1513 | else if (!in_hard_reg_set_p (accessible_reg_set(this_target_hard_regs->x_accessible_reg_set), mode, reg_number)) | ||||
1514 | error ("the register specified for %q+D cannot be accessed" | ||||
1515 | " by the current target", decl); | ||||
1516 | else if (!in_hard_reg_set_p (operand_reg_set(this_target_hard_regs->x_operand_reg_set), mode, reg_number)) | ||||
1517 | error ("the register specified for %q+D is not general enough" | ||||
1518 | " to be used as a register variable", decl); | ||||
1519 | else if (!targetm.hard_regno_mode_ok (reg_number, mode)) | ||||
1520 | error ("register specified for %q+D isn%'t suitable for data type", | ||||
1521 | decl); | ||||
1522 | else if (reg_number != HARD_FRAME_POINTER_REGNUM6 | ||||
1523 | && (reg_number == FRAME_POINTER_REGNUM19 | ||||
1524 | #ifdef RETURN_ADDRESS_POINTER_REGNUM | ||||
1525 | || reg_number == RETURN_ADDRESS_POINTER_REGNUM | ||||
1526 | #endif | ||||
1527 | || reg_number == ARG_POINTER_REGNUM16) | ||||
1528 | && eliminable_regno_p (reg_number)) | ||||
1529 | error ("register specified for %q+D is an internal GCC " | ||||
1530 | "implementation detail", decl); | ||||
1531 | /* Now handle properly declared static register variables. */ | ||||
1532 | else | ||||
1533 | { | ||||
1534 | int nregs; | ||||
1535 | |||||
1536 | if (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1536, __FUNCTION__))->decl_common.initial) != 0 && TREE_STATIC (decl)((decl)->base.static_flag)) | ||||
1537 | { | ||||
1538 | DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1538, __FUNCTION__))->decl_common.initial) = 0; | ||||
1539 | error ("global register variable has initial value"); | ||||
1540 | } | ||||
1541 | if (TREE_THIS_VOLATILE (decl)((decl)->base.volatile_flag)) | ||||
1542 | warning (OPT_Wvolatile_register_var, | ||||
1543 | "optimization may eliminate reads and/or " | ||||
1544 | "writes to register variables"); | ||||
1545 | |||||
1546 | /* If the user specified one of the eliminables registers here, | ||||
1547 | e.g., FRAME_POINTER_REGNUM, we don't want to get this variable | ||||
1548 | confused with that register and be eliminated. This usage is | ||||
1549 | somewhat suspect... */ | ||||
1550 | |||||
1551 | SET_DECL_RTL (decl, gen_raw_REG (mode, reg_number))set_decl_rtl (decl, gen_raw_REG (mode, reg_number)); | ||||
1552 | ORIGINAL_REGNO (DECL_RTL (decl))(__extension__ ({ __typeof ((((contains_struct_check ((decl), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1552, __FUNCTION__))->decl_with_rtl.rtl ? (decl)->decl_with_rtl .rtl : (make_decl_rtl (decl), (decl)->decl_with_rtl.rtl))) ) const _rtx = ((((contains_struct_check ((decl), (TS_DECL_WRTL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1552, __FUNCTION__))->decl_with_rtl.rtl ? (decl)->decl_with_rtl .rtl : (make_decl_rtl (decl), (decl)->decl_with_rtl.rtl))) ); if (((enum rtx_code) (_rtx)->code) != REG) rtl_check_failed_flag ("ORIGINAL_REGNO", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1552, __FUNCTION__); _rtx; })->u2.original_regno) = reg_number; | ||||
1553 | REG_USERVAR_P (DECL_RTL (decl))(__extension__ ({ __typeof ((((contains_struct_check ((decl), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1553, __FUNCTION__))->decl_with_rtl.rtl ? (decl)->decl_with_rtl .rtl : (make_decl_rtl (decl), (decl)->decl_with_rtl.rtl))) ) const _rtx = ((((contains_struct_check ((decl), (TS_DECL_WRTL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1553, __FUNCTION__))->decl_with_rtl.rtl ? (decl)->decl_with_rtl .rtl : (make_decl_rtl (decl), (decl)->decl_with_rtl.rtl))) ); if (((enum rtx_code) (_rtx)->code) != REG) rtl_check_failed_flag ("REG_USERVAR_P", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1553, __FUNCTION__); _rtx; })->volatil) = 1; | ||||
1554 | |||||
1555 | if (TREE_STATIC (decl)((decl)->base.static_flag)) | ||||
1556 | { | ||||
1557 | /* Make this register global, so not usable for anything | ||||
1558 | else. */ | ||||
1559 | #ifdef ASM_DECLARE_REGISTER_GLOBAL | ||||
1560 | name = IDENTIFIER_POINTER (DECL_NAME (decl))((const char *) (tree_check ((((contains_struct_check ((decl) , (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1560, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1560, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str ); | ||||
1561 | ASM_DECLARE_REGISTER_GLOBAL (asm_out_file, decl, reg_number, name); | ||||
1562 | #endif | ||||
1563 | nregs = hard_regno_nregs (reg_number, mode); | ||||
1564 | while (nregs > 0) | ||||
1565 | globalize_reg (decl, reg_number + --nregs); | ||||
1566 | } | ||||
1567 | |||||
1568 | /* As a register variable, it has no section. */ | ||||
1569 | return; | ||||
1570 | } | ||||
1571 | /* Avoid internal errors from invalid register | ||||
1572 | specifications. */ | ||||
1573 | SET_DECL_ASSEMBLER_NAME (decl, NULL_TREE)overwrite_decl_assembler_name (decl, (tree) nullptr); | ||||
1574 | DECL_HARD_REGISTER (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1574, __FUNCTION__, (VAR_DECL)))->decl_with_vis.hard_register ) = 0; | ||||
1575 | /* Also avoid SSA inconsistencies by pretending this is an external | ||||
1576 | decl now. */ | ||||
1577 | DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1577, __FUNCTION__))->decl_common.decl_flag_1) = 1; | ||||
1578 | return; | ||||
1579 | } | ||||
1580 | /* Now handle ordinary static variables and functions (in memory). | ||||
1581 | Also handle vars declared register invalidly. */ | ||||
1582 | else if (name[0] == '*') | ||||
1583 | { | ||||
1584 | #ifdef REGISTER_PREFIX | ||||
1585 | if (strlen (REGISTER_PREFIX) != 0) | ||||
1586 | { | ||||
1587 | reg_number = decode_reg_name (name); | ||||
1588 | if (reg_number >= 0 || reg_number == -3) | ||||
1589 | error ("register name given for non-register variable %q+D", decl); | ||||
1590 | } | ||||
1591 | #endif | ||||
1592 | } | ||||
1593 | |||||
1594 | /* Specifying a section attribute on a variable forces it into a | ||||
1595 | non-.bss section, and thus it cannot be common. */ | ||||
1596 | /* FIXME: In general this code should not be necessary because | ||||
1597 | visibility pass is doing the same work. But notice_global_symbol | ||||
1598 | is called early and it needs to make DECL_RTL to get the name. | ||||
1599 | we take care of recomputing the DECL_RTL after visibility is changed. */ | ||||
1600 | if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) | ||||
1601 | && (TREE_STATIC (decl)((decl)->base.static_flag) || DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1601, __FUNCTION__))->decl_common.decl_flag_1)) | ||||
1602 | && DECL_SECTION_NAME (decl)decl_section_name (decl) != NULLnullptr | ||||
1603 | && DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1603, __FUNCTION__))->decl_common.initial) == NULL_TREE(tree) nullptr | ||||
1604 | && DECL_COMMON (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1604, __FUNCTION__))->decl_with_vis.common_flag)) | ||||
1605 | DECL_COMMON (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1605, __FUNCTION__))->decl_with_vis.common_flag) = 0; | ||||
1606 | |||||
1607 | /* Variables can't be both common and weak. */ | ||||
1608 | if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_WEAK (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1608, __FUNCTION__))->decl_with_vis.weak_flag)) | ||||
1609 | DECL_COMMON (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1609, __FUNCTION__))->decl_with_vis.common_flag) = 0; | ||||
1610 | |||||
1611 | if (use_object_blocks_p () && use_blocks_for_decl_p (decl)) | ||||
1612 | x = create_block_symbol (name, get_block_for_decl (decl), -1); | ||||
1613 | else | ||||
1614 | { | ||||
1615 | machine_mode address_mode = Pmode(global_options.x_ix86_pmode == PMODE_DI ? (scalar_int_mode ( (scalar_int_mode::from_int) E_DImode)) : (scalar_int_mode ((scalar_int_mode ::from_int) E_SImode))); | ||||
1616 | if (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1616, __FUNCTION__))->typed.type) != error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
1617 | { | ||||
1618 | addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1618, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1618, __FUNCTION__))->base.u.bits.address_space); | ||||
1619 | address_mode = targetm.addr_space.address_mode (as); | ||||
1620 | } | ||||
1621 | x = gen_rtx_SYMBOL_REF (address_mode, name)gen_rtx_fmt_s0_stat ((SYMBOL_REF), ((address_mode)), ((name)) ); | ||||
1622 | } | ||||
1623 | SYMBOL_REF_WEAK (x)(__extension__ ({ __typeof ((x)) const _rtx = ((x)); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("SYMBOL_REF_WEAK", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1623, __FUNCTION__); _rtx; })->return_val) = DECL_WEAK (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1623, __FUNCTION__))->decl_with_vis.weak_flag); | ||||
1624 | SET_SYMBOL_REF_DECL (x, decl)(((void)(!(!(__extension__ ({ __typeof ((x)) const _rtx = ((x )); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("CONSTANT_POOL_ADDRESS_P", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1624, __FUNCTION__); _rtx; })->unchanging)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1624, __FUNCTION__), 0 : 0)), ((((x))->u.fld[1]).rt_tree ) = (decl)); | ||||
1625 | |||||
1626 | x = gen_rtx_MEM (DECL_MODE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1626, __FUNCTION__))->decl_common.mode), x); | ||||
1627 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != FUNCTION_DECL) | ||||
1628 | set_mem_attributes (x, decl, 1); | ||||
1629 | SET_DECL_RTL (decl, x)set_decl_rtl (decl, x); | ||||
1630 | |||||
1631 | /* Optionally set flags or add text to the name to record information | ||||
1632 | such as that it is a function name. | ||||
1633 | If the name is changed, the macro ASM_OUTPUT_LABELREF | ||||
1634 | will have to know how to strip this information. */ | ||||
1635 | targetm.encode_section_info (decl, DECL_RTL (decl)((contains_struct_check ((decl), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1635, __FUNCTION__))->decl_with_rtl.rtl ? (decl)->decl_with_rtl .rtl : (make_decl_rtl (decl), (decl)->decl_with_rtl.rtl)), true); | ||||
1636 | } | ||||
1637 | |||||
1638 | /* Like make_decl_rtl, but inhibit creation of new alias sets when | ||||
1639 | calling make_decl_rtl. Also, reset DECL_RTL before returning the | ||||
1640 | rtl. */ | ||||
1641 | |||||
1642 | rtx | ||||
1643 | make_decl_rtl_for_debug (tree decl) | ||||
1644 | { | ||||
1645 | unsigned int save_aliasing_flag; | ||||
1646 | rtx rtl; | ||||
1647 | |||||
1648 | if (DECL_RTL_SET_P (decl)(((tree_contains_struct[(((enum tree_code) (decl)->base.code ))][(TS_DECL_WRTL)])) && (contains_struct_check ((decl ), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1648, __FUNCTION__))->decl_with_rtl.rtl != nullptr)) | ||||
1649 | return DECL_RTL (decl)((contains_struct_check ((decl), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1649, __FUNCTION__))->decl_with_rtl.rtl ? (decl)->decl_with_rtl .rtl : (make_decl_rtl (decl), (decl)->decl_with_rtl.rtl)); | ||||
1650 | |||||
1651 | /* Kludge alert! Somewhere down the call chain, make_decl_rtl will | ||||
1652 | call new_alias_set. If running with -fcompare-debug, sometimes | ||||
1653 | we do not want to create alias sets that will throw the alias | ||||
1654 | numbers off in the comparison dumps. So... clearing | ||||
1655 | flag_strict_aliasing will keep new_alias_set() from creating a | ||||
1656 | new set. */ | ||||
1657 | save_aliasing_flag = flag_strict_aliasingglobal_options.x_flag_strict_aliasing; | ||||
1658 | flag_strict_aliasingglobal_options.x_flag_strict_aliasing = 0; | ||||
1659 | |||||
1660 | rtl = DECL_RTL (decl)((contains_struct_check ((decl), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1660, __FUNCTION__))->decl_with_rtl.rtl ? (decl)->decl_with_rtl .rtl : (make_decl_rtl (decl), (decl)->decl_with_rtl.rtl)); | ||||
1661 | /* Reset DECL_RTL back, as various parts of the compiler expects | ||||
1662 | DECL_RTL set meaning it is actually going to be output. */ | ||||
1663 | SET_DECL_RTL (decl, NULL)set_decl_rtl (decl, nullptr); | ||||
1664 | |||||
1665 | flag_strict_aliasingglobal_options.x_flag_strict_aliasing = save_aliasing_flag; | ||||
1666 | return rtl; | ||||
1667 | } | ||||
1668 | |||||
1669 | /* Output a string of literal assembler code | ||||
1670 | for an `asm' keyword used between functions. */ | ||||
1671 | |||||
1672 | void | ||||
1673 | assemble_asm (tree string) | ||||
1674 | { | ||||
1675 | const char *p; | ||||
1676 | app_enable (); | ||||
1677 | |||||
1678 | if (TREE_CODE (string)((enum tree_code) (string)->base.code) == ADDR_EXPR) | ||||
1679 | string = TREE_OPERAND (string, 0)(*((const_cast<tree*> (tree_operand_check ((string), (0 ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1679, __FUNCTION__))))); | ||||
1680 | |||||
1681 | p = TREE_STRING_POINTER (string)((const char *)((tree_check ((string), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1681, __FUNCTION__, (STRING_CST)))->string.str)); | ||||
1682 | fprintf (asm_out_file, "%s%s\n", p[0] == '\t' ? "" : "\t", p); | ||||
1683 | } | ||||
1684 | |||||
1685 | /* Write the address of the entity given by SYMBOL to SEC. */ | ||||
1686 | void | ||||
1687 | assemble_addr_to_section (rtx symbol, section *sec) | ||||
1688 | { | ||||
1689 | switch_to_section (sec); | ||||
1690 | assemble_align (POINTER_SIZE(((global_options.x_ix86_isa_flags & (1UL << 58)) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4)))); | ||||
1691 | assemble_integer (symbol, POINTER_SIZE_UNITS(((((global_options.x_ix86_isa_flags & (1UL << 58)) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) + (8) - 1) / (8)), POINTER_SIZE(((global_options.x_ix86_isa_flags & (1UL << 58)) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))), 1); | ||||
1692 | } | ||||
1693 | |||||
1694 | /* Return the numbered .ctors.N (if CONSTRUCTOR_P) or .dtors.N (if | ||||
1695 | not) section for PRIORITY. */ | ||||
1696 | section * | ||||
1697 | get_cdtor_priority_section (int priority, bool constructor_p) | ||||
1698 | { | ||||
1699 | /* Buffer conservatively large enough for the full range of a 32-bit | ||||
1700 | int plus the text below. */ | ||||
1701 | char buf[18]; | ||||
1702 | |||||
1703 | /* ??? This only works reliably with the GNU linker. */ | ||||
1704 | sprintf (buf, "%s.%.5u", | ||||
1705 | constructor_p ? ".ctors" : ".dtors", | ||||
1706 | /* Invert the numbering so the linker puts us in the proper | ||||
1707 | order; constructors are run from right to left, and the | ||||
1708 | linker sorts in increasing order. */ | ||||
1709 | MAX_INIT_PRIORITY65535 - priority); | ||||
1710 | return get_section (buf, SECTION_WRITE, NULLnullptr); | ||||
1711 | } | ||||
1712 | |||||
1713 | void | ||||
1714 | default_named_section_asm_out_destructor (rtx symbol, int priority) | ||||
1715 | { | ||||
1716 | section *sec; | ||||
1717 | |||||
1718 | if (priority != DEFAULT_INIT_PRIORITY65535) | ||||
1719 | sec = get_cdtor_priority_section (priority, | ||||
1720 | /*constructor_p=*/false); | ||||
1721 | else | ||||
1722 | sec = get_section (".dtors", SECTION_WRITE, NULLnullptr); | ||||
1723 | |||||
1724 | assemble_addr_to_section (symbol, sec); | ||||
1725 | } | ||||
1726 | |||||
1727 | #ifdef DTORS_SECTION_ASM_OP | ||||
1728 | void | ||||
1729 | default_dtor_section_asm_out_destructor (rtx symbol, | ||||
1730 | int priority ATTRIBUTE_UNUSED__attribute__ ((__unused__))) | ||||
1731 | { | ||||
1732 | assemble_addr_to_section (symbol, dtors_section); | ||||
1733 | } | ||||
1734 | #endif | ||||
1735 | |||||
1736 | void | ||||
1737 | default_named_section_asm_out_constructor (rtx symbol, int priority) | ||||
1738 | { | ||||
1739 | section *sec; | ||||
1740 | |||||
1741 | if (priority != DEFAULT_INIT_PRIORITY65535) | ||||
1742 | sec = get_cdtor_priority_section (priority, | ||||
1743 | /*constructor_p=*/true); | ||||
1744 | else | ||||
1745 | sec = get_section (".ctors", SECTION_WRITE, NULLnullptr); | ||||
1746 | |||||
1747 | assemble_addr_to_section (symbol, sec); | ||||
1748 | } | ||||
1749 | |||||
1750 | #ifdef CTORS_SECTION_ASM_OP | ||||
1751 | void | ||||
1752 | default_ctor_section_asm_out_constructor (rtx symbol, | ||||
1753 | int priority ATTRIBUTE_UNUSED__attribute__ ((__unused__))) | ||||
1754 | { | ||||
1755 | assemble_addr_to_section (symbol, ctors_section); | ||||
1756 | } | ||||
1757 | #endif | ||||
1758 | |||||
1759 | /* CONSTANT_POOL_BEFORE_FUNCTION may be defined as an expression with | ||||
1760 | a nonzero value if the constant pool should be output before the | ||||
1761 | start of the function, or a zero value if the pool should output | ||||
1762 | after the end of the function. The default is to put it before the | ||||
1763 | start. */ | ||||
1764 | |||||
1765 | #ifndef CONSTANT_POOL_BEFORE_FUNCTION1 | ||||
1766 | #define CONSTANT_POOL_BEFORE_FUNCTION1 1 | ||||
1767 | #endif | ||||
1768 | |||||
1769 | /* DECL is an object (either VAR_DECL or FUNCTION_DECL) which is going | ||||
1770 | to be output to assembler. | ||||
1771 | Set first_global_object_name and weak_global_object_name as appropriate. */ | ||||
1772 | |||||
1773 | void | ||||
1774 | notice_global_symbol (tree decl) | ||||
1775 | { | ||||
1776 | const char **t = &first_global_object_name; | ||||
1777 | |||||
1778 | if (first_global_object_name | ||||
1779 | || !TREE_PUBLIC (decl)((decl)->base.public_flag) | ||||
1780 | || DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1780, __FUNCTION__))->decl_common.decl_flag_1) | ||||
1781 | || !DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1781, __FUNCTION__))->decl_minimal.name) | ||||
1782 | || (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_HARD_REGISTER (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1782, __FUNCTION__, (VAR_DECL)))->decl_with_vis.hard_register )) | ||||
1783 | || (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != FUNCTION_DECL | ||||
1784 | && (!VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) | ||||
1785 | || (DECL_COMMON (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1785, __FUNCTION__))->decl_with_vis.common_flag) | ||||
1786 | && (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1786, __FUNCTION__))->decl_common.initial) == 0 | ||||
1787 | || DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1787, __FUNCTION__))->decl_common.initial) == error_mark_nodeglobal_trees[TI_ERROR_MARK]))))) | ||||
1788 | return; | ||||
1789 | |||||
1790 | /* We win when global object is found, but it is useful to know about weak | ||||
1791 | symbol as well so we can produce nicer unique names. */ | ||||
1792 | if (DECL_WEAK (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1792, __FUNCTION__))->decl_with_vis.weak_flag) || DECL_ONE_ONLY (decl)(decl_comdat_group (decl) != (tree) nullptr && (((decl )->base.public_flag) || ((contains_struct_check ((decl), ( TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1792, __FUNCTION__))->decl_common.decl_flag_1))) || flag_shlibglobal_options.x_flag_shlib) | ||||
1793 | t = &weak_global_object_name; | ||||
1794 | |||||
1795 | if (!*t) | ||||
1796 | { | ||||
1797 | tree id = DECL_ASSEMBLER_NAME (decl)decl_assembler_name (decl); | ||||
1798 | ultimate_transparent_alias_target (&id); | ||||
1799 | *t = ggc_strdup (targetm.strip_name_encoding (IDENTIFIER_POINTER (id)))ggc_alloc_string ((targetm.strip_name_encoding (((const char * ) (tree_check ((id), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1799, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str ))), -1 ); | ||||
1800 | } | ||||
1801 | } | ||||
1802 | |||||
1803 | /* If not using flag_reorder_blocks_and_partition, decide early whether the | ||||
1804 | current function goes into the cold section, so that targets can use | ||||
1805 | current_function_section during RTL expansion. DECL describes the | ||||
1806 | function. */ | ||||
1807 | |||||
1808 | void | ||||
1809 | decide_function_section (tree decl) | ||||
1810 | { | ||||
1811 | first_function_block_is_cold = false; | ||||
1812 | |||||
1813 | if (DECL_SECTION_NAME (decl)decl_section_name (decl)) | ||||
1814 | { | ||||
1815 | struct cgraph_node *node = cgraph_node::get (current_function_decl); | ||||
1816 | /* Calls to function_section rely on first_function_block_is_cold | ||||
1817 | being accurate. */ | ||||
1818 | first_function_block_is_cold = (node | ||||
1819 | && node->frequency | ||||
1820 | == NODE_FREQUENCY_UNLIKELY_EXECUTED); | ||||
1821 | } | ||||
1822 | |||||
1823 | in_cold_section_p = first_function_block_is_cold; | ||||
1824 | } | ||||
1825 | |||||
1826 | /* Get the function's name, as described by its RTL. This may be | ||||
1827 | different from the DECL_NAME name used in the source file. */ | ||||
1828 | const char * | ||||
1829 | get_fnname_from_decl (tree decl) | ||||
1830 | { | ||||
1831 | rtx x = DECL_RTL (decl)((contains_struct_check ((decl), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1831, __FUNCTION__))->decl_with_rtl.rtl ? (decl)->decl_with_rtl .rtl : (make_decl_rtl (decl), (decl)->decl_with_rtl.rtl)); | ||||
1832 | gcc_assert (MEM_P (x))((void)(!((((enum rtx_code) (x)->code) == MEM)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1832, __FUNCTION__), 0 : 0)); | ||||
1833 | x = XEXP (x, 0)(((x)->u.fld[0]).rt_rtx); | ||||
1834 | gcc_assert (GET_CODE (x) == SYMBOL_REF)((void)(!(((enum rtx_code) (x)->code) == SYMBOL_REF) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1834, __FUNCTION__), 0 : 0)); | ||||
1835 | return XSTR (x, 0)(((x)->u.fld[0]).rt_str); | ||||
1836 | } | ||||
1837 | |||||
1838 | /* Output assembler code for the constant pool of a function and associated | ||||
1839 | with defining the name of the function. DECL describes the function. | ||||
1840 | NAME is the function's name. For the constant pool, we use the current | ||||
1841 | constant pool data. */ | ||||
1842 | |||||
1843 | void | ||||
1844 | assemble_start_function (tree decl, const char *fnname) | ||||
1845 | { | ||||
1846 | int align; | ||||
1847 | char tmp_label[100]; | ||||
1848 | bool hot_label_written = false; | ||||
1849 | |||||
1850 | if (crtl(&x_rtl)->has_bb_partition) | ||||
1851 | { | ||||
1852 | ASM_GENERATE_INTERNAL_LABEL (tmp_label, "LHOTB", const_labelno)do { char *__p; (tmp_label)[0] = '*'; (tmp_label)[1] = '.'; __p = stpcpy (&(tmp_label)[2], "LHOTB"); sprint_ul (__p, (unsigned long) (const_labelno)); } while (0); | ||||
1853 | crtl(&x_rtl)->subsections.hot_section_label = ggc_strdup (tmp_label)ggc_alloc_string ((tmp_label), -1 ); | ||||
1854 | ASM_GENERATE_INTERNAL_LABEL (tmp_label, "LCOLDB", const_labelno)do { char *__p; (tmp_label)[0] = '*'; (tmp_label)[1] = '.'; __p = stpcpy (&(tmp_label)[2], "LCOLDB"); sprint_ul (__p, (unsigned long) (const_labelno)); } while (0); | ||||
1855 | crtl(&x_rtl)->subsections.cold_section_label = ggc_strdup (tmp_label)ggc_alloc_string ((tmp_label), -1 ); | ||||
1856 | ASM_GENERATE_INTERNAL_LABEL (tmp_label, "LHOTE", const_labelno)do { char *__p; (tmp_label)[0] = '*'; (tmp_label)[1] = '.'; __p = stpcpy (&(tmp_label)[2], "LHOTE"); sprint_ul (__p, (unsigned long) (const_labelno)); } while (0); | ||||
1857 | crtl(&x_rtl)->subsections.hot_section_end_label = ggc_strdup (tmp_label)ggc_alloc_string ((tmp_label), -1 ); | ||||
1858 | ASM_GENERATE_INTERNAL_LABEL (tmp_label, "LCOLDE", const_labelno)do { char *__p; (tmp_label)[0] = '*'; (tmp_label)[1] = '.'; __p = stpcpy (&(tmp_label)[2], "LCOLDE"); sprint_ul (__p, (unsigned long) (const_labelno)); } while (0); | ||||
1859 | crtl(&x_rtl)->subsections.cold_section_end_label = ggc_strdup (tmp_label)ggc_alloc_string ((tmp_label), -1 ); | ||||
1860 | const_labelno++; | ||||
1861 | cold_function_name = NULL_TREE(tree) nullptr; | ||||
1862 | } | ||||
1863 | else | ||||
1864 | { | ||||
1865 | crtl(&x_rtl)->subsections.hot_section_label = NULLnullptr; | ||||
1866 | crtl(&x_rtl)->subsections.cold_section_label = NULLnullptr; | ||||
1867 | crtl(&x_rtl)->subsections.hot_section_end_label = NULLnullptr; | ||||
1868 | crtl(&x_rtl)->subsections.cold_section_end_label = NULLnullptr; | ||||
1869 | } | ||||
1870 | |||||
1871 | /* The following code does not need preprocessing in the assembler. */ | ||||
1872 | |||||
1873 | app_disable (); | ||||
1874 | |||||
1875 | if (CONSTANT_POOL_BEFORE_FUNCTION1) | ||||
1876 | output_constant_pool (fnname, decl); | ||||
1877 | |||||
1878 | align = symtab_node::get (decl)->definition_alignment (); | ||||
1879 | |||||
1880 | /* Make sure the not and cold text (code) sections are properly | ||||
1881 | aligned. This is necessary here in the case where the function | ||||
1882 | has both hot and cold sections, because we don't want to re-set | ||||
1883 | the alignment when the section switch happens mid-function. */ | ||||
1884 | |||||
1885 | if (crtl(&x_rtl)->has_bb_partition) | ||||
1886 | { | ||||
1887 | first_function_block_is_cold = false; | ||||
1888 | |||||
1889 | switch_to_section (unlikely_text_section ()); | ||||
1890 | assemble_align (align); | ||||
1891 | ASM_OUTPUT_LABEL (asm_out_file, crtl->subsections.cold_section_label)do { assemble_name ((asm_out_file), ((&x_rtl)->subsections .cold_section_label)); fputs (":\n", (asm_out_file)); } while (0); | ||||
1892 | |||||
1893 | /* When the function starts with a cold section, we need to explicitly | ||||
1894 | align the hot section and write out the hot section label. | ||||
1895 | But if the current function is a thunk, we do not have a CFG. */ | ||||
1896 | if (!cfun(cfun + 0)->is_thunk | ||||
1897 | && BB_PARTITION (ENTRY_BLOCK_PTR_FOR_FN (cfun)->next_bb)(((((cfun + 0))->cfg->x_entry_block_ptr)->next_bb)-> flags & (BB_HOT_PARTITION|BB_COLD_PARTITION)) == BB_COLD_PARTITION) | ||||
1898 | { | ||||
1899 | switch_to_section (text_section); | ||||
1900 | assemble_align (align); | ||||
1901 | ASM_OUTPUT_LABEL (asm_out_file, crtl->subsections.hot_section_label)do { assemble_name ((asm_out_file), ((&x_rtl)->subsections .hot_section_label)); fputs (":\n", (asm_out_file)); } while ( 0); | ||||
1902 | hot_label_written = true; | ||||
1903 | first_function_block_is_cold = true; | ||||
1904 | } | ||||
1905 | in_cold_section_p = first_function_block_is_cold; | ||||
1906 | } | ||||
1907 | |||||
1908 | |||||
1909 | /* Switch to the correct text section for the start of the function. */ | ||||
1910 | |||||
1911 | switch_to_section (function_section (decl), decl); | ||||
1912 | if (crtl(&x_rtl)->has_bb_partition && !hot_label_written) | ||||
1913 | ASM_OUTPUT_LABEL (asm_out_file, crtl->subsections.hot_section_label)do { assemble_name ((asm_out_file), ((&x_rtl)->subsections .hot_section_label)); fputs (":\n", (asm_out_file)); } while ( 0); | ||||
1914 | |||||
1915 | /* Tell assembler to move to target machine's alignment for functions. */ | ||||
1916 | align = floor_log2 (align / BITS_PER_UNIT(8)); | ||||
1917 | if (align > 0) | ||||
1918 | { | ||||
1919 | ASM_OUTPUT_ALIGN (asm_out_file, align)if ((align) != 0) fprintf ((asm_out_file), "\t.align %d\n", 1 << (align)); | ||||
1920 | } | ||||
1921 | |||||
1922 | /* Handle a user-specified function alignment. | ||||
1923 | Note that we still need to align to DECL_ALIGN, as above, | ||||
1924 | because ASM_OUTPUT_MAX_SKIP_ALIGN might not do any alignment at all. */ | ||||
1925 | if (! DECL_USER_ALIGN (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1925, __FUNCTION__))->base.u.bits.user_align) | ||||
1926 | && align_functions(this_target_flag_state->x_align_functions).levels[0].log > align | ||||
1927 | && optimize_function_for_speed_p (cfun(cfun + 0))) | ||||
1928 | { | ||||
1929 | #ifdef ASM_OUTPUT_MAX_SKIP_ALIGN | ||||
1930 | int align_log = align_functions(this_target_flag_state->x_align_functions).levels[0].log; | ||||
1931 | #endif | ||||
1932 | int max_skip = align_functions(this_target_flag_state->x_align_functions).levels[0].maxskip; | ||||
1933 | if (flag_limit_function_alignmentglobal_options.x_flag_limit_function_alignment && crtl(&x_rtl)->max_insn_address > 0 | ||||
1934 | && max_skip >= crtl(&x_rtl)->max_insn_address) | ||||
1935 | max_skip = crtl(&x_rtl)->max_insn_address - 1; | ||||
1936 | |||||
1937 | #ifdef ASM_OUTPUT_MAX_SKIP_ALIGN | ||||
1938 | ASM_OUTPUT_MAX_SKIP_ALIGN (asm_out_file, align_log, max_skip)do { if ((align_log) != 0) { if ((max_skip) == 0 || (max_skip ) >= (1 << (align_log)) - 1) fprintf ((asm_out_file) , "\t.p2align %d\n", (align_log)); else fprintf ((asm_out_file ), "\t.p2align %d,,%d\n", (align_log), (max_skip)); } } while (0); | ||||
1939 | if (max_skip == align_functions(this_target_flag_state->x_align_functions).levels[0].maxskip) | ||||
1940 | ASM_OUTPUT_MAX_SKIP_ALIGN (asm_out_file,do { if (((this_target_flag_state->x_align_functions).levels [1].log) != 0) { if (((this_target_flag_state->x_align_functions ).levels[1].maxskip) == 0 || ((this_target_flag_state->x_align_functions ).levels[1].maxskip) >= (1 << ((this_target_flag_state ->x_align_functions).levels[1].log)) - 1) fprintf ((asm_out_file ), "\t.p2align %d\n", ((this_target_flag_state->x_align_functions ).levels[1].log)); else fprintf ((asm_out_file), "\t.p2align %d,,%d\n" , ((this_target_flag_state->x_align_functions).levels[1].log ), ((this_target_flag_state->x_align_functions).levels[1]. maxskip)); } } while (0) | ||||
1941 | align_functions.levels[1].log,do { if (((this_target_flag_state->x_align_functions).levels [1].log) != 0) { if (((this_target_flag_state->x_align_functions ).levels[1].maxskip) == 0 || ((this_target_flag_state->x_align_functions ).levels[1].maxskip) >= (1 << ((this_target_flag_state ->x_align_functions).levels[1].log)) - 1) fprintf ((asm_out_file ), "\t.p2align %d\n", ((this_target_flag_state->x_align_functions ).levels[1].log)); else fprintf ((asm_out_file), "\t.p2align %d,,%d\n" , ((this_target_flag_state->x_align_functions).levels[1].log ), ((this_target_flag_state->x_align_functions).levels[1]. maxskip)); } } while (0) | ||||
1942 | align_functions.levels[1].maxskip)do { if (((this_target_flag_state->x_align_functions).levels [1].log) != 0) { if (((this_target_flag_state->x_align_functions ).levels[1].maxskip) == 0 || ((this_target_flag_state->x_align_functions ).levels[1].maxskip) >= (1 << ((this_target_flag_state ->x_align_functions).levels[1].log)) - 1) fprintf ((asm_out_file ), "\t.p2align %d\n", ((this_target_flag_state->x_align_functions ).levels[1].log)); else fprintf ((asm_out_file), "\t.p2align %d,,%d\n" , ((this_target_flag_state->x_align_functions).levels[1].log ), ((this_target_flag_state->x_align_functions).levels[1]. maxskip)); } } while (0); | ||||
1943 | #else | ||||
1944 | ASM_OUTPUT_ALIGN (asm_out_file, align_functions.levels[0].log)if (((this_target_flag_state->x_align_functions).levels[0] .log) != 0) fprintf ((asm_out_file), "\t.align %d\n", 1 << ((this_target_flag_state->x_align_functions).levels[0].log )); | ||||
1945 | #endif | ||||
1946 | } | ||||
1947 | |||||
1948 | #ifdef ASM_OUTPUT_FUNCTION_PREFIX | ||||
1949 | ASM_OUTPUT_FUNCTION_PREFIX (asm_out_file, fnname); | ||||
1950 | #endif | ||||
1951 | |||||
1952 | if (!DECL_IGNORED_P (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1952, __FUNCTION__))->decl_common.ignored_flag)) | ||||
1953 | (*debug_hooks->begin_function) (decl); | ||||
1954 | |||||
1955 | /* Make function name accessible from other files, if appropriate. */ | ||||
1956 | |||||
1957 | if (TREE_PUBLIC (decl)((decl)->base.public_flag)) | ||||
1958 | { | ||||
1959 | notice_global_symbol (decl); | ||||
1960 | |||||
1961 | globalize_decl (decl); | ||||
1962 | |||||
1963 | maybe_assemble_visibility (decl); | ||||
1964 | } | ||||
1965 | |||||
1966 | if (DECL_PRESERVE_P (decl)(contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1966, __FUNCTION__))->decl_common.preserve_flag) | ||||
1967 | targetm.asm_out.mark_decl_preserved (fnname); | ||||
1968 | |||||
1969 | unsigned short patch_area_size = crtl(&x_rtl)->patch_area_size; | ||||
1970 | unsigned short patch_area_entry = crtl(&x_rtl)->patch_area_entry; | ||||
1971 | |||||
1972 | /* Emit the patching area before the entry label, if any. */ | ||||
1973 | if (patch_area_entry > 0) | ||||
1974 | targetm.asm_out.print_patchable_function_entry (asm_out_file, | ||||
1975 | patch_area_entry, true); | ||||
1976 | |||||
1977 | /* Do any machine/system dependent processing of the function name. */ | ||||
1978 | #ifdef ASM_DECLARE_FUNCTION_NAME | ||||
1979 | ASM_DECLARE_FUNCTION_NAME (asm_out_file, fnname, current_function_decl)do { do { fputs ("\t.type\t", asm_out_file); assemble_name (asm_out_file , fnname); fputs (", ", asm_out_file); fprintf (asm_out_file, "@%s", "function"); putc ('\n', asm_out_file); } while (0); ; ix86_asm_output_function_label ((asm_out_file), (fnname), (current_function_decl )); } while (0); | ||||
1980 | #else | ||||
1981 | /* Standard thing is just output label for the function. */ | ||||
1982 | ASM_OUTPUT_FUNCTION_LABEL (asm_out_file, fnname, current_function_decl)ix86_asm_output_function_label ((asm_out_file), (fnname), (current_function_decl )); | ||||
1983 | #endif /* ASM_DECLARE_FUNCTION_NAME */ | ||||
1984 | |||||
1985 | /* And the area after the label. Record it if we haven't done so yet. */ | ||||
1986 | if (patch_area_size > patch_area_entry) | ||||
1987 | targetm.asm_out.print_patchable_function_entry (asm_out_file, | ||||
1988 | patch_area_size | ||||
1989 | - patch_area_entry, | ||||
1990 | patch_area_entry == 0); | ||||
1991 | |||||
1992 | if (lookup_attribute ("no_split_stack", DECL_ATTRIBUTES (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 1992, __FUNCTION__))->decl_common.attributes))) | ||||
1993 | saw_no_split_stack = true; | ||||
1994 | } | ||||
1995 | |||||
1996 | /* Output assembler code associated with defining the size of the | ||||
1997 | function. DECL describes the function. NAME is the function's name. */ | ||||
1998 | |||||
1999 | void | ||||
2000 | assemble_end_function (tree decl, const char *fnname ATTRIBUTE_UNUSED__attribute__ ((__unused__))) | ||||
2001 | { | ||||
2002 | #ifdef ASM_DECLARE_FUNCTION_SIZE | ||||
2003 | /* We could have switched section in the middle of the function. */ | ||||
2004 | if (crtl(&x_rtl)->has_bb_partition) | ||||
2005 | switch_to_section (function_section (decl)); | ||||
2006 | ASM_DECLARE_FUNCTION_SIZE (asm_out_file, fnname, decl)do { if (!global_options.x_flag_inhibit_size_directive) do { fputs ("\t.size\t", asm_out_file); assemble_name (asm_out_file, fnname ); fputs (", .-", asm_out_file); assemble_name (asm_out_file, fnname); putc ('\n', asm_out_file); } while (0); } while (0); | ||||
2007 | #endif | ||||
2008 | if (! CONSTANT_POOL_BEFORE_FUNCTION1) | ||||
2009 | { | ||||
2010 | output_constant_pool (fnname, decl); | ||||
2011 | switch_to_section (function_section (decl)); /* need to switch back */ | ||||
2012 | } | ||||
2013 | /* Output labels for end of hot/cold text sections (to be used by | ||||
2014 | debug info.) */ | ||||
2015 | if (crtl(&x_rtl)->has_bb_partition) | ||||
2016 | { | ||||
2017 | section *save_text_section; | ||||
2018 | |||||
2019 | save_text_section = in_section; | ||||
2020 | switch_to_section (unlikely_text_section ()); | ||||
2021 | #ifdef ASM_DECLARE_COLD_FUNCTION_SIZE | ||||
2022 | if (cold_function_name != NULL_TREE(tree) nullptr) | ||||
2023 | ASM_DECLARE_COLD_FUNCTION_SIZE (asm_out_file,do { if (!global_options.x_flag_inhibit_size_directive) do { fputs ("\t.size\t", asm_out_file); assemble_name (asm_out_file, (( const char *) (tree_check ((cold_function_name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2024, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str )); fputs (", .-", asm_out_file); assemble_name (asm_out_file , ((const char *) (tree_check ((cold_function_name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2024, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str )); putc ('\n', asm_out_file); } while (0); } while (0) | ||||
2024 | IDENTIFIER_POINTER (cold_function_name),do { if (!global_options.x_flag_inhibit_size_directive) do { fputs ("\t.size\t", asm_out_file); assemble_name (asm_out_file, (( const char *) (tree_check ((cold_function_name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2024, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str )); fputs (", .-", asm_out_file); assemble_name (asm_out_file , ((const char *) (tree_check ((cold_function_name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2024, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str )); putc ('\n', asm_out_file); } while (0); } while (0) | ||||
2025 | decl)do { if (!global_options.x_flag_inhibit_size_directive) do { fputs ("\t.size\t", asm_out_file); assemble_name (asm_out_file, (( const char *) (tree_check ((cold_function_name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2024, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str )); fputs (", .-", asm_out_file); assemble_name (asm_out_file , ((const char *) (tree_check ((cold_function_name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2024, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str )); putc ('\n', asm_out_file); } while (0); } while (0); | ||||
2026 | #endif | ||||
2027 | ASM_OUTPUT_LABEL (asm_out_file, crtl->subsections.cold_section_end_label)do { assemble_name ((asm_out_file), ((&x_rtl)->subsections .cold_section_end_label)); fputs (":\n", (asm_out_file)); } while (0); | ||||
2028 | if (first_function_block_is_cold) | ||||
2029 | switch_to_section (text_section); | ||||
2030 | else | ||||
2031 | switch_to_section (function_section (decl)); | ||||
2032 | ASM_OUTPUT_LABEL (asm_out_file, crtl->subsections.hot_section_end_label)do { assemble_name ((asm_out_file), ((&x_rtl)->subsections .hot_section_end_label)); fputs (":\n", (asm_out_file)); } while (0); | ||||
2033 | switch_to_section (save_text_section); | ||||
2034 | } | ||||
2035 | } | ||||
2036 | |||||
2037 | /* Assemble code to leave SIZE bytes of zeros. */ | ||||
2038 | |||||
2039 | void | ||||
2040 | assemble_zeros (unsigned HOST_WIDE_INTlong size) | ||||
2041 | { | ||||
2042 | /* Do no output if -fsyntax-only. */ | ||||
2043 | if (flag_syntax_onlyglobal_options.x_flag_syntax_only) | ||||
2044 | return; | ||||
2045 | |||||
2046 | #ifdef ASM_NO_SKIP_IN_TEXT1 | ||||
2047 | /* The `space' pseudo in the text section outputs nop insns rather than 0s, | ||||
2048 | so we must output 0s explicitly in the text section. */ | ||||
2049 | if (ASM_NO_SKIP_IN_TEXT1 && (in_section->common.flags & SECTION_CODE) != 0) | ||||
2050 | { | ||||
2051 | unsigned HOST_WIDE_INTlong i; | ||||
2052 | for (i = 0; i < size; i++) | ||||
2053 | assemble_integer (const0_rtx(const_int_rtx[64]), 1, BITS_PER_UNIT(8), 1); | ||||
2054 | } | ||||
2055 | else | ||||
2056 | #endif | ||||
2057 | if (size > 0) | ||||
2058 | ASM_OUTPUT_SKIP (asm_out_file, size)fprintf ((asm_out_file), "%s" "%" "l" "u" "\n", "\t.zero\t", ( size)); | ||||
2059 | } | ||||
2060 | |||||
2061 | /* Assemble an alignment pseudo op for an ALIGN-bit boundary. */ | ||||
2062 | |||||
2063 | void | ||||
2064 | assemble_align (unsigned int align) | ||||
2065 | { | ||||
2066 | if (align > BITS_PER_UNIT(8)) | ||||
2067 | { | ||||
2068 | ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (align / BITS_PER_UNIT))if ((floor_log2 (align / (8))) != 0) fprintf ((asm_out_file), "\t.align %d\n", 1 << (floor_log2 (align / (8)))); | ||||
2069 | } | ||||
2070 | } | ||||
2071 | |||||
2072 | /* Assemble a string constant with the specified C string as contents. */ | ||||
2073 | |||||
2074 | void | ||||
2075 | assemble_string (const char *p, int size) | ||||
2076 | { | ||||
2077 | int pos = 0; | ||||
2078 | int maximum = 2000; | ||||
2079 | |||||
2080 | /* If the string is very long, split it up. */ | ||||
2081 | |||||
2082 | while (pos < size) | ||||
2083 | { | ||||
2084 | int thissize = size - pos; | ||||
2085 | if (thissize > maximum) | ||||
2086 | thissize = maximum; | ||||
2087 | |||||
2088 | ASM_OUTPUT_ASCII (asm_out_file, p, thissize)default_elf_asm_output_ascii ((asm_out_file), (p), (thissize) ); | ||||
2089 | |||||
2090 | pos += thissize; | ||||
2091 | p += thissize; | ||||
2092 | } | ||||
2093 | } | ||||
2094 | |||||
2095 | |||||
2096 | /* A noswitch_section_callback for lcomm_section. */ | ||||
2097 | |||||
2098 | static bool | ||||
2099 | emit_local (tree decl ATTRIBUTE_UNUSED__attribute__ ((__unused__)), | ||||
2100 | const char *name ATTRIBUTE_UNUSED__attribute__ ((__unused__)), | ||||
2101 | unsigned HOST_WIDE_INTlong size ATTRIBUTE_UNUSED__attribute__ ((__unused__)), | ||||
2102 | unsigned HOST_WIDE_INTlong rounded ATTRIBUTE_UNUSED__attribute__ ((__unused__))) | ||||
2103 | { | ||||
2104 | #if defined ASM_OUTPUT_ALIGNED_DECL_LOCAL | ||||
2105 | unsigned int align = symtab_node::get (decl)->definition_alignment (); | ||||
2106 | ASM_OUTPUT_ALIGNED_DECL_LOCAL (asm_out_file, decl, name,do { fprintf ((asm_out_file), "%s", "\t.local\t"); assemble_name ((asm_out_file), (name)); fprintf ((asm_out_file), "\n"); x86_elf_aligned_decl_common (asm_out_file, decl, name, size, align);; } while (0) | ||||
2107 | size, align)do { fprintf ((asm_out_file), "%s", "\t.local\t"); assemble_name ((asm_out_file), (name)); fprintf ((asm_out_file), "\n"); x86_elf_aligned_decl_common (asm_out_file, decl, name, size, align);; } while (0); | ||||
2108 | return true; | ||||
2109 | #elif defined ASM_OUTPUT_ALIGNED_LOCAL | ||||
2110 | unsigned int align = symtab_node::get (decl)->definition_alignment (); | ||||
2111 | ASM_OUTPUT_ALIGNED_LOCAL (asm_out_file, name, size, align)do { fprintf ((asm_out_file), "%s", "\t.local\t"); assemble_name ((asm_out_file), (name)); fprintf ((asm_out_file), "\n"); do { fprintf ((asm_out_file), "%s", "\t.comm\t"); assemble_name ((asm_out_file), (name)); fprintf ((asm_out_file), "," "%" "l" "u" ",%u\n", (size), (align) / (8)); } while (0); } while (0 ); | ||||
2112 | return true; | ||||
2113 | #else | ||||
2114 | ASM_OUTPUT_LOCAL (asm_out_file, name, size, rounded); | ||||
2115 | return false; | ||||
2116 | #endif | ||||
2117 | } | ||||
2118 | |||||
2119 | /* A noswitch_section_callback for bss_noswitch_section. */ | ||||
2120 | |||||
2121 | #if defined ASM_OUTPUT_ALIGNED_BSS | ||||
2122 | static bool | ||||
2123 | emit_bss (tree decl ATTRIBUTE_UNUSED__attribute__ ((__unused__)), | ||||
2124 | const char *name ATTRIBUTE_UNUSED__attribute__ ((__unused__)), | ||||
2125 | unsigned HOST_WIDE_INTlong size ATTRIBUTE_UNUSED__attribute__ ((__unused__)), | ||||
2126 | unsigned HOST_WIDE_INTlong rounded ATTRIBUTE_UNUSED__attribute__ ((__unused__))) | ||||
2127 | { | ||||
2128 | ASM_OUTPUT_ALIGNED_BSS (asm_out_file, decl, name, size,x86_output_aligned_bss (asm_out_file, decl, name, size, get_variable_align (decl)) | ||||
2129 | get_variable_align (decl))x86_output_aligned_bss (asm_out_file, decl, name, size, get_variable_align (decl)); | ||||
2130 | return true; | ||||
2131 | } | ||||
2132 | #endif | ||||
2133 | |||||
2134 | /* A noswitch_section_callback for comm_section. */ | ||||
2135 | |||||
2136 | static bool | ||||
2137 | emit_common (tree decl ATTRIBUTE_UNUSED__attribute__ ((__unused__)), | ||||
2138 | const char *name ATTRIBUTE_UNUSED__attribute__ ((__unused__)), | ||||
2139 | unsigned HOST_WIDE_INTlong size ATTRIBUTE_UNUSED__attribute__ ((__unused__)), | ||||
2140 | unsigned HOST_WIDE_INTlong rounded ATTRIBUTE_UNUSED__attribute__ ((__unused__))) | ||||
2141 | { | ||||
2142 | #if defined ASM_OUTPUT_ALIGNED_DECL_COMMON | ||||
2143 | ASM_OUTPUT_ALIGNED_DECL_COMMON (asm_out_file, decl, name,x86_elf_aligned_decl_common (asm_out_file, decl, name, size, get_variable_align (decl)); | ||||
2144 | size, get_variable_align (decl))x86_elf_aligned_decl_common (asm_out_file, decl, name, size, get_variable_align (decl));; | ||||
2145 | return true; | ||||
2146 | #elif defined ASM_OUTPUT_ALIGNED_COMMON | ||||
2147 | ASM_OUTPUT_ALIGNED_COMMON (asm_out_file, name, size,do { fprintf ((asm_out_file), "%s", "\t.comm\t"); assemble_name ((asm_out_file), (name)); fprintf ((asm_out_file), "," "%" "l" "u" ",%u\n", (size), (get_variable_align (decl)) / (8)); } while (0) | ||||
2148 | get_variable_align (decl))do { fprintf ((asm_out_file), "%s", "\t.comm\t"); assemble_name ((asm_out_file), (name)); fprintf ((asm_out_file), "," "%" "l" "u" ",%u\n", (size), (get_variable_align (decl)) / (8)); } while (0); | ||||
2149 | return true; | ||||
2150 | #else | ||||
2151 | ASM_OUTPUT_COMMON (asm_out_file, name, size, rounded); | ||||
2152 | return false; | ||||
2153 | #endif | ||||
2154 | } | ||||
2155 | |||||
2156 | /* A noswitch_section_callback for tls_comm_section. */ | ||||
2157 | |||||
2158 | static bool | ||||
2159 | emit_tls_common (tree decl ATTRIBUTE_UNUSED__attribute__ ((__unused__)), | ||||
2160 | const char *name ATTRIBUTE_UNUSED__attribute__ ((__unused__)), | ||||
2161 | unsigned HOST_WIDE_INTlong size ATTRIBUTE_UNUSED__attribute__ ((__unused__)), | ||||
2162 | unsigned HOST_WIDE_INTlong rounded ATTRIBUTE_UNUSED__attribute__ ((__unused__))) | ||||
2163 | { | ||||
2164 | #ifdef ASM_OUTPUT_TLS_COMMON | ||||
2165 | ASM_OUTPUT_TLS_COMMON (asm_out_file, decl, name, size)do { fprintf ((asm_out_file), "\t%s\t", ".tls_common"); assemble_name ((asm_out_file), (name)); fprintf ((asm_out_file), "," "%" "l" "u"",%u\n", (size), (((contains_struct_check ((decl), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2165, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2165, __FUNCTION__))->decl_common.align) - 1) : 0) / (8) ); } while (0); | ||||
2166 | return true; | ||||
2167 | #else | ||||
2168 | sorry ("thread-local COMMON data not implemented"); | ||||
2169 | return true; | ||||
2170 | #endif | ||||
2171 | } | ||||
2172 | |||||
2173 | /* Assemble DECL given that it belongs in SECTION_NOSWITCH section SECT. | ||||
2174 | NAME is the name of DECL's SYMBOL_REF. */ | ||||
2175 | |||||
2176 | static void | ||||
2177 | assemble_noswitch_variable (tree decl, const char *name, section *sect, | ||||
2178 | unsigned int align) | ||||
2179 | { | ||||
2180 | unsigned HOST_WIDE_INTlong size, rounded; | ||||
2181 | |||||
2182 | size = tree_to_uhwi (DECL_SIZE_UNIT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2182, __FUNCTION__))->decl_common.size_unit)); | ||||
2183 | rounded = size; | ||||
2184 | |||||
2185 | if ((flag_sanitizeglobal_options.x_flag_sanitize & SANITIZE_ADDRESS) && asan_protect_global (decl)) | ||||
2186 | size += asan_red_zone_size (size); | ||||
2187 | |||||
2188 | /* Don't allocate zero bytes of common, | ||||
2189 | since that means "undefined external" in the linker. */ | ||||
2190 | if (size == 0) | ||||
2191 | rounded = 1; | ||||
2192 | |||||
2193 | /* Round size up to multiple of BIGGEST_ALIGNMENT bits | ||||
2194 | so that each uninitialized object starts on such a boundary. */ | ||||
2195 | rounded += (BIGGEST_ALIGNMENT(((global_options.x_target_flags & (1U << 12)) != 0 ) ? 32 : (((global_options.x_ix86_isa_flags & (1UL << 15)) != 0) ? 512 : (((global_options.x_ix86_isa_flags & ( 1UL << 8)) != 0) ? 256 : 128))) / BITS_PER_UNIT(8)) - 1; | ||||
2196 | rounded = (rounded / (BIGGEST_ALIGNMENT(((global_options.x_target_flags & (1U << 12)) != 0 ) ? 32 : (((global_options.x_ix86_isa_flags & (1UL << 15)) != 0) ? 512 : (((global_options.x_ix86_isa_flags & ( 1UL << 8)) != 0) ? 256 : 128))) / BITS_PER_UNIT(8)) | ||||
2197 | * (BIGGEST_ALIGNMENT(((global_options.x_target_flags & (1U << 12)) != 0 ) ? 32 : (((global_options.x_ix86_isa_flags & (1UL << 15)) != 0) ? 512 : (((global_options.x_ix86_isa_flags & ( 1UL << 8)) != 0) ? 256 : 128))) / BITS_PER_UNIT(8))); | ||||
2198 | |||||
2199 | if (!sect->noswitch.callback (decl, name, size, rounded) | ||||
2200 | && (unsigned HOST_WIDE_INTlong) (align / BITS_PER_UNIT(8)) > rounded) | ||||
2201 | error ("requested alignment for %q+D is greater than " | ||||
2202 | "implemented alignment of %wu", decl, rounded); | ||||
2203 | } | ||||
2204 | |||||
2205 | /* A subroutine of assemble_variable. Output the label and contents of | ||||
2206 | DECL, whose address is a SYMBOL_REF with name NAME. DONT_OUTPUT_DATA | ||||
2207 | is as for assemble_variable. */ | ||||
2208 | |||||
2209 | static void | ||||
2210 | assemble_variable_contents (tree decl, const char *name, | ||||
2211 | bool dont_output_data, bool merge_strings) | ||||
2212 | { | ||||
2213 | /* Do any machine/system dependent processing of the object. */ | ||||
2214 | #ifdef ASM_DECLARE_OBJECT_NAME | ||||
2215 | last_assemble_variable_decl = decl; | ||||
2216 | ASM_DECLARE_OBJECT_NAME (asm_out_file, name, decl)do { long size; if (global_options.x_flag_gnu_unique && (decl_comdat_group (decl) != (tree) nullptr && (((decl )->base.public_flag) || ((contains_struct_check ((decl), ( TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2216, __FUNCTION__))->decl_common.decl_flag_1))) && (!((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2216, __FUNCTION__))->decl_common.artificial_flag) || !( (non_type_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2216, __FUNCTION__))->base.readonly_flag))) do { fputs ( "\t.type\t", asm_out_file); assemble_name (asm_out_file, name ); fputs (", ", asm_out_file); fprintf (asm_out_file, "@%s", "gnu_unique_object" ); putc ('\n', asm_out_file); } while (0); else do { fputs ("\t.type\t" , asm_out_file); assemble_name (asm_out_file, name); fputs (", " , asm_out_file); fprintf (asm_out_file, "@%s", "object"); putc ('\n', asm_out_file); } while (0); size_directive_output = 0 ; if (!global_options.x_flag_inhibit_size_directive && (decl) && ((contains_struct_check ((decl), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2216, __FUNCTION__))->decl_common.size)) { size_directive_output = 1; size = tree_to_uhwi (((contains_struct_check ((decl), ( TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2216, __FUNCTION__))->decl_common.size_unit)); do { long size_ = (size); fputs ("\t.size\t", asm_out_file); assemble_name (asm_out_file, name); fprintf (asm_out_file, ", " "%" "l" "d" "\n", size_); } while (0); } do { assemble_name ((asm_out_file ), (name)); fputs (":\n", (asm_out_file)); } while (0); } while (0); | ||||
2217 | #else | ||||
2218 | /* Standard thing is just output label for the object. */ | ||||
2219 | ASM_OUTPUT_LABEL (asm_out_file, name)do { assemble_name ((asm_out_file), (name)); fputs (":\n", (asm_out_file )); } while (0); | ||||
2220 | #endif /* ASM_DECLARE_OBJECT_NAME */ | ||||
2221 | |||||
2222 | if (!dont_output_data) | ||||
2223 | { | ||||
2224 | /* Caller is supposed to use varpool_get_constructor when it wants | ||||
2225 | to output the body. */ | ||||
2226 | gcc_assert (!in_lto_p || DECL_INITIAL (decl) != error_mark_node)((void)(!(!global_options.x_in_lto_p || ((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2226, __FUNCTION__))->decl_common.initial) != global_trees [TI_ERROR_MARK]) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2226, __FUNCTION__), 0 : 0)); | ||||
2227 | if (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2227, __FUNCTION__))->decl_common.initial) | ||||
2228 | && DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2228, __FUNCTION__))->decl_common.initial) != error_mark_nodeglobal_trees[TI_ERROR_MARK] | ||||
2229 | && !initializer_zerop (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2229, __FUNCTION__))->decl_common.initial))) | ||||
2230 | /* Output the actual data. */ | ||||
2231 | output_constant (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2231, __FUNCTION__))->decl_common.initial), | ||||
2232 | tree_to_uhwi (DECL_SIZE_UNIT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2232, __FUNCTION__))->decl_common.size_unit)), | ||||
2233 | get_variable_align (decl), | ||||
2234 | false, merge_strings); | ||||
2235 | else | ||||
2236 | /* Leave space for it. */ | ||||
2237 | assemble_zeros (tree_to_uhwi (DECL_SIZE_UNIT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2237, __FUNCTION__))->decl_common.size_unit))); | ||||
2238 | targetm.asm_out.decl_end (); | ||||
2239 | } | ||||
2240 | } | ||||
2241 | |||||
2242 | /* Write out assembly for the variable DECL, which is not defined in | ||||
2243 | the current translation unit. */ | ||||
2244 | void | ||||
2245 | assemble_undefined_decl (tree decl) | ||||
2246 | { | ||||
2247 | const char *name = XSTR (XEXP (DECL_RTL (decl), 0), 0)((((((((contains_struct_check ((decl), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2247, __FUNCTION__))->decl_with_rtl.rtl ? (decl)->decl_with_rtl .rtl : (make_decl_rtl (decl), (decl)->decl_with_rtl.rtl))) ->u.fld[0]).rt_rtx))->u.fld[0]).rt_str); | ||||
2248 | targetm.asm_out.assemble_undefined_decl (asm_out_file, name, decl); | ||||
2249 | } | ||||
2250 | |||||
2251 | /* Assemble everything that is needed for a variable or function declaration. | ||||
2252 | Not used for automatic variables, and not used for function definitions. | ||||
2253 | Should not be called for variables of incomplete structure type. | ||||
2254 | |||||
2255 | TOP_LEVEL is nonzero if this variable has file scope. | ||||
2256 | AT_END is nonzero if this is the special handling, at end of compilation, | ||||
2257 | to define things that have had only tentative definitions. | ||||
2258 | DONT_OUTPUT_DATA if nonzero means don't actually output the | ||||
2259 | initial value (that will be done by the caller). */ | ||||
2260 | |||||
2261 | void | ||||
2262 | assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED__attribute__ ((__unused__)), | ||||
2263 | int at_end ATTRIBUTE_UNUSED__attribute__ ((__unused__)), int dont_output_data) | ||||
2264 | { | ||||
2265 | const char *name; | ||||
2266 | rtx decl_rtl, symbol; | ||||
2267 | section *sect; | ||||
2268 | unsigned int align; | ||||
2269 | bool asan_protected = false; | ||||
2270 | |||||
2271 | /* This function is supposed to handle VARIABLES. Ensure we have one. */ | ||||
2272 | gcc_assert (VAR_P (decl))((void)(!((((enum tree_code) (decl)->base.code) == VAR_DECL )) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2272, __FUNCTION__), 0 : 0)); | ||||
2273 | |||||
2274 | /* Emulated TLS had better not get this far. */ | ||||
2275 | gcc_checking_assert (targetm.have_tls || !DECL_THREAD_LOCAL_P (decl))((void)(!(targetm.have_tls || !((((decl)->base.static_flag ) || ((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2275, __FUNCTION__))->decl_common.decl_flag_1)) && decl_tls_model (decl) >= TLS_MODEL_REAL)) ? fancy_abort ( "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2275, __FUNCTION__), 0 : 0)); | ||||
2276 | |||||
2277 | last_assemble_variable_decl = 0; | ||||
2278 | |||||
2279 | /* Normally no need to say anything here for external references, | ||||
2280 | since assemble_external is called by the language-specific code | ||||
2281 | when a declaration is first seen. */ | ||||
2282 | |||||
2283 | if (DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2283, __FUNCTION__))->decl_common.decl_flag_1)) | ||||
2284 | return; | ||||
2285 | |||||
2286 | /* Do nothing for global register variables. */ | ||||
2287 | if (DECL_RTL_SET_P (decl)(((tree_contains_struct[(((enum tree_code) (decl)->base.code ))][(TS_DECL_WRTL)])) && (contains_struct_check ((decl ), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2287, __FUNCTION__))->decl_with_rtl.rtl != nullptr) && REG_P (DECL_RTL (decl))(((enum rtx_code) (((contains_struct_check ((decl), (TS_DECL_WRTL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2287, __FUNCTION__))->decl_with_rtl.rtl ? (decl)->decl_with_rtl .rtl : (make_decl_rtl (decl), (decl)->decl_with_rtl.rtl))) ->code) == REG)) | ||||
2288 | { | ||||
2289 | TREE_ASM_WRITTEN (decl)((decl)->base.asm_written_flag) = 1; | ||||
2290 | return; | ||||
2291 | } | ||||
2292 | |||||
2293 | /* If type was incomplete when the variable was declared, | ||||
2294 | see if it is complete now. */ | ||||
2295 | |||||
2296 | if (DECL_SIZE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2296, __FUNCTION__))->decl_common.size) == 0) | ||||
2297 | layout_decl (decl, 0); | ||||
2298 | |||||
2299 | /* Still incomplete => don't allocate it; treat the tentative defn | ||||
2300 | (which is what it must have been) as an `extern' reference. */ | ||||
2301 | |||||
2302 | if (!dont_output_data && DECL_SIZE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2302, __FUNCTION__))->decl_common.size) == 0) | ||||
2303 | { | ||||
2304 | error ("storage size of %q+D isn%'t known", decl); | ||||
2305 | TREE_ASM_WRITTEN (decl)((decl)->base.asm_written_flag) = 1; | ||||
2306 | return; | ||||
2307 | } | ||||
2308 | |||||
2309 | /* The first declaration of a variable that comes through this function | ||||
2310 | decides whether it is global (in C, has external linkage) | ||||
2311 | or local (in C, has internal linkage). So do nothing more | ||||
2312 | if this function has already run. */ | ||||
2313 | |||||
2314 | if (TREE_ASM_WRITTEN (decl)((decl)->base.asm_written_flag)) | ||||
2315 | return; | ||||
2316 | |||||
2317 | /* Make sure targetm.encode_section_info is invoked before we set | ||||
2318 | ASM_WRITTEN. */ | ||||
2319 | decl_rtl = DECL_RTL (decl)((contains_struct_check ((decl), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2319, __FUNCTION__))->decl_with_rtl.rtl ? (decl)->decl_with_rtl .rtl : (make_decl_rtl (decl), (decl)->decl_with_rtl.rtl)); | ||||
2320 | |||||
2321 | TREE_ASM_WRITTEN (decl)((decl)->base.asm_written_flag) = 1; | ||||
2322 | |||||
2323 | /* Do no output if -fsyntax-only. */ | ||||
2324 | if (flag_syntax_onlyglobal_options.x_flag_syntax_only) | ||||
2325 | return; | ||||
2326 | |||||
2327 | if (! dont_output_data | ||||
2328 | && ! valid_constant_size_p (DECL_SIZE_UNIT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2328, __FUNCTION__))->decl_common.size_unit))) | ||||
2329 | { | ||||
2330 | error ("size of variable %q+D is too large", decl); | ||||
2331 | return; | ||||
2332 | } | ||||
2333 | |||||
2334 | gcc_assert (MEM_P (decl_rtl))((void)(!((((enum rtx_code) (decl_rtl)->code) == MEM)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2334, __FUNCTION__), 0 : 0)); | ||||
2335 | gcc_assert (GET_CODE (XEXP (decl_rtl, 0)) == SYMBOL_REF)((void)(!(((enum rtx_code) ((((decl_rtl)->u.fld[0]).rt_rtx ))->code) == SYMBOL_REF) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2335, __FUNCTION__), 0 : 0)); | ||||
2336 | symbol = XEXP (decl_rtl, 0)(((decl_rtl)->u.fld[0]).rt_rtx); | ||||
2337 | |||||
2338 | /* If this symbol belongs to the tree constant pool, output the constant | ||||
2339 | if it hasn't already been written. */ | ||||
2340 | if (TREE_CONSTANT_POOL_ADDRESS_P (symbol)(__extension__ ({ __typeof ((symbol)) const _rtx = ((symbol)) ; if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("TREE_CONSTANT_POOL_ADDRESS_P", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2340, __FUNCTION__); _rtx; })->frame_related)) | ||||
2341 | { | ||||
2342 | tree decl = SYMBOL_REF_DECL (symbol)((__extension__ ({ __typeof ((symbol)) const _rtx = ((symbol) ); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("CONSTANT_POOL_ADDRESS_P", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2342, __FUNCTION__); _rtx; })->unchanging) ? nullptr : ( (((symbol))->u.fld[1]).rt_tree)); | ||||
2343 | if (!TREE_ASM_WRITTEN (DECL_INITIAL (decl))((((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2343, __FUNCTION__))->decl_common.initial))->base.asm_written_flag )) | ||||
2344 | output_constant_def_contents (symbol); | ||||
2345 | return; | ||||
2346 | } | ||||
2347 | |||||
2348 | app_disable (); | ||||
2349 | |||||
2350 | name = XSTR (symbol, 0)(((symbol)->u.fld[0]).rt_str); | ||||
2351 | if (TREE_PUBLIC (decl)((decl)->base.public_flag) && DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2351, __FUNCTION__))->decl_minimal.name)) | ||||
2352 | notice_global_symbol (decl); | ||||
2353 | |||||
2354 | /* Compute the alignment of this data. */ | ||||
2355 | |||||
2356 | align_variable (decl, dont_output_data); | ||||
2357 | |||||
2358 | if ((flag_sanitizeglobal_options.x_flag_sanitize & SANITIZE_ADDRESS) | ||||
2359 | && asan_protect_global (decl)) | ||||
2360 | { | ||||
2361 | asan_protected = true; | ||||
2362 | SET_DECL_ALIGN (decl, MAX (DECL_ALIGN (decl),(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2363, __FUNCTION__))->decl_common.align) = ffs_hwi ((((( (contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2362, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2362, __FUNCTION__))->decl_common.align) - 1) : 0)) > (32 * (8)) ? ((((contains_struct_check ((decl), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2362, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2362, __FUNCTION__))->decl_common.align) - 1) : 0)) : (32 * (8))))) | ||||
2363 | ASAN_RED_ZONE_SIZE * BITS_PER_UNIT))(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2363, __FUNCTION__))->decl_common.align) = ffs_hwi ((((( (contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2362, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2362, __FUNCTION__))->decl_common.align) - 1) : 0)) > (32 * (8)) ? ((((contains_struct_check ((decl), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2362, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2362, __FUNCTION__))->decl_common.align) - 1) : 0)) : (32 * (8))))); | ||||
2364 | } | ||||
2365 | |||||
2366 | set_mem_align (decl_rtl, DECL_ALIGN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2366, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2366, __FUNCTION__))->decl_common.align) - 1) : 0)); | ||||
2367 | |||||
2368 | align = get_variable_align (decl); | ||||
2369 | |||||
2370 | if (TREE_PUBLIC (decl)((decl)->base.public_flag)) | ||||
2371 | maybe_assemble_visibility (decl); | ||||
2372 | |||||
2373 | if (DECL_PRESERVE_P (decl)(contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2373, __FUNCTION__))->decl_common.preserve_flag) | ||||
2374 | targetm.asm_out.mark_decl_preserved (name); | ||||
2375 | |||||
2376 | /* First make the assembler name(s) global if appropriate. */ | ||||
2377 | sect = get_variable_section (decl, false); | ||||
2378 | if (TREE_PUBLIC (decl)((decl)->base.public_flag) | ||||
2379 | && (sect->common.flags & SECTION_COMMON) == 0) | ||||
2380 | globalize_decl (decl); | ||||
2381 | |||||
2382 | /* Output any data that we will need to use the address of. */ | ||||
2383 | if (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2383, __FUNCTION__))->decl_common.initial) && DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2383, __FUNCTION__))->decl_common.initial) != error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
2384 | output_addressed_constants (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2384, __FUNCTION__))->decl_common.initial), 0); | ||||
2385 | |||||
2386 | /* dbxout.cc needs to know this. */ | ||||
2387 | if (sect && (sect->common.flags & SECTION_CODE) != 0) | ||||
2388 | DECL_IN_TEXT_SECTION (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2388, __FUNCTION__, (VAR_DECL)))->decl_with_vis.in_text_section ) = 1; | ||||
2389 | |||||
2390 | /* If the decl is part of an object_block, make sure that the decl | ||||
2391 | has been positioned within its block, but do not write out its | ||||
2392 | definition yet. output_object_blocks will do that later. */ | ||||
2393 | if (SYMBOL_REF_HAS_BLOCK_INFO_P (symbol)(((__extension__ ({ __typeof ((symbol)) const _rtx = ((symbol )); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("SYMBOL_REF_FLAGS", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2393, __FUNCTION__); _rtx; }) ->u2.symbol_ref_flags) & (1 << 7)) != 0) && SYMBOL_REF_BLOCK (symbol)((&(symbol)->u.block_sym)->block)) | ||||
2394 | { | ||||
2395 | gcc_assert (!dont_output_data)((void)(!(!dont_output_data) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2395, __FUNCTION__), 0 : 0)); | ||||
2396 | place_block_symbol (symbol); | ||||
2397 | } | ||||
2398 | else if (SECTION_STYLE (sect)((sect)->common.flags & SECTION_STYLE_MASK) == SECTION_NOSWITCH) | ||||
2399 | assemble_noswitch_variable (decl, name, sect, align); | ||||
2400 | else | ||||
2401 | { | ||||
2402 | /* Special-case handling of vtv comdat sections. */ | ||||
2403 | if (SECTION_STYLE (sect)((sect)->common.flags & SECTION_STYLE_MASK) == SECTION_NAMED | ||||
2404 | && (strcmp (sect->named.name, ".vtable_map_vars") == 0)) | ||||
2405 | handle_vtv_comdat_section (sect, decl); | ||||
2406 | else | ||||
2407 | switch_to_section (sect, decl); | ||||
2408 | if (align > BITS_PER_UNIT(8)) | ||||
2409 | ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (align / BITS_PER_UNIT))if ((floor_log2 (align / (8))) != 0) fprintf ((asm_out_file), "\t.align %d\n", 1 << (floor_log2 (align / (8)))); | ||||
2410 | assemble_variable_contents (decl, name, dont_output_data, | ||||
2411 | (sect->common.flags & SECTION_MERGE) | ||||
2412 | && (sect->common.flags & SECTION_STRINGS)); | ||||
2413 | if (asan_protected) | ||||
2414 | { | ||||
2415 | unsigned HOST_WIDE_INTlong int size | ||||
2416 | = tree_to_uhwi (DECL_SIZE_UNIT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2416, __FUNCTION__))->decl_common.size_unit)); | ||||
2417 | assemble_zeros (asan_red_zone_size (size)); | ||||
2418 | } | ||||
2419 | } | ||||
2420 | } | ||||
2421 | |||||
2422 | /* Return 1 if type TYPE contains any pointers. */ | ||||
2423 | |||||
2424 | static int | ||||
2425 | contains_pointers_p (tree type) | ||||
2426 | { | ||||
2427 | switch (TREE_CODE (type)((enum tree_code) (type)->base.code)) | ||||
2428 | { | ||||
2429 | case POINTER_TYPE: | ||||
2430 | case REFERENCE_TYPE: | ||||
2431 | /* I'm not sure whether OFFSET_TYPE needs this treatment, | ||||
2432 | so I'll play safe and return 1. */ | ||||
2433 | case OFFSET_TYPE: | ||||
2434 | return 1; | ||||
2435 | |||||
2436 | case RECORD_TYPE: | ||||
2437 | case UNION_TYPE: | ||||
2438 | case QUAL_UNION_TYPE: | ||||
2439 | { | ||||
2440 | tree fields; | ||||
2441 | /* For a type that has fields, see if the fields have pointers. */ | ||||
2442 | for (fields = TYPE_FIELDS (type)((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2442, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); fields; fields = DECL_CHAIN (fields)(((contains_struct_check (((contains_struct_check ((fields), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2442, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2442, __FUNCTION__))->common.chain))) | ||||
2443 | if (TREE_CODE (fields)((enum tree_code) (fields)->base.code) == FIELD_DECL | ||||
2444 | && contains_pointers_p (TREE_TYPE (fields)((contains_struct_check ((fields), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2444, __FUNCTION__))->typed.type))) | ||||
2445 | return 1; | ||||
2446 | return 0; | ||||
2447 | } | ||||
2448 | |||||
2449 | case ARRAY_TYPE: | ||||
2450 | /* An array type contains pointers if its element type does. */ | ||||
2451 | return contains_pointers_p (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2451, __FUNCTION__))->typed.type)); | ||||
2452 | |||||
2453 | default: | ||||
2454 | return 0; | ||||
2455 | } | ||||
2456 | } | ||||
2457 | |||||
2458 | /* We delay assemble_external processing until | ||||
2459 | the compilation unit is finalized. This is the best we can do for | ||||
2460 | right now (i.e. stage 3 of GCC 4.0) - the right thing is to delay | ||||
2461 | it all the way to final. See PR 17982 for further discussion. */ | ||||
2462 | static GTY(()) tree pending_assemble_externals; | ||||
2463 | |||||
2464 | #ifdef ASM_OUTPUT_EXTERNAL | ||||
2465 | /* Some targets delay some output to final using TARGET_ASM_FILE_END. | ||||
2466 | As a result, assemble_external can be called after the list of externals | ||||
2467 | is processed and the pointer set destroyed. */ | ||||
2468 | static bool pending_assemble_externals_processed; | ||||
2469 | |||||
2470 | /* Avoid O(external_decls**2) lookups in the pending_assemble_externals | ||||
2471 | TREE_LIST in assemble_external. */ | ||||
2472 | static hash_set<tree> *pending_assemble_externals_set; | ||||
2473 | |||||
2474 | /* True if DECL is a function decl for which no out-of-line copy exists. | ||||
2475 | It is assumed that DECL's assembler name has been set. */ | ||||
2476 | |||||
2477 | static bool | ||||
2478 | incorporeal_function_p (tree decl) | ||||
2479 | { | ||||
2480 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL && fndecl_built_in_p (decl)) | ||||
2481 | { | ||||
2482 | const char *name; | ||||
2483 | |||||
2484 | if (DECL_BUILT_IN_CLASS (decl)((built_in_class) (tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2484, __FUNCTION__, (FUNCTION_DECL)))->function_decl.built_in_class ) == BUILT_IN_NORMAL | ||||
2485 | && ALLOCA_FUNCTION_CODE_P (DECL_FUNCTION_CODE (decl))((DECL_FUNCTION_CODE (decl)) == BUILT_IN_ALLOCA || (DECL_FUNCTION_CODE (decl)) == BUILT_IN_ALLOCA_WITH_ALIGN || (DECL_FUNCTION_CODE (decl)) == BUILT_IN_ALLOCA_WITH_ALIGN_AND_MAX)) | ||||
2486 | return true; | ||||
2487 | |||||
2488 | name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl))((const char *) (tree_check ((decl_assembler_name (decl)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2488, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str ); | ||||
2489 | /* Atomic or sync builtins which have survived this far will be | ||||
2490 | resolved externally and therefore are not incorporeal. */ | ||||
2491 | if (startswith (name, "__builtin_")) | ||||
2492 | return true; | ||||
2493 | } | ||||
2494 | return false; | ||||
2495 | } | ||||
2496 | |||||
2497 | /* Actually do the tests to determine if this is necessary, and invoke | ||||
2498 | ASM_OUTPUT_EXTERNAL. */ | ||||
2499 | static void | ||||
2500 | assemble_external_real (tree decl) | ||||
2501 | { | ||||
2502 | rtx rtl = DECL_RTL (decl)((contains_struct_check ((decl), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2502, __FUNCTION__))->decl_with_rtl.rtl ? (decl)->decl_with_rtl .rtl : (make_decl_rtl (decl), (decl)->decl_with_rtl.rtl)); | ||||
2503 | |||||
2504 | if (MEM_P (rtl)(((enum rtx_code) (rtl)->code) == MEM) && GET_CODE (XEXP (rtl, 0))((enum rtx_code) ((((rtl)->u.fld[0]).rt_rtx))->code) == SYMBOL_REF | ||||
2505 | && !SYMBOL_REF_USED (XEXP (rtl, 0))(__extension__ ({ __typeof (((((rtl)->u.fld[0]).rt_rtx))) const _rtx = (((((rtl)->u.fld[0]).rt_rtx))); if (((enum rtx_code ) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("SYMBOL_REF_USED" , _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2505, __FUNCTION__); _rtx; })->used) | ||||
2506 | && !incorporeal_function_p (decl)) | ||||
2507 | { | ||||
2508 | /* Some systems do require some output. */ | ||||
2509 | SYMBOL_REF_USED (XEXP (rtl, 0))(__extension__ ({ __typeof (((((rtl)->u.fld[0]).rt_rtx))) const _rtx = (((((rtl)->u.fld[0]).rt_rtx))); if (((enum rtx_code ) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("SYMBOL_REF_USED" , _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2509, __FUNCTION__); _rtx; })->used) = 1; | ||||
2510 | ASM_OUTPUT_EXTERNAL (asm_out_file, decl, XSTR (XEXP (rtl, 0), 0))default_elf_asm_output_external (asm_out_file, decl, ((((((rtl )->u.fld[0]).rt_rtx))->u.fld[0]).rt_str)); | ||||
2511 | } | ||||
2512 | } | ||||
2513 | #endif | ||||
2514 | |||||
2515 | void | ||||
2516 | process_pending_assemble_externals (void) | ||||
2517 | { | ||||
2518 | #ifdef ASM_OUTPUT_EXTERNAL | ||||
2519 | tree list; | ||||
2520 | for (list = pending_assemble_externals; list; list = TREE_CHAIN (list)((contains_struct_check ((list), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2520, __FUNCTION__))->common.chain)) | ||||
2521 | assemble_external_real (TREE_VALUE (list)((tree_check ((list), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2521, __FUNCTION__, (TREE_LIST)))->list.value)); | ||||
2522 | |||||
2523 | pending_assemble_externals = 0; | ||||
2524 | pending_assemble_externals_processed = true; | ||||
2525 | delete pending_assemble_externals_set; | ||||
2526 | #endif | ||||
2527 | } | ||||
2528 | |||||
2529 | /* This TREE_LIST contains any weak symbol declarations waiting | ||||
2530 | to be emitted. */ | ||||
2531 | static GTY(()) tree weak_decls; | ||||
2532 | |||||
2533 | /* Output something to declare an external symbol to the assembler, | ||||
2534 | and qualifiers such as weakness. (Most assemblers don't need | ||||
2535 | extern declaration, so we normally output nothing.) Do nothing if | ||||
2536 | DECL is not external. */ | ||||
2537 | |||||
2538 | void | ||||
2539 | assemble_external (tree decl ATTRIBUTE_UNUSED__attribute__ ((__unused__))) | ||||
2540 | { | ||||
2541 | /* Make sure that the ASM_OUT_FILE is open. | ||||
2542 | If it's not, we should not be calling this function. */ | ||||
2543 | gcc_assert (asm_out_file)((void)(!(asm_out_file) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2543, __FUNCTION__), 0 : 0)); | ||||
2544 | |||||
2545 | /* In a perfect world, the following condition would be true. | ||||
2546 | Sadly, the Go front end emit assembly *from the front end*, | ||||
2547 | bypassing the call graph. See PR52739. Fix before GCC 4.8. */ | ||||
2548 | #if 0 | ||||
2549 | /* This function should only be called if we are expanding, or have | ||||
2550 | expanded, to RTL. | ||||
2551 | Ideally, only final.cc would be calling this function, but it is | ||||
2552 | not clear whether that would break things somehow. See PR 17982 | ||||
2553 | for further discussion. */ | ||||
2554 | gcc_assert (state == EXPANSION((void)(!(state == EXPANSION || state == FINISHED) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2555, __FUNCTION__), 0 : 0)) | ||||
2555 | || state == FINISHED)((void)(!(state == EXPANSION || state == FINISHED) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2555, __FUNCTION__), 0 : 0)); | ||||
2556 | #endif | ||||
2557 | |||||
2558 | if (!DECL_P (decl)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (decl)->base.code))] == tcc_declaration) || !DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2558, __FUNCTION__))->decl_common.decl_flag_1) || !TREE_PUBLIC (decl)((decl)->base.public_flag)) | ||||
2559 | return; | ||||
2560 | |||||
2561 | /* We want to output annotation for weak and external symbols at | ||||
2562 | very last to check if they are references or not. */ | ||||
2563 | |||||
2564 | if (TARGET_SUPPORTS_WEAK(1) | ||||
2565 | && DECL_WEAK (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2565, __FUNCTION__))->decl_with_vis.weak_flag) | ||||
2566 | /* TREE_STATIC is a weird and abused creature which is not | ||||
2567 | generally the right test for whether an entity has been | ||||
2568 | locally emitted, inlined or otherwise not-really-extern, but | ||||
2569 | for declarations that can be weak, it happens to be | ||||
2570 | match. */ | ||||
2571 | && !TREE_STATIC (decl)((decl)->base.static_flag) | ||||
2572 | && lookup_attribute ("weak", DECL_ATTRIBUTES (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2572, __FUNCTION__))->decl_common.attributes)) | ||||
2573 | && value_member (decl, weak_decls) == NULL_TREE(tree) nullptr) | ||||
2574 | weak_decls = tree_cons (NULLnullptr, decl, weak_decls); | ||||
2575 | |||||
2576 | #ifdef ASM_OUTPUT_EXTERNAL | ||||
2577 | if (pending_assemble_externals_processed) | ||||
2578 | { | ||||
2579 | assemble_external_real (decl); | ||||
2580 | return; | ||||
2581 | } | ||||
2582 | |||||
2583 | if (! pending_assemble_externals_set->add (decl)) | ||||
2584 | pending_assemble_externals = tree_cons (NULLnullptr, decl, | ||||
2585 | pending_assemble_externals); | ||||
2586 | #endif | ||||
2587 | } | ||||
2588 | |||||
2589 | /* Similar, for calling a library function FUN. */ | ||||
2590 | |||||
2591 | void | ||||
2592 | assemble_external_libcall (rtx fun) | ||||
2593 | { | ||||
2594 | /* Declare library function name external when first used, if nec. */ | ||||
2595 | if (! SYMBOL_REF_USED (fun)(__extension__ ({ __typeof ((fun)) const _rtx = ((fun)); if ( ((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("SYMBOL_REF_USED", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2595, __FUNCTION__); _rtx; })->used)) | ||||
2596 | { | ||||
2597 | SYMBOL_REF_USED (fun)(__extension__ ({ __typeof ((fun)) const _rtx = ((fun)); if ( ((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("SYMBOL_REF_USED", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2597, __FUNCTION__); _rtx; })->used) = 1; | ||||
2598 | targetm.asm_out.external_libcall (fun); | ||||
2599 | } | ||||
2600 | } | ||||
2601 | |||||
2602 | /* Assemble a label named NAME. */ | ||||
2603 | |||||
2604 | void | ||||
2605 | assemble_label (FILE *file, const char *name) | ||||
2606 | { | ||||
2607 | ASM_OUTPUT_LABEL (file, name)do { assemble_name ((file), (name)); fputs (":\n", (file)); } while (0); | ||||
2608 | } | ||||
2609 | |||||
2610 | /* Set the symbol_referenced flag for ID. */ | ||||
2611 | void | ||||
2612 | mark_referenced (tree id) | ||||
2613 | { | ||||
2614 | TREE_SYMBOL_REFERENCED (id)((tree_check ((id), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2614, __FUNCTION__, (IDENTIFIER_NODE)))->base.static_flag ) = 1; | ||||
2615 | } | ||||
2616 | |||||
2617 | /* Set the symbol_referenced flag for DECL and notify callgraph. */ | ||||
2618 | void | ||||
2619 | mark_decl_referenced (tree decl) | ||||
2620 | { | ||||
2621 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL) | ||||
2622 | { | ||||
2623 | /* Extern inline functions don't become needed when referenced. | ||||
2624 | If we know a method will be emitted in other TU and no new | ||||
2625 | functions can be marked reachable, just use the external | ||||
2626 | definition. */ | ||||
2627 | struct cgraph_node *node = cgraph_node::get_create (decl); | ||||
2628 | if (!DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2628, __FUNCTION__))->decl_common.decl_flag_1) | ||||
2629 | && !node->definition) | ||||
2630 | node->mark_force_output (); | ||||
2631 | } | ||||
2632 | else if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)) | ||||
2633 | { | ||||
2634 | varpool_node *node = varpool_node::get_create (decl); | ||||
2635 | /* C++ frontend use mark_decl_references to force COMDAT variables | ||||
2636 | to be output that might appear dead otherwise. */ | ||||
2637 | node->force_output = true; | ||||
2638 | } | ||||
2639 | /* else do nothing - we can get various sorts of CST nodes here, | ||||
2640 | which do not need to be marked. */ | ||||
2641 | } | ||||
2642 | |||||
2643 | |||||
2644 | /* Output to FILE (an assembly file) a reference to NAME. If NAME | ||||
2645 | starts with a *, the rest of NAME is output verbatim. Otherwise | ||||
2646 | NAME is transformed in a target-specific way (usually by the | ||||
2647 | addition of an underscore). */ | ||||
2648 | |||||
2649 | void | ||||
2650 | assemble_name_raw (FILE *file, const char *name) | ||||
2651 | { | ||||
2652 | if (name[0] == '*') | ||||
2653 | fputs (&name[1], file); | ||||
2654 | else | ||||
2655 | ASM_OUTPUT_LABELREF (file, name)do { fputs (user_label_prefix, (file)); fputs ((name), (file) ); } while (0); | ||||
2656 | } | ||||
2657 | |||||
2658 | /* Return NAME that should actually be emitted, looking through | ||||
2659 | transparent aliases. If NAME refers to an entity that is also | ||||
2660 | represented as a tree (like a function or variable), mark the entity | ||||
2661 | as referenced. */ | ||||
2662 | const char * | ||||
2663 | assemble_name_resolve (const char *name) | ||||
2664 | { | ||||
2665 | const char *real_name = targetm.strip_name_encoding (name); | ||||
2666 | tree id = maybe_get_identifier (real_name); | ||||
2667 | |||||
2668 | if (id) | ||||
2669 | { | ||||
2670 | tree id_orig = id; | ||||
2671 | |||||
2672 | mark_referenced (id); | ||||
2673 | ultimate_transparent_alias_target (&id); | ||||
2674 | if (id != id_orig) | ||||
2675 | name = IDENTIFIER_POINTER (id)((const char *) (tree_check ((id), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2675, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str ); | ||||
2676 | gcc_assert (! TREE_CHAIN (id))((void)(!(! ((contains_struct_check ((id), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2676, __FUNCTION__))->common.chain)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2676, __FUNCTION__), 0 : 0)); | ||||
2677 | } | ||||
2678 | |||||
2679 | return name; | ||||
2680 | } | ||||
2681 | |||||
2682 | /* Like assemble_name_raw, but should be used when NAME might refer to | ||||
2683 | an entity that is also represented as a tree (like a function or | ||||
2684 | variable). If NAME does refer to such an entity, that entity will | ||||
2685 | be marked as referenced. */ | ||||
2686 | |||||
2687 | void | ||||
2688 | assemble_name (FILE *file, const char *name) | ||||
2689 | { | ||||
2690 | assemble_name_raw (file, assemble_name_resolve (name)); | ||||
2691 | } | ||||
2692 | |||||
2693 | /* Allocate SIZE bytes writable static space with a gensym name | ||||
2694 | and return an RTX to refer to its address. */ | ||||
2695 | |||||
2696 | rtx | ||||
2697 | assemble_static_space (unsigned HOST_WIDE_INTlong size) | ||||
2698 | { | ||||
2699 | char name[17]; | ||||
2700 | const char *namestring; | ||||
2701 | rtx x; | ||||
2702 | |||||
2703 | ASM_GENERATE_INTERNAL_LABEL (name, "LF", const_labelno)do { char *__p; (name)[0] = '*'; (name)[1] = '.'; __p = stpcpy (&(name)[2], "LF"); sprint_ul (__p, (unsigned long) (const_labelno )); } while (0); | ||||
2704 | ++const_labelno; | ||||
2705 | namestring = ggc_strdup (name)ggc_alloc_string ((name), -1 ); | ||||
2706 | |||||
2707 | x = gen_rtx_SYMBOL_REF (Pmode, namestring)gen_rtx_fmt_s0_stat ((SYMBOL_REF), (((global_options.x_ix86_pmode == PMODE_DI ? (scalar_int_mode ((scalar_int_mode::from_int) E_DImode )) : (scalar_int_mode ((scalar_int_mode::from_int) E_SImode)) ))), ((namestring)) ); | ||||
2708 | SYMBOL_REF_FLAGS (x)(__extension__ ({ __typeof ((x)) const _rtx = ((x)); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("SYMBOL_REF_FLAGS", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2708, __FUNCTION__); _rtx; }) ->u2.symbol_ref_flags) = SYMBOL_FLAG_LOCAL(1 << 1); | ||||
2709 | |||||
2710 | #ifdef ASM_OUTPUT_ALIGNED_DECL_LOCAL | ||||
2711 | ASM_OUTPUT_ALIGNED_DECL_LOCAL (asm_out_file, NULL_TREE, name, size,do { fprintf ((asm_out_file), "%s", "\t.local\t"); assemble_name ((asm_out_file), (name)); fprintf ((asm_out_file), "\n"); x86_elf_aligned_decl_common (asm_out_file, (tree) nullptr, name, size, (((global_options .x_target_flags & (1U << 12)) != 0) ? 32 : (((global_options .x_ix86_isa_flags & (1UL << 15)) != 0) ? 512 : (((global_options .x_ix86_isa_flags & (1UL << 8)) != 0) ? 256 : 128)) ));; } while (0) | ||||
2712 | BIGGEST_ALIGNMENT)do { fprintf ((asm_out_file), "%s", "\t.local\t"); assemble_name ((asm_out_file), (name)); fprintf ((asm_out_file), "\n"); x86_elf_aligned_decl_common (asm_out_file, (tree) nullptr, name, size, (((global_options .x_target_flags & (1U << 12)) != 0) ? 32 : (((global_options .x_ix86_isa_flags & (1UL << 15)) != 0) ? 512 : (((global_options .x_ix86_isa_flags & (1UL << 8)) != 0) ? 256 : 128)) ));; } while (0); | ||||
2713 | #else | ||||
2714 | #ifdef ASM_OUTPUT_ALIGNED_LOCAL | ||||
2715 | ASM_OUTPUT_ALIGNED_LOCAL (asm_out_file, name, size, BIGGEST_ALIGNMENT)do { fprintf ((asm_out_file), "%s", "\t.local\t"); assemble_name ((asm_out_file), (name)); fprintf ((asm_out_file), "\n"); do { fprintf ((asm_out_file), "%s", "\t.comm\t"); assemble_name ((asm_out_file), (name)); fprintf ((asm_out_file), "," "%" "l" "u" ",%u\n", (size), ((((global_options.x_target_flags & (1U << 12)) != 0) ? 32 : (((global_options.x_ix86_isa_flags & (1UL << 15)) != 0) ? 512 : (((global_options.x_ix86_isa_flags & (1UL << 8)) != 0) ? 256 : 128)))) / (8)); } while (0); } while (0); | ||||
2716 | #else | ||||
2717 | { | ||||
2718 | /* Round size up to multiple of BIGGEST_ALIGNMENT bits | ||||
2719 | so that each uninitialized object starts on such a boundary. */ | ||||
2720 | /* Variable `rounded' might or might not be used in ASM_OUTPUT_LOCAL. */ | ||||
2721 | unsigned HOST_WIDE_INTlong rounded ATTRIBUTE_UNUSED__attribute__ ((__unused__)) | ||||
2722 | = ((size + (BIGGEST_ALIGNMENT(((global_options.x_target_flags & (1U << 12)) != 0 ) ? 32 : (((global_options.x_ix86_isa_flags & (1UL << 15)) != 0) ? 512 : (((global_options.x_ix86_isa_flags & ( 1UL << 8)) != 0) ? 256 : 128))) / BITS_PER_UNIT(8)) - 1) | ||||
2723 | / (BIGGEST_ALIGNMENT(((global_options.x_target_flags & (1U << 12)) != 0 ) ? 32 : (((global_options.x_ix86_isa_flags & (1UL << 15)) != 0) ? 512 : (((global_options.x_ix86_isa_flags & ( 1UL << 8)) != 0) ? 256 : 128))) / BITS_PER_UNIT(8)) | ||||
2724 | * (BIGGEST_ALIGNMENT(((global_options.x_target_flags & (1U << 12)) != 0 ) ? 32 : (((global_options.x_ix86_isa_flags & (1UL << 15)) != 0) ? 512 : (((global_options.x_ix86_isa_flags & ( 1UL << 8)) != 0) ? 256 : 128))) / BITS_PER_UNIT(8))); | ||||
2725 | ASM_OUTPUT_LOCAL (asm_out_file, name, size, rounded); | ||||
2726 | } | ||||
2727 | #endif | ||||
2728 | #endif | ||||
2729 | return x; | ||||
2730 | } | ||||
2731 | |||||
2732 | /* Assemble the static constant template for function entry trampolines. | ||||
2733 | This is done at most once per compilation. | ||||
2734 | Returns an RTX for the address of the template. */ | ||||
2735 | |||||
2736 | static GTY(()) rtx initial_trampoline; | ||||
2737 | |||||
2738 | rtx | ||||
2739 | assemble_trampoline_template (void) | ||||
2740 | { | ||||
2741 | char label[256]; | ||||
2742 | const char *name; | ||||
2743 | int align; | ||||
2744 | rtx symbol; | ||||
2745 | |||||
2746 | gcc_assert (targetm.asm_out.trampoline_template != NULL)((void)(!(targetm.asm_out.trampoline_template != nullptr) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2746, __FUNCTION__), 0 : 0)); | ||||
2747 | |||||
2748 | if (initial_trampoline) | ||||
2749 | return initial_trampoline; | ||||
2750 | |||||
2751 | /* By default, put trampoline templates in read-only data section. */ | ||||
2752 | |||||
2753 | #ifdef TRAMPOLINE_SECTION | ||||
2754 | switch_to_section (TRAMPOLINE_SECTION); | ||||
2755 | #else | ||||
2756 | switch_to_section (readonly_data_section); | ||||
2757 | #endif | ||||
2758 | |||||
2759 | /* Write the assembler code to define one. */ | ||||
2760 | align = floor_log2 (TRAMPOLINE_ALIGNMENT(lang_hooks.custom_function_descriptors && targetm.calls .custom_function_descriptors > 0 ? (((8)) > (2 * targetm .calls.custom_function_descriptors * (8)) ? ((8)) : (2 * targetm .calls.custom_function_descriptors * (8))) : (8)) / BITS_PER_UNIT(8)); | ||||
2761 | if (align > 0) | ||||
2762 | ASM_OUTPUT_ALIGN (asm_out_file, align)if ((align) != 0) fprintf ((asm_out_file), "\t.align %d\n", 1 << (align)); | ||||
2763 | |||||
2764 | targetm.asm_out.internal_label (asm_out_file, "LTRAMP", 0); | ||||
2765 | targetm.asm_out.trampoline_template (asm_out_file); | ||||
2766 | |||||
2767 | /* Record the rtl to refer to it. */ | ||||
2768 | ASM_GENERATE_INTERNAL_LABEL (label, "LTRAMP", 0)do { char *__p; (label)[0] = '*'; (label)[1] = '.'; __p = stpcpy (&(label)[2], "LTRAMP"); sprint_ul (__p, (unsigned long) (0)); } while (0); | ||||
2769 | name = ggc_strdup (label)ggc_alloc_string ((label), -1 ); | ||||
2770 | symbol = gen_rtx_SYMBOL_REF (Pmode, name)gen_rtx_fmt_s0_stat ((SYMBOL_REF), (((global_options.x_ix86_pmode == PMODE_DI ? (scalar_int_mode ((scalar_int_mode::from_int) E_DImode )) : (scalar_int_mode ((scalar_int_mode::from_int) E_SImode)) ))), ((name)) ); | ||||
2771 | SYMBOL_REF_FLAGS (symbol)(__extension__ ({ __typeof ((symbol)) const _rtx = ((symbol)) ; if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("SYMBOL_REF_FLAGS", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2771, __FUNCTION__); _rtx; }) ->u2.symbol_ref_flags) = SYMBOL_FLAG_LOCAL(1 << 1); | ||||
2772 | |||||
2773 | initial_trampoline = gen_const_mem (BLKmode((void) 0, E_BLKmode), symbol); | ||||
2774 | set_mem_align (initial_trampoline, TRAMPOLINE_ALIGNMENT(lang_hooks.custom_function_descriptors && targetm.calls .custom_function_descriptors > 0 ? (((8)) > (2 * targetm .calls.custom_function_descriptors * (8)) ? ((8)) : (2 * targetm .calls.custom_function_descriptors * (8))) : (8))); | ||||
2775 | set_mem_size (initial_trampoline, TRAMPOLINE_SIZE(((global_options.x_ix86_isa_flags & (1UL << 1)) != 0) ? 28 : 14)); | ||||
2776 | |||||
2777 | return initial_trampoline; | ||||
2778 | } | ||||
2779 | |||||
2780 | /* A and B are either alignments or offsets. Return the minimum alignment | ||||
2781 | that may be assumed after adding the two together. */ | ||||
2782 | |||||
2783 | static inline unsigned | ||||
2784 | min_align (unsigned int a, unsigned int b) | ||||
2785 | { | ||||
2786 | return least_bit_hwi (a | b); | ||||
2787 | } | ||||
2788 | |||||
2789 | /* Return the assembler directive for creating a given kind of integer | ||||
2790 | object. SIZE is the number of bytes in the object and ALIGNED_P | ||||
2791 | indicates whether it is known to be aligned. Return NULL if the | ||||
2792 | assembly dialect has no such directive. | ||||
2793 | |||||
2794 | The returned string should be printed at the start of a new line and | ||||
2795 | be followed immediately by the object's initial value. */ | ||||
2796 | |||||
2797 | const char * | ||||
2798 | integer_asm_op (int size, int aligned_p) | ||||
2799 | { | ||||
2800 | struct asm_int_op *ops; | ||||
2801 | |||||
2802 | if (aligned_p) | ||||
2803 | ops = &targetm.asm_out.aligned_op; | ||||
2804 | else | ||||
2805 | ops = &targetm.asm_out.unaligned_op; | ||||
2806 | |||||
2807 | switch (size) | ||||
2808 | { | ||||
2809 | case 1: | ||||
2810 | return targetm.asm_out.byte_op; | ||||
2811 | case 2: | ||||
2812 | return ops->hi; | ||||
2813 | case 3: | ||||
2814 | return ops->psi; | ||||
2815 | case 4: | ||||
2816 | return ops->si; | ||||
2817 | case 5: | ||||
2818 | case 6: | ||||
2819 | case 7: | ||||
2820 | return ops->pdi; | ||||
2821 | case 8: | ||||
2822 | return ops->di; | ||||
2823 | case 9: | ||||
2824 | case 10: | ||||
2825 | case 11: | ||||
2826 | case 12: | ||||
2827 | case 13: | ||||
2828 | case 14: | ||||
2829 | case 15: | ||||
2830 | return ops->pti; | ||||
2831 | case 16: | ||||
2832 | return ops->ti; | ||||
2833 | default: | ||||
2834 | return NULLnullptr; | ||||
2835 | } | ||||
2836 | } | ||||
2837 | |||||
2838 | /* Use directive OP to assemble an integer object X. Print OP at the | ||||
2839 | start of the line, followed immediately by the value of X. */ | ||||
2840 | |||||
2841 | void | ||||
2842 | assemble_integer_with_op (const char *op, rtx x) | ||||
2843 | { | ||||
2844 | fputs (op, asm_out_file); | ||||
2845 | output_addr_const (asm_out_file, x); | ||||
2846 | fputc ('\n', asm_out_file); | ||||
2847 | } | ||||
2848 | |||||
2849 | /* The default implementation of the asm_out.integer target hook. */ | ||||
2850 | |||||
2851 | bool | ||||
2852 | default_assemble_integer (rtx x ATTRIBUTE_UNUSED__attribute__ ((__unused__)), | ||||
2853 | unsigned int size ATTRIBUTE_UNUSED__attribute__ ((__unused__)), | ||||
2854 | int aligned_p ATTRIBUTE_UNUSED__attribute__ ((__unused__))) | ||||
2855 | { | ||||
2856 | const char *op = integer_asm_op (size, aligned_p); | ||||
2857 | /* Avoid GAS bugs for large values. Specifically negative values whose | ||||
2858 | absolute value fits in a bfd_vma, but not in a bfd_signed_vma. */ | ||||
2859 | if (size > UNITS_PER_WORD(((global_options.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4) && size > POINTER_SIZE_UNITS(((((global_options.x_ix86_isa_flags & (1UL << 58)) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) + (8) - 1) / (8))) | ||||
2860 | return false; | ||||
2861 | return op && (assemble_integer_with_op (op, x), true); | ||||
2862 | } | ||||
2863 | |||||
2864 | /* Assemble the integer constant X into an object of SIZE bytes. ALIGN is | ||||
2865 | the alignment of the integer in bits. Return 1 if we were able to output | ||||
2866 | the constant, otherwise 0. We must be able to output the constant, | ||||
2867 | if FORCE is nonzero. */ | ||||
2868 | |||||
2869 | bool | ||||
2870 | assemble_integer (rtx x, unsigned int size, unsigned int align, int force) | ||||
2871 | { | ||||
2872 | int aligned_p; | ||||
2873 | |||||
2874 | aligned_p = (align >= MIN (size * BITS_PER_UNIT, BIGGEST_ALIGNMENT)((size * (8)) < ((((global_options.x_target_flags & (1U << 12)) != 0) ? 32 : (((global_options.x_ix86_isa_flags & (1UL << 15)) != 0) ? 512 : (((global_options.x_ix86_isa_flags & (1UL << 8)) != 0) ? 256 : 128)))) ? (size * (8)) : ((((global_options.x_target_flags & (1U << 12)) != 0) ? 32 : (((global_options.x_ix86_isa_flags & (1UL << 15)) != 0) ? 512 : (((global_options.x_ix86_isa_flags & ( 1UL << 8)) != 0) ? 256 : 128)))))); | ||||
2875 | |||||
2876 | /* See if the target hook can handle this kind of object. */ | ||||
2877 | if (targetm.asm_out.integer (x, size, aligned_p)) | ||||
2878 | return true; | ||||
2879 | |||||
2880 | /* If the object is a multi-byte one, try splitting it up. Split | ||||
2881 | it into words it if is multi-word, otherwise split it into bytes. */ | ||||
2882 | if (size > 1) | ||||
2883 | { | ||||
2884 | machine_mode omode, imode; | ||||
2885 | unsigned int subalign; | ||||
2886 | unsigned int subsize, i; | ||||
2887 | enum mode_class mclass; | ||||
2888 | |||||
2889 | subsize = size > UNITS_PER_WORD(((global_options.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4)? UNITS_PER_WORD(((global_options.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4) : 1; | ||||
2890 | subalign = MIN (align, subsize * BITS_PER_UNIT)((align) < (subsize * (8)) ? (align) : (subsize * (8))); | ||||
2891 | if (GET_CODE (x)((enum rtx_code) (x)->code) == CONST_FIXED) | ||||
2892 | mclass = GET_MODE_CLASS (GET_MODE (x))((enum mode_class) mode_class[((machine_mode) (x)->mode)]); | ||||
2893 | else | ||||
2894 | mclass = MODE_INT; | ||||
2895 | |||||
2896 | omode = mode_for_size (subsize * BITS_PER_UNIT(8), mclass, 0).require (); | ||||
2897 | imode = mode_for_size (size * BITS_PER_UNIT(8), mclass, 0).require (); | ||||
2898 | |||||
2899 | for (i = 0; i < size; i += subsize) | ||||
2900 | { | ||||
2901 | rtx partial = simplify_subreg (omode, x, imode, i); | ||||
2902 | if (!partial || !assemble_integer (partial, subsize, subalign, 0)) | ||||
2903 | break; | ||||
2904 | } | ||||
2905 | if (i == size) | ||||
2906 | return true; | ||||
2907 | |||||
2908 | /* If we've printed some of it, but not all of it, there's no going | ||||
2909 | back now. */ | ||||
2910 | gcc_assert (!i)((void)(!(!i) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2910, __FUNCTION__), 0 : 0)); | ||||
2911 | } | ||||
2912 | |||||
2913 | gcc_assert (!force)((void)(!(!force) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2913, __FUNCTION__), 0 : 0)); | ||||
2914 | |||||
2915 | return false; | ||||
2916 | } | ||||
2917 | |||||
2918 | /* Assemble the floating-point constant D into an object of size MODE. ALIGN | ||||
2919 | is the alignment of the constant in bits. If REVERSE is true, D is output | ||||
2920 | in reverse storage order. */ | ||||
2921 | |||||
2922 | void | ||||
2923 | assemble_real (REAL_VALUE_TYPEstruct real_value d, scalar_float_mode mode, unsigned int align, | ||||
2924 | bool reverse) | ||||
2925 | { | ||||
2926 | long data[4] = {0, 0, 0, 0}; | ||||
2927 | int bitsize, nelts, nunits, units_per; | ||||
2928 | rtx elt; | ||||
2929 | |||||
2930 | /* This is hairy. We have a quantity of known size. real_to_target | ||||
2931 | will put it into an array of *host* longs, 32 bits per element | ||||
2932 | (even if long is more than 32 bits). We need to determine the | ||||
2933 | number of array elements that are occupied (nelts) and the number | ||||
2934 | of *target* min-addressable units that will be occupied in the | ||||
2935 | object file (nunits). We cannot assume that 32 divides the | ||||
2936 | mode's bitsize (size * BITS_PER_UNIT) evenly. | ||||
2937 | |||||
2938 | size * BITS_PER_UNIT is used here to make sure that padding bits | ||||
2939 | (which might appear at either end of the value; real_to_target | ||||
2940 | will include the padding bits in its output array) are included. */ | ||||
2941 | |||||
2942 | nunits = GET_MODE_SIZE (mode); | ||||
2943 | bitsize = nunits * BITS_PER_UNIT(8); | ||||
2944 | nelts = CEIL (bitsize, 32)(((bitsize) + (32) - 1) / (32)); | ||||
2945 | units_per = 32 / BITS_PER_UNIT(8); | ||||
2946 | |||||
2947 | real_to_target (data, &d, mode); | ||||
2948 | |||||
2949 | /* Put out the first word with the specified alignment. */ | ||||
2950 | unsigned int chunk_nunits = MIN (nunits, units_per)((nunits) < (units_per) ? (nunits) : (units_per)); | ||||
2951 | if (reverse) | ||||
2952 | elt = flip_storage_order (SImode(scalar_int_mode ((scalar_int_mode::from_int) E_SImode)), gen_int_mode (data[nelts - 1], SImode(scalar_int_mode ((scalar_int_mode::from_int) E_SImode)))); | ||||
2953 | else | ||||
2954 | elt = GEN_INT (sext_hwi (data[0], chunk_nunits * BITS_PER_UNIT))gen_rtx_CONST_INT (((void) 0, E_VOIDmode), (sext_hwi (data[0] , chunk_nunits * (8)))); | ||||
2955 | assemble_integer (elt, chunk_nunits, align, 1); | ||||
2956 | nunits -= chunk_nunits; | ||||
2957 | |||||
2958 | /* Subsequent words need only 32-bit alignment. */ | ||||
2959 | align = min_align (align, 32); | ||||
2960 | |||||
2961 | for (int i = 1; i < nelts; i++) | ||||
2962 | { | ||||
2963 | chunk_nunits = MIN (nunits, units_per)((nunits) < (units_per) ? (nunits) : (units_per)); | ||||
2964 | if (reverse) | ||||
2965 | elt = flip_storage_order (SImode(scalar_int_mode ((scalar_int_mode::from_int) E_SImode)), | ||||
2966 | gen_int_mode (data[nelts - 1 - i], SImode(scalar_int_mode ((scalar_int_mode::from_int) E_SImode)))); | ||||
2967 | else | ||||
2968 | elt = GEN_INT (sext_hwi (data[i], chunk_nunits * BITS_PER_UNIT))gen_rtx_CONST_INT (((void) 0, E_VOIDmode), (sext_hwi (data[i] , chunk_nunits * (8)))); | ||||
2969 | assemble_integer (elt, chunk_nunits, align, 1); | ||||
2970 | nunits -= chunk_nunits; | ||||
2971 | } | ||||
2972 | } | ||||
2973 | |||||
2974 | /* Given an expression EXP with a constant value, | ||||
2975 | reduce it to the sum of an assembler symbol and an integer. | ||||
2976 | Store them both in the structure *VALUE. | ||||
2977 | EXP must be reducible. */ | ||||
2978 | |||||
2979 | class addr_const { | ||||
2980 | public: | ||||
2981 | rtx base; | ||||
2982 | poly_int64 offset; | ||||
2983 | }; | ||||
2984 | |||||
2985 | static void | ||||
2986 | decode_addr_const (tree exp, class addr_const *value) | ||||
2987 | { | ||||
2988 | tree target = TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2988, __FUNCTION__))))); | ||||
2989 | poly_int64 offset = 0; | ||||
2990 | rtx x; | ||||
2991 | |||||
2992 | while (1) | ||||
2993 | { | ||||
2994 | poly_int64 bytepos; | ||||
2995 | if (TREE_CODE (target)((enum tree_code) (target)->base.code) == COMPONENT_REF | ||||
2996 | && poly_int_tree_p (byte_position (TREE_OPERAND (target, 1)(*((const_cast<tree*> (tree_operand_check ((target), (1 ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 2996, __FUNCTION__)))))), | ||||
2997 | &bytepos)) | ||||
2998 | { | ||||
2999 | offset += bytepos; | ||||
3000 | target = TREE_OPERAND (target, 0)(*((const_cast<tree*> (tree_operand_check ((target), (0 ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3000, __FUNCTION__))))); | ||||
3001 | } | ||||
3002 | else if (TREE_CODE (target)((enum tree_code) (target)->base.code) == ARRAY_REF | ||||
3003 | || TREE_CODE (target)((enum tree_code) (target)->base.code) == ARRAY_RANGE_REF) | ||||
3004 | { | ||||
3005 | /* Truncate big offset. */ | ||||
3006 | offset | ||||
3007 | += (TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (target)))((unsigned long) (*tree_int_cst_elt_check ((((tree_class_check ((((contains_struct_check ((target), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3007, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3007, __FUNCTION__))->type_common.size_unit)), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3007, __FUNCTION__))) | ||||
3008 | * wi::to_poly_widest (TREE_OPERAND (target, 1)(*((const_cast<tree*> (tree_operand_check ((target), (1 ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3008, __FUNCTION__)))))).force_shwi ()); | ||||
3009 | target = TREE_OPERAND (target, 0)(*((const_cast<tree*> (tree_operand_check ((target), (0 ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3009, __FUNCTION__))))); | ||||
3010 | } | ||||
3011 | else if (TREE_CODE (target)((enum tree_code) (target)->base.code) == MEM_REF | ||||
3012 | && TREE_CODE (TREE_OPERAND (target, 0))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check ((target), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3012, __FUNCTION__))))))->base.code) == ADDR_EXPR) | ||||
3013 | { | ||||
3014 | offset += mem_ref_offset (target).force_shwi (); | ||||
3015 | target = TREE_OPERAND (TREE_OPERAND (target, 0), 0)(*((const_cast<tree*> (tree_operand_check (((*((const_cast <tree*> (tree_operand_check ((target), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3015, __FUNCTION__)))))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3015, __FUNCTION__))))); | ||||
3016 | } | ||||
3017 | else if (TREE_CODE (target)((enum tree_code) (target)->base.code) == INDIRECT_REF | ||||
3018 | && TREE_CODE (TREE_OPERAND (target, 0))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check ((target), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3018, __FUNCTION__))))))->base.code) == NOP_EXPR | ||||
3019 | && TREE_CODE (TREE_OPERAND (TREE_OPERAND (target, 0), 0))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check (((*((const_cast<tree*> (tree_operand_check ((target), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3019, __FUNCTION__)))))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3019, __FUNCTION__))))))->base.code) | ||||
3020 | == ADDR_EXPR) | ||||
3021 | target = TREE_OPERAND (TREE_OPERAND (TREE_OPERAND (target, 0), 0), 0)(*((const_cast<tree*> (tree_operand_check (((*((const_cast <tree*> (tree_operand_check (((*((const_cast<tree*> (tree_operand_check ((target), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3021, __FUNCTION__)))))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3021, __FUNCTION__)))))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3021, __FUNCTION__))))); | ||||
3022 | else | ||||
3023 | break; | ||||
3024 | } | ||||
3025 | |||||
3026 | switch (TREE_CODE (target)((enum tree_code) (target)->base.code)) | ||||
3027 | { | ||||
3028 | case VAR_DECL: | ||||
3029 | case FUNCTION_DECL: | ||||
3030 | x = DECL_RTL (target)((contains_struct_check ((target), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3030, __FUNCTION__))->decl_with_rtl.rtl ? (target)->decl_with_rtl .rtl : (make_decl_rtl (target), (target)->decl_with_rtl.rtl )); | ||||
3031 | break; | ||||
3032 | |||||
3033 | case LABEL_DECL: | ||||
3034 | x = gen_rtx_MEM (FUNCTION_MODE(scalar_int_mode ((scalar_int_mode::from_int) E_QImode)), | ||||
3035 | gen_rtx_LABEL_REF (Pmode, force_label_rtx (target))gen_rtx_fmt_u_stat ((LABEL_REF), (((global_options.x_ix86_pmode == PMODE_DI ? (scalar_int_mode ((scalar_int_mode::from_int) E_DImode )) : (scalar_int_mode ((scalar_int_mode::from_int) E_SImode)) ))), ((force_label_rtx (target))) )); | ||||
3036 | break; | ||||
3037 | |||||
3038 | case REAL_CST: | ||||
3039 | case FIXED_CST: | ||||
3040 | case STRING_CST: | ||||
3041 | case COMPLEX_CST: | ||||
3042 | case CONSTRUCTOR: | ||||
3043 | case INTEGER_CST: | ||||
3044 | x = lookup_constant_def (target); | ||||
3045 | /* Should have been added by output_addressed_constants. */ | ||||
3046 | gcc_assert (x)((void)(!(x) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3046, __FUNCTION__), 0 : 0)); | ||||
3047 | break; | ||||
3048 | |||||
3049 | case INDIRECT_REF: | ||||
3050 | /* This deals with absolute addresses. */ | ||||
3051 | offset += tree_to_shwi (TREE_OPERAND (target, 0)(*((const_cast<tree*> (tree_operand_check ((target), (0 ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3051, __FUNCTION__)))))); | ||||
3052 | x = gen_rtx_MEM (QImode(scalar_int_mode ((scalar_int_mode::from_int) E_QImode)), | ||||
3053 | gen_rtx_SYMBOL_REF (Pmode, "origin of addresses")gen_rtx_fmt_s0_stat ((SYMBOL_REF), (((global_options.x_ix86_pmode == PMODE_DI ? (scalar_int_mode ((scalar_int_mode::from_int) E_DImode )) : (scalar_int_mode ((scalar_int_mode::from_int) E_SImode)) ))), (("origin of addresses")) )); | ||||
3054 | break; | ||||
3055 | |||||
3056 | case COMPOUND_LITERAL_EXPR: | ||||
3057 | gcc_assert (COMPOUND_LITERAL_EXPR_DECL (target))((void)(!((*((const_cast<tree*> (tree_operand_check ((( tree_check (((*((const_cast<tree*> (tree_operand_check ( ((tree_check ((target), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3057, __FUNCTION__, (COMPOUND_LITERAL_EXPR)))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3057, __FUNCTION__)))))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3057, __FUNCTION__, (DECL_EXPR)))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3057, __FUNCTION__)))))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3057, __FUNCTION__), 0 : 0)); | ||||
3058 | x = DECL_RTL (COMPOUND_LITERAL_EXPR_DECL (target))((contains_struct_check (((*((const_cast<tree*> (tree_operand_check (((tree_check (((*((const_cast<tree*> (tree_operand_check (((tree_check ((target), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3058, __FUNCTION__, (COMPOUND_LITERAL_EXPR)))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3058, __FUNCTION__)))))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3058, __FUNCTION__, (DECL_EXPR)))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3058, __FUNCTION__)))))), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3058, __FUNCTION__))->decl_with_rtl.rtl ? ((*((const_cast <tree*> (tree_operand_check (((tree_check (((*((const_cast <tree*> (tree_operand_check (((tree_check ((target), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3058, __FUNCTION__, (COMPOUND_LITERAL_EXPR)))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3058, __FUNCTION__)))))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3058, __FUNCTION__, (DECL_EXPR)))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3058, __FUNCTION__))))))->decl_with_rtl.rtl : (make_decl_rtl ((*((const_cast<tree*> (tree_operand_check (((tree_check (((*((const_cast<tree*> (tree_operand_check (((tree_check ((target), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3058, __FUNCTION__, (COMPOUND_LITERAL_EXPR)))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3058, __FUNCTION__)))))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3058, __FUNCTION__, (DECL_EXPR)))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3058, __FUNCTION__)))))), ((*((const_cast<tree*> (tree_operand_check (((tree_check (((*((const_cast<tree*> (tree_operand_check (((tree_check ((target), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3058, __FUNCTION__, (COMPOUND_LITERAL_EXPR)))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3058, __FUNCTION__)))))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3058, __FUNCTION__, (DECL_EXPR)))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3058, __FUNCTION__))))))->decl_with_rtl.rtl)); | ||||
3059 | break; | ||||
3060 | |||||
3061 | default: | ||||
3062 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3062, __FUNCTION__)); | ||||
3063 | } | ||||
3064 | |||||
3065 | gcc_assert (MEM_P (x))((void)(!((((enum rtx_code) (x)->code) == MEM)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3065, __FUNCTION__), 0 : 0)); | ||||
3066 | x = XEXP (x, 0)(((x)->u.fld[0]).rt_rtx); | ||||
3067 | |||||
3068 | value->base = x; | ||||
3069 | value->offset = offset; | ||||
3070 | } | ||||
3071 | |||||
3072 | static GTY(()) hash_table<tree_descriptor_hasher> *const_desc_htab; | ||||
3073 | |||||
3074 | static void maybe_output_constant_def_contents (struct constant_descriptor_tree *, int); | ||||
3075 | |||||
3076 | /* Constant pool accessor function. */ | ||||
3077 | |||||
3078 | hash_table<tree_descriptor_hasher> * | ||||
3079 | constant_pool_htab (void) | ||||
3080 | { | ||||
3081 | return const_desc_htab; | ||||
3082 | } | ||||
3083 | |||||
3084 | /* Compute a hash code for a constant expression. */ | ||||
3085 | |||||
3086 | hashval_t | ||||
3087 | tree_descriptor_hasher::hash (constant_descriptor_tree *ptr) | ||||
3088 | { | ||||
3089 | return ptr->hash; | ||||
3090 | } | ||||
3091 | |||||
3092 | static hashval_t | ||||
3093 | const_hash_1 (const tree exp) | ||||
3094 | { | ||||
3095 | const char *p; | ||||
3096 | hashval_t hi; | ||||
3097 | int len, i; | ||||
3098 | enum tree_code code = TREE_CODE (exp)((enum tree_code) (exp)->base.code); | ||||
3099 | |||||
3100 | /* Either set P and LEN to the address and len of something to hash and | ||||
3101 | exit the switch or return a value. */ | ||||
3102 | |||||
3103 | switch (code) | ||||
3104 | { | ||||
3105 | case INTEGER_CST: | ||||
3106 | p = (char *) &TREE_INT_CST_ELT (exp, 0)(*tree_int_cst_elt_check ((exp), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3106, __FUNCTION__)); | ||||
3107 | len = TREE_INT_CST_NUNITS (exp)((tree_check ((exp), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3107, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.unextended ) * sizeof (HOST_WIDE_INTlong); | ||||
3108 | break; | ||||
3109 | |||||
3110 | case REAL_CST: | ||||
3111 | return real_hash (TREE_REAL_CST_PTR (exp)(&(tree_check ((exp), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3111, __FUNCTION__, (REAL_CST)))->real_cst.value)); | ||||
3112 | |||||
3113 | case FIXED_CST: | ||||
3114 | return fixed_hash (TREE_FIXED_CST_PTR (exp)((tree_check ((exp), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3114, __FUNCTION__, (FIXED_CST)))->fixed_cst.fixed_cst_ptr )); | ||||
3115 | |||||
3116 | case STRING_CST: | ||||
3117 | p = TREE_STRING_POINTER (exp)((const char *)((tree_check ((exp), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3117, __FUNCTION__, (STRING_CST)))->string.str)); | ||||
3118 | len = TREE_STRING_LENGTH (exp)((tree_check ((exp), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3118, __FUNCTION__, (STRING_CST)))->string.length); | ||||
3119 | break; | ||||
3120 | |||||
3121 | case COMPLEX_CST: | ||||
3122 | return (const_hash_1 (TREE_REALPART (exp)((tree_check ((exp), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3122, __FUNCTION__, (COMPLEX_CST)))->complex.real)) * 5 | ||||
3123 | + const_hash_1 (TREE_IMAGPART (exp)((tree_check ((exp), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3123, __FUNCTION__, (COMPLEX_CST)))->complex.imag))); | ||||
3124 | |||||
3125 | case VECTOR_CST: | ||||
3126 | { | ||||
3127 | hi = 7 + VECTOR_CST_NPATTERNS (exp)(1U << ((tree_check ((exp), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3127, __FUNCTION__, (VECTOR_CST)))->base.u.vector_cst.log2_npatterns )); | ||||
3128 | hi = hi * 563 + VECTOR_CST_NELTS_PER_PATTERN (exp)((tree_check ((exp), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3128, __FUNCTION__, (VECTOR_CST)))->base.u.vector_cst.nelts_per_pattern ); | ||||
3129 | unsigned int count = vector_cst_encoded_nelts (exp); | ||||
3130 | for (unsigned int i = 0; i < count; ++i) | ||||
3131 | hi = hi * 563 + const_hash_1 (VECTOR_CST_ENCODED_ELT (exp, i)((tree_check ((exp), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3131, __FUNCTION__, (VECTOR_CST)))->vector.elts[i])); | ||||
3132 | return hi; | ||||
3133 | } | ||||
3134 | |||||
3135 | case CONSTRUCTOR: | ||||
3136 | { | ||||
3137 | unsigned HOST_WIDE_INTlong idx; | ||||
3138 | tree value; | ||||
3139 | |||||
3140 | hi = 5 + int_size_in_bytes (TREE_TYPE (exp)((contains_struct_check ((exp), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3140, __FUNCTION__))->typed.type)); | ||||
3141 | |||||
3142 | FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (exp), idx, value)for (idx = 0; (idx >= vec_safe_length (((tree_check ((exp) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3142, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts))) ? false : ((value = (*(((tree_check ((exp), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3142, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts))) [idx].value), true); (idx)++) | ||||
3143 | if (value) | ||||
3144 | hi = hi * 603 + const_hash_1 (value); | ||||
3145 | |||||
3146 | return hi; | ||||
3147 | } | ||||
3148 | |||||
3149 | case ADDR_EXPR: | ||||
3150 | if (CONSTANT_CLASS_P (TREE_OPERAND (exp, 0))(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) ((*((const_cast<tree*> (tree_operand_check ((exp), (0 ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3150, __FUNCTION__))))))->base.code))] == tcc_constant)) | ||||
3151 | return const_hash_1 (TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3151, __FUNCTION__)))))); | ||||
3152 | |||||
3153 | /* Fallthru. */ | ||||
3154 | case FDESC_EXPR: | ||||
3155 | { | ||||
3156 | class addr_const value; | ||||
3157 | |||||
3158 | decode_addr_const (exp, &value); | ||||
3159 | switch (GET_CODE (value.base)((enum rtx_code) (value.base)->code)) | ||||
3160 | { | ||||
3161 | case SYMBOL_REF: | ||||
3162 | /* Don't hash the address of the SYMBOL_REF; | ||||
3163 | only use the offset and the symbol name. */ | ||||
3164 | hi = value.offset.coeffs[0]; | ||||
3165 | p = XSTR (value.base, 0)(((value.base)->u.fld[0]).rt_str); | ||||
3166 | for (i = 0; p[i] != 0; i++) | ||||
3167 | hi = ((hi * 613) + (unsigned) (p[i])); | ||||
3168 | break; | ||||
3169 | |||||
3170 | case LABEL_REF: | ||||
3171 | hi = (value.offset.coeffs[0] | ||||
3172 | + CODE_LABEL_NUMBER (label_ref_label (value.base))(((label_ref_label (value.base))->u.fld[5]).rt_int) * 13); | ||||
3173 | break; | ||||
3174 | |||||
3175 | default: | ||||
3176 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3176, __FUNCTION__)); | ||||
3177 | } | ||||
3178 | } | ||||
3179 | return hi; | ||||
3180 | |||||
3181 | case PLUS_EXPR: | ||||
3182 | case POINTER_PLUS_EXPR: | ||||
3183 | case MINUS_EXPR: | ||||
3184 | return (const_hash_1 (TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3184, __FUNCTION__)))))) * 9 | ||||
3185 | + const_hash_1 (TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3185, __FUNCTION__))))))); | ||||
3186 | |||||
3187 | CASE_CONVERTcase NOP_EXPR: case CONVERT_EXPR: | ||||
3188 | return const_hash_1 (TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3188, __FUNCTION__)))))) * 7 + 2; | ||||
3189 | |||||
3190 | default: | ||||
3191 | /* A language specific constant. Just hash the code. */ | ||||
3192 | return code; | ||||
3193 | } | ||||
3194 | |||||
3195 | /* Compute hashing function. */ | ||||
3196 | hi = len; | ||||
3197 | for (i = 0; i < len; i++) | ||||
3198 | hi = ((hi * 613) + (unsigned) (p[i])); | ||||
3199 | |||||
3200 | return hi; | ||||
3201 | } | ||||
3202 | |||||
3203 | /* Wrapper of compare_constant, for the htab interface. */ | ||||
3204 | bool | ||||
3205 | tree_descriptor_hasher::equal (constant_descriptor_tree *c1, | ||||
3206 | constant_descriptor_tree *c2) | ||||
3207 | { | ||||
3208 | if (c1->hash != c2->hash) | ||||
3209 | return 0; | ||||
3210 | return compare_constant (c1->value, c2->value); | ||||
3211 | } | ||||
3212 | |||||
3213 | /* Compare t1 and t2, and return 1 only if they are known to result in | ||||
3214 | the same bit pattern on output. */ | ||||
3215 | |||||
3216 | static int | ||||
3217 | compare_constant (const tree t1, const tree t2) | ||||
3218 | { | ||||
3219 | enum tree_code typecode; | ||||
3220 | |||||
3221 | if (t1 == NULL_TREE(tree) nullptr) | ||||
3222 | return t2 == NULL_TREE(tree) nullptr; | ||||
3223 | if (t2 == NULL_TREE(tree) nullptr) | ||||
3224 | return 0; | ||||
3225 | |||||
3226 | if (TREE_CODE (t1)((enum tree_code) (t1)->base.code) != TREE_CODE (t2)((enum tree_code) (t2)->base.code)) | ||||
3227 | return 0; | ||||
3228 | |||||
3229 | switch (TREE_CODE (t1)((enum tree_code) (t1)->base.code)) | ||||
3230 | { | ||||
3231 | case INTEGER_CST: | ||||
3232 | /* Integer constants are the same only if the same width of type. */ | ||||
3233 | if (TYPE_PRECISION (TREE_TYPE (t1))((tree_class_check ((((contains_struct_check ((t1), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3233, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3233, __FUNCTION__))->type_common.precision) != TYPE_PRECISION (TREE_TYPE (t2))((tree_class_check ((((contains_struct_check ((t2), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3233, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3233, __FUNCTION__))->type_common.precision)) | ||||
3234 | return 0; | ||||
3235 | if (TYPE_MODE (TREE_TYPE (t1))((((enum tree_code) ((tree_class_check ((((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3235, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3235, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3235, __FUNCTION__))->typed.type)) : (((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3235, __FUNCTION__))->typed.type))->type_common.mode) != TYPE_MODE (TREE_TYPE (t2))((((enum tree_code) ((tree_class_check ((((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3235, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3235, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3235, __FUNCTION__))->typed.type)) : (((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3235, __FUNCTION__))->typed.type))->type_common.mode)) | ||||
3236 | return 0; | ||||
3237 | return tree_int_cst_equal (t1, t2); | ||||
3238 | |||||
3239 | case REAL_CST: | ||||
3240 | /* Real constants are the same only if the same width of type. In | ||||
3241 | addition to the same width, we need to check whether the modes are the | ||||
3242 | same. There might be two floating point modes that are the same size | ||||
3243 | but have different representations, such as the PowerPC that has 2 | ||||
3244 | different 128-bit floating point types (IBM extended double and IEEE | ||||
3245 | 128-bit floating point). */ | ||||
3246 | if (TYPE_PRECISION (TREE_TYPE (t1))((tree_class_check ((((contains_struct_check ((t1), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3246, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3246, __FUNCTION__))->type_common.precision) != TYPE_PRECISION (TREE_TYPE (t2))((tree_class_check ((((contains_struct_check ((t2), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3246, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3246, __FUNCTION__))->type_common.precision)) | ||||
3247 | return 0; | ||||
3248 | if (TYPE_MODE (TREE_TYPE (t1))((((enum tree_code) ((tree_class_check ((((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3248, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3248, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3248, __FUNCTION__))->typed.type)) : (((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3248, __FUNCTION__))->typed.type))->type_common.mode) != TYPE_MODE (TREE_TYPE (t2))((((enum tree_code) ((tree_class_check ((((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3248, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3248, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3248, __FUNCTION__))->typed.type)) : (((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3248, __FUNCTION__))->typed.type))->type_common.mode)) | ||||
3249 | return 0; | ||||
3250 | return real_identical (&TREE_REAL_CST (t1)(*(&(tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3250, __FUNCTION__, (REAL_CST)))->real_cst.value)), &TREE_REAL_CST (t2)(*(&(tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3250, __FUNCTION__, (REAL_CST)))->real_cst.value))); | ||||
3251 | |||||
3252 | case FIXED_CST: | ||||
3253 | /* Fixed constants are the same only if the same width of type. */ | ||||
3254 | if (TYPE_PRECISION (TREE_TYPE (t1))((tree_class_check ((((contains_struct_check ((t1), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3254, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3254, __FUNCTION__))->type_common.precision) != TYPE_PRECISION (TREE_TYPE (t2))((tree_class_check ((((contains_struct_check ((t2), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3254, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3254, __FUNCTION__))->type_common.precision)) | ||||
3255 | return 0; | ||||
3256 | |||||
3257 | return FIXED_VALUES_IDENTICAL (TREE_FIXED_CST (t1), TREE_FIXED_CST (t2))fixed_identical (&((*((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3257, __FUNCTION__, (FIXED_CST)))->fixed_cst.fixed_cst_ptr ))), &((*((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3257, __FUNCTION__, (FIXED_CST)))->fixed_cst.fixed_cst_ptr )))); | ||||
3258 | |||||
3259 | case STRING_CST: | ||||
3260 | if (TYPE_MODE (TREE_TYPE (t1))((((enum tree_code) ((tree_class_check ((((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3260, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3260, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3260, __FUNCTION__))->typed.type)) : (((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3260, __FUNCTION__))->typed.type))->type_common.mode) != TYPE_MODE (TREE_TYPE (t2))((((enum tree_code) ((tree_class_check ((((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3260, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3260, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3260, __FUNCTION__))->typed.type)) : (((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3260, __FUNCTION__))->typed.type))->type_common.mode) | ||||
3261 | || int_size_in_bytes (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3261, __FUNCTION__))->typed.type)) | ||||
3262 | != int_size_in_bytes (TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3262, __FUNCTION__))->typed.type))) | ||||
3263 | return 0; | ||||
3264 | |||||
3265 | return (TREE_STRING_LENGTH (t1)((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3265, __FUNCTION__, (STRING_CST)))->string.length) == TREE_STRING_LENGTH (t2)((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3265, __FUNCTION__, (STRING_CST)))->string.length) | ||||
3266 | && ! memcmp (TREE_STRING_POINTER (t1)((const char *)((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3266, __FUNCTION__, (STRING_CST)))->string.str)), TREE_STRING_POINTER (t2)((const char *)((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3266, __FUNCTION__, (STRING_CST)))->string.str)), | ||||
3267 | TREE_STRING_LENGTH (t1)((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3267, __FUNCTION__, (STRING_CST)))->string.length))); | ||||
3268 | |||||
3269 | case COMPLEX_CST: | ||||
3270 | return (compare_constant (TREE_REALPART (t1)((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3270, __FUNCTION__, (COMPLEX_CST)))->complex.real), TREE_REALPART (t2)((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3270, __FUNCTION__, (COMPLEX_CST)))->complex.real)) | ||||
3271 | && compare_constant (TREE_IMAGPART (t1)((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3271, __FUNCTION__, (COMPLEX_CST)))->complex.imag), TREE_IMAGPART (t2)((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3271, __FUNCTION__, (COMPLEX_CST)))->complex.imag))); | ||||
3272 | |||||
3273 | case VECTOR_CST: | ||||
3274 | { | ||||
3275 | if (VECTOR_CST_NPATTERNS (t1)(1U << ((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3275, __FUNCTION__, (VECTOR_CST)))->base.u.vector_cst.log2_npatterns )) | ||||
3276 | != VECTOR_CST_NPATTERNS (t2)(1U << ((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3276, __FUNCTION__, (VECTOR_CST)))->base.u.vector_cst.log2_npatterns ))) | ||||
3277 | return 0; | ||||
3278 | |||||
3279 | if (VECTOR_CST_NELTS_PER_PATTERN (t1)((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3279, __FUNCTION__, (VECTOR_CST)))->base.u.vector_cst.nelts_per_pattern ) | ||||
3280 | != VECTOR_CST_NELTS_PER_PATTERN (t2)((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3280, __FUNCTION__, (VECTOR_CST)))->base.u.vector_cst.nelts_per_pattern )) | ||||
3281 | return 0; | ||||
3282 | |||||
3283 | unsigned int count = vector_cst_encoded_nelts (t1); | ||||
3284 | for (unsigned int i = 0; i < count; ++i) | ||||
3285 | if (!compare_constant (VECTOR_CST_ENCODED_ELT (t1, i)((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3285, __FUNCTION__, (VECTOR_CST)))->vector.elts[i]), | ||||
3286 | VECTOR_CST_ENCODED_ELT (t2, i)((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3286, __FUNCTION__, (VECTOR_CST)))->vector.elts[i]))) | ||||
3287 | return 0; | ||||
3288 | |||||
3289 | return 1; | ||||
3290 | } | ||||
3291 | |||||
3292 | case CONSTRUCTOR: | ||||
3293 | { | ||||
3294 | vec<constructor_elt, va_gc> *v1, *v2; | ||||
3295 | unsigned HOST_WIDE_INTlong idx; | ||||
3296 | |||||
3297 | typecode = TREE_CODE (TREE_TYPE (t1))((enum tree_code) (((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3297, __FUNCTION__))->typed.type))->base.code); | ||||
3298 | if (typecode != TREE_CODE (TREE_TYPE (t2))((enum tree_code) (((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3298, __FUNCTION__))->typed.type))->base.code)) | ||||
3299 | return 0; | ||||
3300 | |||||
3301 | if (typecode == ARRAY_TYPE) | ||||
3302 | { | ||||
3303 | HOST_WIDE_INTlong size_1 = int_size_in_bytes (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3303, __FUNCTION__))->typed.type)); | ||||
3304 | /* For arrays, check that mode, size and storage order match. */ | ||||
3305 | if (TYPE_MODE (TREE_TYPE (t1))((((enum tree_code) ((tree_class_check ((((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3305, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3305, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3305, __FUNCTION__))->typed.type)) : (((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3305, __FUNCTION__))->typed.type))->type_common.mode) != TYPE_MODE (TREE_TYPE (t2))((((enum tree_code) ((tree_class_check ((((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3305, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3305, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3305, __FUNCTION__))->typed.type)) : (((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3305, __FUNCTION__))->typed.type))->type_common.mode) | ||||
3306 | || size_1 == -1 | ||||
3307 | || size_1 != int_size_in_bytes (TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3307, __FUNCTION__))->typed.type)) | ||||
3308 | || TYPE_REVERSE_STORAGE_ORDER (TREE_TYPE (t1))((tree_check4 ((((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3308, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3308, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE ), (ARRAY_TYPE)))->base.u.bits.saturating_flag) | ||||
3309 | != TYPE_REVERSE_STORAGE_ORDER (TREE_TYPE (t2))((tree_check4 ((((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3309, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3309, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE ), (ARRAY_TYPE)))->base.u.bits.saturating_flag)) | ||||
3310 | return 0; | ||||
3311 | } | ||||
3312 | else | ||||
3313 | { | ||||
3314 | /* For record and union constructors, require exact type | ||||
3315 | equality. */ | ||||
3316 | if (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3316, __FUNCTION__))->typed.type) != TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3316, __FUNCTION__))->typed.type)) | ||||
3317 | return 0; | ||||
3318 | } | ||||
3319 | |||||
3320 | v1 = CONSTRUCTOR_ELTS (t1)((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3320, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts); | ||||
3321 | v2 = CONSTRUCTOR_ELTS (t2)((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3321, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts); | ||||
3322 | if (vec_safe_length (v1) != vec_safe_length (v2)) | ||||
3323 | return 0; | ||||
3324 | |||||
3325 | for (idx = 0; idx < vec_safe_length (v1); ++idx) | ||||
3326 | { | ||||
3327 | constructor_elt *c1 = &(*v1)[idx]; | ||||
3328 | constructor_elt *c2 = &(*v2)[idx]; | ||||
3329 | |||||
3330 | /* Check that each value is the same... */ | ||||
3331 | if (!compare_constant (c1->value, c2->value)) | ||||
3332 | return 0; | ||||
3333 | /* ... and that they apply to the same fields! */ | ||||
3334 | if (typecode == ARRAY_TYPE) | ||||
3335 | { | ||||
3336 | if (!compare_constant (c1->index, c2->index)) | ||||
3337 | return 0; | ||||
3338 | } | ||||
3339 | else | ||||
3340 | { | ||||
3341 | if (c1->index != c2->index) | ||||
3342 | return 0; | ||||
3343 | } | ||||
3344 | } | ||||
3345 | |||||
3346 | return 1; | ||||
3347 | } | ||||
3348 | |||||
3349 | case ADDR_EXPR: | ||||
3350 | case FDESC_EXPR: | ||||
3351 | { | ||||
3352 | class addr_const value1, value2; | ||||
3353 | enum rtx_code code; | ||||
3354 | int ret; | ||||
3355 | |||||
3356 | decode_addr_const (t1, &value1); | ||||
3357 | decode_addr_const (t2, &value2); | ||||
3358 | |||||
3359 | if (maybe_ne (value1.offset, value2.offset)) | ||||
3360 | return 0; | ||||
3361 | |||||
3362 | code = GET_CODE (value1.base)((enum rtx_code) (value1.base)->code); | ||||
3363 | if (code != GET_CODE (value2.base)((enum rtx_code) (value2.base)->code)) | ||||
3364 | return 0; | ||||
3365 | |||||
3366 | switch (code) | ||||
3367 | { | ||||
3368 | case SYMBOL_REF: | ||||
3369 | ret = (strcmp (XSTR (value1.base, 0)(((value1.base)->u.fld[0]).rt_str), XSTR (value2.base, 0)(((value2.base)->u.fld[0]).rt_str)) == 0); | ||||
3370 | break; | ||||
3371 | |||||
3372 | case LABEL_REF: | ||||
3373 | ret = (CODE_LABEL_NUMBER (label_ref_label (value1.base))(((label_ref_label (value1.base))->u.fld[5]).rt_int) | ||||
3374 | == CODE_LABEL_NUMBER (label_ref_label (value2.base))(((label_ref_label (value2.base))->u.fld[5]).rt_int)); | ||||
3375 | break; | ||||
3376 | |||||
3377 | default: | ||||
3378 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3378, __FUNCTION__)); | ||||
3379 | } | ||||
3380 | return ret; | ||||
3381 | } | ||||
3382 | |||||
3383 | case PLUS_EXPR: | ||||
3384 | case POINTER_PLUS_EXPR: | ||||
3385 | case MINUS_EXPR: | ||||
3386 | case RANGE_EXPR: | ||||
3387 | return (compare_constant (TREE_OPERAND (t1, 0)(*((const_cast<tree*> (tree_operand_check ((t1), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3387, __FUNCTION__))))), TREE_OPERAND (t2, 0)(*((const_cast<tree*> (tree_operand_check ((t2), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3387, __FUNCTION__)))))) | ||||
3388 | && compare_constant (TREE_OPERAND (t1, 1)(*((const_cast<tree*> (tree_operand_check ((t1), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3388, __FUNCTION__))))), TREE_OPERAND (t2, 1)(*((const_cast<tree*> (tree_operand_check ((t2), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3388, __FUNCTION__))))))); | ||||
3389 | |||||
3390 | CASE_CONVERTcase NOP_EXPR: case CONVERT_EXPR: | ||||
3391 | case VIEW_CONVERT_EXPR: | ||||
3392 | return compare_constant (TREE_OPERAND (t1, 0)(*((const_cast<tree*> (tree_operand_check ((t1), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3392, __FUNCTION__))))), TREE_OPERAND (t2, 0)(*((const_cast<tree*> (tree_operand_check ((t2), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3392, __FUNCTION__)))))); | ||||
3393 | |||||
3394 | default: | ||||
3395 | return 0; | ||||
3396 | } | ||||
3397 | } | ||||
3398 | |||||
3399 | /* Return the section into which constant EXP should be placed. */ | ||||
3400 | |||||
3401 | static section * | ||||
3402 | get_constant_section (tree exp, unsigned int align) | ||||
3403 | { | ||||
3404 | return targetm.asm_out.select_section (exp, | ||||
3405 | compute_reloc_for_constant (exp), | ||||
3406 | align); | ||||
3407 | } | ||||
3408 | |||||
3409 | /* Return the size of constant EXP in bytes. */ | ||||
3410 | |||||
3411 | static HOST_WIDE_INTlong | ||||
3412 | get_constant_size (tree exp) | ||||
3413 | { | ||||
3414 | HOST_WIDE_INTlong size; | ||||
3415 | |||||
3416 | size = int_size_in_bytes (TREE_TYPE (exp)((contains_struct_check ((exp), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3416, __FUNCTION__))->typed.type)); | ||||
3417 | gcc_checking_assert (size >= 0)((void)(!(size >= 0) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3417, __FUNCTION__), 0 : 0)); | ||||
3418 | gcc_checking_assert (TREE_CODE (exp) != STRING_CST((void)(!(((enum tree_code) (exp)->base.code) != STRING_CST || size >= ((tree_check ((exp), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3419, __FUNCTION__, (STRING_CST)))->string.length)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3419, __FUNCTION__), 0 : 0)) | ||||
3419 | || size >= TREE_STRING_LENGTH (exp))((void)(!(((enum tree_code) (exp)->base.code) != STRING_CST || size >= ((tree_check ((exp), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3419, __FUNCTION__, (STRING_CST)))->string.length)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3419, __FUNCTION__), 0 : 0)); | ||||
3420 | return size; | ||||
3421 | } | ||||
3422 | |||||
3423 | /* Subroutine of output_constant_def: | ||||
3424 | No constant equal to EXP is known to have been output. | ||||
3425 | Make a constant descriptor to enter EXP in the hash table. | ||||
3426 | Assign the label number and construct RTL to refer to the | ||||
3427 | constant's location in memory. | ||||
3428 | Caller is responsible for updating the hash table. */ | ||||
3429 | |||||
3430 | static struct constant_descriptor_tree * | ||||
3431 | build_constant_desc (tree exp) | ||||
3432 | { | ||||
3433 | struct constant_descriptor_tree *desc; | ||||
3434 | rtx symbol, rtl; | ||||
3435 | char label[256]; | ||||
3436 | int labelno; | ||||
3437 | tree decl; | ||||
3438 | |||||
3439 | desc = ggc_alloc<constant_descriptor_tree> (); | ||||
3440 | desc->value = exp; | ||||
3441 | |||||
3442 | /* Create a string containing the label name, in LABEL. */ | ||||
3443 | labelno = const_labelno++; | ||||
3444 | ASM_GENERATE_INTERNAL_LABEL (label, "LC", labelno)do { char *__p; (label)[0] = '*'; (label)[1] = '.'; __p = stpcpy (&(label)[2], "LC"); sprint_ul (__p, (unsigned long) (labelno )); } while (0); | ||||
3445 | |||||
3446 | /* Construct the VAR_DECL associated with the constant. */ | ||||
3447 | decl = build_decl (UNKNOWN_LOCATION((location_t) 0), VAR_DECL, get_identifier (label)(__builtin_constant_p (label) ? get_identifier_with_length (( label), strlen (label)) : get_identifier (label)), | ||||
3448 | TREE_TYPE (exp)((contains_struct_check ((exp), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3448, __FUNCTION__))->typed.type)); | ||||
3449 | DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3449, __FUNCTION__))->decl_common.artificial_flag) = 1; | ||||
3450 | DECL_IGNORED_P (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3450, __FUNCTION__))->decl_common.ignored_flag) = 1; | ||||
3451 | TREE_READONLY (decl)((non_type_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3451, __FUNCTION__))->base.readonly_flag) = 1; | ||||
3452 | TREE_STATIC (decl)((decl)->base.static_flag) = 1; | ||||
3453 | TREE_ADDRESSABLE (decl)((decl)->base.addressable_flag) = 1; | ||||
3454 | /* We don't set the RTL yet as this would cause varpool to assume that the | ||||
3455 | variable is referenced. Moreover, it would just be dropped in LTO mode. | ||||
3456 | Instead we set the flag that will be recognized in make_decl_rtl. */ | ||||
3457 | DECL_IN_CONSTANT_POOL (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3457, __FUNCTION__, (VAR_DECL)))->decl_with_vis.in_constant_pool ) = 1; | ||||
3458 | DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3458, __FUNCTION__))->decl_common.initial) = desc->value; | ||||
3459 | /* ??? targetm.constant_alignment hasn't been updated for vector types on | ||||
3460 | most architectures so use DATA_ALIGNMENT as well, except for strings. */ | ||||
3461 | if (TREE_CODE (exp)((enum tree_code) (exp)->base.code) == STRING_CST) | ||||
3462 | SET_DECL_ALIGN (decl, targetm.constant_alignment (exp, DECL_ALIGN (decl)))(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3462, __FUNCTION__))->decl_common.align) = ffs_hwi (targetm .constant_alignment (exp, (((contains_struct_check ((decl), ( TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3462, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3462, __FUNCTION__))->decl_common.align) - 1) : 0)))); | ||||
3463 | else | ||||
3464 | { | ||||
3465 | align_variable (decl, 0); | ||||
3466 | if (DECL_ALIGN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3466, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3466, __FUNCTION__))->decl_common.align) - 1) : 0) < GET_MODE_ALIGNMENT (DECL_MODE (decl))get_mode_alignment (((contains_struct_check ((decl), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3466, __FUNCTION__))->decl_common.mode)) | ||||
3467 | && ((optab_handler (movmisalign_optab, DECL_MODE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3467, __FUNCTION__))->decl_common.mode)) | ||||
3468 | != CODE_FOR_nothing) | ||||
3469 | || targetm.slow_unaligned_access (DECL_MODE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3469, __FUNCTION__))->decl_common.mode), | ||||
3470 | DECL_ALIGN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3470, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3470, __FUNCTION__))->decl_common.align) - 1) : 0)))) | ||||
3471 | SET_DECL_ALIGN (decl, GET_MODE_ALIGNMENT (DECL_MODE (decl)))(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3471, __FUNCTION__))->decl_common.align) = ffs_hwi (get_mode_alignment (((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3471, __FUNCTION__))->decl_common.mode)))); | ||||
3472 | } | ||||
3473 | |||||
3474 | /* Now construct the SYMBOL_REF and the MEM. */ | ||||
3475 | if (use_object_blocks_p ()) | ||||
3476 | { | ||||
3477 | int align = (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == CONST_DECL | ||||
3478 | || (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_IN_CONSTANT_POOL (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3478, __FUNCTION__, (VAR_DECL)))->decl_with_vis.in_constant_pool )) | ||||
3479 | ? DECL_ALIGN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3479, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3479, __FUNCTION__))->decl_common.align) - 1) : 0) | ||||
3480 | : symtab_node::get (decl)->definition_alignment ()); | ||||
3481 | section *sect = get_constant_section (exp, align); | ||||
3482 | symbol = create_block_symbol (ggc_strdup (label)ggc_alloc_string ((label), -1 ), | ||||
3483 | get_block_for_section (sect), -1); | ||||
3484 | } | ||||
3485 | else | ||||
3486 | symbol = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (label))gen_rtx_fmt_s0_stat ((SYMBOL_REF), (((global_options.x_ix86_pmode == PMODE_DI ? (scalar_int_mode ((scalar_int_mode::from_int) E_DImode )) : (scalar_int_mode ((scalar_int_mode::from_int) E_SImode)) ))), ((ggc_alloc_string ((label), -1 ))) ); | ||||
3487 | SYMBOL_REF_FLAGS (symbol)(__extension__ ({ __typeof ((symbol)) const _rtx = ((symbol)) ; if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("SYMBOL_REF_FLAGS", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3487, __FUNCTION__); _rtx; }) ->u2.symbol_ref_flags) |= SYMBOL_FLAG_LOCAL(1 << 1); | ||||
3488 | SET_SYMBOL_REF_DECL (symbol, decl)(((void)(!(!(__extension__ ({ __typeof ((symbol)) const _rtx = ((symbol)); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF ) rtl_check_failed_flag ("CONSTANT_POOL_ADDRESS_P", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3488, __FUNCTION__); _rtx; })->unchanging)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3488, __FUNCTION__), 0 : 0)), ((((symbol))->u.fld[1]).rt_tree ) = (decl)); | ||||
3489 | TREE_CONSTANT_POOL_ADDRESS_P (symbol)(__extension__ ({ __typeof ((symbol)) const _rtx = ((symbol)) ; if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("TREE_CONSTANT_POOL_ADDRESS_P", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3489, __FUNCTION__); _rtx; })->frame_related) = 1; | ||||
3490 | |||||
3491 | rtl = gen_const_mem (TYPE_MODE (TREE_TYPE (exp))((((enum tree_code) ((tree_class_check ((((contains_struct_check ((exp), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3491, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3491, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (((contains_struct_check ((exp), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3491, __FUNCTION__))->typed.type)) : (((contains_struct_check ((exp), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3491, __FUNCTION__))->typed.type))->type_common.mode), symbol); | ||||
3492 | set_mem_alias_set (rtl, 0); | ||||
3493 | |||||
3494 | /* Putting EXP into the literal pool might have imposed a different | ||||
3495 | alignment which should be visible in the RTX as well. */ | ||||
3496 | set_mem_align (rtl, DECL_ALIGN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3496, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3496, __FUNCTION__))->decl_common.align) - 1) : 0)); | ||||
3497 | |||||
3498 | /* We cannot share RTX'es in pool entries. | ||||
3499 | Mark this piece of RTL as required for unsharing. */ | ||||
3500 | RTX_FLAG (rtl, used)((rtl)->used) = 1; | ||||
3501 | |||||
3502 | /* Set flags or add text to the name to record information, such as | ||||
3503 | that it is a local symbol. If the name is changed, the macro | ||||
3504 | ASM_OUTPUT_LABELREF will have to know how to strip this | ||||
3505 | information. This call might invalidate our local variable | ||||
3506 | SYMBOL; we can't use it afterward. */ | ||||
3507 | targetm.encode_section_info (exp, rtl, true); | ||||
3508 | |||||
3509 | desc->rtl = rtl; | ||||
3510 | |||||
3511 | return desc; | ||||
3512 | } | ||||
3513 | |||||
3514 | /* Subroutine of output_constant_def and tree_output_constant_def: | ||||
3515 | Add a constant to the hash table that tracks which constants | ||||
3516 | already have labels. */ | ||||
3517 | |||||
3518 | static constant_descriptor_tree * | ||||
3519 | add_constant_to_table (tree exp, int defer) | ||||
3520 | { | ||||
3521 | /* The hash table methods may call output_constant_def for addressed | ||||
3522 | constants, so handle them first. */ | ||||
3523 | output_addressed_constants (exp, defer); | ||||
3524 | |||||
3525 | /* Sanity check to catch recursive insertion. */ | ||||
3526 | static bool inserting; | ||||
3527 | gcc_assert (!inserting)((void)(!(!inserting) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3527, __FUNCTION__), 0 : 0)); | ||||
3528 | inserting = true; | ||||
3529 | |||||
3530 | /* Look up EXP in the table of constant descriptors. If we didn't | ||||
3531 | find it, create a new one. */ | ||||
3532 | struct constant_descriptor_tree key; | ||||
3533 | key.value = exp; | ||||
3534 | key.hash = const_hash_1 (exp); | ||||
3535 | constant_descriptor_tree **loc | ||||
3536 | = const_desc_htab->find_slot_with_hash (&key, key.hash, INSERT); | ||||
3537 | |||||
3538 | inserting = false; | ||||
3539 | |||||
3540 | struct constant_descriptor_tree *desc = *loc; | ||||
3541 | if (!desc) | ||||
3542 | { | ||||
3543 | desc = build_constant_desc (exp); | ||||
3544 | desc->hash = key.hash; | ||||
3545 | *loc = desc; | ||||
3546 | } | ||||
3547 | |||||
3548 | return desc; | ||||
3549 | } | ||||
3550 | |||||
3551 | /* Return an rtx representing a reference to constant data in memory | ||||
3552 | for the constant expression EXP. | ||||
3553 | |||||
3554 | If assembler code for such a constant has already been output, | ||||
3555 | return an rtx to refer to it. | ||||
3556 | Otherwise, output such a constant in memory | ||||
3557 | and generate an rtx for it. | ||||
3558 | |||||
3559 | If DEFER is nonzero, this constant can be deferred and output only | ||||
3560 | if referenced in the function after all optimizations. | ||||
3561 | |||||
3562 | `const_desc_table' records which constants already have label strings. */ | ||||
3563 | |||||
3564 | rtx | ||||
3565 | output_constant_def (tree exp, int defer) | ||||
3566 | { | ||||
3567 | struct constant_descriptor_tree *desc = add_constant_to_table (exp, defer); | ||||
3568 | maybe_output_constant_def_contents (desc, defer); | ||||
3569 | return desc->rtl; | ||||
3570 | } | ||||
3571 | |||||
3572 | /* Subroutine of output_constant_def: Decide whether or not we need to | ||||
3573 | output the constant DESC now, and if so, do it. */ | ||||
3574 | static void | ||||
3575 | maybe_output_constant_def_contents (struct constant_descriptor_tree *desc, | ||||
3576 | int defer) | ||||
3577 | { | ||||
3578 | rtx symbol = XEXP (desc->rtl, 0)(((desc->rtl)->u.fld[0]).rt_rtx); | ||||
3579 | tree exp = desc->value; | ||||
3580 | |||||
3581 | if (flag_syntax_onlyglobal_options.x_flag_syntax_only) | ||||
3582 | return; | ||||
3583 | |||||
3584 | if (TREE_ASM_WRITTEN (exp)((exp)->base.asm_written_flag)) | ||||
3585 | /* Already output; don't do it again. */ | ||||
3586 | return; | ||||
3587 | |||||
3588 | /* We can always defer constants as long as the context allows | ||||
3589 | doing so. */ | ||||
3590 | if (defer) | ||||
3591 | { | ||||
3592 | /* Increment n_deferred_constants if it exists. It needs to be at | ||||
3593 | least as large as the number of constants actually referred to | ||||
3594 | by the function. If it's too small we'll stop looking too early | ||||
3595 | and fail to emit constants; if it's too large we'll only look | ||||
3596 | through the entire function when we could have stopped earlier. */ | ||||
3597 | if (cfun(cfun + 0)) | ||||
3598 | n_deferred_constants((&x_rtl)->varasm.deferred_constants)++; | ||||
3599 | return; | ||||
3600 | } | ||||
3601 | |||||
3602 | output_constant_def_contents (symbol); | ||||
3603 | } | ||||
3604 | |||||
3605 | /* Subroutine of output_constant_def_contents. Output the definition | ||||
3606 | of constant EXP, which is pointed to by label LABEL. ALIGN is the | ||||
3607 | constant's alignment in bits. */ | ||||
3608 | |||||
3609 | static void | ||||
3610 | assemble_constant_contents (tree exp, const char *label, unsigned int align, | ||||
3611 | bool merge_strings) | ||||
3612 | { | ||||
3613 | HOST_WIDE_INTlong size; | ||||
3614 | |||||
3615 | size = get_constant_size (exp); | ||||
3616 | |||||
3617 | /* Do any machine/system dependent processing of the constant. */ | ||||
3618 | targetm.asm_out.declare_constant_name (asm_out_file, label, exp, size); | ||||
3619 | |||||
3620 | /* Output the value of EXP. */ | ||||
3621 | output_constant (exp, size, align, false, merge_strings); | ||||
3622 | |||||
3623 | targetm.asm_out.decl_end (); | ||||
3624 | } | ||||
3625 | |||||
3626 | /* We must output the constant data referred to by SYMBOL; do so. */ | ||||
3627 | |||||
3628 | static void | ||||
3629 | output_constant_def_contents (rtx symbol) | ||||
3630 | { | ||||
3631 | tree decl = SYMBOL_REF_DECL (symbol)((__extension__ ({ __typeof ((symbol)) const _rtx = ((symbol) ); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("CONSTANT_POOL_ADDRESS_P", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3631, __FUNCTION__); _rtx; })->unchanging) ? nullptr : ( (((symbol))->u.fld[1]).rt_tree)); | ||||
3632 | tree exp = DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3632, __FUNCTION__))->decl_common.initial); | ||||
3633 | bool asan_protected = false; | ||||
3634 | |||||
3635 | /* Make sure any other constants whose addresses appear in EXP | ||||
3636 | are assigned label numbers. */ | ||||
3637 | output_addressed_constants (exp, 0); | ||||
3638 | |||||
3639 | /* We are no longer deferring this constant. */ | ||||
3640 | TREE_ASM_WRITTEN (decl)((decl)->base.asm_written_flag) = TREE_ASM_WRITTEN (exp)((exp)->base.asm_written_flag) = 1; | ||||
3641 | |||||
3642 | if ((flag_sanitizeglobal_options.x_flag_sanitize & SANITIZE_ADDRESS) | ||||
3643 | && TREE_CODE (exp)((enum tree_code) (exp)->base.code) == STRING_CST | ||||
3644 | && asan_protect_global (exp)) | ||||
3645 | { | ||||
3646 | asan_protected = true; | ||||
3647 | SET_DECL_ALIGN (decl, MAX (DECL_ALIGN (decl),(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3648, __FUNCTION__))->decl_common.align) = ffs_hwi ((((( (contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3647, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3647, __FUNCTION__))->decl_common.align) - 1) : 0)) > (32 * (8)) ? ((((contains_struct_check ((decl), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3647, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3647, __FUNCTION__))->decl_common.align) - 1) : 0)) : (32 * (8))))) | ||||
3648 | ASAN_RED_ZONE_SIZE * BITS_PER_UNIT))(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3648, __FUNCTION__))->decl_common.align) = ffs_hwi ((((( (contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3647, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3647, __FUNCTION__))->decl_common.align) - 1) : 0)) > (32 * (8)) ? ((((contains_struct_check ((decl), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3647, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3647, __FUNCTION__))->decl_common.align) - 1) : 0)) : (32 * (8))))); | ||||
3649 | } | ||||
3650 | |||||
3651 | /* If the constant is part of an object block, make sure that the | ||||
3652 | decl has been positioned within its block, but do not write out | ||||
3653 | its definition yet. output_object_blocks will do that later. */ | ||||
3654 | if (SYMBOL_REF_HAS_BLOCK_INFO_P (symbol)(((__extension__ ({ __typeof ((symbol)) const _rtx = ((symbol )); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("SYMBOL_REF_FLAGS", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3654, __FUNCTION__); _rtx; }) ->u2.symbol_ref_flags) & (1 << 7)) != 0) && SYMBOL_REF_BLOCK (symbol)((&(symbol)->u.block_sym)->block)) | ||||
3655 | place_block_symbol (symbol); | ||||
3656 | else | ||||
3657 | { | ||||
3658 | int align = (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == CONST_DECL | ||||
3659 | || (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_IN_CONSTANT_POOL (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3659, __FUNCTION__, (VAR_DECL)))->decl_with_vis.in_constant_pool )) | ||||
3660 | ? DECL_ALIGN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3660, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3660, __FUNCTION__))->decl_common.align) - 1) : 0) | ||||
3661 | : symtab_node::get (decl)->definition_alignment ()); | ||||
3662 | section *sect = get_constant_section (exp, align); | ||||
3663 | switch_to_section (sect); | ||||
3664 | if (align > BITS_PER_UNIT(8)) | ||||
3665 | ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (align / BITS_PER_UNIT))if ((floor_log2 (align / (8))) != 0) fprintf ((asm_out_file), "\t.align %d\n", 1 << (floor_log2 (align / (8)))); | ||||
3666 | assemble_constant_contents (exp, XSTR (symbol, 0)(((symbol)->u.fld[0]).rt_str), align, | ||||
3667 | (sect->common.flags & SECTION_MERGE) | ||||
3668 | && (sect->common.flags & SECTION_STRINGS)); | ||||
3669 | if (asan_protected) | ||||
3670 | { | ||||
3671 | HOST_WIDE_INTlong size = get_constant_size (exp); | ||||
3672 | assemble_zeros (asan_red_zone_size (size)); | ||||
3673 | } | ||||
3674 | } | ||||
3675 | } | ||||
3676 | |||||
3677 | /* Look up EXP in the table of constant descriptors. Return the rtl | ||||
3678 | if it has been emitted, else null. */ | ||||
3679 | |||||
3680 | rtx | ||||
3681 | lookup_constant_def (tree exp) | ||||
3682 | { | ||||
3683 | struct constant_descriptor_tree key; | ||||
3684 | |||||
3685 | key.value = exp; | ||||
3686 | key.hash = const_hash_1 (exp); | ||||
3687 | constant_descriptor_tree *desc | ||||
3688 | = const_desc_htab->find_with_hash (&key, key.hash); | ||||
3689 | |||||
3690 | return (desc ? desc->rtl : NULL_RTX(rtx) 0); | ||||
3691 | } | ||||
3692 | |||||
3693 | /* Return a tree representing a reference to constant data in memory | ||||
3694 | for the constant expression EXP. | ||||
3695 | |||||
3696 | This is the counterpart of output_constant_def at the Tree level. */ | ||||
3697 | |||||
3698 | tree | ||||
3699 | tree_output_constant_def (tree exp) | ||||
3700 | { | ||||
3701 | struct constant_descriptor_tree *desc = add_constant_to_table (exp, 1); | ||||
3702 | tree decl = SYMBOL_REF_DECL (XEXP (desc->rtl, 0))((__extension__ ({ __typeof (((((desc->rtl)->u.fld[0]). rt_rtx))) const _rtx = (((((desc->rtl)->u.fld[0]).rt_rtx ))); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("CONSTANT_POOL_ADDRESS_P", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3702, __FUNCTION__); _rtx; })->unchanging) ? nullptr : ( ((((((desc->rtl)->u.fld[0]).rt_rtx)))->u.fld[1]).rt_tree )); | ||||
3703 | varpool_node::finalize_decl (decl); | ||||
3704 | return decl; | ||||
3705 | } | ||||
3706 | |||||
3707 | class GTY((chain_next ("%h.next"), for_user)) constant_descriptor_rtx { | ||||
3708 | public: | ||||
3709 | class constant_descriptor_rtx *next; | ||||
3710 | rtx mem; | ||||
3711 | rtx sym; | ||||
3712 | rtx constant; | ||||
3713 | HOST_WIDE_INTlong offset; | ||||
3714 | hashval_t hash; | ||||
3715 | fixed_size_mode mode; | ||||
3716 | unsigned int align; | ||||
3717 | int labelno; | ||||
3718 | int mark; | ||||
3719 | }; | ||||
3720 | |||||
3721 | struct const_rtx_desc_hasher : ggc_ptr_hash<constant_descriptor_rtx> | ||||
3722 | { | ||||
3723 | static hashval_t hash (constant_descriptor_rtx *); | ||||
3724 | static bool equal (constant_descriptor_rtx *, constant_descriptor_rtx *); | ||||
3725 | }; | ||||
3726 | |||||
3727 | /* Used in the hash tables to avoid outputting the same constant | ||||
3728 | twice. Unlike 'struct constant_descriptor_tree', RTX constants | ||||
3729 | are output once per function, not once per file. */ | ||||
3730 | /* ??? Only a few targets need per-function constant pools. Most | ||||
3731 | can use one per-file pool. Should add a targetm bit to tell the | ||||
3732 | difference. */ | ||||
3733 | |||||
3734 | struct GTY(()) rtx_constant_pool { | ||||
3735 | /* Pointers to first and last constant in pool, as ordered by offset. */ | ||||
3736 | class constant_descriptor_rtx *first; | ||||
3737 | class constant_descriptor_rtx *last; | ||||
3738 | |||||
3739 | /* Hash facility for making memory-constants from constant rtl-expressions. | ||||
3740 | It is used on RISC machines where immediate integer arguments and | ||||
3741 | constant addresses are restricted so that such constants must be stored | ||||
3742 | in memory. */ | ||||
3743 | hash_table<const_rtx_desc_hasher> *const_rtx_htab; | ||||
3744 | |||||
3745 | /* Current offset in constant pool (does not include any | ||||
3746 | machine-specific header). */ | ||||
3747 | HOST_WIDE_INTlong offset; | ||||
3748 | }; | ||||
3749 | |||||
3750 | /* Hash and compare functions for const_rtx_htab. */ | ||||
3751 | |||||
3752 | hashval_t | ||||
3753 | const_rtx_desc_hasher::hash (constant_descriptor_rtx *desc) | ||||
3754 | { | ||||
3755 | return desc->hash; | ||||
3756 | } | ||||
3757 | |||||
3758 | bool | ||||
3759 | const_rtx_desc_hasher::equal (constant_descriptor_rtx *x, | ||||
3760 | constant_descriptor_rtx *y) | ||||
3761 | { | ||||
3762 | if (x->mode != y->mode) | ||||
3763 | return 0; | ||||
3764 | return rtx_equal_p (x->constant, y->constant); | ||||
3765 | } | ||||
3766 | |||||
3767 | /* Hash one component of a constant. */ | ||||
3768 | |||||
3769 | static hashval_t | ||||
3770 | const_rtx_hash_1 (const_rtx x) | ||||
3771 | { | ||||
3772 | unsigned HOST_WIDE_INTlong hwi; | ||||
3773 | machine_mode mode; | ||||
3774 | enum rtx_code code; | ||||
3775 | hashval_t h; | ||||
3776 | int i; | ||||
3777 | |||||
3778 | code = GET_CODE (x)((enum rtx_code) (x)->code); | ||||
3779 | mode = GET_MODE (x)((machine_mode) (x)->mode); | ||||
3780 | h = (hashval_t) code * 1048573 + mode; | ||||
3781 | |||||
3782 | switch (code) | ||||
3783 | { | ||||
3784 | case CONST_INT: | ||||
3785 | hwi = INTVAL (x)((x)->u.hwint[0]); | ||||
3786 | |||||
3787 | fold_hwi: | ||||
3788 | { | ||||
3789 | int shift = sizeof (hashval_t) * CHAR_BIT8; | ||||
3790 | const int n = sizeof (HOST_WIDE_INTlong) / sizeof (hashval_t); | ||||
3791 | |||||
3792 | h ^= (hashval_t) hwi; | ||||
3793 | for (i = 1; i < n; ++i) | ||||
3794 | { | ||||
3795 | hwi >>= shift; | ||||
3796 | h ^= (hashval_t) hwi; | ||||
3797 | } | ||||
3798 | } | ||||
3799 | break; | ||||
3800 | |||||
3801 | case CONST_WIDE_INT: | ||||
3802 | hwi = 0; | ||||
3803 | { | ||||
3804 | for (i = 0; i < CONST_WIDE_INT_NUNITS (x)((int)__extension__ ({ __typeof ((x)) const _rtx = ((x)); if ( ((enum rtx_code) (_rtx)->code) != CONST_WIDE_INT) rtl_check_failed_flag ("CWI_GET_NUM_ELEM", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3804, __FUNCTION__); _rtx; })->u2.num_elem); i++) | ||||
3805 | hwi ^= CONST_WIDE_INT_ELT (x, i)((x)->u.hwiv.elem[i]); | ||||
3806 | goto fold_hwi; | ||||
3807 | } | ||||
3808 | |||||
3809 | case CONST_DOUBLE: | ||||
3810 | if (TARGET_SUPPORTS_WIDE_INT1 == 0 && mode == VOIDmode((void) 0, E_VOIDmode)) | ||||
3811 | { | ||||
3812 | hwi = CONST_DOUBLE_LOW (x)((x)->u.hwint[0]) ^ CONST_DOUBLE_HIGH (x)((x)->u.hwint[1]); | ||||
3813 | goto fold_hwi; | ||||
3814 | } | ||||
3815 | else | ||||
3816 | h ^= real_hash (CONST_DOUBLE_REAL_VALUE (x)((const struct real_value *) (&(x)->u.rv))); | ||||
3817 | break; | ||||
3818 | |||||
3819 | case CONST_FIXED: | ||||
3820 | h ^= fixed_hash (CONST_FIXED_VALUE (x)((const struct fixed_value *) (&(x)->u.fv))); | ||||
3821 | break; | ||||
3822 | |||||
3823 | case SYMBOL_REF: | ||||
3824 | h ^= htab_hash_string (XSTR (x, 0)(((x)->u.fld[0]).rt_str)); | ||||
3825 | break; | ||||
3826 | |||||
3827 | case LABEL_REF: | ||||
3828 | h = h * 251 + CODE_LABEL_NUMBER (label_ref_label (x))(((label_ref_label (x))->u.fld[5]).rt_int); | ||||
3829 | break; | ||||
3830 | |||||
3831 | case UNSPEC: | ||||
3832 | case UNSPEC_VOLATILE: | ||||
3833 | h = h * 251 + XINT (x, 1)(((x)->u.fld[1]).rt_int); | ||||
3834 | break; | ||||
3835 | |||||
3836 | default: | ||||
3837 | break; | ||||
3838 | } | ||||
3839 | |||||
3840 | return h; | ||||
3841 | } | ||||
3842 | |||||
3843 | /* Compute a hash value for X, which should be a constant. */ | ||||
3844 | |||||
3845 | static hashval_t | ||||
3846 | const_rtx_hash (rtx x) | ||||
3847 | { | ||||
3848 | hashval_t h = 0; | ||||
3849 | subrtx_iterator::array_type array; | ||||
3850 | FOR_EACH_SUBRTX (iter, array, x, ALL)for (subrtx_iterator iter (array, x, rtx_all_subrtx_bounds); ! iter.at_end (); iter.next ()) | ||||
3851 | h = h * 509 + const_rtx_hash_1 (*iter); | ||||
3852 | return h; | ||||
3853 | } | ||||
3854 | |||||
3855 | |||||
3856 | /* Create and return a new rtx constant pool. */ | ||||
3857 | |||||
3858 | static struct rtx_constant_pool * | ||||
3859 | create_constant_pool (void) | ||||
3860 | { | ||||
3861 | struct rtx_constant_pool *pool; | ||||
3862 | |||||
3863 | pool = ggc_alloc<rtx_constant_pool> (); | ||||
3864 | pool->const_rtx_htab = hash_table<const_rtx_desc_hasher>::create_ggc (31); | ||||
3865 | pool->first = NULLnullptr; | ||||
3866 | pool->last = NULLnullptr; | ||||
3867 | pool->offset = 0; | ||||
3868 | return pool; | ||||
3869 | } | ||||
3870 | |||||
3871 | /* Initialize constant pool hashing for a new function. */ | ||||
3872 | |||||
3873 | void | ||||
3874 | init_varasm_status (void) | ||||
3875 | { | ||||
3876 | crtl(&x_rtl)->varasm.pool = create_constant_pool (); | ||||
3877 | crtl(&x_rtl)->varasm.deferred_constants = 0; | ||||
3878 | } | ||||
3879 | |||||
3880 | /* Given a MINUS expression, simplify it if both sides | ||||
3881 | include the same symbol. */ | ||||
3882 | |||||
3883 | rtx | ||||
3884 | simplify_subtraction (rtx x) | ||||
3885 | { | ||||
3886 | rtx r = simplify_rtx (x); | ||||
3887 | return r ? r : x; | ||||
3888 | } | ||||
3889 | |||||
3890 | /* Given a constant rtx X, make (or find) a memory constant for its value | ||||
3891 | and return a MEM rtx to refer to it in memory. IN_MODE is the mode | ||||
3892 | of X. */ | ||||
3893 | |||||
3894 | rtx | ||||
3895 | force_const_mem (machine_mode in_mode, rtx x) | ||||
3896 | { | ||||
3897 | class constant_descriptor_rtx *desc, tmp; | ||||
3898 | struct rtx_constant_pool *pool; | ||||
3899 | char label[256]; | ||||
3900 | rtx def, symbol; | ||||
3901 | hashval_t hash; | ||||
3902 | unsigned int align; | ||||
3903 | constant_descriptor_rtx **slot; | ||||
3904 | fixed_size_mode mode; | ||||
3905 | |||||
3906 | /* We can't force variable-sized objects to memory. */ | ||||
3907 | if (!is_a <fixed_size_mode> (in_mode, &mode)) | ||||
3908 | return NULL_RTX(rtx) 0; | ||||
3909 | |||||
3910 | /* If we're not allowed to drop X into the constant pool, don't. */ | ||||
3911 | if (targetm.cannot_force_const_mem (mode, x)) | ||||
3912 | return NULL_RTX(rtx) 0; | ||||
3913 | |||||
3914 | /* Record that this function has used a constant pool entry. */ | ||||
3915 | crtl(&x_rtl)->uses_const_pool = 1; | ||||
3916 | |||||
3917 | /* Decide which pool to use. */ | ||||
3918 | pool = (targetm.use_blocks_for_constant_p (mode, x) | ||||
3919 | ? shared_constant_pool | ||||
3920 | : crtl(&x_rtl)->varasm.pool); | ||||
3921 | |||||
3922 | /* Lookup the value in the hashtable. */ | ||||
3923 | tmp.constant = x; | ||||
3924 | tmp.mode = mode; | ||||
3925 | hash = const_rtx_hash (x); | ||||
3926 | slot = pool->const_rtx_htab->find_slot_with_hash (&tmp, hash, INSERT); | ||||
3927 | desc = *slot; | ||||
3928 | |||||
3929 | /* If the constant was already present, return its memory. */ | ||||
3930 | if (desc) | ||||
3931 | return copy_rtx (desc->mem); | ||||
3932 | |||||
3933 | /* Otherwise, create a new descriptor. */ | ||||
3934 | desc = ggc_alloc<constant_descriptor_rtx> (); | ||||
3935 | *slot = desc; | ||||
3936 | |||||
3937 | /* Align the location counter as required by EXP's data type. */ | ||||
3938 | machine_mode align_mode = (mode == VOIDmode((void) 0, E_VOIDmode) ? word_mode : mode); | ||||
3939 | align = targetm.static_rtx_alignment (align_mode); | ||||
3940 | |||||
3941 | pool->offset += (align / BITS_PER_UNIT(8)) - 1; | ||||
3942 | pool->offset &= ~ ((align / BITS_PER_UNIT(8)) - 1); | ||||
3943 | |||||
3944 | desc->next = NULLnullptr; | ||||
3945 | desc->constant = copy_rtx (tmp.constant); | ||||
3946 | desc->offset = pool->offset; | ||||
3947 | desc->hash = hash; | ||||
3948 | desc->mode = mode; | ||||
3949 | desc->align = align; | ||||
3950 | desc->labelno = const_labelno; | ||||
3951 | desc->mark = 0; | ||||
3952 | |||||
3953 | pool->offset += GET_MODE_SIZE (mode); | ||||
3954 | if (pool->last) | ||||
3955 | pool->last->next = desc; | ||||
3956 | else | ||||
3957 | pool->first = pool->last = desc; | ||||
3958 | pool->last = desc; | ||||
3959 | |||||
3960 | /* Create a string containing the label name, in LABEL. */ | ||||
3961 | ASM_GENERATE_INTERNAL_LABEL (label, "LC", const_labelno)do { char *__p; (label)[0] = '*'; (label)[1] = '.'; __p = stpcpy (&(label)[2], "LC"); sprint_ul (__p, (unsigned long) (const_labelno )); } while (0); | ||||
3962 | ++const_labelno; | ||||
3963 | |||||
3964 | /* Construct the SYMBOL_REF. Make sure to mark it as belonging to | ||||
3965 | the constants pool. */ | ||||
3966 | if (use_object_blocks_p () && targetm.use_blocks_for_constant_p (mode, x)) | ||||
3967 | { | ||||
3968 | section *sect = targetm.asm_out.select_rtx_section (mode, x, align); | ||||
3969 | symbol = create_block_symbol (ggc_strdup (label)ggc_alloc_string ((label), -1 ), | ||||
3970 | get_block_for_section (sect), -1); | ||||
3971 | } | ||||
3972 | else | ||||
3973 | symbol = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (label))gen_rtx_fmt_s0_stat ((SYMBOL_REF), (((global_options.x_ix86_pmode == PMODE_DI ? (scalar_int_mode ((scalar_int_mode::from_int) E_DImode )) : (scalar_int_mode ((scalar_int_mode::from_int) E_SImode)) ))), ((ggc_alloc_string ((label), -1 ))) ); | ||||
3974 | desc->sym = symbol; | ||||
3975 | SYMBOL_REF_FLAGS (symbol)(__extension__ ({ __typeof ((symbol)) const _rtx = ((symbol)) ; if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("SYMBOL_REF_FLAGS", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3975, __FUNCTION__); _rtx; }) ->u2.symbol_ref_flags) |= SYMBOL_FLAG_LOCAL(1 << 1); | ||||
3976 | CONSTANT_POOL_ADDRESS_P (symbol)(__extension__ ({ __typeof ((symbol)) const _rtx = ((symbol)) ; if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("CONSTANT_POOL_ADDRESS_P", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3976, __FUNCTION__); _rtx; })->unchanging) = 1; | ||||
3977 | SET_SYMBOL_REF_CONSTANT (symbol, desc)(((void)(!((__extension__ ({ __typeof ((symbol)) const _rtx = ((symbol)); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF ) rtl_check_failed_flag ("CONSTANT_POOL_ADDRESS_P", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3977, __FUNCTION__); _rtx; })->unchanging)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3977, __FUNCTION__), 0 : 0)), ((((symbol))->u.fld[1]).rt_constant ) = (desc)); | ||||
3978 | |||||
3979 | /* Construct the MEM. */ | ||||
3980 | desc->mem = def = gen_const_mem (mode, symbol); | ||||
3981 | set_mem_align (def, align); | ||||
3982 | |||||
3983 | /* If we're dropping a label to the constant pool, make sure we | ||||
3984 | don't delete it. */ | ||||
3985 | if (GET_CODE (x)((enum rtx_code) (x)->code) == LABEL_REF) | ||||
3986 | LABEL_PRESERVE_P (XEXP (x, 0))(__extension__ ({ __typeof (((((x)->u.fld[0]).rt_rtx))) const _rtx = (((((x)->u.fld[0]).rt_rtx))); if (((enum rtx_code) (_rtx)->code) != CODE_LABEL && ((enum rtx_code) ( _rtx)->code) != NOTE) rtl_check_failed_flag ("LABEL_PRESERVE_P" ,_rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3986, __FUNCTION__); _rtx; })->in_struct) = 1; | ||||
3987 | |||||
3988 | return copy_rtx (def); | ||||
3989 | } | ||||
3990 | |||||
3991 | /* Given a constant pool SYMBOL_REF, return the corresponding constant. */ | ||||
3992 | |||||
3993 | rtx | ||||
3994 | get_pool_constant (const_rtx addr) | ||||
3995 | { | ||||
3996 | return SYMBOL_REF_CONSTANT (addr)((__extension__ ({ __typeof ((addr)) const _rtx = ((addr)); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("CONSTANT_POOL_ADDRESS_P", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 3996, __FUNCTION__); _rtx; })->unchanging) ? ((((addr))-> u.fld[1]).rt_constant) : nullptr)->constant; | ||||
3997 | } | ||||
3998 | |||||
3999 | /* Given a constant pool SYMBOL_REF, return the corresponding constant | ||||
4000 | and whether it has been output or not. */ | ||||
4001 | |||||
4002 | rtx | ||||
4003 | get_pool_constant_mark (rtx addr, bool *pmarked) | ||||
4004 | { | ||||
4005 | class constant_descriptor_rtx *desc; | ||||
4006 | |||||
4007 | desc = SYMBOL_REF_CONSTANT (addr)((__extension__ ({ __typeof ((addr)) const _rtx = ((addr)); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("CONSTANT_POOL_ADDRESS_P", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4007, __FUNCTION__); _rtx; })->unchanging) ? ((((addr))-> u.fld[1]).rt_constant) : nullptr); | ||||
4008 | *pmarked = (desc->mark != 0); | ||||
4009 | return desc->constant; | ||||
4010 | } | ||||
4011 | |||||
4012 | /* Similar, return the mode. */ | ||||
4013 | |||||
4014 | fixed_size_mode | ||||
4015 | get_pool_mode (const_rtx addr) | ||||
4016 | { | ||||
4017 | return SYMBOL_REF_CONSTANT (addr)((__extension__ ({ __typeof ((addr)) const _rtx = ((addr)); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("CONSTANT_POOL_ADDRESS_P", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4017, __FUNCTION__); _rtx; })->unchanging) ? ((((addr))-> u.fld[1]).rt_constant) : nullptr)->mode; | ||||
4018 | } | ||||
4019 | |||||
4020 | /* Return TRUE if and only if the constant pool has no entries. Note | ||||
4021 | that even entries we might end up choosing not to emit are counted | ||||
4022 | here, so there is the potential for missed optimizations. */ | ||||
4023 | |||||
4024 | bool | ||||
4025 | constant_pool_empty_p (void) | ||||
4026 | { | ||||
4027 | return crtl(&x_rtl)->varasm.pool->first == NULLnullptr; | ||||
4028 | } | ||||
4029 | |||||
4030 | /* Worker function for output_constant_pool_1. Emit assembly for X | ||||
4031 | in MODE with known alignment ALIGN. */ | ||||
4032 | |||||
4033 | static void | ||||
4034 | output_constant_pool_2 (fixed_size_mode mode, rtx x, unsigned int align) | ||||
4035 | { | ||||
4036 | switch (GET_MODE_CLASS (mode)((enum mode_class) mode_class[mode])) | ||||
4037 | { | ||||
4038 | case MODE_FLOAT: | ||||
4039 | case MODE_DECIMAL_FLOAT: | ||||
4040 | { | ||||
4041 | gcc_assert (CONST_DOUBLE_AS_FLOAT_P (x))((void)(!((((enum rtx_code) (x)->code) == CONST_DOUBLE && ((machine_mode) (x)->mode) != ((void) 0, E_VOIDmode))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4041, __FUNCTION__), 0 : 0)); | ||||
4042 | assemble_real (*CONST_DOUBLE_REAL_VALUE (x)((const struct real_value *) (&(x)->u.rv)), | ||||
4043 | as_a <scalar_float_mode> (mode), align, false); | ||||
4044 | break; | ||||
4045 | } | ||||
4046 | |||||
4047 | case MODE_INT: | ||||
4048 | case MODE_PARTIAL_INT: | ||||
4049 | case MODE_FRACT: | ||||
4050 | case MODE_UFRACT: | ||||
4051 | case MODE_ACCUM: | ||||
4052 | case MODE_UACCUM: | ||||
4053 | assemble_integer (x, GET_MODE_SIZE (mode), align, 1); | ||||
4054 | break; | ||||
4055 | |||||
4056 | case MODE_VECTOR_BOOL: | ||||
4057 | { | ||||
4058 | gcc_assert (GET_CODE (x) == CONST_VECTOR)((void)(!(((enum rtx_code) (x)->code) == CONST_VECTOR) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4058, __FUNCTION__), 0 : 0)); | ||||
4059 | |||||
4060 | /* Pick the smallest integer mode that contains at least one | ||||
4061 | whole element. Often this is byte_mode and contains more | ||||
4062 | than one element. */ | ||||
4063 | unsigned int nelts = GET_MODE_NUNITS (mode); | ||||
4064 | unsigned int elt_bits = GET_MODE_BITSIZE (mode) / nelts; | ||||
4065 | unsigned int int_bits = MAX (elt_bits, BITS_PER_UNIT)((elt_bits) > ((8)) ? (elt_bits) : ((8))); | ||||
4066 | scalar_int_mode int_mode = int_mode_for_size (int_bits, 0).require (); | ||||
4067 | unsigned int mask = GET_MODE_MASK (GET_MODE_INNER (mode))mode_mask_array[(mode_to_inner (mode))]; | ||||
4068 | |||||
4069 | /* Build the constant up one integer at a time. */ | ||||
4070 | unsigned int elts_per_int = int_bits / elt_bits; | ||||
4071 | for (unsigned int i = 0; i < nelts; i += elts_per_int) | ||||
4072 | { | ||||
4073 | unsigned HOST_WIDE_INTlong value = 0; | ||||
4074 | unsigned int limit = MIN (nelts - i, elts_per_int)((nelts - i) < (elts_per_int) ? (nelts - i) : (elts_per_int )); | ||||
4075 | for (unsigned int j = 0; j < limit; ++j) | ||||
4076 | { | ||||
4077 | auto elt = INTVAL (CONST_VECTOR_ELT (x, i + j))((const_vector_elt (x, i + j))->u.hwint[0]); | ||||
4078 | value |= (elt & mask) << (j * elt_bits); | ||||
4079 | } | ||||
4080 | output_constant_pool_2 (int_mode, gen_int_mode (value, int_mode), | ||||
4081 | i != 0 ? MIN (align, int_bits)((align) < (int_bits) ? (align) : (int_bits)) : align); | ||||
4082 | } | ||||
4083 | break; | ||||
4084 | } | ||||
4085 | case MODE_VECTOR_FLOAT: | ||||
4086 | case MODE_VECTOR_INT: | ||||
4087 | case MODE_VECTOR_FRACT: | ||||
4088 | case MODE_VECTOR_UFRACT: | ||||
4089 | case MODE_VECTOR_ACCUM: | ||||
4090 | case MODE_VECTOR_UACCUM: | ||||
4091 | { | ||||
4092 | int i, units; | ||||
4093 | scalar_mode submode = GET_MODE_INNER (mode)(mode_to_inner (mode)); | ||||
4094 | unsigned int subalign = MIN (align, GET_MODE_BITSIZE (submode))((align) < (GET_MODE_BITSIZE (submode)) ? (align) : (GET_MODE_BITSIZE (submode))); | ||||
4095 | |||||
4096 | gcc_assert (GET_CODE (x) == CONST_VECTOR)((void)(!(((enum rtx_code) (x)->code) == CONST_VECTOR) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4096, __FUNCTION__), 0 : 0)); | ||||
4097 | units = GET_MODE_NUNITS (mode); | ||||
4098 | |||||
4099 | for (i = 0; i < units; i++) | ||||
4100 | { | ||||
4101 | rtx elt = CONST_VECTOR_ELT (x, i)const_vector_elt (x, i); | ||||
4102 | output_constant_pool_2 (submode, elt, i ? subalign : align); | ||||
4103 | } | ||||
4104 | } | ||||
4105 | break; | ||||
4106 | |||||
4107 | default: | ||||
4108 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4108, __FUNCTION__)); | ||||
4109 | } | ||||
4110 | } | ||||
4111 | |||||
4112 | /* Worker function for output_constant_pool. Emit constant DESC, | ||||
4113 | giving it ALIGN bits of alignment. */ | ||||
4114 | |||||
4115 | static void | ||||
4116 | output_constant_pool_1 (class constant_descriptor_rtx *desc, | ||||
4117 | unsigned int align) | ||||
4118 | { | ||||
4119 | rtx x, tmp; | ||||
4120 | |||||
4121 | x = desc->constant; | ||||
4122 | |||||
4123 | /* See if X is a LABEL_REF (or a CONST referring to a LABEL_REF) | ||||
4124 | whose CODE_LABEL has been deleted. This can occur if a jump table | ||||
4125 | is eliminated by optimization. If so, write a constant of zero | ||||
4126 | instead. Note that this can also happen by turning the | ||||
4127 | CODE_LABEL into a NOTE. */ | ||||
4128 | /* ??? This seems completely and utterly wrong. Certainly it's | ||||
4129 | not true for NOTE_INSN_DELETED_LABEL, but I disbelieve proper | ||||
4130 | functioning even with rtx_insn::deleted and friends. */ | ||||
4131 | |||||
4132 | tmp = x; | ||||
4133 | switch (GET_CODE (tmp)((enum rtx_code) (tmp)->code)) | ||||
4134 | { | ||||
4135 | case CONST: | ||||
4136 | if (GET_CODE (XEXP (tmp, 0))((enum rtx_code) ((((tmp)->u.fld[0]).rt_rtx))->code) != PLUS | ||||
4137 | || GET_CODE (XEXP (XEXP (tmp, 0), 0))((enum rtx_code) (((((((tmp)->u.fld[0]).rt_rtx))->u.fld [0]).rt_rtx))->code) != LABEL_REF) | ||||
4138 | break; | ||||
4139 | tmp = XEXP (XEXP (tmp, 0), 0)((((((tmp)->u.fld[0]).rt_rtx))->u.fld[0]).rt_rtx); | ||||
4140 | /* FALLTHRU */ | ||||
4141 | |||||
4142 | case LABEL_REF: | ||||
4143 | { | ||||
4144 | rtx_insn *insn = label_ref_label (tmp); | ||||
4145 | gcc_assert (!insn->deleted ())((void)(!(!insn->deleted ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4145, __FUNCTION__), 0 : 0)); | ||||
4146 | gcc_assert (!NOTE_P (insn)((void)(!(!(((enum rtx_code) (insn)->code) == NOTE) || ((( insn)->u.fld[4]).rt_int) != NOTE_INSN_DELETED) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4147, __FUNCTION__), 0 : 0)) | ||||
4147 | || NOTE_KIND (insn) != NOTE_INSN_DELETED)((void)(!(!(((enum rtx_code) (insn)->code) == NOTE) || ((( insn)->u.fld[4]).rt_int) != NOTE_INSN_DELETED) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4147, __FUNCTION__), 0 : 0)); | ||||
4148 | break; | ||||
4149 | } | ||||
4150 | |||||
4151 | default: | ||||
4152 | break; | ||||
4153 | } | ||||
4154 | |||||
4155 | #ifdef ASM_OUTPUT_SPECIAL_POOL_ENTRY | ||||
4156 | ASM_OUTPUT_SPECIAL_POOL_ENTRY (asm_out_file, x, desc->mode, | ||||
4157 | align, desc->labelno, done); | ||||
4158 | #endif | ||||
4159 | |||||
4160 | assemble_align (align); | ||||
4161 | |||||
4162 | /* Output the label. */ | ||||
4163 | targetm.asm_out.internal_label (asm_out_file, "LC", desc->labelno); | ||||
4164 | |||||
4165 | /* Output the data. | ||||
4166 | Pass actual alignment value while emitting string constant to asm code | ||||
4167 | as function 'output_constant_pool_1' explicitly passes the alignment as 1 | ||||
4168 | assuming that the data is already aligned which prevents the generation | ||||
4169 | of fix-up table entries. */ | ||||
4170 | output_constant_pool_2 (desc->mode, x, desc->align); | ||||
4171 | |||||
4172 | /* Make sure all constants in SECTION_MERGE and not SECTION_STRINGS | ||||
4173 | sections have proper size. */ | ||||
4174 | if (align > GET_MODE_BITSIZE (desc->mode) | ||||
4175 | && in_section | ||||
4176 | && (in_section->common.flags & SECTION_MERGE)) | ||||
4177 | assemble_align (align); | ||||
4178 | |||||
4179 | #ifdef ASM_OUTPUT_SPECIAL_POOL_ENTRY | ||||
4180 | done: | ||||
4181 | #endif | ||||
4182 | return; | ||||
4183 | } | ||||
4184 | |||||
4185 | /* Recompute the offsets of entries in POOL, and the overall size of | ||||
4186 | POOL. Do this after calling mark_constant_pool to ensure that we | ||||
4187 | are computing the offset values for the pool which we will actually | ||||
4188 | emit. */ | ||||
4189 | |||||
4190 | static void | ||||
4191 | recompute_pool_offsets (struct rtx_constant_pool *pool) | ||||
4192 | { | ||||
4193 | class constant_descriptor_rtx *desc; | ||||
4194 | pool->offset = 0; | ||||
4195 | |||||
4196 | for (desc = pool->first; desc ; desc = desc->next) | ||||
4197 | if (desc->mark) | ||||
4198 | { | ||||
4199 | /* Recalculate offset. */ | ||||
4200 | unsigned int align = desc->align; | ||||
4201 | pool->offset += (align / BITS_PER_UNIT(8)) - 1; | ||||
4202 | pool->offset &= ~ ((align / BITS_PER_UNIT(8)) - 1); | ||||
4203 | desc->offset = pool->offset; | ||||
4204 | pool->offset += GET_MODE_SIZE (desc->mode); | ||||
4205 | } | ||||
4206 | } | ||||
4207 | |||||
4208 | /* Mark all constants that are referenced by SYMBOL_REFs in X. | ||||
4209 | Emit referenced deferred strings. */ | ||||
4210 | |||||
4211 | static void | ||||
4212 | mark_constants_in_pattern (rtx insn) | ||||
4213 | { | ||||
4214 | subrtx_iterator::array_type array; | ||||
4215 | FOR_EACH_SUBRTX (iter, array, PATTERN (insn), ALL)for (subrtx_iterator iter (array, PATTERN (insn), rtx_all_subrtx_bounds ); !iter.at_end (); iter.next ()) | ||||
4216 | { | ||||
4217 | const_rtx x = *iter; | ||||
4218 | if (GET_CODE (x)((enum rtx_code) (x)->code) == SYMBOL_REF) | ||||
4219 | { | ||||
4220 | if (CONSTANT_POOL_ADDRESS_P (x)(__extension__ ({ __typeof ((x)) const _rtx = ((x)); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("CONSTANT_POOL_ADDRESS_P", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4220, __FUNCTION__); _rtx; })->unchanging)) | ||||
4221 | { | ||||
4222 | class constant_descriptor_rtx *desc = SYMBOL_REF_CONSTANT (x)((__extension__ ({ __typeof ((x)) const _rtx = ((x)); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("CONSTANT_POOL_ADDRESS_P", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4222, __FUNCTION__); _rtx; })->unchanging) ? ((((x))-> u.fld[1]).rt_constant) : nullptr); | ||||
4223 | if (desc->mark == 0) | ||||
4224 | { | ||||
4225 | desc->mark = 1; | ||||
4226 | iter.substitute (desc->constant); | ||||
4227 | } | ||||
4228 | } | ||||
4229 | else if (TREE_CONSTANT_POOL_ADDRESS_P (x)(__extension__ ({ __typeof ((x)) const _rtx = ((x)); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("TREE_CONSTANT_POOL_ADDRESS_P", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4229, __FUNCTION__); _rtx; })->frame_related)) | ||||
4230 | { | ||||
4231 | tree decl = SYMBOL_REF_DECL (x)((__extension__ ({ __typeof ((x)) const _rtx = ((x)); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("CONSTANT_POOL_ADDRESS_P", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4231, __FUNCTION__); _rtx; })->unchanging) ? nullptr : ( (((x))->u.fld[1]).rt_tree)); | ||||
4232 | if (!TREE_ASM_WRITTEN (DECL_INITIAL (decl))((((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4232, __FUNCTION__))->decl_common.initial))->base.asm_written_flag )) | ||||
4233 | { | ||||
4234 | n_deferred_constants((&x_rtl)->varasm.deferred_constants)--; | ||||
4235 | output_constant_def_contents (CONST_CAST_RTX (x)(const_cast<struct rtx_def *> (((x))))); | ||||
4236 | } | ||||
4237 | } | ||||
4238 | } | ||||
4239 | } | ||||
4240 | } | ||||
4241 | |||||
4242 | /* Look through appropriate parts of INSN, marking all entries in the | ||||
4243 | constant pool which are actually being used. Entries that are only | ||||
4244 | referenced by other constants are also marked as used. Emit | ||||
4245 | deferred strings that are used. */ | ||||
4246 | |||||
4247 | static void | ||||
4248 | mark_constants (rtx_insn *insn) | ||||
4249 | { | ||||
4250 | if (!INSN_P (insn)(((((enum rtx_code) (insn)->code) == INSN) || (((enum rtx_code ) (insn)->code) == JUMP_INSN) || (((enum rtx_code) (insn)-> code) == CALL_INSN)) || (((enum rtx_code) (insn)->code) == DEBUG_INSN))) | ||||
4251 | return; | ||||
4252 | |||||
4253 | /* Insns may appear inside a SEQUENCE. Only check the patterns of | ||||
4254 | insns, not any notes that may be attached. We don't want to mark | ||||
4255 | a constant just because it happens to appear in a REG_EQUIV note. */ | ||||
4256 | if (rtx_sequence *seq = dyn_cast <rtx_sequence *> (PATTERN (insn))) | ||||
4257 | { | ||||
4258 | int i, n = seq->len (); | ||||
4259 | for (i = 0; i < n; ++i) | ||||
4260 | { | ||||
4261 | rtx subinsn = seq->element (i); | ||||
4262 | if (INSN_P (subinsn)(((((enum rtx_code) (subinsn)->code) == INSN) || (((enum rtx_code ) (subinsn)->code) == JUMP_INSN) || (((enum rtx_code) (subinsn )->code) == CALL_INSN)) || (((enum rtx_code) (subinsn)-> code) == DEBUG_INSN))) | ||||
4263 | mark_constants_in_pattern (subinsn); | ||||
4264 | } | ||||
4265 | } | ||||
4266 | else | ||||
4267 | mark_constants_in_pattern (insn); | ||||
4268 | } | ||||
4269 | |||||
4270 | /* Look through the instructions for this function, and mark all the | ||||
4271 | entries in POOL which are actually being used. Emit deferred constants | ||||
4272 | which have indeed been used. */ | ||||
4273 | |||||
4274 | static void | ||||
4275 | mark_constant_pool (void) | ||||
4276 | { | ||||
4277 | rtx_insn *insn; | ||||
4278 | |||||
4279 | if (!crtl(&x_rtl)->uses_const_pool && n_deferred_constants((&x_rtl)->varasm.deferred_constants) == 0) | ||||
4280 | return; | ||||
4281 | |||||
4282 | for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) | ||||
4283 | mark_constants (insn); | ||||
4284 | } | ||||
4285 | |||||
4286 | /* Write all the constants in POOL. */ | ||||
4287 | |||||
4288 | static void | ||||
4289 | output_constant_pool_contents (struct rtx_constant_pool *pool) | ||||
4290 | { | ||||
4291 | class constant_descriptor_rtx *desc; | ||||
4292 | |||||
4293 | for (desc = pool->first; desc ; desc = desc->next) | ||||
4294 | if (desc->mark < 0) | ||||
4295 | { | ||||
4296 | #ifdef ASM_OUTPUT_DEF | ||||
4297 | const char *name = XSTR (desc->sym, 0)(((desc->sym)->u.fld[0]).rt_str); | ||||
4298 | char label[256]; | ||||
4299 | char buffer[256 + 32]; | ||||
4300 | const char *p; | ||||
4301 | |||||
4302 | ASM_GENERATE_INTERNAL_LABEL (label, "LC", ~desc->mark)do { char *__p; (label)[0] = '*'; (label)[1] = '.'; __p = stpcpy (&(label)[2], "LC"); sprint_ul (__p, (unsigned long) (~desc ->mark)); } while (0); | ||||
4303 | p = label; | ||||
4304 | if (desc->offset) | ||||
4305 | { | ||||
4306 | sprintf (buffer, "%s+%ld", p, (long) (desc->offset)); | ||||
4307 | p = buffer; | ||||
4308 | } | ||||
4309 | ASM_OUTPUT_DEF (asm_out_file, name, p)do { fprintf ((asm_out_file), "%s", "\t.set\t"); assemble_name (asm_out_file, name); fprintf (asm_out_file, ","); assemble_name (asm_out_file, p); fprintf (asm_out_file, "\n"); } while (0); | ||||
4310 | #else | ||||
4311 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4311, __FUNCTION__)); | ||||
4312 | #endif | ||||
4313 | } | ||||
4314 | else if (desc->mark) | ||||
4315 | { | ||||
4316 | /* If the constant is part of an object_block, make sure that | ||||
4317 | the constant has been positioned within its block, but do not | ||||
4318 | write out its definition yet. output_object_blocks will do | ||||
4319 | that later. */ | ||||
4320 | if (SYMBOL_REF_HAS_BLOCK_INFO_P (desc->sym)(((__extension__ ({ __typeof ((desc->sym)) const _rtx = (( desc->sym)); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF ) rtl_check_failed_flag ("SYMBOL_REF_FLAGS", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4320, __FUNCTION__); _rtx; }) ->u2.symbol_ref_flags) & (1 << 7)) != 0) | ||||
4321 | && SYMBOL_REF_BLOCK (desc->sym)((&(desc->sym)->u.block_sym)->block)) | ||||
4322 | place_block_symbol (desc->sym); | ||||
4323 | else | ||||
4324 | { | ||||
4325 | switch_to_section (targetm.asm_out.select_rtx_section | ||||
4326 | (desc->mode, desc->constant, desc->align)); | ||||
4327 | output_constant_pool_1 (desc, desc->align); | ||||
4328 | } | ||||
4329 | } | ||||
4330 | } | ||||
4331 | |||||
4332 | struct constant_descriptor_rtx_data { | ||||
4333 | constant_descriptor_rtx *desc; | ||||
4334 | target_unit *bytes; | ||||
4335 | unsigned short size; | ||||
4336 | unsigned short offset; | ||||
4337 | unsigned int hash; | ||||
4338 | }; | ||||
4339 | |||||
4340 | /* qsort callback to sort constant_descriptor_rtx_data * vector by | ||||
4341 | decreasing size. */ | ||||
4342 | |||||
4343 | static int | ||||
4344 | constant_descriptor_rtx_data_cmp (const void *p1, const void *p2) | ||||
4345 | { | ||||
4346 | constant_descriptor_rtx_data *const data1 | ||||
4347 | = *(constant_descriptor_rtx_data * const *) p1; | ||||
4348 | constant_descriptor_rtx_data *const data2 | ||||
4349 | = *(constant_descriptor_rtx_data * const *) p2; | ||||
4350 | if (data1->size > data2->size) | ||||
4351 | return -1; | ||||
4352 | if (data1->size < data2->size) | ||||
4353 | return 1; | ||||
4354 | if (data1->hash < data2->hash) | ||||
4355 | return -1; | ||||
4356 | gcc_assert (data1->hash > data2->hash)((void)(!(data1->hash > data2->hash) ? fancy_abort ( "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4356, __FUNCTION__), 0 : 0)); | ||||
4357 | return 1; | ||||
4358 | } | ||||
4359 | |||||
4360 | struct const_rtx_data_hasher : nofree_ptr_hash<constant_descriptor_rtx_data> | ||||
4361 | { | ||||
4362 | static hashval_t hash (constant_descriptor_rtx_data *); | ||||
4363 | static bool equal (constant_descriptor_rtx_data *, | ||||
4364 | constant_descriptor_rtx_data *); | ||||
4365 | }; | ||||
4366 | |||||
4367 | /* Hash and compare functions for const_rtx_data_htab. */ | ||||
4368 | |||||
4369 | hashval_t | ||||
4370 | const_rtx_data_hasher::hash (constant_descriptor_rtx_data *data) | ||||
4371 | { | ||||
4372 | return data->hash; | ||||
4373 | } | ||||
4374 | |||||
4375 | bool | ||||
4376 | const_rtx_data_hasher::equal (constant_descriptor_rtx_data *x, | ||||
4377 | constant_descriptor_rtx_data *y) | ||||
4378 | { | ||||
4379 | if (x->hash != y->hash || x->size != y->size) | ||||
4380 | return 0; | ||||
4381 | unsigned int align1 = x->desc->align; | ||||
4382 | unsigned int align2 = y->desc->align; | ||||
4383 | unsigned int offset1 = (x->offset * BITS_PER_UNIT(8)) & (align1 - 1); | ||||
4384 | unsigned int offset2 = (y->offset * BITS_PER_UNIT(8)) & (align2 - 1); | ||||
4385 | if (offset1) | ||||
4386 | align1 = least_bit_hwi (offset1); | ||||
4387 | if (offset2) | ||||
4388 | align2 = least_bit_hwi (offset2); | ||||
4389 | if (align2 > align1) | ||||
4390 | return 0; | ||||
4391 | if (memcmp (x->bytes, y->bytes, x->size * sizeof (target_unit)) != 0) | ||||
4392 | return 0; | ||||
4393 | return 1; | ||||
4394 | } | ||||
4395 | |||||
4396 | /* Attempt to optimize constant pool POOL. If it contains both CONST_VECTOR | ||||
4397 | constants and scalar constants with the values of CONST_VECTOR elements, | ||||
4398 | try to alias the scalar constants with the CONST_VECTOR elements. */ | ||||
4399 | |||||
4400 | static void | ||||
4401 | optimize_constant_pool (struct rtx_constant_pool *pool) | ||||
4402 | { | ||||
4403 | auto_vec<target_unit, 128> buffer; | ||||
4404 | auto_vec<constant_descriptor_rtx_data *, 128> vec; | ||||
4405 | object_allocator<constant_descriptor_rtx_data> | ||||
4406 | data_pool ("constant_descriptor_rtx_data_pool"); | ||||
4407 | int idx = 0; | ||||
4408 | size_t size = 0; | ||||
4409 | for (constant_descriptor_rtx *desc = pool->first; desc; desc = desc->next) | ||||
4410 | if (desc->mark > 0 | ||||
4411 | && ! (SYMBOL_REF_HAS_BLOCK_INFO_P (desc->sym)(((__extension__ ({ __typeof ((desc->sym)) const _rtx = (( desc->sym)); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF ) rtl_check_failed_flag ("SYMBOL_REF_FLAGS", _rtx, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4411, __FUNCTION__); _rtx; }) ->u2.symbol_ref_flags) & (1 << 7)) != 0) | ||||
4412 | && SYMBOL_REF_BLOCK (desc->sym)((&(desc->sym)->u.block_sym)->block))) | ||||
4413 | { | ||||
4414 | buffer.truncate (0); | ||||
4415 | buffer.reserve (GET_MODE_SIZE (desc->mode)); | ||||
4416 | if (native_encode_rtx (desc->mode, desc->constant, buffer, 0, | ||||
4417 | GET_MODE_SIZE (desc->mode))) | ||||
4418 | { | ||||
4419 | constant_descriptor_rtx_data *data = data_pool.allocate (); | ||||
4420 | data->desc = desc; | ||||
4421 | data->bytes = NULLnullptr; | ||||
4422 | data->size = GET_MODE_SIZE (desc->mode); | ||||
4423 | data->offset = 0; | ||||
4424 | data->hash = idx++; | ||||
4425 | size += data->size; | ||||
4426 | vec.safe_push (data); | ||||
4427 | } | ||||
4428 | } | ||||
4429 | if (idx
| ||||
4430 | { | ||||
4431 | vec.qsort (constant_descriptor_rtx_data_cmp)qsort (constant_descriptor_rtx_data_cmp); | ||||
4432 | unsigned min_size = vec.last ()->size; | ||||
4433 | target_unit *bytes = XNEWVEC (target_unit, size)((target_unit *) xmalloc (sizeof (target_unit) * (size))); | ||||
4434 | unsigned int i; | ||||
4435 | constant_descriptor_rtx_data *data; | ||||
4436 | hash_table<const_rtx_data_hasher> * htab | ||||
4437 | = new hash_table<const_rtx_data_hasher> (31); | ||||
4438 | size = 0; | ||||
4439 | FOR_EACH_VEC_ELT (vec, i, data)for (i = 0; (vec).iterate ((i), &(data)); ++(i)) | ||||
4440 | { | ||||
4441 | buffer.truncate (0); | ||||
4442 | native_encode_rtx (data->desc->mode, data->desc->constant, | ||||
4443 | buffer, 0, data->size); | ||||
4444 | memcpy (bytes + size, buffer.address (), data->size); | ||||
4445 | data->bytes = bytes + size; | ||||
4446 | data->hash = iterative_hash (data->bytes, | ||||
4447 | data->size * sizeof (target_unit), 0); | ||||
4448 | size += data->size; | ||||
4449 | constant_descriptor_rtx_data **slot | ||||
4450 | = htab->find_slot_with_hash (data, data->hash, INSERT); | ||||
4451 | if (*slot) | ||||
4452 | { | ||||
4453 | data->desc->mark = ~(*slot)->desc->labelno; | ||||
4454 | data->desc->offset = (*slot)->offset; | ||||
4455 | } | ||||
4456 | else | ||||
4457 | { | ||||
4458 | unsigned int sz = 1 << floor_log2 (data->size); | ||||
| |||||
4459 | |||||
4460 | *slot = data; | ||||
4461 | for (sz >>= 1; sz >= min_size; sz >>= 1) | ||||
4462 | for (unsigned off = 0; off + sz <= data->size; off += sz) | ||||
4463 | { | ||||
4464 | constant_descriptor_rtx_data tmp; | ||||
4465 | tmp.desc = data->desc; | ||||
4466 | tmp.bytes = data->bytes + off; | ||||
4467 | tmp.size = sz; | ||||
4468 | tmp.offset = off; | ||||
4469 | tmp.hash = iterative_hash (tmp.bytes, | ||||
4470 | sz * sizeof (target_unit), 0); | ||||
4471 | slot = htab->find_slot_with_hash (&tmp, tmp.hash, INSERT); | ||||
4472 | if (*slot == NULLnullptr) | ||||
4473 | { | ||||
4474 | *slot = data_pool.allocate (); | ||||
4475 | **slot = tmp; | ||||
4476 | } | ||||
4477 | } | ||||
4478 | } | ||||
4479 | } | ||||
4480 | delete htab; | ||||
4481 | XDELETE (bytes)free ((void*) (bytes)); | ||||
4482 | } | ||||
4483 | data_pool.release (); | ||||
4484 | } | ||||
4485 | |||||
4486 | /* Mark all constants that are used in the current function, then write | ||||
4487 | out the function's private constant pool. */ | ||||
4488 | |||||
4489 | static void | ||||
4490 | output_constant_pool (const char *fnname ATTRIBUTE_UNUSED__attribute__ ((__unused__)), | ||||
4491 | tree fndecl ATTRIBUTE_UNUSED__attribute__ ((__unused__))) | ||||
4492 | { | ||||
4493 | struct rtx_constant_pool *pool = crtl(&x_rtl)->varasm.pool; | ||||
4494 | |||||
4495 | /* It is possible for gcc to call force_const_mem and then to later | ||||
4496 | discard the instructions which refer to the constant. In such a | ||||
4497 | case we do not need to output the constant. */ | ||||
4498 | mark_constant_pool (); | ||||
4499 | |||||
4500 | /* Having marked the constant pool entries we'll actually emit, we | ||||
4501 | now need to rebuild the offset information, which may have become | ||||
4502 | stale. */ | ||||
4503 | recompute_pool_offsets (pool); | ||||
4504 | |||||
4505 | #ifdef ASM_OUTPUT_POOL_PROLOGUE | ||||
4506 | ASM_OUTPUT_POOL_PROLOGUE (asm_out_file, fnname, fndecl, pool->offset); | ||||
4507 | #endif | ||||
4508 | |||||
4509 | output_constant_pool_contents (pool); | ||||
4510 | |||||
4511 | #ifdef ASM_OUTPUT_POOL_EPILOGUE | ||||
4512 | ASM_OUTPUT_POOL_EPILOGUE (asm_out_file, fnname, fndecl, pool->offset); | ||||
4513 | #endif | ||||
4514 | } | ||||
4515 | |||||
4516 | /* Write the contents of the shared constant pool. */ | ||||
4517 | |||||
4518 | void | ||||
4519 | output_shared_constant_pool (void) | ||||
4520 | { | ||||
4521 | if (optimizeglobal_options.x_optimize | ||||
| |||||
4522 | && TARGET_SUPPORTS_ALIASES1) | ||||
4523 | optimize_constant_pool (shared_constant_pool); | ||||
4524 | |||||
4525 | output_constant_pool_contents (shared_constant_pool); | ||||
4526 | } | ||||
4527 | |||||
4528 | /* Determine what kind of relocations EXP may need. */ | ||||
4529 | |||||
4530 | int | ||||
4531 | compute_reloc_for_constant (tree exp) | ||||
4532 | { | ||||
4533 | int reloc = 0, reloc2; | ||||
4534 | tree tem; | ||||
4535 | |||||
4536 | switch (TREE_CODE (exp)((enum tree_code) (exp)->base.code)) | ||||
4537 | { | ||||
4538 | case ADDR_EXPR: | ||||
4539 | case FDESC_EXPR: | ||||
4540 | /* Go inside any operations that get_inner_reference can handle and see | ||||
4541 | if what's inside is a constant: no need to do anything here for | ||||
4542 | addresses of variables or functions. */ | ||||
4543 | for (tem = TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4543, __FUNCTION__))))); handled_component_p (tem); | ||||
4544 | tem = TREE_OPERAND (tem, 0)(*((const_cast<tree*> (tree_operand_check ((tem), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4544, __FUNCTION__)))))) | ||||
4545 | ; | ||||
4546 | |||||
4547 | if (TREE_CODE (tem)((enum tree_code) (tem)->base.code) == MEM_REF | ||||
4548 | && TREE_CODE (TREE_OPERAND (tem, 0))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check ((tem), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4548, __FUNCTION__))))))->base.code) == ADDR_EXPR) | ||||
4549 | { | ||||
4550 | reloc = compute_reloc_for_constant (TREE_OPERAND (tem, 0)(*((const_cast<tree*> (tree_operand_check ((tem), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4550, __FUNCTION__)))))); | ||||
4551 | break; | ||||
4552 | } | ||||
4553 | |||||
4554 | if (!targetm.binds_local_p (tem)) | ||||
4555 | reloc |= 2; | ||||
4556 | else | ||||
4557 | reloc |= 1; | ||||
4558 | break; | ||||
4559 | |||||
4560 | case PLUS_EXPR: | ||||
4561 | case POINTER_PLUS_EXPR: | ||||
4562 | reloc = compute_reloc_for_constant (TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4562, __FUNCTION__)))))); | ||||
4563 | reloc |= compute_reloc_for_constant (TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4563, __FUNCTION__)))))); | ||||
4564 | break; | ||||
4565 | |||||
4566 | case MINUS_EXPR: | ||||
4567 | reloc = compute_reloc_for_constant (TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4567, __FUNCTION__)))))); | ||||
4568 | reloc2 = compute_reloc_for_constant (TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4568, __FUNCTION__)))))); | ||||
4569 | /* The difference of two local labels is computable at link time. */ | ||||
4570 | if (reloc == 1 && reloc2 == 1) | ||||
4571 | reloc = 0; | ||||
4572 | else | ||||
4573 | reloc |= reloc2; | ||||
4574 | break; | ||||
4575 | |||||
4576 | CASE_CONVERTcase NOP_EXPR: case CONVERT_EXPR: | ||||
4577 | case VIEW_CONVERT_EXPR: | ||||
4578 | reloc = compute_reloc_for_constant (TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4578, __FUNCTION__)))))); | ||||
4579 | break; | ||||
4580 | |||||
4581 | case CONSTRUCTOR: | ||||
4582 | { | ||||
4583 | unsigned HOST_WIDE_INTlong idx; | ||||
4584 | FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (exp), idx, tem)for (idx = 0; (idx >= vec_safe_length (((tree_check ((exp) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4584, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts))) ? false : ((tem = (*(((tree_check ((exp), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4584, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts))) [idx].value), true); (idx)++) | ||||
4585 | if (tem != 0) | ||||
4586 | reloc |= compute_reloc_for_constant (tem); | ||||
4587 | } | ||||
4588 | break; | ||||
4589 | |||||
4590 | default: | ||||
4591 | break; | ||||
4592 | } | ||||
4593 | return reloc; | ||||
4594 | } | ||||
4595 | |||||
4596 | /* Find all the constants whose addresses are referenced inside of EXP, | ||||
4597 | and make sure assembler code with a label has been output for each one. | ||||
4598 | Indicate whether an ADDR_EXPR has been encountered. */ | ||||
4599 | |||||
4600 | static void | ||||
4601 | output_addressed_constants (tree exp, int defer) | ||||
4602 | { | ||||
4603 | tree tem; | ||||
4604 | |||||
4605 | switch (TREE_CODE (exp)((enum tree_code) (exp)->base.code)) | ||||
4606 | { | ||||
4607 | case ADDR_EXPR: | ||||
4608 | case FDESC_EXPR: | ||||
4609 | /* Go inside any operations that get_inner_reference can handle and see | ||||
4610 | if what's inside is a constant: no need to do anything here for | ||||
4611 | addresses of variables or functions. */ | ||||
4612 | for (tem = TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4612, __FUNCTION__))))); handled_component_p (tem); | ||||
4613 | tem = TREE_OPERAND (tem, 0)(*((const_cast<tree*> (tree_operand_check ((tem), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4613, __FUNCTION__)))))) | ||||
4614 | ; | ||||
4615 | |||||
4616 | /* If we have an initialized CONST_DECL, retrieve the initializer. */ | ||||
4617 | if (TREE_CODE (tem)((enum tree_code) (tem)->base.code) == CONST_DECL && DECL_INITIAL (tem)((contains_struct_check ((tem), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4617, __FUNCTION__))->decl_common.initial)) | ||||
4618 | tem = DECL_INITIAL (tem)((contains_struct_check ((tem), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4618, __FUNCTION__))->decl_common.initial); | ||||
4619 | |||||
4620 | if (CONSTANT_CLASS_P (tem)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (tem)->base.code))] == tcc_constant) || TREE_CODE (tem)((enum tree_code) (tem)->base.code) == CONSTRUCTOR) | ||||
4621 | output_constant_def (tem, defer); | ||||
4622 | |||||
4623 | if (TREE_CODE (tem)((enum tree_code) (tem)->base.code) == MEM_REF) | ||||
4624 | output_addressed_constants (TREE_OPERAND (tem, 0)(*((const_cast<tree*> (tree_operand_check ((tem), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4624, __FUNCTION__))))), defer); | ||||
4625 | break; | ||||
4626 | |||||
4627 | case PLUS_EXPR: | ||||
4628 | case POINTER_PLUS_EXPR: | ||||
4629 | case MINUS_EXPR: | ||||
4630 | output_addressed_constants (TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4630, __FUNCTION__))))), defer); | ||||
4631 | gcc_fallthrough (); | ||||
4632 | |||||
4633 | CASE_CONVERTcase NOP_EXPR: case CONVERT_EXPR: | ||||
4634 | case VIEW_CONVERT_EXPR: | ||||
4635 | output_addressed_constants (TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4635, __FUNCTION__))))), defer); | ||||
4636 | break; | ||||
4637 | |||||
4638 | case CONSTRUCTOR: | ||||
4639 | { | ||||
4640 | unsigned HOST_WIDE_INTlong idx; | ||||
4641 | FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (exp), idx, tem)for (idx = 0; (idx >= vec_safe_length (((tree_check ((exp) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4641, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts))) ? false : ((tem = (*(((tree_check ((exp), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4641, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts))) [idx].value), true); (idx)++) | ||||
4642 | if (tem != 0) | ||||
4643 | output_addressed_constants (tem, defer); | ||||
4644 | } | ||||
4645 | break; | ||||
4646 | |||||
4647 | default: | ||||
4648 | break; | ||||
4649 | } | ||||
4650 | } | ||||
4651 | |||||
4652 | /* Whether a constructor CTOR is a valid static constant initializer if all | ||||
4653 | its elements are. This used to be internal to initializer_constant_valid_p | ||||
4654 | and has been exposed to let other functions like categorize_ctor_elements | ||||
4655 | evaluate the property while walking a constructor for other purposes. */ | ||||
4656 | |||||
4657 | bool | ||||
4658 | constructor_static_from_elts_p (const_tree ctor) | ||||
4659 | { | ||||
4660 | return (TREE_CONSTANT (ctor)((non_type_check ((ctor), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4660, __FUNCTION__))->base.constant_flag) | ||||
4661 | && (TREE_CODE (TREE_TYPE (ctor))((enum tree_code) (((contains_struct_check ((ctor), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4661, __FUNCTION__))->typed.type))->base.code) == UNION_TYPE | ||||
4662 | || TREE_CODE (TREE_TYPE (ctor))((enum tree_code) (((contains_struct_check ((ctor), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4662, __FUNCTION__))->typed.type))->base.code) == RECORD_TYPE | ||||
4663 | || TREE_CODE (TREE_TYPE (ctor))((enum tree_code) (((contains_struct_check ((ctor), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4663, __FUNCTION__))->typed.type))->base.code) == ARRAY_TYPE)); | ||||
4664 | } | ||||
4665 | |||||
4666 | static tree initializer_constant_valid_p_1 (tree value, tree endtype, | ||||
4667 | tree *cache); | ||||
4668 | |||||
4669 | /* A subroutine of initializer_constant_valid_p. VALUE is a MINUS_EXPR, | ||||
4670 | PLUS_EXPR or POINTER_PLUS_EXPR. This looks for cases of VALUE | ||||
4671 | which are valid when ENDTYPE is an integer of any size; in | ||||
4672 | particular, this does not accept a pointer minus a constant. This | ||||
4673 | returns null_pointer_node if the VALUE is an absolute constant | ||||
4674 | which can be used to initialize a static variable. Otherwise it | ||||
4675 | returns NULL. */ | ||||
4676 | |||||
4677 | static tree | ||||
4678 | narrowing_initializer_constant_valid_p (tree value, tree endtype, tree *cache) | ||||
4679 | { | ||||
4680 | tree op0, op1; | ||||
4681 | |||||
4682 | if (!INTEGRAL_TYPE_P (endtype)(((enum tree_code) (endtype)->base.code) == ENUMERAL_TYPE || ((enum tree_code) (endtype)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (endtype)->base.code) == INTEGER_TYPE)) | ||||
4683 | return NULL_TREE(tree) nullptr; | ||||
4684 | |||||
4685 | op0 = TREE_OPERAND (value, 0)(*((const_cast<tree*> (tree_operand_check ((value), (0) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4685, __FUNCTION__))))); | ||||
4686 | op1 = TREE_OPERAND (value, 1)(*((const_cast<tree*> (tree_operand_check ((value), (1) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4686, __FUNCTION__))))); | ||||
4687 | |||||
4688 | /* Like STRIP_NOPS except allow the operand mode to widen. This | ||||
4689 | works around a feature of fold that simplifies (int)(p1 - p2) to | ||||
4690 | ((int)p1 - (int)p2) under the theory that the narrower operation | ||||
4691 | is cheaper. */ | ||||
4692 | |||||
4693 | while (CONVERT_EXPR_P (op0)((((enum tree_code) (op0)->base.code)) == NOP_EXPR || (((enum tree_code) (op0)->base.code)) == CONVERT_EXPR) | ||||
4694 | || TREE_CODE (op0)((enum tree_code) (op0)->base.code) == NON_LVALUE_EXPR) | ||||
4695 | { | ||||
4696 | tree inner = TREE_OPERAND (op0, 0)(*((const_cast<tree*> (tree_operand_check ((op0), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4696, __FUNCTION__))))); | ||||
4697 | if (inner == error_mark_nodeglobal_trees[TI_ERROR_MARK] | ||||
4698 | || ! INTEGRAL_TYPE_P (TREE_TYPE (op0))(((enum tree_code) (((contains_struct_check ((op0), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4698, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE || ((enum tree_code) (((contains_struct_check ((op0), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4698, __FUNCTION__))->typed.type))->base.code) == BOOLEAN_TYPE || ((enum tree_code) (((contains_struct_check ((op0), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4698, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE ) | ||||
4699 | || ! SCALAR_INT_MODE_P (TYPE_MODE (TREE_TYPE (op0)))(((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check ((((contains_struct_check ((op0), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4699, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4699, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (((contains_struct_check ((op0), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4699, __FUNCTION__))->typed.type)) : (((contains_struct_check ((op0), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4699, __FUNCTION__))->typed.type))->type_common.mode) ]) == MODE_INT || ((enum mode_class) mode_class[((((enum tree_code ) ((tree_class_check ((((contains_struct_check ((op0), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4699, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4699, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (((contains_struct_check ((op0), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4699, __FUNCTION__))->typed.type)) : (((contains_struct_check ((op0), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4699, __FUNCTION__))->typed.type))->type_common.mode) ]) == MODE_PARTIAL_INT) | ||||
4700 | || ! INTEGRAL_TYPE_P (TREE_TYPE (inner))(((enum tree_code) (((contains_struct_check ((inner), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4700, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE || ((enum tree_code) (((contains_struct_check ((inner), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4700, __FUNCTION__))->typed.type))->base.code) == BOOLEAN_TYPE || ((enum tree_code) (((contains_struct_check ((inner), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4700, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE ) | ||||
4701 | || ! SCALAR_INT_MODE_P (TYPE_MODE (TREE_TYPE (inner)))(((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check ((((contains_struct_check ((inner), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4701, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4701, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (((contains_struct_check ((inner), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4701, __FUNCTION__))->typed.type)) : (((contains_struct_check ((inner), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4701, __FUNCTION__))->typed.type))->type_common.mode) ]) == MODE_INT || ((enum mode_class) mode_class[((((enum tree_code ) ((tree_class_check ((((contains_struct_check ((inner), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4701, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4701, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (((contains_struct_check ((inner), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4701, __FUNCTION__))->typed.type)) : (((contains_struct_check ((inner), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4701, __FUNCTION__))->typed.type))->type_common.mode) ]) == MODE_PARTIAL_INT) | ||||
4702 | || (GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (TREE_TYPE (op0))(as_a <scalar_int_mode> ((tree_class_check ((((contains_struct_check ((op0), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4702, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4702, __FUNCTION__))->type_common.mode))) | ||||
4703 | > GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (TREE_TYPE (inner))(as_a <scalar_int_mode> ((tree_class_check ((((contains_struct_check ((inner), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4703, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4703, __FUNCTION__))->type_common.mode))))) | ||||
4704 | break; | ||||
4705 | op0 = inner; | ||||
4706 | } | ||||
4707 | |||||
4708 | while (CONVERT_EXPR_P (op1)((((enum tree_code) (op1)->base.code)) == NOP_EXPR || (((enum tree_code) (op1)->base.code)) == CONVERT_EXPR) | ||||
4709 | || TREE_CODE (op1)((enum tree_code) (op1)->base.code) == NON_LVALUE_EXPR) | ||||
4710 | { | ||||
4711 | tree inner = TREE_OPERAND (op1, 0)(*((const_cast<tree*> (tree_operand_check ((op1), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4711, __FUNCTION__))))); | ||||
4712 | if (inner == error_mark_nodeglobal_trees[TI_ERROR_MARK] | ||||
4713 | || ! INTEGRAL_TYPE_P (TREE_TYPE (op1))(((enum tree_code) (((contains_struct_check ((op1), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4713, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE || ((enum tree_code) (((contains_struct_check ((op1), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4713, __FUNCTION__))->typed.type))->base.code) == BOOLEAN_TYPE || ((enum tree_code) (((contains_struct_check ((op1), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4713, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE ) | ||||
4714 | || ! SCALAR_INT_MODE_P (TYPE_MODE (TREE_TYPE (op1)))(((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check ((((contains_struct_check ((op1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4714, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4714, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (((contains_struct_check ((op1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4714, __FUNCTION__))->typed.type)) : (((contains_struct_check ((op1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4714, __FUNCTION__))->typed.type))->type_common.mode) ]) == MODE_INT || ((enum mode_class) mode_class[((((enum tree_code ) ((tree_class_check ((((contains_struct_check ((op1), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4714, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4714, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (((contains_struct_check ((op1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4714, __FUNCTION__))->typed.type)) : (((contains_struct_check ((op1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4714, __FUNCTION__))->typed.type))->type_common.mode) ]) == MODE_PARTIAL_INT) | ||||
4715 | || ! INTEGRAL_TYPE_P (TREE_TYPE (inner))(((enum tree_code) (((contains_struct_check ((inner), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4715, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE || ((enum tree_code) (((contains_struct_check ((inner), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4715, __FUNCTION__))->typed.type))->base.code) == BOOLEAN_TYPE || ((enum tree_code) (((contains_struct_check ((inner), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4715, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE ) | ||||
4716 | || ! SCALAR_INT_MODE_P (TYPE_MODE (TREE_TYPE (inner)))(((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check ((((contains_struct_check ((inner), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4716, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4716, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (((contains_struct_check ((inner), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4716, __FUNCTION__))->typed.type)) : (((contains_struct_check ((inner), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4716, __FUNCTION__))->typed.type))->type_common.mode) ]) == MODE_INT || ((enum mode_class) mode_class[((((enum tree_code ) ((tree_class_check ((((contains_struct_check ((inner), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4716, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4716, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (((contains_struct_check ((inner), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4716, __FUNCTION__))->typed.type)) : (((contains_struct_check ((inner), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4716, __FUNCTION__))->typed.type))->type_common.mode) ]) == MODE_PARTIAL_INT) | ||||
4717 | || (GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (TREE_TYPE (op1))(as_a <scalar_int_mode> ((tree_class_check ((((contains_struct_check ((op1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4717, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4717, __FUNCTION__))->type_common.mode))) | ||||
4718 | > GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (TREE_TYPE (inner))(as_a <scalar_int_mode> ((tree_class_check ((((contains_struct_check ((inner), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4718, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4718, __FUNCTION__))->type_common.mode))))) | ||||
4719 | break; | ||||
4720 | op1 = inner; | ||||
4721 | } | ||||
4722 | |||||
4723 | op0 = initializer_constant_valid_p_1 (op0, endtype, cache); | ||||
4724 | if (!op0) | ||||
4725 | return NULL_TREE(tree) nullptr; | ||||
4726 | |||||
4727 | op1 = initializer_constant_valid_p_1 (op1, endtype, | ||||
4728 | cache ? cache + 2 : NULLnullptr); | ||||
4729 | /* Both initializers must be known. */ | ||||
4730 | if (op1) | ||||
4731 | { | ||||
4732 | if (op0 == op1 | ||||
4733 | && (op0 == null_pointer_nodeglobal_trees[TI_NULL_POINTER] | ||||
4734 | || TREE_CODE (value)((enum tree_code) (value)->base.code) == MINUS_EXPR)) | ||||
4735 | return null_pointer_nodeglobal_trees[TI_NULL_POINTER]; | ||||
4736 | |||||
4737 | /* Support differences between labels. */ | ||||
4738 | if (TREE_CODE (op0)((enum tree_code) (op0)->base.code) == LABEL_DECL | ||||
4739 | && TREE_CODE (op1)((enum tree_code) (op1)->base.code) == LABEL_DECL) | ||||
4740 | return null_pointer_nodeglobal_trees[TI_NULL_POINTER]; | ||||
4741 | |||||
4742 | if (TREE_CODE (op0)((enum tree_code) (op0)->base.code) == STRING_CST | ||||
4743 | && TREE_CODE (op1)((enum tree_code) (op1)->base.code) == STRING_CST | ||||
4744 | && operand_equal_p (op0, op1, 1)) | ||||
4745 | return null_pointer_nodeglobal_trees[TI_NULL_POINTER]; | ||||
4746 | } | ||||
4747 | |||||
4748 | return NULL_TREE(tree) nullptr; | ||||
4749 | } | ||||
4750 | |||||
4751 | /* Helper function of initializer_constant_valid_p. | ||||
4752 | Return nonzero if VALUE is a valid constant-valued expression | ||||
4753 | for use in initializing a static variable; one that can be an | ||||
4754 | element of a "constant" initializer. | ||||
4755 | |||||
4756 | Return null_pointer_node if the value is absolute; | ||||
4757 | if it is relocatable, return the variable that determines the relocation. | ||||
4758 | We assume that VALUE has been folded as much as possible; | ||||
4759 | therefore, we do not need to check for such things as | ||||
4760 | arithmetic-combinations of integers. | ||||
4761 | |||||
4762 | Use CACHE (pointer to 2 tree values) for caching if non-NULL. */ | ||||
4763 | |||||
4764 | static tree | ||||
4765 | initializer_constant_valid_p_1 (tree value, tree endtype, tree *cache) | ||||
4766 | { | ||||
4767 | tree ret; | ||||
4768 | |||||
4769 | switch (TREE_CODE (value)((enum tree_code) (value)->base.code)) | ||||
4770 | { | ||||
4771 | case CONSTRUCTOR: | ||||
4772 | if (constructor_static_from_elts_p (value)) | ||||
4773 | { | ||||
4774 | unsigned HOST_WIDE_INTlong idx; | ||||
4775 | tree elt; | ||||
4776 | bool absolute = true; | ||||
4777 | |||||
4778 | if (cache && cache[0] == value) | ||||
4779 | return cache[1]; | ||||
4780 | FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (value), idx, elt)for (idx = 0; (idx >= vec_safe_length (((tree_check ((value ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4780, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts))) ? false : ((elt = (*(((tree_check ((value), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4780, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts))) [idx].value), true); (idx)++) | ||||
4781 | { | ||||
4782 | tree reloc; | ||||
4783 | reloc = initializer_constant_valid_p_1 (elt, TREE_TYPE (elt)((contains_struct_check ((elt), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4783, __FUNCTION__))->typed.type), | ||||
4784 | NULLnullptr); | ||||
4785 | if (!reloc | ||||
4786 | /* An absolute value is required with reverse SSO. */ | ||||
4787 | || (reloc != null_pointer_nodeglobal_trees[TI_NULL_POINTER] | ||||
4788 | && TYPE_REVERSE_STORAGE_ORDER (TREE_TYPE (value))((tree_check4 ((((contains_struct_check ((value), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4788, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4788, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE ), (ARRAY_TYPE)))->base.u.bits.saturating_flag) | ||||
4789 | && !AGGREGATE_TYPE_P (TREE_TYPE (elt))(((enum tree_code) (((contains_struct_check ((elt), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4789, __FUNCTION__))->typed.type))->base.code) == ARRAY_TYPE || (((enum tree_code) (((contains_struct_check ((elt), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4789, __FUNCTION__))->typed.type))->base.code) == RECORD_TYPE || ((enum tree_code) (((contains_struct_check ((elt), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4789, __FUNCTION__))->typed.type))->base.code) == UNION_TYPE || ((enum tree_code) (((contains_struct_check ((elt), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4789, __FUNCTION__))->typed.type))->base.code) == QUAL_UNION_TYPE )))) | ||||
4790 | { | ||||
4791 | if (cache) | ||||
4792 | { | ||||
4793 | cache[0] = value; | ||||
4794 | cache[1] = NULL_TREE(tree) nullptr; | ||||
4795 | } | ||||
4796 | return NULL_TREE(tree) nullptr; | ||||
4797 | } | ||||
4798 | if (reloc != null_pointer_nodeglobal_trees[TI_NULL_POINTER]) | ||||
4799 | absolute = false; | ||||
4800 | } | ||||
4801 | /* For a non-absolute relocation, there is no single | ||||
4802 | variable that can be "the variable that determines the | ||||
4803 | relocation." */ | ||||
4804 | if (cache) | ||||
4805 | { | ||||
4806 | cache[0] = value; | ||||
4807 | cache[1] = absolute ? null_pointer_nodeglobal_trees[TI_NULL_POINTER] : error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
4808 | } | ||||
4809 | return absolute ? null_pointer_nodeglobal_trees[TI_NULL_POINTER] : error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
4810 | } | ||||
4811 | |||||
4812 | return TREE_STATIC (value)((value)->base.static_flag) ? null_pointer_nodeglobal_trees[TI_NULL_POINTER] : NULL_TREE(tree) nullptr; | ||||
4813 | |||||
4814 | case INTEGER_CST: | ||||
4815 | case VECTOR_CST: | ||||
4816 | case REAL_CST: | ||||
4817 | case FIXED_CST: | ||||
4818 | case STRING_CST: | ||||
4819 | case COMPLEX_CST: | ||||
4820 | return null_pointer_nodeglobal_trees[TI_NULL_POINTER]; | ||||
4821 | |||||
4822 | case ADDR_EXPR: | ||||
4823 | case FDESC_EXPR: | ||||
4824 | { | ||||
4825 | tree op0 = staticp (TREE_OPERAND (value, 0)(*((const_cast<tree*> (tree_operand_check ((value), (0) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4825, __FUNCTION__)))))); | ||||
4826 | if (op0) | ||||
4827 | { | ||||
4828 | /* "&(*a).f" is like unto pointer arithmetic. If "a" turns out | ||||
4829 | to be a constant, this is old-skool offsetof-like nonsense. */ | ||||
4830 | if (TREE_CODE (op0)((enum tree_code) (op0)->base.code) == INDIRECT_REF | ||||
4831 | && TREE_CONSTANT (TREE_OPERAND (op0, 0))((non_type_check (((*((const_cast<tree*> (tree_operand_check ((op0), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4831, __FUNCTION__)))))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4831, __FUNCTION__))->base.constant_flag)) | ||||
4832 | return null_pointer_nodeglobal_trees[TI_NULL_POINTER]; | ||||
4833 | /* Taking the address of a nested function involves a trampoline, | ||||
4834 | unless we don't need or want one. */ | ||||
4835 | if (TREE_CODE (op0)((enum tree_code) (op0)->base.code) == FUNCTION_DECL | ||||
4836 | && DECL_STATIC_CHAIN (op0)((tree_check ((op0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4836, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.regdecl_flag ) | ||||
4837 | && !TREE_NO_TRAMPOLINE (value)((tree_check ((value), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4837, __FUNCTION__, (ADDR_EXPR)))->base.static_flag)) | ||||
4838 | return NULL_TREE(tree) nullptr; | ||||
4839 | /* "&{...}" requires a temporary to hold the constructed | ||||
4840 | object. */ | ||||
4841 | if (TREE_CODE (op0)((enum tree_code) (op0)->base.code) == CONSTRUCTOR) | ||||
4842 | return NULL_TREE(tree) nullptr; | ||||
4843 | } | ||||
4844 | return op0; | ||||
4845 | } | ||||
4846 | |||||
4847 | case NON_LVALUE_EXPR: | ||||
4848 | return initializer_constant_valid_p_1 (TREE_OPERAND (value, 0)(*((const_cast<tree*> (tree_operand_check ((value), (0) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4848, __FUNCTION__))))), | ||||
4849 | endtype, cache); | ||||
4850 | |||||
4851 | case VIEW_CONVERT_EXPR: | ||||
4852 | { | ||||
4853 | tree src = TREE_OPERAND (value, 0)(*((const_cast<tree*> (tree_operand_check ((value), (0) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4853, __FUNCTION__))))); | ||||
4854 | tree src_type = TREE_TYPE (src)((contains_struct_check ((src), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4854, __FUNCTION__))->typed.type); | ||||
4855 | tree dest_type = TREE_TYPE (value)((contains_struct_check ((value), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4855, __FUNCTION__))->typed.type); | ||||
4856 | |||||
4857 | /* Allow view-conversions from aggregate to non-aggregate type only | ||||
4858 | if the bit pattern is fully preserved afterwards; otherwise, the | ||||
4859 | RTL expander won't be able to apply a subsequent transformation | ||||
4860 | to the underlying constructor. */ | ||||
4861 | if (AGGREGATE_TYPE_P (src_type)(((enum tree_code) (src_type)->base.code) == ARRAY_TYPE || (((enum tree_code) (src_type)->base.code) == RECORD_TYPE || ((enum tree_code) (src_type)->base.code) == UNION_TYPE || ((enum tree_code) (src_type)->base.code) == QUAL_UNION_TYPE )) && !AGGREGATE_TYPE_P (dest_type)(((enum tree_code) (dest_type)->base.code) == ARRAY_TYPE || (((enum tree_code) (dest_type)->base.code) == RECORD_TYPE || ((enum tree_code) (dest_type)->base.code) == UNION_TYPE || ((enum tree_code) (dest_type)->base.code) == QUAL_UNION_TYPE ))) | ||||
4862 | { | ||||
4863 | if (TYPE_MODE (endtype)((((enum tree_code) ((tree_class_check ((endtype), (tcc_type) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4863, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (endtype) : (endtype)->type_common.mode) == TYPE_MODE (dest_type)((((enum tree_code) ((tree_class_check ((dest_type), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4863, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (dest_type) : (dest_type)->type_common.mode)) | ||||
4864 | return initializer_constant_valid_p_1 (src, endtype, cache); | ||||
4865 | else | ||||
4866 | return NULL_TREE(tree) nullptr; | ||||
4867 | } | ||||
4868 | |||||
4869 | /* Allow all other kinds of view-conversion. */ | ||||
4870 | return initializer_constant_valid_p_1 (src, endtype, cache); | ||||
4871 | } | ||||
4872 | |||||
4873 | CASE_CONVERTcase NOP_EXPR: case CONVERT_EXPR: | ||||
4874 | { | ||||
4875 | tree src = TREE_OPERAND (value, 0)(*((const_cast<tree*> (tree_operand_check ((value), (0) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4875, __FUNCTION__))))); | ||||
4876 | tree src_type = TREE_TYPE (src)((contains_struct_check ((src), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4876, __FUNCTION__))->typed.type); | ||||
4877 | tree dest_type = TREE_TYPE (value)((contains_struct_check ((value), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4877, __FUNCTION__))->typed.type); | ||||
4878 | |||||
4879 | /* Allow conversions between pointer types, floating-point | ||||
4880 | types, and offset types. */ | ||||
4881 | if ((POINTER_TYPE_P (dest_type)(((enum tree_code) (dest_type)->base.code) == POINTER_TYPE || ((enum tree_code) (dest_type)->base.code) == REFERENCE_TYPE ) && POINTER_TYPE_P (src_type)(((enum tree_code) (src_type)->base.code) == POINTER_TYPE || ((enum tree_code) (src_type)->base.code) == REFERENCE_TYPE )) | ||||
4882 | || (FLOAT_TYPE_P (dest_type)((((enum tree_code) (dest_type)->base.code) == REAL_TYPE) || ((((enum tree_code) (dest_type)->base.code) == COMPLEX_TYPE || (((enum tree_code) (dest_type)->base.code) == VECTOR_TYPE )) && (((enum tree_code) (((contains_struct_check ((dest_type ), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4882, __FUNCTION__))->typed.type))->base.code) == REAL_TYPE ))) && FLOAT_TYPE_P (src_type)((((enum tree_code) (src_type)->base.code) == REAL_TYPE) || ((((enum tree_code) (src_type)->base.code) == COMPLEX_TYPE || (((enum tree_code) (src_type)->base.code) == VECTOR_TYPE )) && (((enum tree_code) (((contains_struct_check ((src_type ), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4882, __FUNCTION__))->typed.type))->base.code) == REAL_TYPE )))) | ||||
4883 | || (TREE_CODE (dest_type)((enum tree_code) (dest_type)->base.code) == OFFSET_TYPE | ||||
4884 | && TREE_CODE (src_type)((enum tree_code) (src_type)->base.code) == OFFSET_TYPE)) | ||||
4885 | return initializer_constant_valid_p_1 (src, endtype, cache); | ||||
4886 | |||||
4887 | /* Allow length-preserving conversions between integer types. */ | ||||
4888 | if (INTEGRAL_TYPE_P (dest_type)(((enum tree_code) (dest_type)->base.code) == ENUMERAL_TYPE || ((enum tree_code) (dest_type)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (dest_type)->base.code) == INTEGER_TYPE ) && INTEGRAL_TYPE_P (src_type)(((enum tree_code) (src_type)->base.code) == ENUMERAL_TYPE || ((enum tree_code) (src_type)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (src_type)->base.code) == INTEGER_TYPE ) | ||||
4889 | && (TYPE_PRECISION (dest_type)((tree_class_check ((dest_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4889, __FUNCTION__))->type_common.precision) == TYPE_PRECISION (src_type)((tree_class_check ((src_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4889, __FUNCTION__))->type_common.precision))) | ||||
4890 | return initializer_constant_valid_p_1 (src, endtype, cache); | ||||
4891 | |||||
4892 | /* Allow conversions between other integer types only if | ||||
4893 | explicit value. Don't allow sign-extension to a type larger | ||||
4894 | than word and pointer, there aren't relocations that would | ||||
4895 | allow to sign extend it to a wider type. */ | ||||
4896 | if (INTEGRAL_TYPE_P (dest_type)(((enum tree_code) (dest_type)->base.code) == ENUMERAL_TYPE || ((enum tree_code) (dest_type)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (dest_type)->base.code) == INTEGER_TYPE ) | ||||
4897 | && INTEGRAL_TYPE_P (src_type)(((enum tree_code) (src_type)->base.code) == ENUMERAL_TYPE || ((enum tree_code) (src_type)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (src_type)->base.code) == INTEGER_TYPE ) | ||||
4898 | && (TYPE_UNSIGNED (src_type)((tree_class_check ((src_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4898, __FUNCTION__))->base.u.bits.unsigned_flag) | ||||
4899 | || TYPE_PRECISION (dest_type)((tree_class_check ((dest_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4899, __FUNCTION__))->type_common.precision) <= TYPE_PRECISION (src_type)((tree_class_check ((src_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4899, __FUNCTION__))->type_common.precision) | ||||
4900 | || TYPE_PRECISION (dest_type)((tree_class_check ((dest_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4900, __FUNCTION__))->type_common.precision) <= BITS_PER_WORD((8) * (((global_options.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4)) | ||||
4901 | || TYPE_PRECISION (dest_type)((tree_class_check ((dest_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4901, __FUNCTION__))->type_common.precision) <= POINTER_SIZE(((global_options.x_ix86_isa_flags & (1UL << 58)) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))))) | ||||
4902 | { | ||||
4903 | tree inner = initializer_constant_valid_p_1 (src, endtype, cache); | ||||
4904 | if (inner == null_pointer_nodeglobal_trees[TI_NULL_POINTER]) | ||||
4905 | return null_pointer_nodeglobal_trees[TI_NULL_POINTER]; | ||||
4906 | break; | ||||
4907 | } | ||||
4908 | |||||
4909 | /* Allow (int) &foo provided int is as wide as a pointer. */ | ||||
4910 | if (INTEGRAL_TYPE_P (dest_type)(((enum tree_code) (dest_type)->base.code) == ENUMERAL_TYPE || ((enum tree_code) (dest_type)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (dest_type)->base.code) == INTEGER_TYPE ) && POINTER_TYPE_P (src_type)(((enum tree_code) (src_type)->base.code) == POINTER_TYPE || ((enum tree_code) (src_type)->base.code) == REFERENCE_TYPE ) | ||||
4911 | && (TYPE_PRECISION (dest_type)((tree_class_check ((dest_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4911, __FUNCTION__))->type_common.precision) >= TYPE_PRECISION (src_type)((tree_class_check ((src_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4911, __FUNCTION__))->type_common.precision))) | ||||
4912 | return initializer_constant_valid_p_1 (src, endtype, cache); | ||||
4913 | |||||
4914 | /* Likewise conversions from int to pointers, but also allow | ||||
4915 | conversions from 0. */ | ||||
4916 | if ((POINTER_TYPE_P (dest_type)(((enum tree_code) (dest_type)->base.code) == POINTER_TYPE || ((enum tree_code) (dest_type)->base.code) == REFERENCE_TYPE ) | ||||
4917 | || TREE_CODE (dest_type)((enum tree_code) (dest_type)->base.code) == OFFSET_TYPE) | ||||
4918 | && INTEGRAL_TYPE_P (src_type)(((enum tree_code) (src_type)->base.code) == ENUMERAL_TYPE || ((enum tree_code) (src_type)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (src_type)->base.code) == INTEGER_TYPE )) | ||||
4919 | { | ||||
4920 | if (TREE_CODE (src)((enum tree_code) (src)->base.code) == INTEGER_CST | ||||
4921 | && TYPE_PRECISION (dest_type)((tree_class_check ((dest_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4921, __FUNCTION__))->type_common.precision) >= TYPE_PRECISION (src_type)((tree_class_check ((src_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4921, __FUNCTION__))->type_common.precision)) | ||||
4922 | return null_pointer_nodeglobal_trees[TI_NULL_POINTER]; | ||||
4923 | if (integer_zerop (src)) | ||||
4924 | return null_pointer_nodeglobal_trees[TI_NULL_POINTER]; | ||||
4925 | else if (TYPE_PRECISION (dest_type)((tree_class_check ((dest_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4925, __FUNCTION__))->type_common.precision) <= TYPE_PRECISION (src_type)((tree_class_check ((src_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4925, __FUNCTION__))->type_common.precision)) | ||||
4926 | return initializer_constant_valid_p_1 (src, endtype, cache); | ||||
4927 | } | ||||
4928 | |||||
4929 | /* Allow conversions to struct or union types if the value | ||||
4930 | inside is okay. */ | ||||
4931 | if (TREE_CODE (dest_type)((enum tree_code) (dest_type)->base.code) == RECORD_TYPE | ||||
4932 | || TREE_CODE (dest_type)((enum tree_code) (dest_type)->base.code) == UNION_TYPE) | ||||
4933 | return initializer_constant_valid_p_1 (src, endtype, cache); | ||||
4934 | } | ||||
4935 | break; | ||||
4936 | |||||
4937 | case POINTER_PLUS_EXPR: | ||||
4938 | case PLUS_EXPR: | ||||
4939 | /* Any valid floating-point constants will have been folded by now; | ||||
4940 | with -frounding-math we hit this with addition of two constants. */ | ||||
4941 | if (TREE_CODE (endtype)((enum tree_code) (endtype)->base.code) == REAL_TYPE) | ||||
4942 | return NULL_TREE(tree) nullptr; | ||||
4943 | if (cache && cache[0] == value) | ||||
4944 | return cache[1]; | ||||
4945 | if (! INTEGRAL_TYPE_P (endtype)(((enum tree_code) (endtype)->base.code) == ENUMERAL_TYPE || ((enum tree_code) (endtype)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (endtype)->base.code) == INTEGER_TYPE) | ||||
4946 | || TYPE_PRECISION (endtype)((tree_class_check ((endtype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4946, __FUNCTION__))->type_common.precision) >= TYPE_PRECISION (TREE_TYPE (value))((tree_class_check ((((contains_struct_check ((value), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4946, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4946, __FUNCTION__))->type_common.precision)) | ||||
4947 | { | ||||
4948 | tree ncache[4] = { NULL_TREE(tree) nullptr, NULL_TREE(tree) nullptr, NULL_TREE(tree) nullptr, NULL_TREE(tree) nullptr }; | ||||
4949 | tree valid0 | ||||
4950 | = initializer_constant_valid_p_1 (TREE_OPERAND (value, 0)(*((const_cast<tree*> (tree_operand_check ((value), (0) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4950, __FUNCTION__))))), | ||||
4951 | endtype, ncache); | ||||
4952 | tree valid1 | ||||
4953 | = initializer_constant_valid_p_1 (TREE_OPERAND (value, 1)(*((const_cast<tree*> (tree_operand_check ((value), (1) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4953, __FUNCTION__))))), | ||||
4954 | endtype, ncache + 2); | ||||
4955 | /* If either term is absolute, use the other term's relocation. */ | ||||
4956 | if (valid0 == null_pointer_nodeglobal_trees[TI_NULL_POINTER]) | ||||
4957 | ret = valid1; | ||||
4958 | else if (valid1 == null_pointer_nodeglobal_trees[TI_NULL_POINTER]) | ||||
4959 | ret = valid0; | ||||
4960 | /* Support narrowing pointer differences. */ | ||||
4961 | else | ||||
4962 | ret = narrowing_initializer_constant_valid_p (value, endtype, | ||||
4963 | ncache); | ||||
4964 | } | ||||
4965 | else | ||||
4966 | /* Support narrowing pointer differences. */ | ||||
4967 | ret = narrowing_initializer_constant_valid_p (value, endtype, NULLnullptr); | ||||
4968 | if (cache) | ||||
4969 | { | ||||
4970 | cache[0] = value; | ||||
4971 | cache[1] = ret; | ||||
4972 | } | ||||
4973 | return ret; | ||||
4974 | |||||
4975 | case POINTER_DIFF_EXPR: | ||||
4976 | case MINUS_EXPR: | ||||
4977 | if (TREE_CODE (endtype)((enum tree_code) (endtype)->base.code) == REAL_TYPE) | ||||
4978 | return NULL_TREE(tree) nullptr; | ||||
4979 | if (cache && cache[0] == value) | ||||
4980 | return cache[1]; | ||||
4981 | if (! INTEGRAL_TYPE_P (endtype)(((enum tree_code) (endtype)->base.code) == ENUMERAL_TYPE || ((enum tree_code) (endtype)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (endtype)->base.code) == INTEGER_TYPE) | ||||
4982 | || TYPE_PRECISION (endtype)((tree_class_check ((endtype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4982, __FUNCTION__))->type_common.precision) >= TYPE_PRECISION (TREE_TYPE (value))((tree_class_check ((((contains_struct_check ((value), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4982, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4982, __FUNCTION__))->type_common.precision)) | ||||
4983 | { | ||||
4984 | tree ncache[4] = { NULL_TREE(tree) nullptr, NULL_TREE(tree) nullptr, NULL_TREE(tree) nullptr, NULL_TREE(tree) nullptr }; | ||||
4985 | tree valid0 | ||||
4986 | = initializer_constant_valid_p_1 (TREE_OPERAND (value, 0)(*((const_cast<tree*> (tree_operand_check ((value), (0) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4986, __FUNCTION__))))), | ||||
4987 | endtype, ncache); | ||||
4988 | tree valid1 | ||||
4989 | = initializer_constant_valid_p_1 (TREE_OPERAND (value, 1)(*((const_cast<tree*> (tree_operand_check ((value), (1) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 4989, __FUNCTION__))))), | ||||
4990 | endtype, ncache + 2); | ||||
4991 | /* Win if second argument is absolute. */ | ||||
4992 | if (valid1 == null_pointer_nodeglobal_trees[TI_NULL_POINTER]) | ||||
4993 | ret = valid0; | ||||
4994 | /* Win if both arguments have the same relocation. | ||||
4995 | Then the value is absolute. */ | ||||
4996 | else if (valid0 == valid1 && valid0 != 0) | ||||
4997 | ret = null_pointer_nodeglobal_trees[TI_NULL_POINTER]; | ||||
4998 | /* Since GCC guarantees that string constants are unique in the | ||||
4999 | generated code, a subtraction between two copies of the same | ||||
5000 | constant string is absolute. */ | ||||
5001 | else if (valid0 && TREE_CODE (valid0)((enum tree_code) (valid0)->base.code) == STRING_CST | ||||
5002 | && valid1 && TREE_CODE (valid1)((enum tree_code) (valid1)->base.code) == STRING_CST | ||||
5003 | && operand_equal_p (valid0, valid1, 1)) | ||||
5004 | ret = null_pointer_nodeglobal_trees[TI_NULL_POINTER]; | ||||
5005 | /* Support narrowing differences. */ | ||||
5006 | else | ||||
5007 | ret = narrowing_initializer_constant_valid_p (value, endtype, | ||||
5008 | ncache); | ||||
5009 | } | ||||
5010 | else | ||||
5011 | /* Support narrowing differences. */ | ||||
5012 | ret = narrowing_initializer_constant_valid_p (value, endtype, NULLnullptr); | ||||
5013 | if (cache) | ||||
5014 | { | ||||
5015 | cache[0] = value; | ||||
5016 | cache[1] = ret; | ||||
5017 | } | ||||
5018 | return ret; | ||||
5019 | |||||
5020 | default: | ||||
5021 | break; | ||||
5022 | } | ||||
5023 | |||||
5024 | return NULL_TREE(tree) nullptr; | ||||
5025 | } | ||||
5026 | |||||
5027 | /* Return nonzero if VALUE is a valid constant-valued expression | ||||
5028 | for use in initializing a static variable; one that can be an | ||||
5029 | element of a "constant" initializer. | ||||
5030 | |||||
5031 | Return null_pointer_node if the value is absolute; | ||||
5032 | if it is relocatable, return the variable that determines the relocation. | ||||
5033 | We assume that VALUE has been folded as much as possible; | ||||
5034 | therefore, we do not need to check for such things as | ||||
5035 | arithmetic-combinations of integers. */ | ||||
5036 | tree | ||||
5037 | initializer_constant_valid_p (tree value, tree endtype, bool reverse) | ||||
5038 | { | ||||
5039 | tree reloc = initializer_constant_valid_p_1 (value, endtype, NULLnullptr); | ||||
5040 | |||||
5041 | /* An absolute value is required with reverse storage order. */ | ||||
5042 | if (reloc | ||||
5043 | && reloc != null_pointer_nodeglobal_trees[TI_NULL_POINTER] | ||||
5044 | && reverse | ||||
5045 | && !AGGREGATE_TYPE_P (endtype)(((enum tree_code) (endtype)->base.code) == ARRAY_TYPE || ( ((enum tree_code) (endtype)->base.code) == RECORD_TYPE || ( (enum tree_code) (endtype)->base.code) == UNION_TYPE || (( enum tree_code) (endtype)->base.code) == QUAL_UNION_TYPE)) | ||||
5046 | && !VECTOR_TYPE_P (endtype)(((enum tree_code) (endtype)->base.code) == VECTOR_TYPE)) | ||||
5047 | reloc = NULL_TREE(tree) nullptr; | ||||
5048 | |||||
5049 | return reloc; | ||||
5050 | } | ||||
5051 | |||||
5052 | /* Return true if VALUE is a valid constant-valued expression | ||||
5053 | for use in initializing a static bit-field; one that can be | ||||
5054 | an element of a "constant" initializer. */ | ||||
5055 | |||||
5056 | bool | ||||
5057 | initializer_constant_valid_for_bitfield_p (const_tree value) | ||||
5058 | { | ||||
5059 | /* For bitfields we support integer constants or possibly nested aggregates | ||||
5060 | of such. */ | ||||
5061 | switch (TREE_CODE (value)((enum tree_code) (value)->base.code)) | ||||
5062 | { | ||||
5063 | case CONSTRUCTOR: | ||||
5064 | { | ||||
5065 | unsigned HOST_WIDE_INTlong idx; | ||||
5066 | const_tree elt; | ||||
5067 | |||||
5068 | FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (value), idx, elt)for (idx = 0; (idx >= vec_safe_length (((tree_check ((value ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 5068, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts))) ? false : ((elt = (*(((tree_check ((value), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 5068, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts))) [idx].value), true); (idx)++) | ||||
5069 | if (!initializer_constant_valid_for_bitfield_p (elt)) | ||||
5070 | return false; | ||||
5071 | return true; | ||||
5072 | } | ||||
5073 | |||||
5074 | case INTEGER_CST: | ||||
5075 | case REAL_CST: | ||||
5076 | return true; | ||||
5077 | |||||
5078 | case VIEW_CONVERT_EXPR: | ||||
5079 | case NON_LVALUE_EXPR: | ||||
5080 | return | ||||
5081 | initializer_constant_valid_for_bitfield_p (TREE_OPERAND (value, 0)(*((const_cast<tree*> (tree_operand_check ((value), (0) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.cc" , 5081, __FUNCTION__)))))); | ||||
5082 | |||||
5083 | default: | ||||
5084 | break; | ||||
5085 | } | ||||
5086 | |||||
5087 |