File: | build/gcc/varasm.cc |
Warning: | line 3665, column 2 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
|
16.1 | 'dont_output_data' is not equal to 0 |
43 | The result of the left shift is undefined because the right operand is negative |