Bug Summary

File:build/gcc/varasm.c
Warning:line 2049, column 7
The result of the left shift is undefined because the right operand is negative

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-unknown-linux-gnu -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name varasm.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -analyzer-config-compatibility-mode=true -mrelocation-model static -mframe-pointer=none -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -fno-split-dwarf-inlining -debugger-tuning=gdb -resource-dir /usr/lib64/clang/11.0.0 -D IN_GCC -D HAVE_CONFIG_H -I . -I . -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/. -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../include -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libcpp/include -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libcody -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libdecnumber -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libdecnumber/bid -I ../libdecnumber -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libbacktrace -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10 -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/x86_64-suse-linux -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/backward -internal-isystem /usr/local/include -internal-isystem /usr/lib64/clang/11.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-narrowing -Wwrite-strings -Wno-error=format-diag -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fdeprecated-macro -fdebug-compilation-dir /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/objdir/gcc -ferror-limit 19 -fno-rtti -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-output=plist-html -analyzer-config silence-checkers=core.NullDereference -faddrsig -o /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/objdir/clang-static-analyzer/2021-01-16-135054-17580-1/report-1Dc2LO.plist -x c++ /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c

/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c

1/* Output variables, constants and external declarations, for GNU compiler.
2 Copyright (C) 1987-2021 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14for more details.
15
16You should have received a copy of the GNU General Public License
17along 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#ifdef XCOFF_DEBUGGING_INFO
66#include "xcoffout.h" /* Needed for external data declarations. */
67#endif
68
69/* The (assembler) name of the first globally-visible object output. */
70extern GTY(()) const char *first_global_object_name;
71extern GTY(()) const char *weak_global_object_name;
72
73const char *first_global_object_name;
74const char *weak_global_object_name;
75
76class addr_const;
77class constant_descriptor_rtx;
78struct rtx_constant_pool;
79
80#define n_deferred_constants((&x_rtl)->varasm.deferred_constants) (crtl(&x_rtl)->varasm.deferred_constants)
81
82/* Number for making the label on the next
83 constant that is stored in memory. */
84
85static GTY(()) int const_labelno;
86
87/* Carry information from ASM_DECLARE_OBJECT_NAME
88 to ASM_FINISH_DECLARE_OBJECT. */
89
90int size_directive_output;
91
92/* The last decl for which assemble_variable was called,
93 if it did ASM_DECLARE_OBJECT_NAME.
94 If the last call to assemble_variable didn't do that,
95 this holds 0. */
96
97tree last_assemble_variable_decl;
98
99/* The following global variable indicates if the first basic block
100 in a function belongs to the cold partition or not. */
101
102bool first_function_block_is_cold;
103
104/* Whether we saw any functions with no_split_stack. */
105
106static bool saw_no_split_stack;
107
108static const char *strip_reg_name (const char *);
109static int contains_pointers_p (tree);
110#ifdef ASM_OUTPUT_EXTERNAL
111static bool incorporeal_function_p (tree);
112#endif
113static void decode_addr_const (tree, class addr_const *);
114static hashval_t const_hash_1 (const tree);
115static int compare_constant (const tree, const tree);
116static void output_constant_def_contents (rtx);
117static void output_addressed_constants (tree, int);
118static unsigned HOST_WIDE_INTlong output_constant (tree, unsigned HOST_WIDE_INTlong,
119 unsigned int, bool, bool);
120static void globalize_decl (tree);
121static bool decl_readonly_section_1 (enum section_category);
122#ifdef BSS_SECTION_ASM_OP"\t.bss"
123#ifdef ASM_OUTPUT_ALIGNED_BSS
124static void asm_output_aligned_bss (FILE *, tree, const char *,
125 unsigned HOST_WIDE_INTlong, int)
126 ATTRIBUTE_UNUSED__attribute__ ((__unused__));
127#endif
128#endif /* BSS_SECTION_ASM_OP */
129static void mark_weak (tree);
130static void output_constant_pool (const char *, tree);
131static void handle_vtv_comdat_section (section *, const_tree);
132
133/* Well-known sections, each one associated with some sort of *_ASM_OP. */
134section *text_section;
135section *data_section;
136section *readonly_data_section;
137section *sdata_section;
138section *ctors_section;
139section *dtors_section;
140section *bss_section;
141section *sbss_section;
142
143/* Various forms of common section. All are guaranteed to be nonnull. */
144section *tls_comm_section;
145section *comm_section;
146section *lcomm_section;
147
148/* A SECTION_NOSWITCH section used for declaring global BSS variables.
149 May be null. */
150section *bss_noswitch_section;
151
152/* The section that holds the main exception table, when known. The section
153 is set either by the target's init_sections hook or by the first call to
154 switch_to_exception_section. */
155section *exception_section;
156
157/* The section that holds the DWARF2 frame unwind information, when known.
158 The section is set either by the target's init_sections hook or by the
159 first call to switch_to_eh_frame_section. */
160section *eh_frame_section;
161
162/* asm_out_file's current section. This is NULL if no section has yet
163 been selected or if we lose track of what the current section is. */
164section *in_section;
165
166/* True if code for the current function is currently being directed
167 at the cold section. */
168bool in_cold_section_p;
169
170/* The following global holds the "function name" for the code in the
171 cold section of a function, if hot/cold function splitting is enabled
172 and there was actually code that went into the cold section. A
173 pseudo function name is needed for the cold section of code for some
174 debugging tools that perform symbolization. */
175tree cold_function_name = NULL_TREE(tree) nullptr;
176
177/* A linked list of all the unnamed sections. */
178static GTY(()) section *unnamed_sections;
179
180/* Return a nonzero value if DECL has a section attribute. */
181#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)
\
182 (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)
183
184struct section_hasher : ggc_ptr_hash<section>
185{
186 typedef const char *compare_type;
187
188 static hashval_t hash (section *);
189 static bool equal (section *, const char *);
190};
191
192/* Hash table of named sections. */
193static GTY(()) hash_table<section_hasher> *section_htab;
194
195struct object_block_hasher : ggc_ptr_hash<object_block>
196{
197 typedef const section *compare_type;
198
199 static hashval_t hash (object_block *);
200 static bool equal (object_block *, const section *);
201};
202
203/* A table of object_blocks, indexed by section. */
204static GTY(()) hash_table<object_block_hasher> *object_block_htab;
205
206/* The next number to use for internal anchor labels. */
207static GTY(()) int anchor_labelno;
208
209/* A pool of constants that can be shared between functions. */
210static GTY(()) struct rtx_constant_pool *shared_constant_pool;
211
212/* Helper routines for maintaining section_htab. */
213
214bool
215section_hasher::equal (section *old, const char *new_name)
216{
217 return strcmp (old->named.name, new_name) == 0;
218}
219
220hashval_t
221section_hasher::hash (section *old)
222{
223 return htab_hash_string (old->named.name);
224}
225
226/* Return a hash value for section SECT. */
227
228static hashval_t
229hash_section (section *sect)
230{
231 if (sect->common.flags & SECTION_NAMED0x200000)
232 return htab_hash_string (sect->named.name);
233 return sect->common.flags & ~SECTION_DECLARED0x100000;
234}
235
236/* Helper routines for maintaining object_block_htab. */
237
238inline bool
239object_block_hasher::equal (object_block *old, const section *new_section)
240{
241 return old->sect == new_section;
242}
243
244hashval_t
245object_block_hasher::hash (object_block *old)
246{
247 return hash_section (old->sect);
248}
249
250/* Return a new unnamed section with the given fields. */
251
252section *
253get_unnamed_section (unsigned int flags, void (*callback) (const void *),
254 const void *data)
255{
256 section *sect;
257
258 sect = ggc_alloc<section> ();
259 sect->unnamed.common.flags = flags | SECTION_UNNAMED0x000000;
260 sect->unnamed.callback = callback;
261 sect->unnamed.data = data;
262 sect->unnamed.next = unnamed_sections;
263
264 unnamed_sections = sect;
265 return sect;
266}
267
268/* Return a SECTION_NOSWITCH section with the given fields. */
269
270static section *
271get_noswitch_section (unsigned int flags, noswitch_section_callback callback)
272{
273 section *sect;
274
275 sect = ggc_alloc<section> ();
276 sect->noswitch.common.flags = flags | SECTION_NOSWITCH0x400000;
277 sect->noswitch.callback = callback;
278
279 return sect;
280}
281
282/* Return the named section structure associated with NAME. Create
283 a new section with the given fields if no such structure exists.
284 When NOT_EXISTING, then fail if the section already exists. Return
285 the existing section if the SECTION_RETAIN bit doesn't match. Set
286 the SECTION_WRITE | SECTION_RELRO bits on the the existing section
287 if one of the section flags is SECTION_WRITE | SECTION_RELRO and the
288 other has none of these flags in named sections and either the section
289 hasn't been declared yet or has been declared as writable. */
290
291section *
292get_section (const char *name, unsigned int flags, tree decl,
293 bool not_existing)
294{
295 section *sect, **slot;
296
297 slot = section_htab->find_slot_with_hash (name, htab_hash_string (name),
298 INSERT);
299 flags |= SECTION_NAMED0x200000;
300 if (SUPPORTS_SHF_GNU_RETAIN0
301 && decl != nullptr
302 && DECL_P (decl)(tree_code_type[(int) (((enum tree_code) (decl)->base.code
))] == tcc_declaration)
303 && DECL_PRESERVE_P (decl)(contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 303, __FUNCTION__))->decl_common.preserve_flag
)
304 flags |= SECTION_RETAIN0x4000000;
305 if (*slot == NULLnullptr)
306 {
307 sect = ggc_alloc<section> ();
308 sect->named.common.flags = flags;
309 sect->named.name = ggc_strdup (name)ggc_alloc_string ((name), -1 );
310 sect->named.decl = decl;
311 *slot = sect;
312 }
313 else
314 {
315 if (not_existing)
316 internal_error ("Section already exists: %qs", name);
317
318 sect = *slot;
319 /* It is fine if one of the sections has SECTION_NOTYPE as long as
320 the other has none of the contrary flags (see the logic at the end
321 of default_section_type_flags, below). */
322 if (((sect->common.flags ^ flags) & SECTION_NOTYPE0x80000)
323 && !((sect->common.flags | flags)
324 & (SECTION_CODE0x00100 | SECTION_BSS0x02000 | SECTION_TLS0x40000 | SECTION_ENTSIZE0x000ff
325 | (HAVE_COMDAT_GROUP1 ? SECTION_LINKONCE0x00800 : 0))))
326 {
327 sect->common.flags |= SECTION_NOTYPE0x80000;
328 flags |= SECTION_NOTYPE0x80000;
329 }
330 if ((sect->common.flags & ~SECTION_DECLARED0x100000) != flags
331 && ((sect->common.flags | flags) & SECTION_OVERRIDE0x20000) == 0)
332 {
333 /* It is fine if one of the section flags is
334 SECTION_WRITE | SECTION_RELRO and the other has none of these
335 flags (i.e. read-only) in named sections and either the
336 section hasn't been declared yet or has been declared as writable.
337 In that case just make sure the resulting flags are
338 SECTION_WRITE | SECTION_RELRO, ie. writable only because of
339 relocations. */
340 if (((sect->common.flags ^ flags) & (SECTION_WRITE0x00200 | SECTION_RELRO0x1000000))
341 == (SECTION_WRITE0x00200 | SECTION_RELRO0x1000000)
342 && (sect->common.flags
343 & ~(SECTION_DECLARED0x100000 | SECTION_WRITE0x00200 | SECTION_RELRO0x1000000))
344 == (flags & ~(SECTION_WRITE0x00200 | SECTION_RELRO0x1000000))
345 && ((sect->common.flags & SECTION_DECLARED0x100000) == 0
346 || (sect->common.flags & SECTION_WRITE0x00200)))
347 {
348 sect->common.flags |= (SECTION_WRITE0x00200 | SECTION_RELRO0x1000000);
349 return sect;
350 }
351 /* If the SECTION_RETAIN bit doesn't match, return and switch
352 to a new section later. */
353 if ((sect->common.flags & SECTION_RETAIN0x4000000)
354 != (flags & SECTION_RETAIN0x4000000))
355 return sect;
356 /* Sanity check user variables for flag changes. */
357 if (sect->named.decl != NULLnullptr
358 && DECL_P (sect->named.decl)(tree_code_type[(int) (((enum tree_code) (sect->named.decl
)->base.code))] == tcc_declaration)
359 && decl != sect->named.decl)
360 {
361 if (decl != NULLnullptr && DECL_P (decl)(tree_code_type[(int) (((enum tree_code) (decl)->base.code
))] == tcc_declaration)
)
362 error ("%+qD causes a section type conflict with %qD",
363 decl, sect->named.decl);
364 else
365 error ("section type conflict with %qD", sect->named.decl);
366 inform (DECL_SOURCE_LOCATION (sect->named.decl)((contains_struct_check ((sect->named.decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 366, __FUNCTION__))->decl_minimal.locus)
,
367 "%qD was declared here", sect->named.decl);
368 }
369 else if (decl != NULLnullptr && DECL_P (decl)(tree_code_type[(int) (((enum tree_code) (decl)->base.code
))] == tcc_declaration)
)
370 error ("%+qD causes a section type conflict", decl);
371 else
372 error ("section type conflict");
373 /* Make sure we don't error about one section multiple times. */
374 sect->common.flags |= SECTION_OVERRIDE0x20000;
375 }
376 }
377 return sect;
378}
379
380/* Return true if the current compilation mode benefits from having
381 objects grouped into blocks. */
382
383static bool
384use_object_blocks_p (void)
385{
386 return flag_section_anchorsglobal_options.x_flag_section_anchors;
387}
388
389/* Return the object_block structure for section SECT. Create a new
390 structure if we haven't created one already. Return null if SECT
391 itself is null. Return also null for mergeable sections since
392 section anchors can't be used in mergeable sections anyway,
393 because the linker might move objects around, and using the
394 object blocks infrastructure in that case is both a waste and a
395 maintenance burden. */
396
397static struct object_block *
398get_block_for_section (section *sect)
399{
400 struct object_block *block;
401
402 if (sect == NULLnullptr)
403 return NULLnullptr;
404
405 if (sect->common.flags & SECTION_MERGE0x08000)
406 return NULLnullptr;
407
408 object_block **slot
409 = object_block_htab->find_slot_with_hash (sect, hash_section (sect),
410 INSERT);
411 block = *slot;
412 if (block == NULLnullptr)
413 {
414 block = ggc_cleared_alloc<object_block> ();
415 block->sect = sect;
416 *slot = block;
417 }
418 return block;
419}
420
421/* Create a symbol with label LABEL and place it at byte offset
422 OFFSET in BLOCK. OFFSET can be negative if the symbol's offset
423 is not yet known. LABEL must be a garbage-collected string. */
424
425static rtx
426create_block_symbol (const char *label, struct object_block *block,
427 HOST_WIDE_INTlong offset)
428{
429 rtx symbol;
430 unsigned int size;
431
432 /* Create the extended SYMBOL_REF. */
433 size = RTX_HDR_SIZE__builtin_offsetof(struct rtx_def, u) + sizeof (struct block_symbol);
434 symbol = (rtx) ggc_internal_alloc (size);
435
436 /* Initialize the normal SYMBOL_REF fields. */
437 memset (symbol, 0, size);
438 PUT_CODE (symbol, SYMBOL_REF)((symbol)->code = (SYMBOL_REF));
439 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)))
);
440 XSTR (symbol, 0)(((symbol)->u.fld[0]).rt_str) = label;
441 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, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 441, __FUNCTION__); _rtx; }) ->u2.symbol_ref_flags)
= SYMBOL_FLAG_HAS_BLOCK_INFO(1 << 7);
442
443 /* Initialize the block_symbol stuff. */
444 SYMBOL_REF_BLOCK (symbol)((&(symbol)->u.block_sym)->block) = block;
445 SYMBOL_REF_BLOCK_OFFSET (symbol)((&(symbol)->u.block_sym)->offset) = offset;
446
447 return symbol;
448}
449
450/* Return a section with a particular name and with whatever SECTION_*
451 flags section_type_flags deems appropriate. The name of the section
452 is taken from NAME if nonnull, otherwise it is taken from DECL's
453 DECL_SECTION_NAME. DECL is the decl associated with the section
454 (see the section comment for details) and RELOC is as for
455 section_type_flags. */
456
457section *
458get_named_section (tree decl, const char *name, int reloc)
459{
460 unsigned int flags;
461
462 if (name == NULLnullptr)
463 {
464 gcc_assert (decl && DECL_P (decl) && DECL_SECTION_NAME (decl))((void)(!(decl && (tree_code_type[(int) (((enum tree_code
) (decl)->base.code))] == tcc_declaration) && decl_section_name
(decl)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 464, __FUNCTION__), 0 : 0))
;
465 name = DECL_SECTION_NAME (decl)decl_section_name (decl);
466 }
467
468 flags = targetm.section_type_flags (decl, name, reloc);
469 return get_section (name, flags, decl);
470}
471
472/* Worker for resolve_unique_section. */
473
474static bool
475set_implicit_section (struct symtab_node *n, void *data ATTRIBUTE_UNUSED__attribute__ ((__unused__)))
476{
477 n->implicit_section = true;
478 return false;
479}
480
481/* If required, set DECL_SECTION_NAME to a unique name. */
482
483void
484resolve_unique_section (tree decl, int reloc ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
485 int flag_function_or_data_sections)
486{
487 if (DECL_SECTION_NAME (decl)decl_section_name (decl) == NULLnullptr
488 && targetm_common.have_named_sections
489 && (flag_function_or_data_sections
490 || (SUPPORTS_SHF_GNU_RETAIN0 && DECL_PRESERVE_P (decl)(contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 490, __FUNCTION__))->decl_common.preserve_flag
)
491 || DECL_COMDAT_GROUP (decl)decl_comdat_group (decl)))
492 {
493 targetm.asm_out.unique_section (decl, reloc);
494 if (DECL_SECTION_NAME (decl)decl_section_name (decl))
495 symtab_node::get (decl)->call_for_symbol_and_aliases
496 (set_implicit_section, NULLnullptr, true);
497 }
498}
499
500#ifdef BSS_SECTION_ASM_OP"\t.bss"
501
502#ifdef ASM_OUTPUT_ALIGNED_BSS
503
504/* Utility function for targets to use in implementing
505 ASM_OUTPUT_ALIGNED_BSS.
506 ??? It is believed that this function will work in most cases so such
507 support is localized here. */
508
509static void
510asm_output_aligned_bss (FILE *file, tree decl ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
511 const char *name, unsigned HOST_WIDE_INTlong size,
512 int align)
513{
514 switch_to_section (bss_section);
515 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))))
;
516#ifdef ASM_DECLARE_OBJECT_NAME
517 last_assemble_variable_decl = decl;
518 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 518, __FUNCTION__))->decl_common.decl_flag_1))) &&
(!((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 518, __FUNCTION__))->decl_common.artificial_flag) || !((
non_type_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 518, __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
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 518, __FUNCTION__))->decl_common.size)) { size_directive_output
= 1; size = tree_to_uhwi (((contains_struct_check ((decl), (
TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 518, __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)
;
519#else
520 /* Standard thing is just output label for the object. */
521 ASM_OUTPUT_LABEL (file, name)do { assemble_name ((file), (name)); fputs (":\n", (file)); }
while (0)
;
522#endif /* ASM_DECLARE_OBJECT_NAME */
523 ASM_OUTPUT_SKIP (file, size ? size : 1)fprintf ((file), "%s" "%" "l" "u" "\n", "\t.zero\t", (size ? size
: 1))
;
524}
525
526#endif
527
528#endif /* BSS_SECTION_ASM_OP */
529
530#ifndef USE_SELECT_SECTION_FOR_FUNCTIONS
531/* Return the hot section for function DECL. Return text_section for
532 null DECLs. */
533
534static section *
535hot_function_section (tree decl)
536{
537 if (decl != NULL_TREE(tree) nullptr
538 && DECL_SECTION_NAME (decl)decl_section_name (decl) != NULLnullptr
539 && targetm_common.have_named_sections)
540 return get_named_section (decl, NULLnullptr, 0);
541 else
542 return text_section;
543}
544#endif
545
546/* Return section for TEXT_SECTION_NAME if DECL or DECL_SECTION_NAME (DECL)
547 is NULL.
548
549 When DECL_SECTION_NAME is non-NULL and it is implicit section and
550 NAMED_SECTION_SUFFIX is non-NULL, then produce section called
551 concatenate the name with NAMED_SECTION_SUFFIX.
552 Otherwise produce "TEXT_SECTION_NAME.IMPLICIT_NAME". */
553
554section *
555get_named_text_section (tree decl,
556 const char *text_section_name,
557 const char *named_section_suffix)
558{
559 if (decl && DECL_SECTION_NAME (decl)decl_section_name (decl))
560 {
561 if (named_section_suffix)
562 {
563 const char *dsn = DECL_SECTION_NAME (decl)decl_section_name (decl);
564 const char *stripped_name;
565 char *name, *buffer;
566
567 name = (char *) alloca (strlen (dsn) + 1)__builtin_alloca(strlen (dsn) + 1);
568 memcpy (name, dsn,
569 strlen (dsn) + 1);
570
571 stripped_name = targetm.strip_name_encoding (name);
572
573 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))
;
574 return get_named_section (decl, buffer, 0);
575 }
576 else if (symtab_node::get (decl)->implicit_section)
577 {
578 const char *name;
579
580 /* Do not try to split gnu_linkonce functions. This gets somewhat
581 slipperly. */
582 if (DECL_COMDAT_GROUP (decl)decl_comdat_group (decl) && !HAVE_COMDAT_GROUP1)
583 return NULLnullptr;
584 name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl))((const char *) (tree_check ((decl_assembler_name (decl)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 584, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str
)
;
585 name = targetm.strip_name_encoding (name);
586 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))
587 name, NULL))(libiberty_concat_ptr = (char *) __builtin_alloca(concat_length
(text_section_name, ".", name, nullptr) + 1), concat_copy2 (
text_section_name, ".", name, nullptr))
, 0);
588 }
589 else
590 return NULLnullptr;
591 }
592 return get_named_section (decl, text_section_name, 0);
593}
594
595/* Choose named function section based on its frequency. */
596
597section *
598default_function_section (tree decl, enum node_frequency freq,
599 bool startup, bool exit)
600{
601#if defined HAVE_LD_EH_GC_SECTIONS1 && defined HAVE_LD_EH_GC_SECTIONS_BUG
602 /* Old GNU linkers have buggy --gc-section support, which sometimes
603 results in .gcc_except_table* sections being garbage collected. */
604 if (decl
605 && symtab_node::get (decl)->implicit_section)
606 return NULLnullptr;
607#endif
608
609 if (!flag_reorder_functionsglobal_options.x_flag_reorder_functions
610 || !targetm_common.have_named_sections)
611 return NULLnullptr;
612 /* Startup code should go to startup subsection unless it is
613 unlikely executed (this happens especially with function splitting
614 where we can split away unnecessary parts of static constructors. */
615 if (startup && freq != NODE_FREQUENCY_UNLIKELY_EXECUTED)
616 {
617 /* During LTO the tp_first_run profiling will naturally place all
618 initialization code first. Using separate section is counter-productive
619 because startup only code may call functions which are no longer
620 startup only. */
621 if (!in_lto_pglobal_options.x_in_lto_p
622 || !cgraph_node::get (decl)->tp_first_run
623 || !opt_for_fn (decl, flag_profile_reorder_functions)(opts_for_fn (decl)->x_flag_profile_reorder_functions))
624 return get_named_text_section (decl, ".text.startup", NULLnullptr);
625 else
626 return NULLnullptr;
627 }
628
629 /* Similarly for exit. */
630 if (exit && freq != NODE_FREQUENCY_UNLIKELY_EXECUTED)
631 return get_named_text_section (decl, ".text.exit", NULLnullptr);
632
633 /* Group cold functions together, similarly for hot code. */
634 switch (freq)
635 {
636 case NODE_FREQUENCY_UNLIKELY_EXECUTED:
637 return get_named_text_section (decl, ".text.unlikely", NULLnullptr);
638 case NODE_FREQUENCY_HOT:
639 return get_named_text_section (decl, ".text.hot", NULLnullptr);
640 /* FALLTHRU */
641 default:
642 return NULLnullptr;
643 }
644}
645
646/* Return the section for function DECL.
647
648 If DECL is NULL_TREE, return the text section. We can be passed
649 NULL_TREE under some circumstances by dbxout.c at least.
650
651 If FORCE_COLD is true, return cold function section ignoring
652 the frequency info of cgraph_node. */
653
654static section *
655function_section_1 (tree decl, bool force_cold)
656{
657 section *section = NULLnullptr;
658 enum node_frequency freq = NODE_FREQUENCY_NORMAL;
659 bool startup = false, exit = false;
660
661 if (decl)
662 {
663 struct cgraph_node *node = cgraph_node::get (decl);
664
665 if (node)
666 {
667 freq = node->frequency;
668 startup = node->only_called_at_startup;
669 exit = node->only_called_at_exit;
670 }
671 }
672 if (force_cold)
673 freq = NODE_FREQUENCY_UNLIKELY_EXECUTED;
674
675#ifdef USE_SELECT_SECTION_FOR_FUNCTIONS
676 if (decl != NULL_TREE(tree) nullptr
677 && DECL_SECTION_NAME (decl)decl_section_name (decl) != NULLnullptr)
678 {
679 if (targetm.asm_out.function_section)
680 section = targetm.asm_out.function_section (decl, freq,
681 startup, exit);
682 if (section)
683 return section;
684 return get_named_section (decl, NULLnullptr, 0);
685 }
686 else
687 return targetm.asm_out.select_section
688 (decl, freq == NODE_FREQUENCY_UNLIKELY_EXECUTED,
689 symtab_node::get (decl)->definition_alignment ());
690#else
691 if (targetm.asm_out.function_section)
692 section = targetm.asm_out.function_section (decl, freq, startup, exit);
693 if (section)
694 return section;
695 return hot_function_section (decl);
696#endif
697}
698
699/* Return the section for function DECL.
700
701 If DECL is NULL_TREE, return the text section. We can be passed
702 NULL_TREE under some circumstances by dbxout.c at least. */
703
704section *
705function_section (tree decl)
706{
707 /* Handle cases where function splitting code decides
708 to put function entry point into unlikely executed section
709 despite the fact that the function itself is not cold
710 (i.e. it is called rarely but contains a hot loop that is
711 better to live in hot subsection for the code locality). */
712 return function_section_1 (decl,
713 first_function_block_is_cold);
714}
715
716/* Return the section for the current function, take IN_COLD_SECTION_P
717 into account. */
718
719section *
720current_function_section (void)
721{
722 return function_section_1 (current_function_decl, in_cold_section_p);
723}
724
725/* Tell assembler to switch to unlikely-to-be-executed text section. */
726
727section *
728unlikely_text_section (void)
729{
730 return function_section_1 (current_function_decl, true);
731}
732
733/* When called within a function context, return true if the function
734 has been assigned a cold text section and if SECT is that section.
735 When called outside a function context, return true if SECT is the
736 default cold section. */
737
738bool
739unlikely_text_section_p (section *sect)
740{
741 return sect == function_section_1 (current_function_decl, true);
742}
743
744/* Switch to the other function partition (if inside of hot section
745 into cold section, otherwise into the hot section). */
746
747void
748switch_to_other_text_partition (void)
749{
750 in_cold_section_p = !in_cold_section_p;
751 switch_to_section (current_function_section ());
752}
753
754/* Return the read-only or relocated read-only data section
755 associated with function DECL. */
756
757section *
758default_function_rodata_section (tree decl, bool relocatable)
759{
760 const char* sname;
761 unsigned int flags;
762
763 flags = 0;
764
765 if (relocatable)
766 {
767 sname = ".data.rel.ro.local";
768 flags = (SECTION_WRITE0x00200 | SECTION_RELRO0x1000000);
769 }
770 else
771 sname = ".rodata";
772
773 if (decl && DECL_SECTION_NAME (decl)decl_section_name (decl))
774 {
775 const char *name = DECL_SECTION_NAME (decl)decl_section_name (decl);
776
777 if (DECL_COMDAT_GROUP (decl)decl_comdat_group (decl) && HAVE_COMDAT_GROUP1)
778 {
779 const char *dot;
780 size_t len;
781 char* rname;
782
783 dot = strchr (name + 1, '.');
784 if (!dot)
785 dot = name;
786 len = strlen (dot) + strlen (sname) + 1;
787 rname = (char *) alloca (len)__builtin_alloca(len);
788
789 strcpy (rname, sname);
790 strcat (rname, dot);
791 return get_section (rname, (SECTION_LINKONCE0x00800 | flags), decl);
792 }
793 /* For .gnu.linkonce.t.foo we want to use .gnu.linkonce.r.foo or
794 .gnu.linkonce.d.rel.ro.local.foo if the jump table is relocatable. */
795 else if (DECL_COMDAT_GROUP (decl)decl_comdat_group (decl)
796 && strncmp (name, ".gnu.linkonce.t.", 16) == 0)
797 {
798 size_t len;
799 char *rname;
800
801 if (relocatable)
802 {
803 len = strlen (name) + strlen (".rel.ro.local") + 1;
804 rname = (char *) alloca (len)__builtin_alloca(len);
805
806 strcpy (rname, ".gnu.linkonce.d.rel.ro.local");
807 strcat (rname, name + 15);
808 }
809 else
810 {
811 len = strlen (name) + 1;
812 rname = (char *) alloca (len)__builtin_alloca(len);
813
814 memcpy (rname, name, len);
815 rname[14] = 'r';
816 }
817 return get_section (rname, (SECTION_LINKONCE0x00800 | flags), decl);
818 }
819 /* For .text.foo we want to use .rodata.foo. */
820 else if (flag_function_sectionsglobal_options.x_flag_function_sections && flag_data_sectionsglobal_options.x_flag_data_sections
821 && strncmp (name, ".text.", 6) == 0)
822 {
823 size_t len = strlen (name) + 1;
824 char *rname = (char *) alloca (len + strlen (sname) - 5)__builtin_alloca(len + strlen (sname) - 5);
825
826 memcpy (rname, sname, strlen (sname));
827 memcpy (rname + strlen (sname), name + 5, len - 5);
828 return get_section (rname, flags, decl);
829 }
830 }
831
832 if (relocatable)
833 return get_section (sname, flags, decl);
834 else
835 return readonly_data_section;
836}
837
838/* Return the read-only data section associated with function DECL
839 for targets where that section should be always the single
840 readonly data section. */
841
842section *
843default_no_function_rodata_section (tree, bool)
844{
845 return readonly_data_section;
846}
847
848/* A subroutine of mergeable_string_section and mergeable_constant_section. */
849
850static const char *
851function_mergeable_rodata_prefix (void)
852{
853 section *s = targetm.asm_out.function_rodata_section (current_function_decl,
854 false);
855 if (SECTION_STYLE (s)((s)->common.flags & 0x600000) == SECTION_NAMED0x200000)
856 return s->named.name;
857 else
858 return targetm.asm_out.mergeable_rodata_prefix;
859}
860
861/* Return the section to use for string merging. */
862
863static section *
864mergeable_string_section (tree decl ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
865 unsigned HOST_WIDE_INTlong align ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
866 unsigned int flags ATTRIBUTE_UNUSED__attribute__ ((__unused__)))
867{
868 HOST_WIDE_INTlong len;
869
870 if (HAVE_GAS_SHF_MERGE1 && flag_merge_constantsglobal_options.x_flag_merge_constants
871 && TREE_CODE (decl)((enum tree_code) (decl)->base.code) == STRING_CST
872 && TREE_CODE (TREE_TYPE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 872, __FUNCTION__))->typed.type))->base.code)
== ARRAY_TYPE
873 && align <= 256
874 && (len = int_size_in_bytes (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 874, __FUNCTION__))->typed.type)
)) > 0
875 && TREE_STRING_LENGTH (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 875, __FUNCTION__, (STRING_CST)))->string.length)
== len)
876 {
877 scalar_int_mode mode;
878 unsigned int modesize;
879 const char *str;
880 HOST_WIDE_INTlong i;
881 int j, unit;
882 const char *prefix = function_mergeable_rodata_prefix ();
883 char *name = (char *) alloca (strlen (prefix) + 30)__builtin_alloca(strlen (prefix) + 30);
884
885 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 885, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 885, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 885, __FUNCTION__))->type_common.mode))
;
886 modesize = GET_MODE_BITSIZE (mode);
887 if (modesize >= 8 && modesize <= 256
888 && (modesize & (modesize - 1)) == 0)
889 {
890 if (align < modesize)
891 align = modesize;
892
893 if (!HAVE_LD_ALIGNED_SHF_MERGE1 && align > 8)
894 return readonly_data_section;
895
896 str = TREE_STRING_POINTER (decl)((const char *)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 896, __FUNCTION__, (STRING_CST)))->string.str))
;
897 unit = GET_MODE_SIZE (mode);
898
899 /* Check for embedded NUL characters. */
900 for (i = 0; i < len; i += unit)
901 {
902 for (j = 0; j < unit; j++)
903 if (str[i + j] != '\0')
904 break;
905 if (j == unit)
906 break;
907 }
908 if (i == len - unit || (unit == 1 && i == len))
909 {
910 sprintf (name, "%s.str%d.%d", prefix,
911 modesize / 8, (int) (align / 8));
912 flags |= (modesize / 8) | SECTION_MERGE0x08000 | SECTION_STRINGS0x10000;
913 return get_section (name, flags, NULLnullptr);
914 }
915 }
916 }
917
918 return readonly_data_section;
919}
920
921/* Return the section to use for constant merging. */
922
923section *
924mergeable_constant_section (machine_mode mode ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
925 unsigned HOST_WIDE_INTlong align ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
926 unsigned int flags ATTRIBUTE_UNUSED__attribute__ ((__unused__)))
927{
928 if (HAVE_GAS_SHF_MERGE1 && flag_merge_constantsglobal_options.x_flag_merge_constants
929 && mode != VOIDmode((void) 0, E_VOIDmode)
930 && mode != BLKmode((void) 0, E_BLKmode)
931 && known_le (GET_MODE_BITSIZE (mode), align)(!maybe_lt (align, GET_MODE_BITSIZE (mode)))
932 && align >= 8
933 && align <= 256
934 && (align & (align - 1)) == 0
935 && (HAVE_LD_ALIGNED_SHF_MERGE1 ? 1 : align == 8))
936 {
937 const char *prefix = function_mergeable_rodata_prefix ();
938 char *name = (char *) alloca (strlen (prefix) + 30)__builtin_alloca(strlen (prefix) + 30);
939
940 sprintf (name, "%s.cst%d", prefix, (int) (align / 8));
941 flags |= (align / 8) | SECTION_MERGE0x08000;
942 return get_section (name, flags, NULLnullptr);
943 }
944 return readonly_data_section;
945}
946
947/* Given NAME, a putative register name, discard any customary prefixes. */
948
949static const char *
950strip_reg_name (const char *name)
951{
952#ifdef REGISTER_PREFIX
953 if (!strncmp (name, REGISTER_PREFIX, strlen (REGISTER_PREFIX)))
954 name += strlen (REGISTER_PREFIX);
955#endif
956 if (name[0] == '%' || name[0] == '#')
957 name++;
958 return name;
959}
960
961/* The user has asked for a DECL to have a particular name. Set (or
962 change) it in such a way that we don't prefix an underscore to
963 it. */
964void
965set_user_assembler_name (tree decl, const char *name)
966{
967 char *starred = (char *) alloca (strlen (name) + 2)__builtin_alloca(strlen (name) + 2);
968 starred[0] = '*';
969 strcpy (starred + 1, name);
970 symtab->change_decl_assembler_name (decl, get_identifier (starred)(__builtin_constant_p (starred) ? get_identifier_with_length (
(starred), strlen (starred)) : get_identifier (starred))
);
971 SET_DECL_RTL (decl, NULL_RTX)set_decl_rtl (decl, (rtx) 0);
972}
973
974/* Decode an `asm' spec for a declaration as a register name.
975 Return the register number, or -1 if nothing specified,
976 or -2 if the ASMSPEC is not `cc' or `memory' and is not recognized,
977 or -3 if ASMSPEC is `cc' and is not recognized,
978 or -4 if ASMSPEC is `memory' and is not recognized.
979 Accept an exact spelling or a decimal number.
980 Prefixes such as % are optional. */
981
982int
983decode_reg_name_and_count (const char *asmspec, int *pnregs)
984{
985 /* Presume just one register is clobbered. */
986 *pnregs = 1;
987
988 if (asmspec != 0)
989 {
990 int i;
991
992 /* Get rid of confusing prefixes. */
993 asmspec = strip_reg_name (asmspec);
994
995 /* Allow a decimal number as a "register name". */
996 for (i = strlen (asmspec) - 1; i >= 0; i--)
997 if (! ISDIGIT (asmspec[i])(_sch_istable[(asmspec[i]) & 0xff] & (unsigned short)
(_sch_isdigit))
)
998 break;
999 if (asmspec[0] != 0 && i < 0)
1000 {
1001 i = atoi (asmspec);
1002 if (i < FIRST_PSEUDO_REGISTER76 && i >= 0 && reg_names(this_target_hard_regs->x_reg_names)[i][0])
1003 return i;
1004 else
1005 return -2;
1006 }
1007
1008 for (i = 0; i < FIRST_PSEUDO_REGISTER76; i++)
1009 if (reg_names(this_target_hard_regs->x_reg_names)[i][0]
1010 && ! strcmp (asmspec, strip_reg_name (reg_names(this_target_hard_regs->x_reg_names)[i])))
1011 return i;
1012
1013#ifdef OVERLAPPING_REGISTER_NAMES
1014 {
1015 static const struct
1016 {
1017 const char *const name;
1018 const int number;
1019 const int nregs;
1020 } table[] = OVERLAPPING_REGISTER_NAMES;
1021
1022 for (i = 0; i < (int) ARRAY_SIZE (table)(sizeof (table) / sizeof ((table)[0])); i++)
1023 if (table[i].name[0]
1024 && ! strcmp (asmspec, table[i].name))
1025 {
1026 *pnregs = table[i].nregs;
1027 return table[i].number;
1028 }
1029 }
1030#endif /* OVERLAPPING_REGISTER_NAMES */
1031
1032#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 } }
1033 {
1034 static const struct { const char *const name; const int number; } table[]
1035 = 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 } }
;
1036
1037 for (i = 0; i < (int) ARRAY_SIZE (table)(sizeof (table) / sizeof ((table)[0])); i++)
1038 if (table[i].name[0]
1039 && ! strcmp (asmspec, table[i].name)
1040 && reg_names(this_target_hard_regs->x_reg_names)[table[i].number][0])
1041 return table[i].number;
1042 }
1043#endif /* ADDITIONAL_REGISTER_NAMES */
1044
1045 if (!strcmp (asmspec, "memory"))
1046 return -4;
1047
1048 if (!strcmp (asmspec, "cc"))
1049 return -3;
1050
1051 return -2;
1052 }
1053
1054 return -1;
1055}
1056
1057int
1058decode_reg_name (const char *name)
1059{
1060 int count;
1061 return decode_reg_name_and_count (name, &count);
1062}
1063
1064
1065/* Return true if DECL's initializer is suitable for a BSS section. */
1066
1067bool
1068bss_initializer_p (const_tree decl, bool named)
1069{
1070 /* Do not put non-common constants into the .bss section, they belong in
1071 a readonly section, except when NAMED is true. */
1072 return ((!TREE_READONLY (decl)((non_type_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1072, __FUNCTION__))->base.readonly_flag)
|| DECL_COMMON (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1072, __FUNCTION__))->decl_with_vis.common_flag)
|| named)
1073 && (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1073, __FUNCTION__))->decl_common.initial)
== NULLnullptr
1074 /* In LTO we have no errors in program; error_mark_node is used
1075 to mark offlined constructors. */
1076 || (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1076, __FUNCTION__))->decl_common.initial)
== error_mark_nodeglobal_trees[TI_ERROR_MARK]
1077 && !in_lto_pglobal_options.x_in_lto_p)
1078 || (flag_zero_initialized_in_bssglobal_options.x_flag_zero_initialized_in_bss
1079 && initializer_zerop (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1079, __FUNCTION__))->decl_common.initial)
)
1080 /* A decl with the "persistent" attribute applied and
1081 explicitly initialized to 0 should not be treated as a BSS
1082 variable. */
1083 && !DECL_PERSISTENT_P (decl)((tree_code_type[(int) (((enum tree_code) (decl)->base.code
))] == tcc_declaration) && (lookup_attribute ("persistent"
, ((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1083, __FUNCTION__))->decl_common.attributes)) != (tree)
nullptr))
)));
1084}
1085
1086/* Compute the alignment of variable specified by DECL.
1087 DONT_OUTPUT_DATA is from assemble_variable. */
1088
1089void
1090align_variable (tree decl, bool dont_output_data)
1091{
1092 unsigned int align = DECL_ALIGN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1092, __FUNCTION__))->decl_common.align) ? ((unsigned)1)
<< (((contains_struct_check ((decl), (TS_DECL_COMMON),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1092, __FUNCTION__))->decl_common.align) - 1) : 0)
;
1093
1094 /* In the case for initialing an array whose length isn't specified,
1095 where we have not yet been able to do the layout,
1096 figure out the proper alignment now. */
1097 if (dont_output_data && DECL_SIZE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1097, __FUNCTION__))->decl_common.size)
== 0
1098 && TREE_CODE (TREE_TYPE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1098, __FUNCTION__))->typed.type))->base.code)
== ARRAY_TYPE)
1099 align = MAX (align, TYPE_ALIGN (TREE_TYPE (TREE_TYPE (decl))))((align) > (((tree_class_check ((((contains_struct_check (
(((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1099, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1099, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1099, __FUNCTION__))->type_common.align ? ((unsigned)1) <<
((((contains_struct_check ((((contains_struct_check ((decl),
(TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1099, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1099, __FUNCTION__))->typed.type))->type_common.align
- 1) : 0)) ? (align) : (((tree_class_check ((((contains_struct_check
((((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1099, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1099, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1099, __FUNCTION__))->type_common.align ? ((unsigned)1) <<
((((contains_struct_check ((((contains_struct_check ((decl),
(TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1099, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1099, __FUNCTION__))->typed.type))->type_common.align
- 1) : 0)))
;
1100
1101 /* Some object file formats have a maximum alignment which they support.
1102 In particular, a.out format supports a maximum alignment of 4. */
1103 if (align > MAX_OFILE_ALIGNMENT(((unsigned int) 1 << 28) * 8))
1104 {
1105 error ("alignment of %q+D is greater than maximum object "
1106 "file alignment %d", decl,
1107 MAX_OFILE_ALIGNMENT(((unsigned int) 1 << 28) * 8)/BITS_PER_UNIT(8));
1108 align = MAX_OFILE_ALIGNMENT(((unsigned int) 1 << 28) * 8);
1109 }
1110
1111 if (! DECL_USER_ALIGN (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1111, __FUNCTION__))->base.u.bits.user_align)
)
1112 {
1113#ifdef DATA_ABI_ALIGNMENT
1114 unsigned int data_abi_align
1115 = DATA_ABI_ALIGNMENT (TREE_TYPE (decl), align)ix86_data_alignment ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1115, __FUNCTION__))->typed.type)), (align), false)
;
1116 /* For backwards compatibility, don't assume the ABI alignment for
1117 TLS variables. */
1118 if (! DECL_THREAD_LOCAL_P (decl)((((decl)->base.static_flag) || ((contains_struct_check ((
decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1118, __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))
)
1119 align = data_abi_align;
1120#endif
1121
1122 /* On some machines, it is good to increase alignment sometimes.
1123 But as DECL_ALIGN is used both for actually emitting the variable
1124 and for code accessing the variable as guaranteed alignment, we
1125 can only increase the alignment if it is a performance optimization
1126 if the references to it must bind to the current definition. */
1127 if (decl_binds_to_current_def_p (decl)
1128 && !DECL_VIRTUAL_P (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1128, __FUNCTION__))->decl_common.virtual_flag)
)
1129 {
1130#ifdef DATA_ALIGNMENT
1131 unsigned int data_align = DATA_ALIGNMENT (TREE_TYPE (decl), align)ix86_data_alignment ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1131, __FUNCTION__))->typed.type)), (align), true)
;
1132 /* Don't increase alignment too much for TLS variables - TLS space
1133 is too precious. */
1134 if (! DECL_THREAD_LOCAL_P (decl)((((decl)->base.static_flag) || ((contains_struct_check ((
decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1134, __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))
)
1135 align = data_align;
1136#endif
1137 if (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1137, __FUNCTION__))->decl_common.initial)
!= 0
1138 /* In LTO we have no errors in program; error_mark_node is used
1139 to mark offlined constructors. */
1140 && (in_lto_pglobal_options.x_in_lto_p || DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1140, __FUNCTION__))->decl_common.initial)
!= error_mark_nodeglobal_trees[TI_ERROR_MARK]))
1141 {
1142 unsigned int const_align
1143 = targetm.constant_alignment (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1143, __FUNCTION__))->decl_common.initial)
, align);
1144 /* Don't increase alignment too much for TLS variables - TLS
1145 space is too precious. */
1146 if (! DECL_THREAD_LOCAL_P (decl)((((decl)->base.static_flag) || ((contains_struct_check ((
decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1146, __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))
)
1147 align = const_align;
1148 }
1149 }
1150 }
1151
1152 /* Reset the alignment in case we have made it tighter, so we can benefit
1153 from it in get_pointer_alignment. */
1154 SET_DECL_ALIGN (decl, align)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1154, __FUNCTION__))->decl_common.align) = ffs_hwi (align
))
;
1155}
1156
1157/* Return DECL_ALIGN (decl), possibly increased for optimization purposes
1158 beyond what align_variable returned. */
1159
1160static unsigned int
1161get_variable_align (tree decl)
1162{
1163 unsigned int align = DECL_ALIGN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1163, __FUNCTION__))->decl_common.align) ? ((unsigned)1)
<< (((contains_struct_check ((decl), (TS_DECL_COMMON),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1163, __FUNCTION__))->decl_common.align) - 1) : 0)
;
1164
1165 /* For user aligned vars or static vars align_variable already did
1166 everything. */
1167 if (DECL_USER_ALIGN (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1167, __FUNCTION__))->base.u.bits.user_align)
|| !TREE_PUBLIC (decl)((decl)->base.public_flag))
1168 return align;
1169
1170#ifdef DATA_ABI_ALIGNMENT
1171 if (DECL_THREAD_LOCAL_P (decl)((((decl)->base.static_flag) || ((contains_struct_check ((
decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1171, __FUNCTION__))->decl_common.decl_flag_1)) &&
decl_tls_model (decl) >= TLS_MODEL_REAL)
)
1172 align = DATA_ABI_ALIGNMENT (TREE_TYPE (decl), align)ix86_data_alignment ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1172, __FUNCTION__))->typed.type)), (align), false)
;
1173#endif
1174
1175 /* For decls that bind to the current definition, align_variable
1176 did also everything, except for not assuming ABI required alignment
1177 of TLS variables. For other vars, increase the alignment here
1178 as an optimization. */
1179 if (!decl_binds_to_current_def_p (decl))
1180 {
1181 /* On some machines, it is good to increase alignment sometimes. */
1182#ifdef DATA_ALIGNMENT
1183 unsigned int data_align = DATA_ALIGNMENT (TREE_TYPE (decl), align)ix86_data_alignment ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1183, __FUNCTION__))->typed.type)), (align), true)
;
1184 /* Don't increase alignment too much for TLS variables - TLS space
1185 is too precious. */
1186 if (! DECL_THREAD_LOCAL_P (decl)((((decl)->base.static_flag) || ((contains_struct_check ((
decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1186, __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))
)
1187 align = data_align;
1188#endif
1189 if (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1189, __FUNCTION__))->decl_common.initial)
!= 0
1190 /* In LTO we have no errors in program; error_mark_node is used
1191 to mark offlined constructors. */
1192 && (in_lto_pglobal_options.x_in_lto_p || DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1192, __FUNCTION__))->decl_common.initial)
!= error_mark_nodeglobal_trees[TI_ERROR_MARK]))
1193 {
1194 unsigned int const_align
1195 = targetm.constant_alignment (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1195, __FUNCTION__))->decl_common.initial)
, align);
1196 /* Don't increase alignment too much for TLS variables - TLS space
1197 is too precious. */
1198 if (! DECL_THREAD_LOCAL_P (decl)((((decl)->base.static_flag) || ((contains_struct_check ((
decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1198, __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))
)
1199 align = const_align;
1200 }
1201 }
1202
1203 return align;
1204}
1205
1206/* Return the section into which the given VAR_DECL or CONST_DECL
1207 should be placed. PREFER_NOSWITCH_P is true if a noswitch
1208 section should be used wherever possible. */
1209
1210section *
1211get_variable_section (tree decl, bool prefer_noswitch_p)
1212{
1213 addr_space_t as = ADDR_SPACE_GENERIC0;
1214 int reloc;
1215 varpool_node *vnode = varpool_node::get (decl);
1216 if (vnode)
1217 {
1218 vnode = vnode->ultimate_alias_target ();
1219 decl = vnode->decl;
1220 }
1221
1222 if (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1222, __FUNCTION__))->typed.type)
!= error_mark_nodeglobal_trees[TI_ERROR_MARK])
1223 as = TYPE_ADDR_SPACE (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1223, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1223, __FUNCTION__))->base.u.bits.address_space)
;
1224
1225 /* We need the constructor to figure out reloc flag. */
1226 if (vnode)
1227 vnode->get_constructor ();
1228
1229 if (DECL_COMMON (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1229, __FUNCTION__))->decl_with_vis.common_flag)
1230 && !(SUPPORTS_SHF_GNU_RETAIN0 && DECL_PRESERVE_P (decl)(contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1230, __FUNCTION__))->decl_common.preserve_flag
))
1231 {
1232 /* If the decl has been given an explicit section name, or it resides
1233 in a non-generic address space, then it isn't common, and shouldn't
1234 be handled as such. */
1235 gcc_assert (DECL_SECTION_NAME (decl) == NULL((void)(!(decl_section_name (decl) == nullptr && ((as
) == 0)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1236, __FUNCTION__), 0 : 0))
1236 && ADDR_SPACE_GENERIC_P (as))((void)(!(decl_section_name (decl) == nullptr && ((as
) == 0)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1236, __FUNCTION__), 0 : 0))
;
1237 if (DECL_THREAD_LOCAL_P (decl)((((decl)->base.static_flag) || ((contains_struct_check ((
decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1237, __FUNCTION__))->decl_common.decl_flag_1)) &&
decl_tls_model (decl) >= TLS_MODEL_REAL)
)
1238 return tls_comm_section;
1239 else if (TREE_PUBLIC (decl)((decl)->base.public_flag) && bss_initializer_p (decl))
1240 return comm_section;
1241 }
1242
1243 if (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1243, __FUNCTION__))->decl_common.initial)
== error_mark_nodeglobal_trees[TI_ERROR_MARK])
1244 reloc = contains_pointers_p (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1244, __FUNCTION__))->typed.type)
) ? 3 : 0;
1245 else if (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1245, __FUNCTION__))->decl_common.initial)
)
1246 reloc = compute_reloc_for_constant (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1246, __FUNCTION__))->decl_common.initial)
);
1247 else
1248 reloc = 0;
1249
1250 resolve_unique_section (decl, reloc, flag_data_sectionsglobal_options.x_flag_data_sections);
1251 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)
)
1252 {
1253 section *sect = get_named_section (decl, NULLnullptr, reloc);
1254
1255 if ((sect->common.flags & SECTION_BSS0x02000)
1256 && !bss_initializer_p (decl, true))
1257 {
1258 error_at (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1258, __FUNCTION__))->decl_minimal.locus)
,
1259 "only zero initializers are allowed in section %qs",
1260 sect->named.name);
1261 DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1261, __FUNCTION__))->decl_common.initial)
= error_mark_nodeglobal_trees[TI_ERROR_MARK];
1262 }
1263 return sect;
1264 }
1265
1266 if (ADDR_SPACE_GENERIC_P (as)((as) == 0)
1267 && !DECL_THREAD_LOCAL_P (decl)((((decl)->base.static_flag) || ((contains_struct_check ((
decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1267, __FUNCTION__))->decl_common.decl_flag_1)) &&
decl_tls_model (decl) >= TLS_MODEL_REAL)
1268 && !DECL_NOINIT_P (decl)((tree_code_type[(int) (((enum tree_code) (decl)->base.code
))] == tcc_declaration) && (lookup_attribute ("noinit"
, ((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1268, __FUNCTION__))->decl_common.attributes)) != (tree)
nullptr))
1269 && !(prefer_noswitch_p && targetm.have_switchable_bss_sections)
1270 && bss_initializer_p (decl))
1271 {
1272 if (!TREE_PUBLIC (decl)((decl)->base.public_flag)
1273 && !((flag_sanitizeglobal_options.x_flag_sanitize & SANITIZE_ADDRESS)
1274 && asan_protect_global (decl)))
1275 return lcomm_section;
1276 if (bss_noswitch_section)
1277 return bss_noswitch_section;
1278 }
1279
1280 return targetm.asm_out.select_section (decl, reloc,
1281 get_variable_align (decl));
1282}
1283
1284/* Return the block into which object_block DECL should be placed. */
1285
1286static struct object_block *
1287get_block_for_decl (tree decl)
1288{
1289 section *sect;
1290
1291 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL))
1292 {
1293 /* The object must be defined in this translation unit. */
1294 if (DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1294, __FUNCTION__))->decl_common.decl_flag_1)
)
1295 return NULLnullptr;
1296
1297 /* There's no point using object blocks for something that is
1298 isolated by definition. */
1299 if (DECL_COMDAT_GROUP (decl)decl_comdat_group (decl))
1300 return NULLnullptr;
1301 }
1302
1303 /* We can only calculate block offsets if the decl has a known
1304 constant size. */
1305 if (DECL_SIZE_UNIT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1305, __FUNCTION__))->decl_common.size_unit)
== NULLnullptr)
1306 return NULLnullptr;
1307 if (!tree_fits_uhwi_p (DECL_SIZE_UNIT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1307, __FUNCTION__))->decl_common.size_unit)
))
1308 return NULLnullptr;
1309
1310 /* Find out which section should contain DECL. We cannot put it into
1311 an object block if it requires a standalone definition. */
1312 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL))
1313 align_variable (decl, 0);
1314 sect = get_variable_section (decl, true);
1315 if (SECTION_STYLE (sect)((sect)->common.flags & 0x600000) == SECTION_NOSWITCH0x400000)
1316 return NULLnullptr;
1317
1318 return get_block_for_section (sect);
1319}
1320
1321/* Make sure block symbol SYMBOL is in block BLOCK. */
1322
1323static void
1324change_symbol_block (rtx symbol, struct object_block *block)
1325{
1326 if (block != SYMBOL_REF_BLOCK (symbol)((&(symbol)->u.block_sym)->block))
1327 {
1328 gcc_assert (SYMBOL_REF_BLOCK_OFFSET (symbol) < 0)((void)(!(((&(symbol)->u.block_sym)->offset) < 0
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1328, __FUNCTION__), 0 : 0))
;
1329 SYMBOL_REF_BLOCK (symbol)((&(symbol)->u.block_sym)->block) = block;
1330 }
1331}
1332
1333/* Return true if it is possible to put DECL in an object_block. */
1334
1335static bool
1336use_blocks_for_decl_p (tree decl)
1337{
1338 struct symtab_node *snode;
1339
1340 /* Only data DECLs can be placed into object blocks. */
1341 if (!VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && TREE_CODE (decl)((enum tree_code) (decl)->base.code) != CONST_DECL)
1342 return false;
1343
1344 /* DECL_INITIAL (decl) set to decl is a hack used for some decls that
1345 are never used from code directly and we never want object block handling
1346 for those. */
1347 if (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1347, __FUNCTION__))->decl_common.initial)
== decl)
1348 return false;
1349
1350 /* If this decl is an alias, then we don't want to emit a
1351 definition. */
1352 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)
1353 && (snode = symtab_node::get (decl)) != NULLnullptr
1354 && snode->alias)
1355 return false;
1356
1357 return targetm.use_blocks_for_decl_p (decl);
1358}
1359
1360/* Follow the IDENTIFIER_TRANSPARENT_ALIAS chain starting at *ALIAS
1361 until we find an identifier that is not itself a transparent alias.
1362 Modify the alias passed to it by reference (and all aliases on the
1363 way to the ultimate target), such that they do not have to be
1364 followed again, and return the ultimate target of the alias
1365 chain. */
1366
1367static inline tree
1368ultimate_transparent_alias_target (tree *alias)
1369{
1370 tree target = *alias;
1371
1372 if (IDENTIFIER_TRANSPARENT_ALIAS (target)((tree_check ((target), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1372, __FUNCTION__, (IDENTIFIER_NODE)))->base.deprecated_flag
)
)
1373 {
1374 gcc_assert (TREE_CHAIN (target))((void)(!(((contains_struct_check ((target), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1374, __FUNCTION__))->common.chain)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1374, __FUNCTION__), 0 : 0))
;
1375 target = ultimate_transparent_alias_target (&TREE_CHAIN (target)((contains_struct_check ((target), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1375, __FUNCTION__))->common.chain)
);
1376 gcc_assert (! IDENTIFIER_TRANSPARENT_ALIAS (target)((void)(!(! ((tree_check ((target), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1376, __FUNCTION__, (IDENTIFIER_NODE)))->base.deprecated_flag
) && ! ((contains_struct_check ((target), (TS_COMMON)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1377, __FUNCTION__))->common.chain)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1377, __FUNCTION__), 0 : 0))
1377 && ! TREE_CHAIN (target))((void)(!(! ((tree_check ((target), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1376, __FUNCTION__, (IDENTIFIER_NODE)))->base.deprecated_flag
) && ! ((contains_struct_check ((target), (TS_COMMON)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1377, __FUNCTION__))->common.chain)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1377, __FUNCTION__), 0 : 0))
;
1378 *alias = target;
1379 }
1380
1381 return target;
1382}
1383
1384/* Return true if REGNUM is mentioned in ELIMINABLE_REGS as a from
1385 register number. */
1386
1387static bool
1388eliminable_regno_p (int regnum)
1389{
1390 static const struct
1391 {
1392 const int from;
1393 const int to;
1394 } eliminables[] = ELIMINABLE_REGS{{ 16, 7}, { 16, 6}, { 19, 7}, { 19, 6}};
1395 for (size_t i = 0; i < ARRAY_SIZE (eliminables)(sizeof (eliminables) / sizeof ((eliminables)[0])); i++)
1396 if (regnum == eliminables[i].from)
1397 return true;
1398 return false;
1399}
1400
1401/* Create the DECL_RTL for a VAR_DECL or FUNCTION_DECL. DECL should
1402 have static storage duration. In other words, it should not be an
1403 automatic variable, including PARM_DECLs.
1404
1405 There is, however, one exception: this function handles variables
1406 explicitly placed in a particular register by the user.
1407
1408 This is never called for PARM_DECL nodes. */
1409
1410void
1411make_decl_rtl (tree decl)
1412{
1413 const char *name = 0;
1414 int reg_number;
1415 tree id;
1416 rtx x;
1417
1418 /* Check that we are not being given an automatic variable. */
1419 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 ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1420, __FUNCTION__), 0 : 0))
1420 && TREE_CODE (decl) != RESULT_DECL)((void)(!(((enum tree_code) (decl)->base.code) != PARM_DECL
&& ((enum tree_code) (decl)->base.code) != RESULT_DECL
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1420, __FUNCTION__), 0 : 0))
;
1421
1422 /* A weak alias has TREE_PUBLIC set but not the other bits. */
1423 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1426, __FUNCTION__))->decl_common.decl_flag_1) || ((contains_struct_check
((decl), (TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1427, __FUNCTION__))->decl_common.decl_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1427, __FUNCTION__), 0 : 0))
1424 || 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1426, __FUNCTION__))->decl_common.decl_flag_1) || ((contains_struct_check
((decl), (TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1427, __FUNCTION__))->decl_common.decl_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1427, __FUNCTION__), 0 : 0))
1425 || 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1426, __FUNCTION__))->decl_common.decl_flag_1) || ((contains_struct_check
((decl), (TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1427, __FUNCTION__))->decl_common.decl_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1427, __FUNCTION__), 0 : 0))
1426 || 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1426, __FUNCTION__))->decl_common.decl_flag_1) || ((contains_struct_check
((decl), (TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1427, __FUNCTION__))->decl_common.decl_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1427, __FUNCTION__), 0 : 0))
1427 || 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1426, __FUNCTION__))->decl_common.decl_flag_1) || ((contains_struct_check
((decl), (TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1427, __FUNCTION__))->decl_common.decl_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1427, __FUNCTION__), 0 : 0))
;
1428
1429 /* And that we were not given a type or a label. */
1430 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 ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1431, __FUNCTION__), 0 : 0))
1431 && TREE_CODE (decl) != LABEL_DECL)((void)(!(((enum tree_code) (decl)->base.code) != TYPE_DECL
&& ((enum tree_code) (decl)->base.code) != LABEL_DECL
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1431, __FUNCTION__), 0 : 0))
;
1432
1433 /* For a duplicate declaration, we can be called twice on the
1434 same DECL node. Don't discard the RTL already made. */
1435 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1435, __FUNCTION__))->decl_with_rtl.rtl != nullptr)
)
1436 {
1437 /* If the old RTL had the wrong mode, fix the mode. */
1438 x = DECL_RTL (decl)((contains_struct_check ((decl), (TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1438, __FUNCTION__))->decl_with_rtl.rtl ? (decl)->decl_with_rtl
.rtl : (make_decl_rtl (decl), (decl)->decl_with_rtl.rtl))
;
1439 if (GET_MODE (x)((machine_mode) (x)->mode) != DECL_MODE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1439, __FUNCTION__))->decl_common.mode)
)
1440 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1440, __FUNCTION__))->decl_common.mode), 0, 0, 1, 0, 0))
;
1441
1442 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != FUNCTION_DECL && DECL_REGISTER (decl)((contains_struct_check ((decl), (TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1442, __FUNCTION__))->decl_common.decl_flag_0)
)
1443 return;
1444
1445 /* ??? Another way to do this would be to maintain a hashed
1446 table of such critters. Instead of adding stuff to a DECL
1447 to give certain attributes to it, we could use an external
1448 hash map from DECL to set of attributes. */
1449
1450 /* Let the target reassign the RTL if it wants.
1451 This is necessary, for example, when one machine specific
1452 decl attribute overrides another. */
1453 targetm.encode_section_info (decl, DECL_RTL (decl)((contains_struct_check ((decl), (TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1453, __FUNCTION__))->decl_with_rtl.rtl ? (decl)->decl_with_rtl
.rtl : (make_decl_rtl (decl), (decl)->decl_with_rtl.rtl))
, false);
1454
1455 /* If the symbol has a SYMBOL_REF_BLOCK field, update it based
1456 on the new decl information. */
1457 if (MEM_P (x)(((enum rtx_code) (x)->code) == MEM)
1458 && GET_CODE (XEXP (x, 0))((enum rtx_code) ((((x)->u.fld[0]).rt_rtx))->code) == SYMBOL_REF
1459 && 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, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1459, __FUNCTION__); _rtx; }) ->u2.symbol_ref_flags) &
(1 << 7)) != 0)
)
1460 change_symbol_block (XEXP (x, 0)(((x)->u.fld[0]).rt_rtx), get_block_for_decl (decl));
1461
1462 return;
1463 }
1464
1465 /* If this variable belongs to the global constant pool, retrieve the
1466 pre-computed RTL or recompute it in LTO mode. */
1467 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_IN_CONSTANT_POOL (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1467, __FUNCTION__, (VAR_DECL)))->decl_with_vis.in_constant_pool
)
)
1468 {
1469 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1469, __FUNCTION__))->decl_common.initial), 1))
;
1470 return;
1471 }
1472
1473 id = DECL_ASSEMBLER_NAME (decl)decl_assembler_name (decl);
1474 name = IDENTIFIER_POINTER (id)((const char *) (tree_check ((id), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1474, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str
)
;
1475
1476 if (name[0] != '*' && TREE_CODE (decl)((enum tree_code) (decl)->base.code) != FUNCTION_DECL
1477 && DECL_REGISTER (decl)((contains_struct_check ((decl), (TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1477, __FUNCTION__))->decl_common.decl_flag_0)
)
1478 {
1479 error ("register name not specified for %q+D", decl);
1480 }
1481 else if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != FUNCTION_DECL && DECL_REGISTER (decl)((contains_struct_check ((decl), (TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1481, __FUNCTION__))->decl_common.decl_flag_0)
)
1482 {
1483 const char *asmspec = name+1;
1484 machine_mode mode = DECL_MODE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1484, __FUNCTION__))->decl_common.mode)
;
1485 reg_number = decode_reg_name (asmspec);
1486 /* First detect errors in declaring global registers. */
1487 if (reg_number == -1)
1488 error ("register name not specified for %q+D", decl);
1489 else if (reg_number < 0)
1490 error ("invalid register name for %q+D", decl);
1491 else if (mode == BLKmode((void) 0, E_BLKmode))
1492 error ("data type of %q+D isn%'t suitable for a register",
1493 decl);
1494 else if (!in_hard_reg_set_p (accessible_reg_set(this_target_hard_regs->x_accessible_reg_set), mode, reg_number))
1495 error ("the register specified for %q+D cannot be accessed"
1496 " by the current target", decl);
1497 else if (!in_hard_reg_set_p (operand_reg_set(this_target_hard_regs->x_operand_reg_set), mode, reg_number))
1498 error ("the register specified for %q+D is not general enough"
1499 " to be used as a register variable", decl);
1500 else if (!targetm.hard_regno_mode_ok (reg_number, mode))
1501 error ("register specified for %q+D isn%'t suitable for data type",
1502 decl);
1503 else if (reg_number != HARD_FRAME_POINTER_REGNUM6
1504 && (reg_number == FRAME_POINTER_REGNUM19
1505#ifdef RETURN_ADDRESS_POINTER_REGNUM
1506 || reg_number == RETURN_ADDRESS_POINTER_REGNUM
1507#endif
1508 || reg_number == ARG_POINTER_REGNUM16)
1509 && eliminable_regno_p (reg_number))
1510 error ("register specified for %q+D is an internal GCC "
1511 "implementation detail", decl);
1512 /* Now handle properly declared static register variables. */
1513 else
1514 {
1515 int nregs;
1516
1517 if (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1517, __FUNCTION__))->decl_common.initial)
!= 0 && TREE_STATIC (decl)((decl)->base.static_flag))
1518 {
1519 DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1519, __FUNCTION__))->decl_common.initial)
= 0;
1520 error ("global register variable has initial value");
1521 }
1522 if (TREE_THIS_VOLATILE (decl)((decl)->base.volatile_flag))
1523 warning (OPT_Wvolatile_register_var,
1524 "optimization may eliminate reads and/or "
1525 "writes to register variables");
1526
1527 /* If the user specified one of the eliminables registers here,
1528 e.g., FRAME_POINTER_REGNUM, we don't want to get this variable
1529 confused with that register and be eliminated. This usage is
1530 somewhat suspect... */
1531
1532 SET_DECL_RTL (decl, gen_raw_REG (mode, reg_number))set_decl_rtl (decl, gen_raw_REG (mode, reg_number));
1533 ORIGINAL_REGNO (DECL_RTL (decl))(__extension__ ({ __typeof ((((contains_struct_check ((decl),
(TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1533, __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
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1533, __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, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1533, __FUNCTION__); _rtx; })->u2.original_regno)
= reg_number;
1534 REG_USERVAR_P (DECL_RTL (decl))(__extension__ ({ __typeof ((((contains_struct_check ((decl),
(TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1534, __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
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1534, __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, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1534, __FUNCTION__); _rtx; })->volatil)
= 1;
1535
1536 if (TREE_STATIC (decl)((decl)->base.static_flag))
1537 {
1538 /* Make this register global, so not usable for anything
1539 else. */
1540#ifdef ASM_DECLARE_REGISTER_GLOBAL
1541 name = IDENTIFIER_POINTER (DECL_NAME (decl))((const char *) (tree_check ((((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1541, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1541, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str
)
;
1542 ASM_DECLARE_REGISTER_GLOBAL (asm_out_file, decl, reg_number, name);
1543#endif
1544 nregs = hard_regno_nregs (reg_number, mode);
1545 while (nregs > 0)
1546 globalize_reg (decl, reg_number + --nregs);
1547 }
1548
1549 /* As a register variable, it has no section. */
1550 return;
1551 }
1552 /* Avoid internal errors from invalid register
1553 specifications. */
1554 SET_DECL_ASSEMBLER_NAME (decl, NULL_TREE)overwrite_decl_assembler_name (decl, (tree) nullptr);
1555 DECL_HARD_REGISTER (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1555, __FUNCTION__, (VAR_DECL)))->decl_with_vis.hard_register
)
= 0;
1556 /* Also avoid SSA inconsistencies by pretending this is an external
1557 decl now. */
1558 DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1558, __FUNCTION__))->decl_common.decl_flag_1)
= 1;
1559 return;
1560 }
1561 /* Now handle ordinary static variables and functions (in memory).
1562 Also handle vars declared register invalidly. */
1563 else if (name[0] == '*')
1564 {
1565#ifdef REGISTER_PREFIX
1566 if (strlen (REGISTER_PREFIX) != 0)
1567 {
1568 reg_number = decode_reg_name (name);
1569 if (reg_number >= 0 || reg_number == -3)
1570 error ("register name given for non-register variable %q+D", decl);
1571 }
1572#endif
1573 }
1574
1575 /* Specifying a section attribute on a variable forces it into a
1576 non-.bss section, and thus it cannot be common. */
1577 /* FIXME: In general this code should not be necessary because
1578 visibility pass is doing the same work. But notice_global_symbol
1579 is called early and it needs to make DECL_RTL to get the name.
1580 we take care of recomputing the DECL_RTL after visibility is changed. */
1581 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)
1582 && (TREE_STATIC (decl)((decl)->base.static_flag) || DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1582, __FUNCTION__))->decl_common.decl_flag_1)
)
1583 && DECL_SECTION_NAME (decl)decl_section_name (decl) != NULLnullptr
1584 && DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1584, __FUNCTION__))->decl_common.initial)
== NULL_TREE(tree) nullptr
1585 && DECL_COMMON (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1585, __FUNCTION__))->decl_with_vis.common_flag)
)
1586 DECL_COMMON (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1586, __FUNCTION__))->decl_with_vis.common_flag)
= 0;
1587
1588 /* Variables can't be both common and weak. */
1589 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_WEAK (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1589, __FUNCTION__))->decl_with_vis.weak_flag)
)
1590 DECL_COMMON (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1590, __FUNCTION__))->decl_with_vis.common_flag)
= 0;
1591
1592 if (use_object_blocks_p () && use_blocks_for_decl_p (decl))
1593 x = create_block_symbol (name, get_block_for_decl (decl), -1);
1594 else
1595 {
1596 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)))
;
1597 if (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1597, __FUNCTION__))->typed.type)
!= error_mark_nodeglobal_trees[TI_ERROR_MARK])
1598 {
1599 addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1599, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1599, __FUNCTION__))->base.u.bits.address_space)
;
1600 address_mode = targetm.addr_space.address_mode (as);
1601 }
1602 x = gen_rtx_SYMBOL_REF (address_mode, name)gen_rtx_fmt_s0_stat ((SYMBOL_REF), ((address_mode)), ((name))
)
;
1603 }
1604 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, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1604, __FUNCTION__); _rtx; })->return_val)
= DECL_WEAK (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1604, __FUNCTION__))->decl_with_vis.weak_flag)
;
1605 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, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1605, __FUNCTION__); _rtx; })->unchanging)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1605, __FUNCTION__), 0 : 0)), ((((x))->u.fld[1]).rt_tree
) = (decl))
;
1606
1607 x = gen_rtx_MEM (DECL_MODE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1607, __FUNCTION__))->decl_common.mode)
, x);
1608 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != FUNCTION_DECL)
1609 set_mem_attributes (x, decl, 1);
1610 SET_DECL_RTL (decl, x)set_decl_rtl (decl, x);
1611
1612 /* Optionally set flags or add text to the name to record information
1613 such as that it is a function name.
1614 If the name is changed, the macro ASM_OUTPUT_LABELREF
1615 will have to know how to strip this information. */
1616 targetm.encode_section_info (decl, DECL_RTL (decl)((contains_struct_check ((decl), (TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1616, __FUNCTION__))->decl_with_rtl.rtl ? (decl)->decl_with_rtl
.rtl : (make_decl_rtl (decl), (decl)->decl_with_rtl.rtl))
, true);
1617}
1618
1619/* Like make_decl_rtl, but inhibit creation of new alias sets when
1620 calling make_decl_rtl. Also, reset DECL_RTL before returning the
1621 rtl. */
1622
1623rtx
1624make_decl_rtl_for_debug (tree decl)
1625{
1626 unsigned int save_aliasing_flag;
1627 rtx rtl;
1628
1629 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1629, __FUNCTION__))->decl_with_rtl.rtl != nullptr)
)
1630 return DECL_RTL (decl)((contains_struct_check ((decl), (TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1630, __FUNCTION__))->decl_with_rtl.rtl ? (decl)->decl_with_rtl
.rtl : (make_decl_rtl (decl), (decl)->decl_with_rtl.rtl))
;
1631
1632 /* Kludge alert! Somewhere down the call chain, make_decl_rtl will
1633 call new_alias_set. If running with -fcompare-debug, sometimes
1634 we do not want to create alias sets that will throw the alias
1635 numbers off in the comparison dumps. So... clearing
1636 flag_strict_aliasing will keep new_alias_set() from creating a
1637 new set. */
1638 save_aliasing_flag = flag_strict_aliasingglobal_options.x_flag_strict_aliasing;
1639 flag_strict_aliasingglobal_options.x_flag_strict_aliasing = 0;
1640
1641 rtl = DECL_RTL (decl)((contains_struct_check ((decl), (TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1641, __FUNCTION__))->decl_with_rtl.rtl ? (decl)->decl_with_rtl
.rtl : (make_decl_rtl (decl), (decl)->decl_with_rtl.rtl))
;
1642 /* Reset DECL_RTL back, as various parts of the compiler expects
1643 DECL_RTL set meaning it is actually going to be output. */
1644 SET_DECL_RTL (decl, NULL)set_decl_rtl (decl, nullptr);
1645
1646 flag_strict_aliasingglobal_options.x_flag_strict_aliasing = save_aliasing_flag;
1647 return rtl;
1648}
1649
1650/* Output a string of literal assembler code
1651 for an `asm' keyword used between functions. */
1652
1653void
1654assemble_asm (tree string)
1655{
1656 const char *p;
1657 app_enable ();
1658
1659 if (TREE_CODE (string)((enum tree_code) (string)->base.code) == ADDR_EXPR)
1660 string = TREE_OPERAND (string, 0)(*((const_cast<tree*> (tree_operand_check ((string), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1660, __FUNCTION__)))))
;
1661
1662 p = TREE_STRING_POINTER (string)((const char *)((tree_check ((string), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1662, __FUNCTION__, (STRING_CST)))->string.str))
;
1663 fprintf (asm_out_file, "%s%s\n", p[0] == '\t' ? "" : "\t", p);
1664}
1665
1666/* Write the address of the entity given by SYMBOL to SEC. */
1667void
1668assemble_addr_to_section (rtx symbol, section *sec)
1669{
1670 switch_to_section (sec);
1671 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)))
);
1672 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);
1673}
1674
1675/* Return the numbered .ctors.N (if CONSTRUCTOR_P) or .dtors.N (if
1676 not) section for PRIORITY. */
1677section *
1678get_cdtor_priority_section (int priority, bool constructor_p)
1679{
1680 /* Buffer conservatively large enough for the full range of a 32-bit
1681 int plus the text below. */
1682 char buf[18];
1683
1684 /* ??? This only works reliably with the GNU linker. */
1685 sprintf (buf, "%s.%.5u",
1686 constructor_p ? ".ctors" : ".dtors",
1687 /* Invert the numbering so the linker puts us in the proper
1688 order; constructors are run from right to left, and the
1689 linker sorts in increasing order. */
1690 MAX_INIT_PRIORITY65535 - priority);
1691 return get_section (buf, SECTION_WRITE0x00200, NULLnullptr);
1692}
1693
1694void
1695default_named_section_asm_out_destructor (rtx symbol, int priority)
1696{
1697 section *sec;
1698
1699 if (priority != DEFAULT_INIT_PRIORITY65535)
1700 sec = get_cdtor_priority_section (priority,
1701 /*constructor_p=*/false);
1702 else
1703 sec = get_section (".dtors", SECTION_WRITE0x00200, NULLnullptr);
1704
1705 assemble_addr_to_section (symbol, sec);
1706}
1707
1708#ifdef DTORS_SECTION_ASM_OP
1709void
1710default_dtor_section_asm_out_destructor (rtx symbol,
1711 int priority ATTRIBUTE_UNUSED__attribute__ ((__unused__)))
1712{
1713 assemble_addr_to_section (symbol, dtors_section);
1714}
1715#endif
1716
1717void
1718default_named_section_asm_out_constructor (rtx symbol, int priority)
1719{
1720 section *sec;
1721
1722 if (priority != DEFAULT_INIT_PRIORITY65535)
1723 sec = get_cdtor_priority_section (priority,
1724 /*constructor_p=*/true);
1725 else
1726 sec = get_section (".ctors", SECTION_WRITE0x00200, NULLnullptr);
1727
1728 assemble_addr_to_section (symbol, sec);
1729}
1730
1731#ifdef CTORS_SECTION_ASM_OP
1732void
1733default_ctor_section_asm_out_constructor (rtx symbol,
1734 int priority ATTRIBUTE_UNUSED__attribute__ ((__unused__)))
1735{
1736 assemble_addr_to_section (symbol, ctors_section);
1737}
1738#endif
1739
1740/* CONSTANT_POOL_BEFORE_FUNCTION may be defined as an expression with
1741 a nonzero value if the constant pool should be output before the
1742 start of the function, or a zero value if the pool should output
1743 after the end of the function. The default is to put it before the
1744 start. */
1745
1746#ifndef CONSTANT_POOL_BEFORE_FUNCTION1
1747#define CONSTANT_POOL_BEFORE_FUNCTION1 1
1748#endif
1749
1750/* DECL is an object (either VAR_DECL or FUNCTION_DECL) which is going
1751 to be output to assembler.
1752 Set first_global_object_name and weak_global_object_name as appropriate. */
1753
1754void
1755notice_global_symbol (tree decl)
1756{
1757 const char **t = &first_global_object_name;
1758
1759 if (first_global_object_name
1760 || !TREE_PUBLIC (decl)((decl)->base.public_flag)
1761 || DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1761, __FUNCTION__))->decl_common.decl_flag_1)
1762 || !DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1762, __FUNCTION__))->decl_minimal.name)
1763 || (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_HARD_REGISTER (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1763, __FUNCTION__, (VAR_DECL)))->decl_with_vis.hard_register
)
)
1764 || (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != FUNCTION_DECL
1765 && (!VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)
1766 || (DECL_COMMON (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1766, __FUNCTION__))->decl_with_vis.common_flag)
1767 && (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1767, __FUNCTION__))->decl_common.initial)
== 0
1768 || DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1768, __FUNCTION__))->decl_common.initial)
== error_mark_nodeglobal_trees[TI_ERROR_MARK])))))
1769 return;
1770
1771 /* We win when global object is found, but it is useful to know about weak
1772 symbol as well so we can produce nicer unique names. */
1773 if (DECL_WEAK (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1773, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1773, __FUNCTION__))->decl_common.decl_flag_1)))
|| flag_shlibglobal_options.x_flag_shlib)
1774 t = &weak_global_object_name;
1775
1776 if (!*t)
1777 {
1778 tree id = DECL_ASSEMBLER_NAME (decl)decl_assembler_name (decl);
1779 ultimate_transparent_alias_target (&id);
1780 *t = ggc_strdup (targetm.strip_name_encoding (IDENTIFIER_POINTER (id)))ggc_alloc_string ((targetm.strip_name_encoding (((const char *
) (tree_check ((id), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1780, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str
))), -1 )
;
1781 }
1782}
1783
1784/* If not using flag_reorder_blocks_and_partition, decide early whether the
1785 current function goes into the cold section, so that targets can use
1786 current_function_section during RTL expansion. DECL describes the
1787 function. */
1788
1789void
1790decide_function_section (tree decl)
1791{
1792 first_function_block_is_cold = false;
1793
1794 if (DECL_SECTION_NAME (decl)decl_section_name (decl))
1795 {
1796 struct cgraph_node *node = cgraph_node::get (current_function_decl);
1797 /* Calls to function_section rely on first_function_block_is_cold
1798 being accurate. */
1799 first_function_block_is_cold = (node
1800 && node->frequency
1801 == NODE_FREQUENCY_UNLIKELY_EXECUTED);
1802 }
1803
1804 in_cold_section_p = first_function_block_is_cold;
1805}
1806
1807/* Get the function's name, as described by its RTL. This may be
1808 different from the DECL_NAME name used in the source file. */
1809const char *
1810get_fnname_from_decl (tree decl)
1811{
1812 rtx x = DECL_RTL (decl)((contains_struct_check ((decl), (TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1812, __FUNCTION__))->decl_with_rtl.rtl ? (decl)->decl_with_rtl
.rtl : (make_decl_rtl (decl), (decl)->decl_with_rtl.rtl))
;
1813 gcc_assert (MEM_P (x))((void)(!((((enum rtx_code) (x)->code) == MEM)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1813, __FUNCTION__), 0 : 0))
;
1814 x = XEXP (x, 0)(((x)->u.fld[0]).rt_rtx);
1815 gcc_assert (GET_CODE (x) == SYMBOL_REF)((void)(!(((enum rtx_code) (x)->code) == SYMBOL_REF) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1815, __FUNCTION__), 0 : 0))
;
1816 return XSTR (x, 0)(((x)->u.fld[0]).rt_str);
1817}
1818
1819/* Output assembler code for the constant pool of a function and associated
1820 with defining the name of the function. DECL describes the function.
1821 NAME is the function's name. For the constant pool, we use the current
1822 constant pool data. */
1823
1824void
1825assemble_start_function (tree decl, const char *fnname)
1826{
1827 int align;
1828 char tmp_label[100];
1829 bool hot_label_written = false;
1830
1831 if (crtl(&x_rtl)->has_bb_partition)
1
Assuming field 'has_bb_partition' is false
2
Taking false branch
1832 {
1833 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)
;
1834 crtl(&x_rtl)->subsections.hot_section_label = ggc_strdup (tmp_label)ggc_alloc_string ((tmp_label), -1 );
1835 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)
;
1836 crtl(&x_rtl)->subsections.cold_section_label = ggc_strdup (tmp_label)ggc_alloc_string ((tmp_label), -1 );
1837 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)
;
1838 crtl(&x_rtl)->subsections.hot_section_end_label = ggc_strdup (tmp_label)ggc_alloc_string ((tmp_label), -1 );
1839 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)
;
1840 crtl(&x_rtl)->subsections.cold_section_end_label = ggc_strdup (tmp_label)ggc_alloc_string ((tmp_label), -1 );
1841 const_labelno++;
1842 cold_function_name = NULL_TREE(tree) nullptr;
1843 }
1844 else
1845 {
1846 crtl(&x_rtl)->subsections.hot_section_label = NULLnullptr;
1847 crtl(&x_rtl)->subsections.cold_section_label = NULLnullptr;
1848 crtl(&x_rtl)->subsections.hot_section_end_label = NULLnullptr;
1849 crtl(&x_rtl)->subsections.cold_section_end_label = NULLnullptr;
1850 }
1851
1852 /* The following code does not need preprocessing in the assembler. */
1853
1854 app_disable ();
1855
1856 if (CONSTANT_POOL_BEFORE_FUNCTION1)
3
Taking true branch
1857 output_constant_pool (fnname, decl);
1858
1859 align = symtab_node::get (decl)->definition_alignment ();
1860
1861 /* Make sure the not and cold text (code) sections are properly
1862 aligned. This is necessary here in the case where the function
1863 has both hot and cold sections, because we don't want to re-set
1864 the alignment when the section switch happens mid-function. */
1865
1866 if (crtl(&x_rtl)->has_bb_partition)
4
Assuming field 'has_bb_partition' is true
5
Taking true branch
1867 {
1868 first_function_block_is_cold = false;
1869
1870 switch_to_section (unlikely_text_section ());
1871 assemble_align (align);
6
Calling 'assemble_align'
1872 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)
;
1873
1874 /* When the function starts with a cold section, we need to explicitly
1875 align the hot section and write out the hot section label.
1876 But if the current function is a thunk, we do not have a CFG. */
1877 if (!cfun(cfun + 0)->is_thunk
1878 && 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)
1879 {
1880 switch_to_section (text_section);
1881 assemble_align (align);
1882 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)
;
1883 hot_label_written = true;
1884 first_function_block_is_cold = true;
1885 }
1886 in_cold_section_p = first_function_block_is_cold;
1887 }
1888
1889
1890 /* Switch to the correct text section for the start of the function. */
1891
1892 switch_to_section (function_section (decl), decl);
1893 if (crtl(&x_rtl)->has_bb_partition && !hot_label_written)
1894 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)
;
1895
1896 /* Tell assembler to move to target machine's alignment for functions. */
1897 align = floor_log2 (align / BITS_PER_UNIT(8));
1898 if (align > 0)
1899 {
1900 ASM_OUTPUT_ALIGN (asm_out_file, align)if ((align) != 0) fprintf ((asm_out_file), "\t.align %d\n", 1
<< (align))
;
1901 }
1902
1903 /* Handle a user-specified function alignment.
1904 Note that we still need to align to DECL_ALIGN, as above,
1905 because ASM_OUTPUT_MAX_SKIP_ALIGN might not do any alignment at all. */
1906 if (! DECL_USER_ALIGN (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1906, __FUNCTION__))->base.u.bits.user_align)
1907 && align_functions(this_target_flag_state->x_align_functions).levels[0].log > align
1908 && optimize_function_for_speed_p (cfun(cfun + 0)))
1909 {
1910#ifdef ASM_OUTPUT_MAX_SKIP_ALIGN
1911 int align_log = align_functions(this_target_flag_state->x_align_functions).levels[0].log;
1912#endif
1913 int max_skip = align_functions(this_target_flag_state->x_align_functions).levels[0].maxskip;
1914 if (flag_limit_function_alignmentglobal_options.x_flag_limit_function_alignment && crtl(&x_rtl)->max_insn_address > 0
1915 && max_skip >= crtl(&x_rtl)->max_insn_address)
1916 max_skip = crtl(&x_rtl)->max_insn_address - 1;
1917
1918#ifdef ASM_OUTPUT_MAX_SKIP_ALIGN
1919 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)
;
1920 if (max_skip == align_functions(this_target_flag_state->x_align_functions).levels[0].maxskip)
1921 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)
1922 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)
1923 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)
;
1924#else
1925 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
))
;
1926#endif
1927 }
1928
1929#ifdef ASM_OUTPUT_FUNCTION_PREFIX
1930 ASM_OUTPUT_FUNCTION_PREFIX (asm_out_file, fnname);
1931#endif
1932
1933 if (!DECL_IGNORED_P (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1933, __FUNCTION__))->decl_common.ignored_flag)
)
1934 (*debug_hooks->begin_function) (decl);
1935
1936 /* Make function name accessible from other files, if appropriate. */
1937
1938 if (TREE_PUBLIC (decl)((decl)->base.public_flag))
1939 {
1940 notice_global_symbol (decl);
1941
1942 globalize_decl (decl);
1943
1944 maybe_assemble_visibility (decl);
1945 }
1946
1947 if (DECL_PRESERVE_P (decl)(contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1947, __FUNCTION__))->decl_common.preserve_flag
)
1948 targetm.asm_out.mark_decl_preserved (fnname);
1949
1950 unsigned short patch_area_size = crtl(&x_rtl)->patch_area_size;
1951 unsigned short patch_area_entry = crtl(&x_rtl)->patch_area_entry;
1952
1953 /* Emit the patching area before the entry label, if any. */
1954 if (patch_area_entry > 0)
1955 targetm.asm_out.print_patchable_function_entry (asm_out_file,
1956 patch_area_entry, true);
1957
1958 /* Do any machine/system dependent processing of the function name. */
1959#ifdef ASM_DECLARE_FUNCTION_NAME
1960 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)
;
1961#else
1962 /* Standard thing is just output label for the function. */
1963 ASM_OUTPUT_FUNCTION_LABEL (asm_out_file, fnname, current_function_decl)ix86_asm_output_function_label ((asm_out_file), (fnname), (current_function_decl
))
;
1964#endif /* ASM_DECLARE_FUNCTION_NAME */
1965
1966 /* And the area after the label. Record it if we haven't done so yet. */
1967 if (patch_area_size > patch_area_entry)
1968 targetm.asm_out.print_patchable_function_entry (asm_out_file,
1969 patch_area_size
1970 - patch_area_entry,
1971 patch_area_entry == 0);
1972
1973 if (lookup_attribute ("no_split_stack", DECL_ATTRIBUTES (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 1973, __FUNCTION__))->decl_common.attributes)
))
1974 saw_no_split_stack = true;
1975}
1976
1977/* Output assembler code associated with defining the size of the
1978 function. DECL describes the function. NAME is the function's name. */
1979
1980void
1981assemble_end_function (tree decl, const char *fnname ATTRIBUTE_UNUSED__attribute__ ((__unused__)))
1982{
1983#ifdef ASM_DECLARE_FUNCTION_SIZE
1984 /* We could have switched section in the middle of the function. */
1985 if (crtl(&x_rtl)->has_bb_partition)
1986 switch_to_section (function_section (decl));
1987 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)
;
1988#endif
1989 if (! CONSTANT_POOL_BEFORE_FUNCTION1)
1990 {
1991 output_constant_pool (fnname, decl);
1992 switch_to_section (function_section (decl)); /* need to switch back */
1993 }
1994 /* Output labels for end of hot/cold text sections (to be used by
1995 debug info.) */
1996 if (crtl(&x_rtl)->has_bb_partition)
1997 {
1998 section *save_text_section;
1999
2000 save_text_section = in_section;
2001 switch_to_section (unlikely_text_section ());
2002#ifdef ASM_DECLARE_COLD_FUNCTION_SIZE
2003 if (cold_function_name != NULL_TREE(tree) nullptr)
2004 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2005, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str
)); fputs (", .-", asm_out_file); assemble_name (asm_out_file
, ((const char *) (tree_check ((cold_function_name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2005, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str
)); putc ('\n', asm_out_file); } while (0); } while (0)
2005 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2005, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str
)); fputs (", .-", asm_out_file); assemble_name (asm_out_file
, ((const char *) (tree_check ((cold_function_name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2005, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str
)); putc ('\n', asm_out_file); } while (0); } while (0)
2006 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2005, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str
)); fputs (", .-", asm_out_file); assemble_name (asm_out_file
, ((const char *) (tree_check ((cold_function_name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2005, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str
)); putc ('\n', asm_out_file); } while (0); } while (0)
;
2007#endif
2008 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)
;
2009 if (first_function_block_is_cold)
2010 switch_to_section (text_section);
2011 else
2012 switch_to_section (function_section (decl));
2013 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)
;
2014 switch_to_section (save_text_section);
2015 }
2016}
2017
2018/* Assemble code to leave SIZE bytes of zeros. */
2019
2020void
2021assemble_zeros (unsigned HOST_WIDE_INTlong size)
2022{
2023 /* Do no output if -fsyntax-only. */
2024 if (flag_syntax_onlyglobal_options.x_flag_syntax_only)
2025 return;
2026
2027#ifdef ASM_NO_SKIP_IN_TEXT1
2028 /* The `space' pseudo in the text section outputs nop insns rather than 0s,
2029 so we must output 0s explicitly in the text section. */
2030 if (ASM_NO_SKIP_IN_TEXT1 && (in_section->common.flags & SECTION_CODE0x00100) != 0)
2031 {
2032 unsigned HOST_WIDE_INTlong i;
2033 for (i = 0; i < size; i++)
2034 assemble_integer (const0_rtx(const_int_rtx[64]), 1, BITS_PER_UNIT(8), 1);
2035 }
2036 else
2037#endif
2038 if (size > 0)
2039 ASM_OUTPUT_SKIP (asm_out_file, size)fprintf ((asm_out_file), "%s" "%" "l" "u" "\n", "\t.zero\t", (
size))
;
2040}
2041
2042/* Assemble an alignment pseudo op for an ALIGN-bit boundary. */
2043
2044void
2045assemble_align (unsigned int align)
2046{
2047 if (align > BITS_PER_UNIT(8))
7
Assuming 'align' is > BITS_PER_UNIT
8
Taking true branch
2048 {
2049 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))))
;
9
Taking true branch
10
Calling 'floor_log2'
12
Returning from 'floor_log2'
13
The result of the left shift is undefined because the right operand is negative
2050 }
2051}
2052
2053/* Assemble a string constant with the specified C string as contents. */
2054
2055void
2056assemble_string (const char *p, int size)
2057{
2058 int pos = 0;
2059 int maximum = 2000;
2060
2061 /* If the string is very long, split it up. */
2062
2063 while (pos < size)
2064 {
2065 int thissize = size - pos;
2066 if (thissize > maximum)
2067 thissize = maximum;
2068
2069 ASM_OUTPUT_ASCII (asm_out_file, p, thissize)default_elf_asm_output_ascii ((asm_out_file), (p), (thissize)
)
;
2070
2071 pos += thissize;
2072 p += thissize;
2073 }
2074}
2075
2076
2077/* A noswitch_section_callback for lcomm_section. */
2078
2079static bool
2080emit_local (tree decl ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
2081 const char *name ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
2082 unsigned HOST_WIDE_INTlong size ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
2083 unsigned HOST_WIDE_INTlong rounded ATTRIBUTE_UNUSED__attribute__ ((__unused__)))
2084{
2085#if defined ASM_OUTPUT_ALIGNED_DECL_LOCAL
2086 unsigned int align = symtab_node::get (decl)->definition_alignment ();
2087 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)
2088 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)
;
2089 return true;
2090#elif defined ASM_OUTPUT_ALIGNED_LOCAL
2091 unsigned int align = symtab_node::get (decl)->definition_alignment ();
2092 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
)
;
2093 return true;
2094#else
2095 ASM_OUTPUT_LOCAL (asm_out_file, name, size, rounded);
2096 return false;
2097#endif
2098}
2099
2100/* A noswitch_section_callback for bss_noswitch_section. */
2101
2102#if defined ASM_OUTPUT_ALIGNED_BSS
2103static bool
2104emit_bss (tree decl ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
2105 const char *name ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
2106 unsigned HOST_WIDE_INTlong size ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
2107 unsigned HOST_WIDE_INTlong rounded ATTRIBUTE_UNUSED__attribute__ ((__unused__)))
2108{
2109 ASM_OUTPUT_ALIGNED_BSS (asm_out_file, decl, name, size,x86_output_aligned_bss (asm_out_file, decl, name, size, get_variable_align
(decl))
2110 get_variable_align (decl))x86_output_aligned_bss (asm_out_file, decl, name, size, get_variable_align
(decl))
;
2111 return true;
2112}
2113#endif
2114
2115/* A noswitch_section_callback for comm_section. */
2116
2117static bool
2118emit_common (tree decl ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
2119 const char *name ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
2120 unsigned HOST_WIDE_INTlong size ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
2121 unsigned HOST_WIDE_INTlong rounded ATTRIBUTE_UNUSED__attribute__ ((__unused__)))
2122{
2123#if defined ASM_OUTPUT_ALIGNED_DECL_COMMON
2124 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));
2125 size, get_variable_align (decl))x86_elf_aligned_decl_common (asm_out_file, decl, name, size, get_variable_align
(decl));
;
2126 return true;
2127#elif defined ASM_OUTPUT_ALIGNED_COMMON
2128 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)
2129 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)
;
2130 return true;
2131#else
2132 ASM_OUTPUT_COMMON (asm_out_file, name, size, rounded);
2133 return false;
2134#endif
2135}
2136
2137/* A noswitch_section_callback for tls_comm_section. */
2138
2139static bool
2140emit_tls_common (tree decl ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
2141 const char *name ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
2142 unsigned HOST_WIDE_INTlong size ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
2143 unsigned HOST_WIDE_INTlong rounded ATTRIBUTE_UNUSED__attribute__ ((__unused__)))
2144{
2145#ifdef ASM_OUTPUT_TLS_COMMON
2146 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
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2146, __FUNCTION__))->decl_common.align) ? ((unsigned)1)
<< (((contains_struct_check ((decl), (TS_DECL_COMMON),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2146, __FUNCTION__))->decl_common.align) - 1) : 0) / (8)
); } while (0)
;
2147 return true;
2148#else
2149 sorry ("thread-local COMMON data not implemented");
2150 return true;
2151#endif
2152}
2153
2154/* Assemble DECL given that it belongs in SECTION_NOSWITCH section SECT.
2155 NAME is the name of DECL's SYMBOL_REF. */
2156
2157static void
2158assemble_noswitch_variable (tree decl, const char *name, section *sect,
2159 unsigned int align)
2160{
2161 unsigned HOST_WIDE_INTlong size, rounded;
2162
2163 size = tree_to_uhwi (DECL_SIZE_UNIT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2163, __FUNCTION__))->decl_common.size_unit)
);
2164 rounded = size;
2165
2166 if ((flag_sanitizeglobal_options.x_flag_sanitize & SANITIZE_ADDRESS) && asan_protect_global (decl))
2167 size += asan_red_zone_size (size);
2168
2169 /* Don't allocate zero bytes of common,
2170 since that means "undefined external" in the linker. */
2171 if (size == 0)
2172 rounded = 1;
2173
2174 /* Round size up to multiple of BIGGEST_ALIGNMENT bits
2175 so that each uninitialized object starts on such a boundary. */
2176 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;
2177 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))
2178 * (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)));
2179
2180 if (!sect->noswitch.callback (decl, name, size, rounded)
2181 && (unsigned HOST_WIDE_INTlong) (align / BITS_PER_UNIT(8)) > rounded)
2182 error ("requested alignment for %q+D is greater than "
2183 "implemented alignment of %wu", decl, rounded);
2184}
2185
2186/* A subroutine of assemble_variable. Output the label and contents of
2187 DECL, whose address is a SYMBOL_REF with name NAME. DONT_OUTPUT_DATA
2188 is as for assemble_variable. */
2189
2190static void
2191assemble_variable_contents (tree decl, const char *name,
2192 bool dont_output_data, bool merge_strings)
2193{
2194 /* Do any machine/system dependent processing of the object. */
2195#ifdef ASM_DECLARE_OBJECT_NAME
2196 last_assemble_variable_decl = decl;
2197 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2197, __FUNCTION__))->decl_common.decl_flag_1))) &&
(!((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2197, __FUNCTION__))->decl_common.artificial_flag) || !(
(non_type_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2197, __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
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2197, __FUNCTION__))->decl_common.size)) { size_directive_output
= 1; size = tree_to_uhwi (((contains_struct_check ((decl), (
TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2197, __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)
;
2198#else
2199 /* Standard thing is just output label for the object. */
2200 ASM_OUTPUT_LABEL (asm_out_file, name)do { assemble_name ((asm_out_file), (name)); fputs (":\n", (asm_out_file
)); } while (0)
;
2201#endif /* ASM_DECLARE_OBJECT_NAME */
2202
2203 if (!dont_output_data)
2204 {
2205 /* Caller is supposed to use varpool_get_constructor when it wants
2206 to output the body. */
2207 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2207, __FUNCTION__))->decl_common.initial) != global_trees
[TI_ERROR_MARK]) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2207, __FUNCTION__), 0 : 0))
;
2208 if (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2208, __FUNCTION__))->decl_common.initial)
2209 && DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2209, __FUNCTION__))->decl_common.initial)
!= error_mark_nodeglobal_trees[TI_ERROR_MARK]
2210 && !initializer_zerop (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2210, __FUNCTION__))->decl_common.initial)
))
2211 /* Output the actual data. */
2212 output_constant (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2212, __FUNCTION__))->decl_common.initial)
,
2213 tree_to_uhwi (DECL_SIZE_UNIT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2213, __FUNCTION__))->decl_common.size_unit)
),
2214 get_variable_align (decl),
2215 false, merge_strings);
2216 else
2217 /* Leave space for it. */
2218 assemble_zeros (tree_to_uhwi (DECL_SIZE_UNIT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2218, __FUNCTION__))->decl_common.size_unit)
));
2219 targetm.asm_out.decl_end ();
2220 }
2221}
2222
2223/* Write out assembly for the variable DECL, which is not defined in
2224 the current translation unit. */
2225void
2226assemble_undefined_decl (tree decl)
2227{
2228 const char *name = XSTR (XEXP (DECL_RTL (decl), 0), 0)((((((((contains_struct_check ((decl), (TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2228, __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)
;
2229 targetm.asm_out.assemble_undefined_decl (asm_out_file, name, decl);
2230}
2231
2232/* Assemble everything that is needed for a variable or function declaration.
2233 Not used for automatic variables, and not used for function definitions.
2234 Should not be called for variables of incomplete structure type.
2235
2236 TOP_LEVEL is nonzero if this variable has file scope.
2237 AT_END is nonzero if this is the special handling, at end of compilation,
2238 to define things that have had only tentative definitions.
2239 DONT_OUTPUT_DATA if nonzero means don't actually output the
2240 initial value (that will be done by the caller). */
2241
2242void
2243assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
2244 int at_end ATTRIBUTE_UNUSED__attribute__ ((__unused__)), int dont_output_data)
2245{
2246 const char *name;
2247 rtx decl_rtl, symbol;
2248 section *sect;
2249 unsigned int align;
2250 bool asan_protected = false;
2251
2252 /* This function is supposed to handle VARIABLES. Ensure we have one. */
2253 gcc_assert (VAR_P (decl))((void)(!((((enum tree_code) (decl)->base.code) == VAR_DECL
)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2253, __FUNCTION__), 0 : 0))
;
2254
2255 /* Emulated TLS had better not get this far. */
2256 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2256, __FUNCTION__))->decl_common.decl_flag_1)) &&
decl_tls_model (decl) >= TLS_MODEL_REAL)) ? fancy_abort (
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2256, __FUNCTION__), 0 : 0))
;
2257
2258 last_assemble_variable_decl = 0;
2259
2260 /* Normally no need to say anything here for external references,
2261 since assemble_external is called by the language-specific code
2262 when a declaration is first seen. */
2263
2264 if (DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2264, __FUNCTION__))->decl_common.decl_flag_1)
)
2265 return;
2266
2267 /* Do nothing for global register variables. */
2268 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2268, __FUNCTION__))->decl_with_rtl.rtl != nullptr)
&& REG_P (DECL_RTL (decl))(((enum rtx_code) (((contains_struct_check ((decl), (TS_DECL_WRTL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2268, __FUNCTION__))->decl_with_rtl.rtl ? (decl)->decl_with_rtl
.rtl : (make_decl_rtl (decl), (decl)->decl_with_rtl.rtl)))
->code) == REG)
)
2269 {
2270 TREE_ASM_WRITTEN (decl)((decl)->base.asm_written_flag) = 1;
2271 return;
2272 }
2273
2274 /* If type was incomplete when the variable was declared,
2275 see if it is complete now. */
2276
2277 if (DECL_SIZE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2277, __FUNCTION__))->decl_common.size)
== 0)
2278 layout_decl (decl, 0);
2279
2280 /* Still incomplete => don't allocate it; treat the tentative defn
2281 (which is what it must have been) as an `extern' reference. */
2282
2283 if (!dont_output_data && DECL_SIZE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2283, __FUNCTION__))->decl_common.size)
== 0)
2284 {
2285 error ("storage size of %q+D isn%'t known", decl);
2286 TREE_ASM_WRITTEN (decl)((decl)->base.asm_written_flag) = 1;
2287 return;
2288 }
2289
2290 /* The first declaration of a variable that comes through this function
2291 decides whether it is global (in C, has external linkage)
2292 or local (in C, has internal linkage). So do nothing more
2293 if this function has already run. */
2294
2295 if (TREE_ASM_WRITTEN (decl)((decl)->base.asm_written_flag))
2296 return;
2297
2298 /* Make sure targetm.encode_section_info is invoked before we set
2299 ASM_WRITTEN. */
2300 decl_rtl = DECL_RTL (decl)((contains_struct_check ((decl), (TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2300, __FUNCTION__))->decl_with_rtl.rtl ? (decl)->decl_with_rtl
.rtl : (make_decl_rtl (decl), (decl)->decl_with_rtl.rtl))
;
2301
2302 TREE_ASM_WRITTEN (decl)((decl)->base.asm_written_flag) = 1;
2303
2304 /* Do no output if -fsyntax-only. */
2305 if (flag_syntax_onlyglobal_options.x_flag_syntax_only)
2306 return;
2307
2308 if (! dont_output_data
2309 && ! valid_constant_size_p (DECL_SIZE_UNIT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2309, __FUNCTION__))->decl_common.size_unit)
))
2310 {
2311 error ("size of variable %q+D is too large", decl);
2312 return;
2313 }
2314
2315 gcc_assert (MEM_P (decl_rtl))((void)(!((((enum rtx_code) (decl_rtl)->code) == MEM)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2315, __FUNCTION__), 0 : 0))
;
2316 gcc_assert (GET_CODE (XEXP (decl_rtl, 0)) == SYMBOL_REF)((void)(!(((enum rtx_code) ((((decl_rtl)->u.fld[0]).rt_rtx
))->code) == SYMBOL_REF) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2316, __FUNCTION__), 0 : 0))
;
2317 symbol = XEXP (decl_rtl, 0)(((decl_rtl)->u.fld[0]).rt_rtx);
2318
2319 /* If this symbol belongs to the tree constant pool, output the constant
2320 if it hasn't already been written. */
2321 if (TREE_CONSTANT_POOL_ADDRESS_P (symbol)(__extension__ ({ __typeof ((symbol)) const _rtx = ((symbol))
; if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag
("TREE_CONSTANT_POOL_ADDRESS_P", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2321, __FUNCTION__); _rtx; })->frame_related)
)
2322 {
2323 tree decl = SYMBOL_REF_DECL (symbol)((__extension__ ({ __typeof ((symbol)) const _rtx = ((symbol)
); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag
("CONSTANT_POOL_ADDRESS_P", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2323, __FUNCTION__); _rtx; })->unchanging) ? nullptr : (
(((symbol))->u.fld[1]).rt_tree))
;
2324 if (!TREE_ASM_WRITTEN (DECL_INITIAL (decl))((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2324, __FUNCTION__))->decl_common.initial))->base.asm_written_flag
)
)
2325 output_constant_def_contents (symbol);
2326 return;
2327 }
2328
2329 app_disable ();
2330
2331 name = XSTR (symbol, 0)(((symbol)->u.fld[0]).rt_str);
2332 if (TREE_PUBLIC (decl)((decl)->base.public_flag) && DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2332, __FUNCTION__))->decl_minimal.name)
)
2333 notice_global_symbol (decl);
2334
2335 /* Compute the alignment of this data. */
2336
2337 align_variable (decl, dont_output_data);
2338
2339 if ((flag_sanitizeglobal_options.x_flag_sanitize & SANITIZE_ADDRESS)
2340 && asan_protect_global (decl))
2341 {
2342 asan_protected = true;
2343 SET_DECL_ALIGN (decl, MAX (DECL_ALIGN (decl),(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2344, __FUNCTION__))->decl_common.align) = ffs_hwi (((((
(contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2343, __FUNCTION__))->decl_common.align) ? ((unsigned)1)
<< (((contains_struct_check ((decl), (TS_DECL_COMMON),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2343, __FUNCTION__))->decl_common.align) - 1) : 0)) >
(32 * (8)) ? ((((contains_struct_check ((decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2343, __FUNCTION__))->decl_common.align) ? ((unsigned)1)
<< (((contains_struct_check ((decl), (TS_DECL_COMMON),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2343, __FUNCTION__))->decl_common.align) - 1) : 0)) : (32
* (8)))))
2344 ASAN_RED_ZONE_SIZE * BITS_PER_UNIT))(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2344, __FUNCTION__))->decl_common.align) = ffs_hwi (((((
(contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2343, __FUNCTION__))->decl_common.align) ? ((unsigned)1)
<< (((contains_struct_check ((decl), (TS_DECL_COMMON),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2343, __FUNCTION__))->decl_common.align) - 1) : 0)) >
(32 * (8)) ? ((((contains_struct_check ((decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2343, __FUNCTION__))->decl_common.align) ? ((unsigned)1)
<< (((contains_struct_check ((decl), (TS_DECL_COMMON),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2343, __FUNCTION__))->decl_common.align) - 1) : 0)) : (32
* (8)))))
;
2345 }
2346
2347 set_mem_align (decl_rtl, DECL_ALIGN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2347, __FUNCTION__))->decl_common.align) ? ((unsigned)1)
<< (((contains_struct_check ((decl), (TS_DECL_COMMON),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2347, __FUNCTION__))->decl_common.align) - 1) : 0)
);
2348
2349 align = get_variable_align (decl);
2350
2351 if (TREE_PUBLIC (decl)((decl)->base.public_flag))
2352 maybe_assemble_visibility (decl);
2353
2354 if (DECL_PRESERVE_P (decl)(contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2354, __FUNCTION__))->decl_common.preserve_flag
)
2355 targetm.asm_out.mark_decl_preserved (name);
2356
2357 /* First make the assembler name(s) global if appropriate. */
2358 sect = get_variable_section (decl, false);
2359 if (TREE_PUBLIC (decl)((decl)->base.public_flag)
2360 && (sect->common.flags & SECTION_COMMON0x800000) == 0)
2361 globalize_decl (decl);
2362
2363 /* Output any data that we will need to use the address of. */
2364 if (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2364, __FUNCTION__))->decl_common.initial)
&& DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2364, __FUNCTION__))->decl_common.initial)
!= error_mark_nodeglobal_trees[TI_ERROR_MARK])
2365 output_addressed_constants (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2365, __FUNCTION__))->decl_common.initial)
, 0);
2366
2367 /* dbxout.c needs to know this. */
2368 if (sect && (sect->common.flags & SECTION_CODE0x00100) != 0)
2369 DECL_IN_TEXT_SECTION (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2369, __FUNCTION__, (VAR_DECL)))->decl_with_vis.in_text_section
)
= 1;
2370
2371 /* If the decl is part of an object_block, make sure that the decl
2372 has been positioned within its block, but do not write out its
2373 definition yet. output_object_blocks will do that later. */
2374 if (SYMBOL_REF_HAS_BLOCK_INFO_P (symbol)(((__extension__ ({ __typeof ((symbol)) const _rtx = ((symbol
)); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag
("SYMBOL_REF_FLAGS", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2374, __FUNCTION__); _rtx; }) ->u2.symbol_ref_flags) &
(1 << 7)) != 0)
&& SYMBOL_REF_BLOCK (symbol)((&(symbol)->u.block_sym)->block))
2375 {
2376 gcc_assert (!dont_output_data)((void)(!(!dont_output_data) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2376, __FUNCTION__), 0 : 0))
;
2377 place_block_symbol (symbol);
2378 }
2379 else if (SECTION_STYLE (sect)((sect)->common.flags & 0x600000) == SECTION_NOSWITCH0x400000)
2380 assemble_noswitch_variable (decl, name, sect, align);
2381 else
2382 {
2383 /* Special-case handling of vtv comdat sections. */
2384 if (sect->named.name
2385 && (strcmp (sect->named.name, ".vtable_map_vars") == 0))
2386 handle_vtv_comdat_section (sect, decl);
2387 else
2388 switch_to_section (sect, decl);
2389 if (align > BITS_PER_UNIT(8))
2390 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))))
;
2391 assemble_variable_contents (decl, name, dont_output_data,
2392 (sect->common.flags & SECTION_MERGE0x08000)
2393 && (sect->common.flags & SECTION_STRINGS0x10000));
2394 if (asan_protected)
2395 {
2396 unsigned HOST_WIDE_INTlong int size
2397 = tree_to_uhwi (DECL_SIZE_UNIT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2397, __FUNCTION__))->decl_common.size_unit)
);
2398 assemble_zeros (asan_red_zone_size (size));
2399 }
2400 }
2401}
2402
2403
2404/* Given a function declaration (FN_DECL), this function assembles the
2405 function into the .preinit_array section. */
2406
2407void
2408assemble_vtv_preinit_initializer (tree fn_decl)
2409{
2410 section *sect;
2411 unsigned flags = SECTION_WRITE0x00200;
2412 rtx symbol = XEXP (DECL_RTL (fn_decl), 0)(((((contains_struct_check ((fn_decl), (TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2412, __FUNCTION__))->decl_with_rtl.rtl ? (fn_decl)->
decl_with_rtl.rtl : (make_decl_rtl (fn_decl), (fn_decl)->decl_with_rtl
.rtl)))->u.fld[0]).rt_rtx)
;
2413
2414 flags |= SECTION_NOTYPE0x80000;
2415 sect = get_section (".preinit_array", flags, fn_decl);
2416 switch_to_section (sect);
2417 assemble_addr_to_section (symbol, sect);
2418}
2419
2420/* Return 1 if type TYPE contains any pointers. */
2421
2422static int
2423contains_pointers_p (tree type)
2424{
2425 switch (TREE_CODE (type)((enum tree_code) (type)->base.code))
2426 {
2427 case POINTER_TYPE:
2428 case REFERENCE_TYPE:
2429 /* I'm not sure whether OFFSET_TYPE needs this treatment,
2430 so I'll play safe and return 1. */
2431 case OFFSET_TYPE:
2432 return 1;
2433
2434 case RECORD_TYPE:
2435 case UNION_TYPE:
2436 case QUAL_UNION_TYPE:
2437 {
2438 tree fields;
2439 /* For a type that has fields, see if the fields have pointers. */
2440 for (fields = TYPE_FIELDS (type)((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2440, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
; fields; fields = DECL_CHAIN (fields)(((contains_struct_check (((contains_struct_check ((fields), (
TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2440, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2440, __FUNCTION__))->common.chain))
)
2441 if (TREE_CODE (fields)((enum tree_code) (fields)->base.code) == FIELD_DECL
2442 && contains_pointers_p (TREE_TYPE (fields)((contains_struct_check ((fields), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2442, __FUNCTION__))->typed.type)
))
2443 return 1;
2444 return 0;
2445 }
2446
2447 case ARRAY_TYPE:
2448 /* An array type contains pointers if its element type does. */
2449 return contains_pointers_p (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2449, __FUNCTION__))->typed.type)
);
2450
2451 default:
2452 return 0;
2453 }
2454}
2455
2456/* We delay assemble_external processing until
2457 the compilation unit is finalized. This is the best we can do for
2458 right now (i.e. stage 3 of GCC 4.0) - the right thing is to delay
2459 it all the way to final. See PR 17982 for further discussion. */
2460static GTY(()) tree pending_assemble_externals;
2461
2462#ifdef ASM_OUTPUT_EXTERNAL
2463/* Some targets delay some output to final using TARGET_ASM_FILE_END.
2464 As a result, assemble_external can be called after the list of externals
2465 is processed and the pointer set destroyed. */
2466static bool pending_assemble_externals_processed;
2467
2468/* Avoid O(external_decls**2) lookups in the pending_assemble_externals
2469 TREE_LIST in assemble_external. */
2470static hash_set<tree> *pending_assemble_externals_set;
2471
2472/* True if DECL is a function decl for which no out-of-line copy exists.
2473 It is assumed that DECL's assembler name has been set. */
2474
2475static bool
2476incorporeal_function_p (tree decl)
2477{
2478 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL && fndecl_built_in_p (decl))
2479 {
2480 const char *name;
2481
2482 if (DECL_BUILT_IN_CLASS (decl)((built_in_class) (tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2482, __FUNCTION__, (FUNCTION_DECL)))->function_decl.built_in_class
)
== BUILT_IN_NORMAL
2483 && ALLOCA_FUNCTION_CODE_P (DECL_FUNCTION_CODE (decl))((DECL_FUNCTION_CODE (decl)) == BUILT_IN_ALLOCA || (DECL_FUNCTION_CODE
(decl)) == BUILT_IN_ALLOCA_WITH_ALIGN || (DECL_FUNCTION_CODE
(decl)) == BUILT_IN_ALLOCA_WITH_ALIGN_AND_MAX)
)
2484 return true;
2485
2486 name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl))((const char *) (tree_check ((decl_assembler_name (decl)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2486, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str
)
;
2487 /* Atomic or sync builtins which have survived this far will be
2488 resolved externally and therefore are not incorporeal. */
2489 if (strncmp (name, "__builtin_", 10) == 0)
2490 return true;
2491 }
2492 return false;
2493}
2494
2495/* Actually do the tests to determine if this is necessary, and invoke
2496 ASM_OUTPUT_EXTERNAL. */
2497static void
2498assemble_external_real (tree decl)
2499{
2500 rtx rtl = DECL_RTL (decl)((contains_struct_check ((decl), (TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2500, __FUNCTION__))->decl_with_rtl.rtl ? (decl)->decl_with_rtl
.rtl : (make_decl_rtl (decl), (decl)->decl_with_rtl.rtl))
;
2501
2502 if (MEM_P (rtl)(((enum rtx_code) (rtl)->code) == MEM) && GET_CODE (XEXP (rtl, 0))((enum rtx_code) ((((rtl)->u.fld[0]).rt_rtx))->code) == SYMBOL_REF
2503 && !SYMBOL_REF_USED (XEXP (rtl, 0))(__extension__ ({ __typeof (((((rtl)->u.fld[0]).rt_rtx))) const
_rtx = (((((rtl)->u.fld[0]).rt_rtx))); if (((enum rtx_code
) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("SYMBOL_REF_USED"
, _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2503, __FUNCTION__); _rtx; })->used)
2504 && !incorporeal_function_p (decl))
2505 {
2506 /* Some systems do require some output. */
2507 SYMBOL_REF_USED (XEXP (rtl, 0))(__extension__ ({ __typeof (((((rtl)->u.fld[0]).rt_rtx))) const
_rtx = (((((rtl)->u.fld[0]).rt_rtx))); if (((enum rtx_code
) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag ("SYMBOL_REF_USED"
, _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2507, __FUNCTION__); _rtx; })->used)
= 1;
2508 ASM_OUTPUT_EXTERNAL (asm_out_file, decl, XSTR (XEXP (rtl, 0), 0))default_elf_asm_output_external (asm_out_file, decl, ((((((rtl
)->u.fld[0]).rt_rtx))->u.fld[0]).rt_str))
;
2509 }
2510}
2511#endif
2512
2513void
2514process_pending_assemble_externals (void)
2515{
2516#ifdef ASM_OUTPUT_EXTERNAL
2517 tree list;
2518 for (list = pending_assemble_externals; list; list = TREE_CHAIN (list)((contains_struct_check ((list), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2518, __FUNCTION__))->common.chain)
)
2519 assemble_external_real (TREE_VALUE (list)((tree_check ((list), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2519, __FUNCTION__, (TREE_LIST)))->list.value)
);
2520
2521 pending_assemble_externals = 0;
2522 pending_assemble_externals_processed = true;
2523 delete pending_assemble_externals_set;
2524#endif
2525}
2526
2527/* This TREE_LIST contains any weak symbol declarations waiting
2528 to be emitted. */
2529static GTY(()) tree weak_decls;
2530
2531/* Output something to declare an external symbol to the assembler,
2532 and qualifiers such as weakness. (Most assemblers don't need
2533 extern declaration, so we normally output nothing.) Do nothing if
2534 DECL is not external. */
2535
2536void
2537assemble_external (tree decl ATTRIBUTE_UNUSED__attribute__ ((__unused__)))
2538{
2539 /* Make sure that the ASM_OUT_FILE is open.
2540 If it's not, we should not be calling this function. */
2541 gcc_assert (asm_out_file)((void)(!(asm_out_file) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2541, __FUNCTION__), 0 : 0))
;
2542
2543 /* In a perfect world, the following condition would be true.
2544 Sadly, the Go front end emit assembly *from the front end*,
2545 bypassing the call graph. See PR52739. Fix before GCC 4.8. */
2546#if 0
2547 /* This function should only be called if we are expanding, or have
2548 expanded, to RTL.
2549 Ideally, only final.c would be calling this function, but it is
2550 not clear whether that would break things somehow. See PR 17982
2551 for further discussion. */
2552 gcc_assert (state == EXPANSION((void)(!(state == EXPANSION || state == FINISHED) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2553, __FUNCTION__), 0 : 0))
2553 || state == FINISHED)((void)(!(state == EXPANSION || state == FINISHED) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2553, __FUNCTION__), 0 : 0))
;
2554#endif
2555
2556 if (!DECL_P (decl)(tree_code_type[(int) (((enum tree_code) (decl)->base.code
))] == tcc_declaration)
|| !DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2556, __FUNCTION__))->decl_common.decl_flag_1)
|| !TREE_PUBLIC (decl)((decl)->base.public_flag))
2557 return;
2558
2559 /* We want to output annotation for weak and external symbols at
2560 very last to check if they are references or not. */
2561
2562 if (TARGET_SUPPORTS_WEAK(1)
2563 && DECL_WEAK (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2563, __FUNCTION__))->decl_with_vis.weak_flag)
2564 /* TREE_STATIC is a weird and abused creature which is not
2565 generally the right test for whether an entity has been
2566 locally emitted, inlined or otherwise not-really-extern, but
2567 for declarations that can be weak, it happens to be
2568 match. */
2569 && !TREE_STATIC (decl)((decl)->base.static_flag)
2570 && lookup_attribute ("weak", DECL_ATTRIBUTES (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2570, __FUNCTION__))->decl_common.attributes)
)
2571 && value_member (decl, weak_decls) == NULL_TREE(tree) nullptr)
2572 weak_decls = tree_cons (NULLnullptr, decl, weak_decls);
2573
2574#ifdef ASM_OUTPUT_EXTERNAL
2575 if (pending_assemble_externals_processed)
2576 {
2577 assemble_external_real (decl);
2578 return;
2579 }
2580
2581 if (! pending_assemble_externals_set->add (decl))
2582 pending_assemble_externals = tree_cons (NULLnullptr, decl,
2583 pending_assemble_externals);
2584#endif
2585}
2586
2587/* Similar, for calling a library function FUN. */
2588
2589void
2590assemble_external_libcall (rtx fun)
2591{
2592 /* Declare library function name external when first used, if nec. */
2593 if (! SYMBOL_REF_USED (fun)(__extension__ ({ __typeof ((fun)) const _rtx = ((fun)); if (
((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag
("SYMBOL_REF_USED", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2593, __FUNCTION__); _rtx; })->used)
)
2594 {
2595 SYMBOL_REF_USED (fun)(__extension__ ({ __typeof ((fun)) const _rtx = ((fun)); if (
((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag
("SYMBOL_REF_USED", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2595, __FUNCTION__); _rtx; })->used)
= 1;
2596 targetm.asm_out.external_libcall (fun);
2597 }
2598}
2599
2600/* Assemble a label named NAME. */
2601
2602void
2603assemble_label (FILE *file, const char *name)
2604{
2605 ASM_OUTPUT_LABEL (file, name)do { assemble_name ((file), (name)); fputs (":\n", (file)); }
while (0)
;
2606}
2607
2608/* Set the symbol_referenced flag for ID. */
2609void
2610mark_referenced (tree id)
2611{
2612 TREE_SYMBOL_REFERENCED (id)((tree_check ((id), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2612, __FUNCTION__, (IDENTIFIER_NODE)))->base.static_flag
)
= 1;
2613}
2614
2615/* Set the symbol_referenced flag for DECL and notify callgraph. */
2616void
2617mark_decl_referenced (tree decl)
2618{
2619 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL)
2620 {
2621 /* Extern inline functions don't become needed when referenced.
2622 If we know a method will be emitted in other TU and no new
2623 functions can be marked reachable, just use the external
2624 definition. */
2625 struct cgraph_node *node = cgraph_node::get_create (decl);
2626 if (!DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2626, __FUNCTION__))->decl_common.decl_flag_1)
2627 && !node->definition)
2628 node->mark_force_output ();
2629 }
2630 else if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL))
2631 {
2632 varpool_node *node = varpool_node::get_create (decl);
2633 /* C++ frontend use mark_decl_references to force COMDAT variables
2634 to be output that might appear dead otherwise. */
2635 node->force_output = true;
2636 }
2637 /* else do nothing - we can get various sorts of CST nodes here,
2638 which do not need to be marked. */
2639}
2640
2641
2642/* Output to FILE (an assembly file) a reference to NAME. If NAME
2643 starts with a *, the rest of NAME is output verbatim. Otherwise
2644 NAME is transformed in a target-specific way (usually by the
2645 addition of an underscore). */
2646
2647void
2648assemble_name_raw (FILE *file, const char *name)
2649{
2650 if (name[0] == '*')
2651 fputs (&name[1], file);
2652 else
2653 ASM_OUTPUT_LABELREF (file, name)do { fputs (user_label_prefix, (file)); fputs ((name), (file)
); } while (0)
;
2654}
2655
2656/* Return NAME that should actually be emitted, looking through
2657 transparent aliases. If NAME refers to an entity that is also
2658 represented as a tree (like a function or variable), mark the entity
2659 as referenced. */
2660const char *
2661assemble_name_resolve (const char *name)
2662{
2663 const char *real_name = targetm.strip_name_encoding (name);
2664 tree id = maybe_get_identifier (real_name);
2665
2666 if (id)
2667 {
2668 tree id_orig = id;
2669
2670 mark_referenced (id);
2671 ultimate_transparent_alias_target (&id);
2672 if (id != id_orig)
2673 name = IDENTIFIER_POINTER (id)((const char *) (tree_check ((id), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2673, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str
)
;
2674 gcc_assert (! TREE_CHAIN (id))((void)(!(! ((contains_struct_check ((id), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2674, __FUNCTION__))->common.chain)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2674, __FUNCTION__), 0 : 0))
;
2675 }
2676
2677 return name;
2678}
2679
2680/* Like assemble_name_raw, but should be used when NAME might refer to
2681 an entity that is also represented as a tree (like a function or
2682 variable). If NAME does refer to such an entity, that entity will
2683 be marked as referenced. */
2684
2685void
2686assemble_name (FILE *file, const char *name)
2687{
2688 assemble_name_raw (file, assemble_name_resolve (name));
2689}
2690
2691/* Allocate SIZE bytes writable static space with a gensym name
2692 and return an RTX to refer to its address. */
2693
2694rtx
2695assemble_static_space (unsigned HOST_WIDE_INTlong size)
2696{
2697 char name[17];
2698 const char *namestring;
2699 rtx x;
2700
2701 ASM_GENERATE_INTERNAL_LABEL (name, "LF", const_labelno)do { char *__p; (name)[0] = '*'; (name)[1] = '.'; __p = stpcpy
(&(name)[2], "LF"); sprint_ul (__p, (unsigned long) (const_labelno
)); } while (0)
;
2702 ++const_labelno;
2703 namestring = ggc_strdup (name)ggc_alloc_string ((name), -1 );
2704
2705 x = gen_rtx_SYMBOL_REF (Pmode, namestring)gen_rtx_fmt_s0_stat ((SYMBOL_REF), (((global_options.x_ix86_pmode
== PMODE_DI ? (scalar_int_mode ((scalar_int_mode::from_int) E_DImode
)) : (scalar_int_mode ((scalar_int_mode::from_int) E_SImode))
))), ((namestring)) )
;
2706 SYMBOL_REF_FLAGS (x)(__extension__ ({ __typeof ((x)) const _rtx = ((x)); if (((enum
rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag
("SYMBOL_REF_FLAGS", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2706, __FUNCTION__); _rtx; }) ->u2.symbol_ref_flags)
= SYMBOL_FLAG_LOCAL(1 << 1);
2707
2708#ifdef ASM_OUTPUT_ALIGNED_DECL_LOCAL
2709 ASM_OUTPUT_ALIGNED_DECL_LOCAL (asm_out_file, NULL_TREE, name, size,do { fprintf ((asm_out_file), "%s", "\t.local\t"); assemble_name
((asm_out_file), (name)); fprintf ((asm_out_file), "\n"); x86_elf_aligned_decl_common
(asm_out_file, (tree) nullptr, name, size, (((global_options
.x_target_flags & (1U << 12)) != 0) ? 32 : (((global_options
.x_ix86_isa_flags & (1UL << 15)) != 0) ? 512 : (((global_options
.x_ix86_isa_flags & (1UL << 8)) != 0) ? 256 : 128))
));; } while (0)
2710 BIGGEST_ALIGNMENT)do { fprintf ((asm_out_file), "%s", "\t.local\t"); assemble_name
((asm_out_file), (name)); fprintf ((asm_out_file), "\n"); x86_elf_aligned_decl_common
(asm_out_file, (tree) nullptr, name, size, (((global_options
.x_target_flags & (1U << 12)) != 0) ? 32 : (((global_options
.x_ix86_isa_flags & (1UL << 15)) != 0) ? 512 : (((global_options
.x_ix86_isa_flags & (1UL << 8)) != 0) ? 256 : 128))
));; } while (0)
;
2711#else
2712#ifdef ASM_OUTPUT_ALIGNED_LOCAL
2713 ASM_OUTPUT_ALIGNED_LOCAL (asm_out_file, name, size, BIGGEST_ALIGNMENT)do { fprintf ((asm_out_file), "%s", "\t.local\t"); assemble_name
((asm_out_file), (name)); fprintf ((asm_out_file), "\n"); do
{ fprintf ((asm_out_file), "%s", "\t.comm\t"); assemble_name
((asm_out_file), (name)); fprintf ((asm_out_file), "," "%" "l"
"u" ",%u\n", (size), ((((global_options.x_target_flags &
(1U << 12)) != 0) ? 32 : (((global_options.x_ix86_isa_flags
& (1UL << 15)) != 0) ? 512 : (((global_options.x_ix86_isa_flags
& (1UL << 8)) != 0) ? 256 : 128)))) / (8)); } while
(0); } while (0)
;
2714#else
2715 {
2716 /* Round size up to multiple of BIGGEST_ALIGNMENT bits
2717 so that each uninitialized object starts on such a boundary. */
2718 /* Variable `rounded' might or might not be used in ASM_OUTPUT_LOCAL. */
2719 unsigned HOST_WIDE_INTlong rounded ATTRIBUTE_UNUSED__attribute__ ((__unused__))
2720 = ((size + (BIGGEST_ALIGNMENT(((global_options.x_target_flags & (1U << 12)) != 0
) ? 32 : (((global_options.x_ix86_isa_flags & (1UL <<
15)) != 0) ? 512 : (((global_options.x_ix86_isa_flags & (
1UL << 8)) != 0) ? 256 : 128)))
/ BITS_PER_UNIT(8)) - 1)
2721 / (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))
2722 * (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)));
2723 ASM_OUTPUT_LOCAL (asm_out_file, name, size, rounded);
2724 }
2725#endif
2726#endif
2727 return x;
2728}
2729
2730/* Assemble the static constant template for function entry trampolines.
2731 This is done at most once per compilation.
2732 Returns an RTX for the address of the template. */
2733
2734static GTY(()) rtx initial_trampoline;
2735
2736rtx
2737assemble_trampoline_template (void)
2738{
2739 char label[256];
2740 const char *name;
2741 int align;
2742 rtx symbol;
2743
2744 gcc_assert (targetm.asm_out.trampoline_template != NULL)((void)(!(targetm.asm_out.trampoline_template != nullptr) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2744, __FUNCTION__), 0 : 0))
;
2745
2746 if (initial_trampoline)
2747 return initial_trampoline;
2748
2749 /* By default, put trampoline templates in read-only data section. */
2750
2751#ifdef TRAMPOLINE_SECTION
2752 switch_to_section (TRAMPOLINE_SECTION);
2753#else
2754 switch_to_section (readonly_data_section);
2755#endif
2756
2757 /* Write the assembler code to define one. */
2758 align = floor_log2 (TRAMPOLINE_ALIGNMENT(lang_hooks.custom_function_descriptors && targetm.calls
.custom_function_descriptors > 0 ? (((8)) > (2 * targetm
.calls.custom_function_descriptors * (8)) ? ((8)) : (2 * targetm
.calls.custom_function_descriptors * (8))) : (8))
/ BITS_PER_UNIT(8));
2759 if (align > 0)
2760 ASM_OUTPUT_ALIGN (asm_out_file, align)if ((align) != 0) fprintf ((asm_out_file), "\t.align %d\n", 1
<< (align))
;
2761
2762 targetm.asm_out.internal_label (asm_out_file, "LTRAMP", 0);
2763 targetm.asm_out.trampoline_template (asm_out_file);
2764
2765 /* Record the rtl to refer to it. */
2766 ASM_GENERATE_INTERNAL_LABEL (label, "LTRAMP", 0)do { char *__p; (label)[0] = '*'; (label)[1] = '.'; __p = stpcpy
(&(label)[2], "LTRAMP"); sprint_ul (__p, (unsigned long)
(0)); } while (0)
;
2767 name = ggc_strdup (label)ggc_alloc_string ((label), -1 );
2768 symbol = gen_rtx_SYMBOL_REF (Pmode, name)gen_rtx_fmt_s0_stat ((SYMBOL_REF), (((global_options.x_ix86_pmode
== PMODE_DI ? (scalar_int_mode ((scalar_int_mode::from_int) E_DImode
)) : (scalar_int_mode ((scalar_int_mode::from_int) E_SImode))
))), ((name)) )
;
2769 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, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2769, __FUNCTION__); _rtx; }) ->u2.symbol_ref_flags)
= SYMBOL_FLAG_LOCAL(1 << 1);
2770
2771 initial_trampoline = gen_const_mem (BLKmode((void) 0, E_BLKmode), symbol);
2772 set_mem_align (initial_trampoline, TRAMPOLINE_ALIGNMENT(lang_hooks.custom_function_descriptors && targetm.calls
.custom_function_descriptors > 0 ? (((8)) > (2 * targetm
.calls.custom_function_descriptors * (8)) ? ((8)) : (2 * targetm
.calls.custom_function_descriptors * (8))) : (8))
);
2773 set_mem_size (initial_trampoline, TRAMPOLINE_SIZE(((global_options.x_ix86_isa_flags & (1UL << 1)) !=
0) ? 28 : 14)
);
2774
2775 return initial_trampoline;
2776}
2777
2778/* A and B are either alignments or offsets. Return the minimum alignment
2779 that may be assumed after adding the two together. */
2780
2781static inline unsigned
2782min_align (unsigned int a, unsigned int b)
2783{
2784 return least_bit_hwi (a | b);
2785}
2786
2787/* Return the assembler directive for creating a given kind of integer
2788 object. SIZE is the number of bytes in the object and ALIGNED_P
2789 indicates whether it is known to be aligned. Return NULL if the
2790 assembly dialect has no such directive.
2791
2792 The returned string should be printed at the start of a new line and
2793 be followed immediately by the object's initial value. */
2794
2795const char *
2796integer_asm_op (int size, int aligned_p)
2797{
2798 struct asm_int_op *ops;
2799
2800 if (aligned_p)
2801 ops = &targetm.asm_out.aligned_op;
2802 else
2803 ops = &targetm.asm_out.unaligned_op;
2804
2805 switch (size)
2806 {
2807 case 1:
2808 return targetm.asm_out.byte_op;
2809 case 2:
2810 return ops->hi;
2811 case 3:
2812 return ops->psi;
2813 case 4:
2814 return ops->si;
2815 case 5:
2816 case 6:
2817 case 7:
2818 return ops->pdi;
2819 case 8:
2820 return ops->di;
2821 case 9:
2822 case 10:
2823 case 11:
2824 case 12:
2825 case 13:
2826 case 14:
2827 case 15:
2828 return ops->pti;
2829 case 16:
2830 return ops->ti;
2831 default:
2832 return NULLnullptr;
2833 }
2834}
2835
2836/* Use directive OP to assemble an integer object X. Print OP at the
2837 start of the line, followed immediately by the value of X. */
2838
2839void
2840assemble_integer_with_op (const char *op, rtx x)
2841{
2842 fputs (op, asm_out_file);
2843 output_addr_const (asm_out_file, x);
2844 fputc ('\n', asm_out_file);
2845}
2846
2847/* The default implementation of the asm_out.integer target hook. */
2848
2849bool
2850default_assemble_integer (rtx x ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
2851 unsigned int size ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
2852 int aligned_p ATTRIBUTE_UNUSED__attribute__ ((__unused__)))
2853{
2854 const char *op = integer_asm_op (size, aligned_p);
2855 /* Avoid GAS bugs for large values. Specifically negative values whose
2856 absolute value fits in a bfd_vma, but not in a bfd_signed_vma. */
2857 if (size > UNITS_PER_WORD(((global_options.x_ix86_isa_flags & (1UL << 1)) !=
0) ? 8 : 4)
&& size > POINTER_SIZE_UNITS(((((global_options.x_ix86_isa_flags & (1UL << 58))
!= 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags &
(1UL << 1)) != 0) ? 8 : 4))) + (8) - 1) / (8))
)
2858 return false;
2859 return op && (assemble_integer_with_op (op, x), true);
2860}
2861
2862/* Assemble the integer constant X into an object of SIZE bytes. ALIGN is
2863 the alignment of the integer in bits. Return 1 if we were able to output
2864 the constant, otherwise 0. We must be able to output the constant,
2865 if FORCE is nonzero. */
2866
2867bool
2868assemble_integer (rtx x, unsigned int size, unsigned int align, int force)
2869{
2870 int aligned_p;
2871
2872 aligned_p = (align >= MIN (size * BITS_PER_UNIT, BIGGEST_ALIGNMENT)((size * (8)) < ((((global_options.x_target_flags & (1U
<< 12)) != 0) ? 32 : (((global_options.x_ix86_isa_flags
& (1UL << 15)) != 0) ? 512 : (((global_options.x_ix86_isa_flags
& (1UL << 8)) != 0) ? 256 : 128)))) ? (size * (8))
: ((((global_options.x_target_flags & (1U << 12)) !=
0) ? 32 : (((global_options.x_ix86_isa_flags & (1UL <<
15)) != 0) ? 512 : (((global_options.x_ix86_isa_flags & (
1UL << 8)) != 0) ? 256 : 128)))))
);
2873
2874 /* See if the target hook can handle this kind of object. */
2875 if (targetm.asm_out.integer (x, size, aligned_p))
2876 return true;
2877
2878 /* If the object is a multi-byte one, try splitting it up. Split
2879 it into words it if is multi-word, otherwise split it into bytes. */
2880 if (size > 1)
2881 {
2882 machine_mode omode, imode;
2883 unsigned int subalign;
2884 unsigned int subsize, i;
2885 enum mode_class mclass;
2886
2887 subsize = size > UNITS_PER_WORD(((global_options.x_ix86_isa_flags & (1UL << 1)) !=
0) ? 8 : 4)
? UNITS_PER_WORD(((global_options.x_ix86_isa_flags & (1UL << 1)) !=
0) ? 8 : 4)
: 1;
2888 subalign = MIN (align, subsize * BITS_PER_UNIT)((align) < (subsize * (8)) ? (align) : (subsize * (8)));
2889 if (GET_CODE (x)((enum rtx_code) (x)->code) == CONST_FIXED)
2890 mclass = GET_MODE_CLASS (GET_MODE (x))((enum mode_class) mode_class[((machine_mode) (x)->mode)]);
2891 else
2892 mclass = MODE_INT;
2893
2894 omode = mode_for_size (subsize * BITS_PER_UNIT(8), mclass, 0).require ();
2895 imode = mode_for_size (size * BITS_PER_UNIT(8), mclass, 0).require ();
2896
2897 for (i = 0; i < size; i += subsize)
2898 {
2899 rtx partial = simplify_subreg (omode, x, imode, i);
2900 if (!partial || !assemble_integer (partial, subsize, subalign, 0))
2901 break;
2902 }
2903 if (i == size)
2904 return true;
2905
2906 /* If we've printed some of it, but not all of it, there's no going
2907 back now. */
2908 gcc_assert (!i)((void)(!(!i) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2908, __FUNCTION__), 0 : 0))
;
2909 }
2910
2911 gcc_assert (!force)((void)(!(!force) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2911, __FUNCTION__), 0 : 0))
;
2912
2913 return false;
2914}
2915
2916/* Assemble the floating-point constant D into an object of size MODE. ALIGN
2917 is the alignment of the constant in bits. If REVERSE is true, D is output
2918 in reverse storage order. */
2919
2920void
2921assemble_real (REAL_VALUE_TYPEstruct real_value d, scalar_float_mode mode, unsigned int align,
2922 bool reverse)
2923{
2924 long data[4] = {0, 0, 0, 0};
2925 int bitsize, nelts, nunits, units_per;
2926 rtx elt;
2927
2928 /* This is hairy. We have a quantity of known size. real_to_target
2929 will put it into an array of *host* longs, 32 bits per element
2930 (even if long is more than 32 bits). We need to determine the
2931 number of array elements that are occupied (nelts) and the number
2932 of *target* min-addressable units that will be occupied in the
2933 object file (nunits). We cannot assume that 32 divides the
2934 mode's bitsize (size * BITS_PER_UNIT) evenly.
2935
2936 size * BITS_PER_UNIT is used here to make sure that padding bits
2937 (which might appear at either end of the value; real_to_target
2938 will include the padding bits in its output array) are included. */
2939
2940 nunits = GET_MODE_SIZE (mode);
2941 bitsize = nunits * BITS_PER_UNIT(8);
2942 nelts = CEIL (bitsize, 32)(((bitsize) + (32) - 1) / (32));
2943 units_per = 32 / BITS_PER_UNIT(8);
2944
2945 real_to_target (data, &d, mode);
2946
2947 /* Put out the first word with the specified alignment. */
2948 unsigned int chunk_nunits = MIN (nunits, units_per)((nunits) < (units_per) ? (nunits) : (units_per));
2949 if (reverse)
2950 elt = flip_storage_order (SImode(scalar_int_mode ((scalar_int_mode::from_int) E_SImode)), gen_int_mode (data[nelts - 1], SImode(scalar_int_mode ((scalar_int_mode::from_int) E_SImode))));
2951 else
2952 elt = GEN_INT (sext_hwi (data[0], chunk_nunits * BITS_PER_UNIT))gen_rtx_CONST_INT (((void) 0, E_VOIDmode), (sext_hwi (data[0]
, chunk_nunits * (8))))
;
2953 assemble_integer (elt, chunk_nunits, align, 1);
2954 nunits -= chunk_nunits;
2955
2956 /* Subsequent words need only 32-bit alignment. */
2957 align = min_align (align, 32);
2958
2959 for (int i = 1; i < nelts; i++)
2960 {
2961 chunk_nunits = MIN (nunits, units_per)((nunits) < (units_per) ? (nunits) : (units_per));
2962 if (reverse)
2963 elt = flip_storage_order (SImode(scalar_int_mode ((scalar_int_mode::from_int) E_SImode)),
2964 gen_int_mode (data[nelts - 1 - i], SImode(scalar_int_mode ((scalar_int_mode::from_int) E_SImode))));
2965 else
2966 elt = GEN_INT (sext_hwi (data[i], chunk_nunits * BITS_PER_UNIT))gen_rtx_CONST_INT (((void) 0, E_VOIDmode), (sext_hwi (data[i]
, chunk_nunits * (8))))
;
2967 assemble_integer (elt, chunk_nunits, align, 1);
2968 nunits -= chunk_nunits;
2969 }
2970}
2971
2972/* Given an expression EXP with a constant value,
2973 reduce it to the sum of an assembler symbol and an integer.
2974 Store them both in the structure *VALUE.
2975 EXP must be reducible. */
2976
2977class addr_const {
2978public:
2979 rtx base;
2980 poly_int64 offset;
2981};
2982
2983static void
2984decode_addr_const (tree exp, class addr_const *value)
2985{
2986 tree target = TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2986, __FUNCTION__)))))
;
2987 poly_int64 offset = 0;
2988 rtx x;
2989
2990 while (1)
2991 {
2992 poly_int64 bytepos;
2993 if (TREE_CODE (target)((enum tree_code) (target)->base.code) == COMPONENT_REF
2994 && poly_int_tree_p (byte_position (TREE_OPERAND (target, 1)(*((const_cast<tree*> (tree_operand_check ((target), (1
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2994, __FUNCTION__)))))
),
2995 &bytepos))
2996 {
2997 offset += bytepos;
2998 target = TREE_OPERAND (target, 0)(*((const_cast<tree*> (tree_operand_check ((target), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 2998, __FUNCTION__)))))
;
2999 }
3000 else if (TREE_CODE (target)((enum tree_code) (target)->base.code) == ARRAY_REF
3001 || TREE_CODE (target)((enum tree_code) (target)->base.code) == ARRAY_RANGE_REF)
3002 {
3003 /* Truncate big offset. */
3004 offset
3005 += (TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (target)))((unsigned long) (*tree_int_cst_elt_check ((((tree_class_check
((((contains_struct_check ((target), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3005, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3005, __FUNCTION__))->type_common.size_unit)), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3005, __FUNCTION__)))
3006 * wi::to_poly_widest (TREE_OPERAND (target, 1)(*((const_cast<tree*> (tree_operand_check ((target), (1
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3006, __FUNCTION__)))))
).force_shwi ());
3007 target = TREE_OPERAND (target, 0)(*((const_cast<tree*> (tree_operand_check ((target), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3007, __FUNCTION__)))))
;
3008 }
3009 else if (TREE_CODE (target)((enum tree_code) (target)->base.code) == MEM_REF
3010 && TREE_CODE (TREE_OPERAND (target, 0))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((target), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3010, __FUNCTION__))))))->base.code)
== ADDR_EXPR)
3011 {
3012 offset += mem_ref_offset (target).force_shwi ();
3013 target = TREE_OPERAND (TREE_OPERAND (target, 0), 0)(*((const_cast<tree*> (tree_operand_check (((*((const_cast
<tree*> (tree_operand_check ((target), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3013, __FUNCTION__)))))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3013, __FUNCTION__)))))
;
3014 }
3015 else if (TREE_CODE (target)((enum tree_code) (target)->base.code) == INDIRECT_REF
3016 && TREE_CODE (TREE_OPERAND (target, 0))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((target), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3016, __FUNCTION__))))))->base.code)
== NOP_EXPR
3017 && TREE_CODE (TREE_OPERAND (TREE_OPERAND (target, 0), 0))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
(((*((const_cast<tree*> (tree_operand_check ((target),
(0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3017, __FUNCTION__)))))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3017, __FUNCTION__))))))->base.code)
3018 == ADDR_EXPR)
3019 target = TREE_OPERAND (TREE_OPERAND (TREE_OPERAND (target, 0), 0), 0)(*((const_cast<tree*> (tree_operand_check (((*((const_cast
<tree*> (tree_operand_check (((*((const_cast<tree*>
(tree_operand_check ((target), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3019, __FUNCTION__)))))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3019, __FUNCTION__)))))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3019, __FUNCTION__)))))
;
3020 else
3021 break;
3022 }
3023
3024 switch (TREE_CODE (target)((enum tree_code) (target)->base.code))
3025 {
3026 case VAR_DECL:
3027 case FUNCTION_DECL:
3028 x = DECL_RTL (target)((contains_struct_check ((target), (TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3028, __FUNCTION__))->decl_with_rtl.rtl ? (target)->decl_with_rtl
.rtl : (make_decl_rtl (target), (target)->decl_with_rtl.rtl
))
;
3029 break;
3030
3031 case LABEL_DECL:
3032 x = gen_rtx_MEM (FUNCTION_MODE(scalar_int_mode ((scalar_int_mode::from_int) E_QImode)),
3033 gen_rtx_LABEL_REF (Pmode, force_label_rtx (target))gen_rtx_fmt_u_stat ((LABEL_REF), (((global_options.x_ix86_pmode
== PMODE_DI ? (scalar_int_mode ((scalar_int_mode::from_int) E_DImode
)) : (scalar_int_mode ((scalar_int_mode::from_int) E_SImode))
))), ((force_label_rtx (target))) )
);
3034 break;
3035
3036 case REAL_CST:
3037 case FIXED_CST:
3038 case STRING_CST:
3039 case COMPLEX_CST:
3040 case CONSTRUCTOR:
3041 case INTEGER_CST:
3042 x = lookup_constant_def (target);
3043 /* Should have been added by output_addressed_constants. */
3044 gcc_assert (x)((void)(!(x) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3044, __FUNCTION__), 0 : 0))
;
3045 break;
3046
3047 case INDIRECT_REF:
3048 /* This deals with absolute addresses. */
3049 offset += tree_to_shwi (TREE_OPERAND (target, 0)(*((const_cast<tree*> (tree_operand_check ((target), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3049, __FUNCTION__)))))
);
3050 x = gen_rtx_MEM (QImode(scalar_int_mode ((scalar_int_mode::from_int) E_QImode)),
3051 gen_rtx_SYMBOL_REF (Pmode, "origin of addresses")gen_rtx_fmt_s0_stat ((SYMBOL_REF), (((global_options.x_ix86_pmode
== PMODE_DI ? (scalar_int_mode ((scalar_int_mode::from_int) E_DImode
)) : (scalar_int_mode ((scalar_int_mode::from_int) E_SImode))
))), (("origin of addresses")) )
);
3052 break;
3053
3054 case COMPOUND_LITERAL_EXPR:
3055 gcc_assert (COMPOUND_LITERAL_EXPR_DECL (target))((void)(!((*((const_cast<tree*> (tree_operand_check (((
tree_check (((*((const_cast<tree*> (tree_operand_check (
((tree_check ((target), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3055, __FUNCTION__, (COMPOUND_LITERAL_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3055, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3055, __FUNCTION__, (DECL_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3055, __FUNCTION__)))))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3055, __FUNCTION__), 0 : 0))
;
3056 x = DECL_RTL (COMPOUND_LITERAL_EXPR_DECL (target))((contains_struct_check (((*((const_cast<tree*> (tree_operand_check
(((tree_check (((*((const_cast<tree*> (tree_operand_check
(((tree_check ((target), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3056, __FUNCTION__, (COMPOUND_LITERAL_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3056, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3056, __FUNCTION__, (DECL_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3056, __FUNCTION__)))))), (TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3056, __FUNCTION__))->decl_with_rtl.rtl ? ((*((const_cast
<tree*> (tree_operand_check (((tree_check (((*((const_cast
<tree*> (tree_operand_check (((tree_check ((target), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3056, __FUNCTION__, (COMPOUND_LITERAL_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3056, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3056, __FUNCTION__, (DECL_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3056, __FUNCTION__))))))->decl_with_rtl.rtl : (make_decl_rtl
((*((const_cast<tree*> (tree_operand_check (((tree_check
(((*((const_cast<tree*> (tree_operand_check (((tree_check
((target), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3056, __FUNCTION__, (COMPOUND_LITERAL_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3056, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3056, __FUNCTION__, (DECL_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3056, __FUNCTION__)))))), ((*((const_cast<tree*> (tree_operand_check
(((tree_check (((*((const_cast<tree*> (tree_operand_check
(((tree_check ((target), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3056, __FUNCTION__, (COMPOUND_LITERAL_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3056, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3056, __FUNCTION__, (DECL_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3056, __FUNCTION__))))))->decl_with_rtl.rtl))
;
3057 break;
3058
3059 default:
3060 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3060, __FUNCTION__))
;
3061 }
3062
3063 gcc_assert (MEM_P (x))((void)(!((((enum rtx_code) (x)->code) == MEM)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3063, __FUNCTION__), 0 : 0))
;
3064 x = XEXP (x, 0)(((x)->u.fld[0]).rt_rtx);
3065
3066 value->base = x;
3067 value->offset = offset;
3068}
3069
3070static GTY(()) hash_table<tree_descriptor_hasher> *const_desc_htab;
3071
3072static void maybe_output_constant_def_contents (struct constant_descriptor_tree *, int);
3073
3074/* Constant pool accessor function. */
3075
3076hash_table<tree_descriptor_hasher> *
3077constant_pool_htab (void)
3078{
3079 return const_desc_htab;
3080}
3081
3082/* Compute a hash code for a constant expression. */
3083
3084hashval_t
3085tree_descriptor_hasher::hash (constant_descriptor_tree *ptr)
3086{
3087 return ptr->hash;
3088}
3089
3090static hashval_t
3091const_hash_1 (const tree exp)
3092{
3093 const char *p;
3094 hashval_t hi;
3095 int len, i;
3096 enum tree_code code = TREE_CODE (exp)((enum tree_code) (exp)->base.code);
3097
3098 /* Either set P and LEN to the address and len of something to hash and
3099 exit the switch or return a value. */
3100
3101 switch (code)
3102 {
3103 case INTEGER_CST:
3104 p = (char *) &TREE_INT_CST_ELT (exp, 0)(*tree_int_cst_elt_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3104, __FUNCTION__))
;
3105 len = TREE_INT_CST_NUNITS (exp)((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3105, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.unextended
)
* sizeof (HOST_WIDE_INTlong);
3106 break;
3107
3108 case REAL_CST:
3109 return real_hash (TREE_REAL_CST_PTR (exp)((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3109, __FUNCTION__, (REAL_CST)))->real_cst.real_cst_ptr)
);
3110
3111 case FIXED_CST:
3112 return fixed_hash (TREE_FIXED_CST_PTR (exp)((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3112, __FUNCTION__, (FIXED_CST)))->fixed_cst.fixed_cst_ptr
)
);
3113
3114 case STRING_CST:
3115 p = TREE_STRING_POINTER (exp)((const char *)((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3115, __FUNCTION__, (STRING_CST)))->string.str))
;
3116 len = TREE_STRING_LENGTH (exp)((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3116, __FUNCTION__, (STRING_CST)))->string.length)
;
3117 break;
3118
3119 case COMPLEX_CST:
3120 return (const_hash_1 (TREE_REALPART (exp)((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3120, __FUNCTION__, (COMPLEX_CST)))->complex.real)
) * 5
3121 + const_hash_1 (TREE_IMAGPART (exp)((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3121, __FUNCTION__, (COMPLEX_CST)))->complex.imag)
));
3122
3123 case VECTOR_CST:
3124 {
3125 hi = 7 + VECTOR_CST_NPATTERNS (exp)(1U << ((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3125, __FUNCTION__, (VECTOR_CST)))->base.u.vector_cst.log2_npatterns
))
;
3126 hi = hi * 563 + VECTOR_CST_NELTS_PER_PATTERN (exp)((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3126, __FUNCTION__, (VECTOR_CST)))->base.u.vector_cst.nelts_per_pattern
)
;
3127 unsigned int count = vector_cst_encoded_nelts (exp);
3128 for (unsigned int i = 0; i < count; ++i)
3129 hi = hi * 563 + const_hash_1 (VECTOR_CST_ENCODED_ELT (exp, i)((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3129, __FUNCTION__, (VECTOR_CST)))->vector.elts[i])
);
3130 return hi;
3131 }
3132
3133 case CONSTRUCTOR:
3134 {
3135 unsigned HOST_WIDE_INTlong idx;
3136 tree value;
3137
3138 hi = 5 + int_size_in_bytes (TREE_TYPE (exp)((contains_struct_check ((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3138, __FUNCTION__))->typed.type)
);
3139
3140 FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (exp), idx, value)for (idx = 0; (idx >= vec_safe_length (((tree_check ((exp)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3140, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)))
? false : ((value = (*(((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3140, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)))
[idx].value), true); (idx)++)
3141 if (value)
3142 hi = hi * 603 + const_hash_1 (value);
3143
3144 return hi;
3145 }
3146
3147 case ADDR_EXPR:
3148 if (CONSTANT_CLASS_P (TREE_OPERAND (exp, 0))(tree_code_type[(int) (((enum tree_code) ((*((const_cast<tree
*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3148, __FUNCTION__))))))->base.code))] == tcc_constant)
)
3149 return const_hash_1 (TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3149, __FUNCTION__)))))
);
3150
3151 /* Fallthru. */
3152 case FDESC_EXPR:
3153 {
3154 class addr_const value;
3155
3156 decode_addr_const (exp, &value);
3157 switch (GET_CODE (value.base)((enum rtx_code) (value.base)->code))
3158 {
3159 case SYMBOL_REF:
3160 /* Don't hash the address of the SYMBOL_REF;
3161 only use the offset and the symbol name. */
3162 hi = value.offset.coeffs[0];
3163 p = XSTR (value.base, 0)(((value.base)->u.fld[0]).rt_str);
3164 for (i = 0; p[i] != 0; i++)
3165 hi = ((hi * 613) + (unsigned) (p[i]));
3166 break;
3167
3168 case LABEL_REF:
3169 hi = (value.offset.coeffs[0]
3170 + CODE_LABEL_NUMBER (label_ref_label (value.base))(((label_ref_label (value.base))->u.fld[5]).rt_int) * 13);
3171 break;
3172
3173 default:
3174 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3174, __FUNCTION__))
;
3175 }
3176 }
3177 return hi;
3178
3179 case PLUS_EXPR:
3180 case POINTER_PLUS_EXPR:
3181 case MINUS_EXPR:
3182 return (const_hash_1 (TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3182, __FUNCTION__)))))
) * 9
3183 + const_hash_1 (TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3183, __FUNCTION__)))))
));
3184
3185 CASE_CONVERTcase NOP_EXPR: case CONVERT_EXPR:
3186 return const_hash_1 (TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3186, __FUNCTION__)))))
) * 7 + 2;
3187
3188 default:
3189 /* A language specific constant. Just hash the code. */
3190 return code;
3191 }
3192
3193 /* Compute hashing function. */
3194 hi = len;
3195 for (i = 0; i < len; i++)
3196 hi = ((hi * 613) + (unsigned) (p[i]));
3197
3198 return hi;
3199}
3200
3201/* Wrapper of compare_constant, for the htab interface. */
3202bool
3203tree_descriptor_hasher::equal (constant_descriptor_tree *c1,
3204 constant_descriptor_tree *c2)
3205{
3206 if (c1->hash != c2->hash)
3207 return 0;
3208 return compare_constant (c1->value, c2->value);
3209}
3210
3211/* Compare t1 and t2, and return 1 only if they are known to result in
3212 the same bit pattern on output. */
3213
3214static int
3215compare_constant (const tree t1, const tree t2)
3216{
3217 enum tree_code typecode;
3218
3219 if (t1 == NULL_TREE(tree) nullptr)
3220 return t2 == NULL_TREE(tree) nullptr;
3221 if (t2 == NULL_TREE(tree) nullptr)
3222 return 0;
3223
3224 if (TREE_CODE (t1)((enum tree_code) (t1)->base.code) != TREE_CODE (t2)((enum tree_code) (t2)->base.code))
3225 return 0;
3226
3227 switch (TREE_CODE (t1)((enum tree_code) (t1)->base.code))
3228 {
3229 case INTEGER_CST:
3230 /* Integer constants are the same only if the same width of type. */
3231 if (TYPE_PRECISION (TREE_TYPE (t1))((tree_class_check ((((contains_struct_check ((t1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3231, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3231, __FUNCTION__))->type_common.precision)
!= TYPE_PRECISION (TREE_TYPE (t2))((tree_class_check ((((contains_struct_check ((t2), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3231, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3231, __FUNCTION__))->type_common.precision)
)
3232 return 0;
3233 if (TYPE_MODE (TREE_TYPE (t1))((((enum tree_code) ((tree_class_check ((((contains_struct_check
((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3233, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3233, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3233, __FUNCTION__))->typed.type)) : (((contains_struct_check
((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3233, __FUNCTION__))->typed.type))->type_common.mode)
!= TYPE_MODE (TREE_TYPE (t2))((((enum tree_code) ((tree_class_check ((((contains_struct_check
((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3233, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3233, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3233, __FUNCTION__))->typed.type)) : (((contains_struct_check
((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3233, __FUNCTION__))->typed.type))->type_common.mode)
)
3234 return 0;
3235 return tree_int_cst_equal (t1, t2);
3236
3237 case REAL_CST:
3238 /* Real constants are the same only if the same width of type. In
3239 addition to the same width, we need to check whether the modes are the
3240 same. There might be two floating point modes that are the same size
3241 but have different representations, such as the PowerPC that has 2
3242 different 128-bit floating point types (IBM extended double and IEEE
3243 128-bit floating point). */
3244 if (TYPE_PRECISION (TREE_TYPE (t1))((tree_class_check ((((contains_struct_check ((t1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3244, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3244, __FUNCTION__))->type_common.precision)
!= TYPE_PRECISION (TREE_TYPE (t2))((tree_class_check ((((contains_struct_check ((t2), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3244, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3244, __FUNCTION__))->type_common.precision)
)
3245 return 0;
3246 if (TYPE_MODE (TREE_TYPE (t1))((((enum tree_code) ((tree_class_check ((((contains_struct_check
((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3246, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3246, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3246, __FUNCTION__))->typed.type)) : (((contains_struct_check
((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3246, __FUNCTION__))->typed.type))->type_common.mode)
!= TYPE_MODE (TREE_TYPE (t2))((((enum tree_code) ((tree_class_check ((((contains_struct_check
((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3246, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3246, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3246, __FUNCTION__))->typed.type)) : (((contains_struct_check
((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3246, __FUNCTION__))->typed.type))->type_common.mode)
)
3247 return 0;
3248 return real_identical (&TREE_REAL_CST (t1)(*((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3248, __FUNCTION__, (REAL_CST)))->real_cst.real_cst_ptr)
)
, &TREE_REAL_CST (t2)(*((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3248, __FUNCTION__, (REAL_CST)))->real_cst.real_cst_ptr)
)
);
3249
3250 case FIXED_CST:
3251 /* Fixed constants are the same only if the same width of type. */
3252 if (TYPE_PRECISION (TREE_TYPE (t1))((tree_class_check ((((contains_struct_check ((t1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3252, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3252, __FUNCTION__))->type_common.precision)
!= TYPE_PRECISION (TREE_TYPE (t2))((tree_class_check ((((contains_struct_check ((t2), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3252, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3252, __FUNCTION__))->type_common.precision)
)
3253 return 0;
3254
3255 return FIXED_VALUES_IDENTICAL (TREE_FIXED_CST (t1), TREE_FIXED_CST (t2))fixed_identical (&((*((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3255, __FUNCTION__, (FIXED_CST)))->fixed_cst.fixed_cst_ptr
))), &((*((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3255, __FUNCTION__, (FIXED_CST)))->fixed_cst.fixed_cst_ptr
))))
;
3256
3257 case STRING_CST:
3258 if (TYPE_MODE (TREE_TYPE (t1))((((enum tree_code) ((tree_class_check ((((contains_struct_check
((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3258, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3258, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3258, __FUNCTION__))->typed.type)) : (((contains_struct_check
((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3258, __FUNCTION__))->typed.type))->type_common.mode)
!= TYPE_MODE (TREE_TYPE (t2))((((enum tree_code) ((tree_class_check ((((contains_struct_check
((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3258, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3258, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3258, __FUNCTION__))->typed.type)) : (((contains_struct_check
((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3258, __FUNCTION__))->typed.type))->type_common.mode)
3259 || int_size_in_bytes (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3259, __FUNCTION__))->typed.type)
)
3260 != int_size_in_bytes (TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3260, __FUNCTION__))->typed.type)
))
3261 return 0;
3262
3263 return (TREE_STRING_LENGTH (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3263, __FUNCTION__, (STRING_CST)))->string.length)
== TREE_STRING_LENGTH (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3263, __FUNCTION__, (STRING_CST)))->string.length)
3264 && ! memcmp (TREE_STRING_POINTER (t1)((const char *)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3264, __FUNCTION__, (STRING_CST)))->string.str))
, TREE_STRING_POINTER (t2)((const char *)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3264, __FUNCTION__, (STRING_CST)))->string.str))
,
3265 TREE_STRING_LENGTH (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3265, __FUNCTION__, (STRING_CST)))->string.length)
));
3266
3267 case COMPLEX_CST:
3268 return (compare_constant (TREE_REALPART (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3268, __FUNCTION__, (COMPLEX_CST)))->complex.real)
, TREE_REALPART (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3268, __FUNCTION__, (COMPLEX_CST)))->complex.real)
)
3269 && compare_constant (TREE_IMAGPART (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3269, __FUNCTION__, (COMPLEX_CST)))->complex.imag)
, TREE_IMAGPART (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3269, __FUNCTION__, (COMPLEX_CST)))->complex.imag)
));
3270
3271 case VECTOR_CST:
3272 {
3273 if (VECTOR_CST_NPATTERNS (t1)(1U << ((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3273, __FUNCTION__, (VECTOR_CST)))->base.u.vector_cst.log2_npatterns
))
3274 != VECTOR_CST_NPATTERNS (t2)(1U << ((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3274, __FUNCTION__, (VECTOR_CST)))->base.u.vector_cst.log2_npatterns
))
)
3275 return 0;
3276
3277 if (VECTOR_CST_NELTS_PER_PATTERN (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3277, __FUNCTION__, (VECTOR_CST)))->base.u.vector_cst.nelts_per_pattern
)
3278 != VECTOR_CST_NELTS_PER_PATTERN (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3278, __FUNCTION__, (VECTOR_CST)))->base.u.vector_cst.nelts_per_pattern
)
)
3279 return 0;
3280
3281 unsigned int count = vector_cst_encoded_nelts (t1);
3282 for (unsigned int i = 0; i < count; ++i)
3283 if (!compare_constant (VECTOR_CST_ENCODED_ELT (t1, i)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3283, __FUNCTION__, (VECTOR_CST)))->vector.elts[i])
,
3284 VECTOR_CST_ENCODED_ELT (t2, i)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3284, __FUNCTION__, (VECTOR_CST)))->vector.elts[i])
))
3285 return 0;
3286
3287 return 1;
3288 }
3289
3290 case CONSTRUCTOR:
3291 {
3292 vec<constructor_elt, va_gc> *v1, *v2;
3293 unsigned HOST_WIDE_INTlong idx;
3294
3295 typecode = TREE_CODE (TREE_TYPE (t1))((enum tree_code) (((contains_struct_check ((t1), (TS_TYPED),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3295, __FUNCTION__))->typed.type))->base.code)
;
3296 if (typecode != TREE_CODE (TREE_TYPE (t2))((enum tree_code) (((contains_struct_check ((t2), (TS_TYPED),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3296, __FUNCTION__))->typed.type))->base.code)
)
3297 return 0;
3298
3299 if (typecode == ARRAY_TYPE)
3300 {
3301 HOST_WIDE_INTlong size_1 = int_size_in_bytes (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3301, __FUNCTION__))->typed.type)
);
3302 /* For arrays, check that mode, size and storage order match. */
3303 if (TYPE_MODE (TREE_TYPE (t1))((((enum tree_code) ((tree_class_check ((((contains_struct_check
((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3303, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3303, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3303, __FUNCTION__))->typed.type)) : (((contains_struct_check
((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3303, __FUNCTION__))->typed.type))->type_common.mode)
!= TYPE_MODE (TREE_TYPE (t2))((((enum tree_code) ((tree_class_check ((((contains_struct_check
((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3303, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3303, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3303, __FUNCTION__))->typed.type)) : (((contains_struct_check
((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3303, __FUNCTION__))->typed.type))->type_common.mode)
3304 || size_1 == -1
3305 || size_1 != int_size_in_bytes (TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3305, __FUNCTION__))->typed.type)
)
3306 || TYPE_REVERSE_STORAGE_ORDER (TREE_TYPE (t1))((tree_check4 ((((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3306, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3306, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
), (ARRAY_TYPE)))->base.u.bits.saturating_flag)
3307 != TYPE_REVERSE_STORAGE_ORDER (TREE_TYPE (t2))((tree_check4 ((((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3307, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3307, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
), (ARRAY_TYPE)))->base.u.bits.saturating_flag)
)
3308 return 0;
3309 }
3310 else
3311 {
3312 /* For record and union constructors, require exact type
3313 equality. */
3314 if (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3314, __FUNCTION__))->typed.type)
!= TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3314, __FUNCTION__))->typed.type)
)
3315 return 0;
3316 }
3317
3318 v1 = CONSTRUCTOR_ELTS (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3318, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)
;
3319 v2 = CONSTRUCTOR_ELTS (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3319, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)
;
3320 if (vec_safe_length (v1) != vec_safe_length (v2))
3321 return 0;
3322
3323 for (idx = 0; idx < vec_safe_length (v1); ++idx)
3324 {
3325 constructor_elt *c1 = &(*v1)[idx];
3326 constructor_elt *c2 = &(*v2)[idx];
3327
3328 /* Check that each value is the same... */
3329 if (!compare_constant (c1->value, c2->value))
3330 return 0;
3331 /* ... and that they apply to the same fields! */
3332 if (typecode == ARRAY_TYPE)
3333 {
3334 if (!compare_constant (c1->index, c2->index))
3335 return 0;
3336 }
3337 else
3338 {
3339 if (c1->index != c2->index)
3340 return 0;
3341 }
3342 }
3343
3344 return 1;
3345 }
3346
3347 case ADDR_EXPR:
3348 case FDESC_EXPR:
3349 {
3350 class addr_const value1, value2;
3351 enum rtx_code code;
3352 int ret;
3353
3354 decode_addr_const (t1, &value1);
3355 decode_addr_const (t2, &value2);
3356
3357 if (maybe_ne (value1.offset, value2.offset))
3358 return 0;
3359
3360 code = GET_CODE (value1.base)((enum rtx_code) (value1.base)->code);
3361 if (code != GET_CODE (value2.base)((enum rtx_code) (value2.base)->code))
3362 return 0;
3363
3364 switch (code)
3365 {
3366 case SYMBOL_REF:
3367 ret = (strcmp (XSTR (value1.base, 0)(((value1.base)->u.fld[0]).rt_str), XSTR (value2.base, 0)(((value2.base)->u.fld[0]).rt_str)) == 0);
3368 break;
3369
3370 case LABEL_REF:
3371 ret = (CODE_LABEL_NUMBER (label_ref_label (value1.base))(((label_ref_label (value1.base))->u.fld[5]).rt_int)
3372 == CODE_LABEL_NUMBER (label_ref_label (value2.base))(((label_ref_label (value2.base))->u.fld[5]).rt_int));
3373 break;
3374
3375 default:
3376 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3376, __FUNCTION__))
;
3377 }
3378 return ret;
3379 }
3380
3381 case PLUS_EXPR:
3382 case POINTER_PLUS_EXPR:
3383 case MINUS_EXPR:
3384 case RANGE_EXPR:
3385 return (compare_constant (TREE_OPERAND (t1, 0)(*((const_cast<tree*> (tree_operand_check ((t1), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3385, __FUNCTION__)))))
, TREE_OPERAND (t2, 0)(*((const_cast<tree*> (tree_operand_check ((t2), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3385, __FUNCTION__)))))
)
3386 && compare_constant (TREE_OPERAND (t1, 1)(*((const_cast<tree*> (tree_operand_check ((t1), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3386, __FUNCTION__)))))
, TREE_OPERAND (t2, 1)(*((const_cast<tree*> (tree_operand_check ((t2), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3386, __FUNCTION__)))))
));
3387
3388 CASE_CONVERTcase NOP_EXPR: case CONVERT_EXPR:
3389 case VIEW_CONVERT_EXPR:
3390 return compare_constant (TREE_OPERAND (t1, 0)(*((const_cast<tree*> (tree_operand_check ((t1), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3390, __FUNCTION__)))))
, TREE_OPERAND (t2, 0)(*((const_cast<tree*> (tree_operand_check ((t2), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3390, __FUNCTION__)))))
);
3391
3392 default:
3393 return 0;
3394 }
3395
3396 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3396, __FUNCTION__))
;
3397}
3398
3399/* Return the section into which constant EXP should be placed. */
3400
3401static section *
3402get_constant_section (tree exp, unsigned int align)
3403{
3404 return targetm.asm_out.select_section (exp,
3405 compute_reloc_for_constant (exp),
3406 align);
3407}
3408
3409/* Return the size of constant EXP in bytes. */
3410
3411static HOST_WIDE_INTlong
3412get_constant_size (tree exp)
3413{
3414 HOST_WIDE_INTlong size;
3415
3416 size = int_size_in_bytes (TREE_TYPE (exp)((contains_struct_check ((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3416, __FUNCTION__))->typed.type)
);
3417 gcc_checking_assert (size >= 0)((void)(!(size >= 0) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3417, __FUNCTION__), 0 : 0))
;
3418 gcc_checking_assert (TREE_CODE (exp) != STRING_CST((void)(!(((enum tree_code) (exp)->base.code) != STRING_CST
|| size >= ((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3419, __FUNCTION__, (STRING_CST)))->string.length)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3419, __FUNCTION__), 0 : 0))
3419 || size >= TREE_STRING_LENGTH (exp))((void)(!(((enum tree_code) (exp)->base.code) != STRING_CST
|| size >= ((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3419, __FUNCTION__, (STRING_CST)))->string.length)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3419, __FUNCTION__), 0 : 0))
;
3420 return size;
3421}
3422
3423/* Subroutine of output_constant_def:
3424 No constant equal to EXP is known to have been output.
3425 Make a constant descriptor to enter EXP in the hash table.
3426 Assign the label number and construct RTL to refer to the
3427 constant's location in memory.
3428 Caller is responsible for updating the hash table. */
3429
3430static struct constant_descriptor_tree *
3431build_constant_desc (tree exp)
3432{
3433 struct constant_descriptor_tree *desc;
3434 rtx symbol, rtl;
3435 char label[256];
3436 int labelno;
3437 tree decl;
3438
3439 desc = ggc_alloc<constant_descriptor_tree> ();
3440 desc->value = exp;
3441
3442 /* Create a string containing the label name, in LABEL. */
3443 labelno = const_labelno++;
3444 ASM_GENERATE_INTERNAL_LABEL (label, "LC", labelno)do { char *__p; (label)[0] = '*'; (label)[1] = '.'; __p = stpcpy
(&(label)[2], "LC"); sprint_ul (__p, (unsigned long) (labelno
)); } while (0)
;
3445
3446 /* Construct the VAR_DECL associated with the constant. */
3447 decl = build_decl (UNKNOWN_LOCATION((location_t) 0), VAR_DECL, get_identifier (label)(__builtin_constant_p (label) ? get_identifier_with_length ((
label), strlen (label)) : get_identifier (label))
,
3448 TREE_TYPE (exp)((contains_struct_check ((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3448, __FUNCTION__))->typed.type)
);
3449 DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3449, __FUNCTION__))->decl_common.artificial_flag)
= 1;
3450 DECL_IGNORED_P (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3450, __FUNCTION__))->decl_common.ignored_flag)
= 1;
3451 TREE_READONLY (decl)((non_type_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3451, __FUNCTION__))->base.readonly_flag)
= 1;
3452 TREE_STATIC (decl)((decl)->base.static_flag) = 1;
3453 TREE_ADDRESSABLE (decl)((decl)->base.addressable_flag) = 1;
3454 /* We don't set the RTL yet as this would cause varpool to assume that the
3455 variable is referenced. Moreover, it would just be dropped in LTO mode.
3456 Instead we set the flag that will be recognized in make_decl_rtl. */
3457 DECL_IN_CONSTANT_POOL (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3457, __FUNCTION__, (VAR_DECL)))->decl_with_vis.in_constant_pool
)
= 1;
3458 DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3458, __FUNCTION__))->decl_common.initial)
= desc->value;
3459 /* ??? targetm.constant_alignment hasn't been updated for vector types on
3460 most architectures so use DATA_ALIGNMENT as well, except for strings. */
3461 if (TREE_CODE (exp)((enum tree_code) (exp)->base.code) == STRING_CST)
3462 SET_DECL_ALIGN (decl, targetm.constant_alignment (exp, DECL_ALIGN (decl)))(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3462, __FUNCTION__))->decl_common.align) = ffs_hwi (targetm
.constant_alignment (exp, (((contains_struct_check ((decl), (
TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3462, __FUNCTION__))->decl_common.align) ? ((unsigned)1)
<< (((contains_struct_check ((decl), (TS_DECL_COMMON),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3462, __FUNCTION__))->decl_common.align) - 1) : 0))))
;
3463 else
3464 {
3465 align_variable (decl, 0);
3466 if (DECL_ALIGN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3466, __FUNCTION__))->decl_common.align) ? ((unsigned)1)
<< (((contains_struct_check ((decl), (TS_DECL_COMMON),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3466, __FUNCTION__))->decl_common.align) - 1) : 0)
< GET_MODE_ALIGNMENT (DECL_MODE (decl))get_mode_alignment (((contains_struct_check ((decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3466, __FUNCTION__))->decl_common.mode))
3467 && ((optab_handler (movmisalign_optab, DECL_MODE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3467, __FUNCTION__))->decl_common.mode)
)
3468 != CODE_FOR_nothing)
3469 || targetm.slow_unaligned_access (DECL_MODE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3469, __FUNCTION__))->decl_common.mode)
,
3470 DECL_ALIGN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3470, __FUNCTION__))->decl_common.align) ? ((unsigned)1)
<< (((contains_struct_check ((decl), (TS_DECL_COMMON),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3470, __FUNCTION__))->decl_common.align) - 1) : 0)
)))
3471 SET_DECL_ALIGN (decl, GET_MODE_ALIGNMENT (DECL_MODE (decl)))(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3471, __FUNCTION__))->decl_common.align) = ffs_hwi (get_mode_alignment
(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3471, __FUNCTION__))->decl_common.mode))))
;
3472 }
3473
3474 /* Now construct the SYMBOL_REF and the MEM. */
3475 if (use_object_blocks_p ())
3476 {
3477 int align = (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == CONST_DECL
3478 || (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_IN_CONSTANT_POOL (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3478, __FUNCTION__, (VAR_DECL)))->decl_with_vis.in_constant_pool
)
)
3479 ? DECL_ALIGN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3479, __FUNCTION__))->decl_common.align) ? ((unsigned)1)
<< (((contains_struct_check ((decl), (TS_DECL_COMMON),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3479, __FUNCTION__))->decl_common.align) - 1) : 0)
3480 : symtab_node::get (decl)->definition_alignment ());
3481 section *sect = get_constant_section (exp, align);
3482 symbol = create_block_symbol (ggc_strdup (label)ggc_alloc_string ((label), -1 ),
3483 get_block_for_section (sect), -1);
3484 }
3485 else
3486 symbol = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (label))gen_rtx_fmt_s0_stat ((SYMBOL_REF), (((global_options.x_ix86_pmode
== PMODE_DI ? (scalar_int_mode ((scalar_int_mode::from_int) E_DImode
)) : (scalar_int_mode ((scalar_int_mode::from_int) E_SImode))
))), ((ggc_alloc_string ((label), -1 ))) )
;
3487 SYMBOL_REF_FLAGS (symbol)(__extension__ ({ __typeof ((symbol)) const _rtx = ((symbol))
; if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag
("SYMBOL_REF_FLAGS", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3487, __FUNCTION__); _rtx; }) ->u2.symbol_ref_flags)
|= SYMBOL_FLAG_LOCAL(1 << 1);
3488 SET_SYMBOL_REF_DECL (symbol, decl)(((void)(!(!(__extension__ ({ __typeof ((symbol)) const _rtx =
((symbol)); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF
) rtl_check_failed_flag ("CONSTANT_POOL_ADDRESS_P", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3488, __FUNCTION__); _rtx; })->unchanging)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3488, __FUNCTION__), 0 : 0)), ((((symbol))->u.fld[1]).rt_tree
) = (decl))
;
3489 TREE_CONSTANT_POOL_ADDRESS_P (symbol)(__extension__ ({ __typeof ((symbol)) const _rtx = ((symbol))
; if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag
("TREE_CONSTANT_POOL_ADDRESS_P", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3489, __FUNCTION__); _rtx; })->frame_related)
= 1;
3490
3491 rtl = gen_const_mem (TYPE_MODE (TREE_TYPE (exp))((((enum tree_code) ((tree_class_check ((((contains_struct_check
((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3491, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3491, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3491, __FUNCTION__))->typed.type)) : (((contains_struct_check
((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3491, __FUNCTION__))->typed.type))->type_common.mode)
, symbol);
3492 set_mem_alias_set (rtl, 0);
3493
3494 /* Putting EXP into the literal pool might have imposed a different
3495 alignment which should be visible in the RTX as well. */
3496 set_mem_align (rtl, DECL_ALIGN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3496, __FUNCTION__))->decl_common.align) ? ((unsigned)1)
<< (((contains_struct_check ((decl), (TS_DECL_COMMON),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3496, __FUNCTION__))->decl_common.align) - 1) : 0)
);
3497
3498 /* We cannot share RTX'es in pool entries.
3499 Mark this piece of RTL as required for unsharing. */
3500 RTX_FLAG (rtl, used)((rtl)->used) = 1;
3501
3502 /* Set flags or add text to the name to record information, such as
3503 that it is a local symbol. If the name is changed, the macro
3504 ASM_OUTPUT_LABELREF will have to know how to strip this
3505 information. This call might invalidate our local variable
3506 SYMBOL; we can't use it afterward. */
3507 targetm.encode_section_info (exp, rtl, true);
3508
3509 desc->rtl = rtl;
3510
3511 return desc;
3512}
3513
3514/* Subroutine of output_constant_def and tree_output_constant_def:
3515 Add a constant to the hash table that tracks which constants
3516 already have labels. */
3517
3518static constant_descriptor_tree *
3519add_constant_to_table (tree exp, int defer)
3520{
3521 /* The hash table methods may call output_constant_def for addressed
3522 constants, so handle them first. */
3523 output_addressed_constants (exp, defer);
3524
3525 /* Sanity check to catch recursive insertion. */
3526 static bool inserting;
3527 gcc_assert (!inserting)((void)(!(!inserting) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3527, __FUNCTION__), 0 : 0))
;
3528 inserting = true;
3529
3530 /* Look up EXP in the table of constant descriptors. If we didn't
3531 find it, create a new one. */
3532 struct constant_descriptor_tree key;
3533 key.value = exp;
3534 key.hash = const_hash_1 (exp);
3535 constant_descriptor_tree **loc
3536 = const_desc_htab->find_slot_with_hash (&key, key.hash, INSERT);
3537
3538 inserting = false;
3539
3540 struct constant_descriptor_tree *desc = *loc;
3541 if (!desc)
3542 {
3543 desc = build_constant_desc (exp);
3544 desc->hash = key.hash;
3545 *loc = desc;
3546 }
3547
3548 return desc;
3549}
3550
3551/* Return an rtx representing a reference to constant data in memory
3552 for the constant expression EXP.
3553
3554 If assembler code for such a constant has already been output,
3555 return an rtx to refer to it.
3556 Otherwise, output such a constant in memory
3557 and generate an rtx for it.
3558
3559 If DEFER is nonzero, this constant can be deferred and output only
3560 if referenced in the function after all optimizations.
3561
3562 `const_desc_table' records which constants already have label strings. */
3563
3564rtx
3565output_constant_def (tree exp, int defer)
3566{
3567 struct constant_descriptor_tree *desc = add_constant_to_table (exp, defer);
3568 maybe_output_constant_def_contents (desc, defer);
3569 return desc->rtl;
3570}
3571
3572/* Subroutine of output_constant_def: Decide whether or not we need to
3573 output the constant DESC now, and if so, do it. */
3574static void
3575maybe_output_constant_def_contents (struct constant_descriptor_tree *desc,
3576 int defer)
3577{
3578 rtx symbol = XEXP (desc->rtl, 0)(((desc->rtl)->u.fld[0]).rt_rtx);
3579 tree exp = desc->value;
3580
3581 if (flag_syntax_onlyglobal_options.x_flag_syntax_only)
3582 return;
3583
3584 if (TREE_ASM_WRITTEN (exp)((exp)->base.asm_written_flag))
3585 /* Already output; don't do it again. */
3586 return;
3587
3588 /* We can always defer constants as long as the context allows
3589 doing so. */
3590 if (defer)
3591 {
3592 /* Increment n_deferred_constants if it exists. It needs to be at
3593 least as large as the number of constants actually referred to
3594 by the function. If it's too small we'll stop looking too early
3595 and fail to emit constants; if it's too large we'll only look
3596 through the entire function when we could have stopped earlier. */
3597 if (cfun(cfun + 0))
3598 n_deferred_constants((&x_rtl)->varasm.deferred_constants)++;
3599 return;
3600 }
3601
3602 output_constant_def_contents (symbol);
3603}
3604
3605/* Subroutine of output_constant_def_contents. Output the definition
3606 of constant EXP, which is pointed to by label LABEL. ALIGN is the
3607 constant's alignment in bits. */
3608
3609static void
3610assemble_constant_contents (tree exp, const char *label, unsigned int align,
3611 bool merge_strings)
3612{
3613 HOST_WIDE_INTlong size;
3614
3615 size = get_constant_size (exp);
3616
3617 /* Do any machine/system dependent processing of the constant. */
3618 targetm.asm_out.declare_constant_name (asm_out_file, label, exp, size);
3619
3620 /* Output the value of EXP. */
3621 output_constant (exp, size, align, false, merge_strings);
3622
3623 targetm.asm_out.decl_end ();
3624}
3625
3626/* We must output the constant data referred to by SYMBOL; do so. */
3627
3628static void
3629output_constant_def_contents (rtx symbol)
3630{
3631 tree decl = SYMBOL_REF_DECL (symbol)((__extension__ ({ __typeof ((symbol)) const _rtx = ((symbol)
); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag
("CONSTANT_POOL_ADDRESS_P", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3631, __FUNCTION__); _rtx; })->unchanging) ? nullptr : (
(((symbol))->u.fld[1]).rt_tree))
;
3632 tree exp = DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3632, __FUNCTION__))->decl_common.initial)
;
3633 bool asan_protected = false;
3634
3635 /* Make sure any other constants whose addresses appear in EXP
3636 are assigned label numbers. */
3637 output_addressed_constants (exp, 0);
3638
3639 /* We are no longer deferring this constant. */
3640 TREE_ASM_WRITTEN (decl)((decl)->base.asm_written_flag) = TREE_ASM_WRITTEN (exp)((exp)->base.asm_written_flag) = 1;
3641
3642 if ((flag_sanitizeglobal_options.x_flag_sanitize & SANITIZE_ADDRESS)
3643 && TREE_CODE (exp)((enum tree_code) (exp)->base.code) == STRING_CST
3644 && asan_protect_global (exp))
3645 {
3646 asan_protected = true;
3647 SET_DECL_ALIGN (decl, MAX (DECL_ALIGN (decl),(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3648, __FUNCTION__))->decl_common.align) = ffs_hwi (((((
(contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3647, __FUNCTION__))->decl_common.align) ? ((unsigned)1)
<< (((contains_struct_check ((decl), (TS_DECL_COMMON),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3647, __FUNCTION__))->decl_common.align) - 1) : 0)) >
(32 * (8)) ? ((((contains_struct_check ((decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3647, __FUNCTION__))->decl_common.align) ? ((unsigned)1)
<< (((contains_struct_check ((decl), (TS_DECL_COMMON),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3647, __FUNCTION__))->decl_common.align) - 1) : 0)) : (32
* (8)))))
3648 ASAN_RED_ZONE_SIZE * BITS_PER_UNIT))(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3648, __FUNCTION__))->decl_common.align) = ffs_hwi (((((
(contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3647, __FUNCTION__))->decl_common.align) ? ((unsigned)1)
<< (((contains_struct_check ((decl), (TS_DECL_COMMON),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3647, __FUNCTION__))->decl_common.align) - 1) : 0)) >
(32 * (8)) ? ((((contains_struct_check ((decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3647, __FUNCTION__))->decl_common.align) ? ((unsigned)1)
<< (((contains_struct_check ((decl), (TS_DECL_COMMON),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3647, __FUNCTION__))->decl_common.align) - 1) : 0)) : (32
* (8)))))
;
3649 }
3650
3651 /* If the constant is part of an object block, make sure that the
3652 decl has been positioned within its block, but do not write out
3653 its definition yet. output_object_blocks will do that later. */
3654 if (SYMBOL_REF_HAS_BLOCK_INFO_P (symbol)(((__extension__ ({ __typeof ((symbol)) const _rtx = ((symbol
)); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag
("SYMBOL_REF_FLAGS", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3654, __FUNCTION__); _rtx; }) ->u2.symbol_ref_flags) &
(1 << 7)) != 0)
&& SYMBOL_REF_BLOCK (symbol)((&(symbol)->u.block_sym)->block))
3655 place_block_symbol (symbol);
3656 else
3657 {
3658 int align = (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == CONST_DECL
3659 || (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_IN_CONSTANT_POOL (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3659, __FUNCTION__, (VAR_DECL)))->decl_with_vis.in_constant_pool
)
)
3660 ? DECL_ALIGN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3660, __FUNCTION__))->decl_common.align) ? ((unsigned)1)
<< (((contains_struct_check ((decl), (TS_DECL_COMMON),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3660, __FUNCTION__))->decl_common.align) - 1) : 0)
3661 : symtab_node::get (decl)->definition_alignment ());
3662 section *sect = get_constant_section (exp, align);
3663 switch_to_section (sect);
3664 if (align > BITS_PER_UNIT(8))
3665 ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (align / BITS_PER_UNIT))if ((floor_log2 (align / (8))) != 0) fprintf ((asm_out_file),
"\t.align %d\n", 1 << (floor_log2 (align / (8))))
;
3666 assemble_constant_contents (exp, XSTR (symbol, 0)(((symbol)->u.fld[0]).rt_str), align,
3667 (sect->common.flags & SECTION_MERGE0x08000)
3668 && (sect->common.flags & SECTION_STRINGS0x10000));
3669 if (asan_protected)
3670 {
3671 HOST_WIDE_INTlong size = get_constant_size (exp);
3672 assemble_zeros (asan_red_zone_size (size));
3673 }
3674 }
3675}
3676
3677/* Look up EXP in the table of constant descriptors. Return the rtl
3678 if it has been emitted, else null. */
3679
3680rtx
3681lookup_constant_def (tree exp)
3682{
3683 struct constant_descriptor_tree key;
3684
3685 key.value = exp;
3686 key.hash = const_hash_1 (exp);
3687 constant_descriptor_tree *desc
3688 = const_desc_htab->find_with_hash (&key, key.hash);
3689
3690 return (desc ? desc->rtl : NULL_RTX(rtx) 0);
3691}
3692
3693/* Return a tree representing a reference to constant data in memory
3694 for the constant expression EXP.
3695
3696 This is the counterpart of output_constant_def at the Tree level. */
3697
3698tree
3699tree_output_constant_def (tree exp)
3700{
3701 struct constant_descriptor_tree *desc = add_constant_to_table (exp, 1);
3702 tree decl = SYMBOL_REF_DECL (XEXP (desc->rtl, 0))((__extension__ ({ __typeof (((((desc->rtl)->u.fld[0]).
rt_rtx))) const _rtx = (((((desc->rtl)->u.fld[0]).rt_rtx
))); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag
("CONSTANT_POOL_ADDRESS_P", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3702, __FUNCTION__); _rtx; })->unchanging) ? nullptr : (
((((((desc->rtl)->u.fld[0]).rt_rtx)))->u.fld[1]).rt_tree
))
;
3703 varpool_node::finalize_decl (decl);
3704 return decl;
3705}
3706
3707class GTY((chain_next ("%h.next"), for_user)) constant_descriptor_rtx {
3708public:
3709 class constant_descriptor_rtx *next;
3710 rtx mem;
3711 rtx sym;
3712 rtx constant;
3713 HOST_WIDE_INTlong offset;
3714 hashval_t hash;
3715 fixed_size_mode mode;
3716 unsigned int align;
3717 int labelno;
3718 int mark;
3719};
3720
3721struct const_rtx_desc_hasher : ggc_ptr_hash<constant_descriptor_rtx>
3722{
3723 static hashval_t hash (constant_descriptor_rtx *);
3724 static bool equal (constant_descriptor_rtx *, constant_descriptor_rtx *);
3725};
3726
3727/* Used in the hash tables to avoid outputting the same constant
3728 twice. Unlike 'struct constant_descriptor_tree', RTX constants
3729 are output once per function, not once per file. */
3730/* ??? Only a few targets need per-function constant pools. Most
3731 can use one per-file pool. Should add a targetm bit to tell the
3732 difference. */
3733
3734struct GTY(()) rtx_constant_pool {
3735 /* Pointers to first and last constant in pool, as ordered by offset. */
3736 class constant_descriptor_rtx *first;
3737 class constant_descriptor_rtx *last;
3738
3739 /* Hash facility for making memory-constants from constant rtl-expressions.
3740 It is used on RISC machines where immediate integer arguments and
3741 constant addresses are restricted so that such constants must be stored
3742 in memory. */
3743 hash_table<const_rtx_desc_hasher> *const_rtx_htab;
3744
3745 /* Current offset in constant pool (does not include any
3746 machine-specific header). */
3747 HOST_WIDE_INTlong offset;
3748};
3749
3750/* Hash and compare functions for const_rtx_htab. */
3751
3752hashval_t
3753const_rtx_desc_hasher::hash (constant_descriptor_rtx *desc)
3754{
3755 return desc->hash;
3756}
3757
3758bool
3759const_rtx_desc_hasher::equal (constant_descriptor_rtx *x,
3760 constant_descriptor_rtx *y)
3761{
3762 if (x->mode != y->mode)
3763 return 0;
3764 return rtx_equal_p (x->constant, y->constant);
3765}
3766
3767/* Hash one component of a constant. */
3768
3769static hashval_t
3770const_rtx_hash_1 (const_rtx x)
3771{
3772 unsigned HOST_WIDE_INTlong hwi;
3773 machine_mode mode;
3774 enum rtx_code code;
3775 hashval_t h;
3776 int i;
3777
3778 code = GET_CODE (x)((enum rtx_code) (x)->code);
3779 mode = GET_MODE (x)((machine_mode) (x)->mode);
3780 h = (hashval_t) code * 1048573 + mode;
3781
3782 switch (code)
3783 {
3784 case CONST_INT:
3785 hwi = INTVAL (x)((x)->u.hwint[0]);
3786
3787 fold_hwi:
3788 {
3789 int shift = sizeof (hashval_t) * CHAR_BIT8;
3790 const int n = sizeof (HOST_WIDE_INTlong) / sizeof (hashval_t);
3791
3792 h ^= (hashval_t) hwi;
3793 for (i = 1; i < n; ++i)
3794 {
3795 hwi >>= shift;
3796 h ^= (hashval_t) hwi;
3797 }
3798 }
3799 break;
3800
3801 case CONST_WIDE_INT:
3802 hwi = 0;
3803 {
3804 for (i = 0; i < CONST_WIDE_INT_NUNITS (x)((int)__extension__ ({ __typeof ((x)) const _rtx = ((x)); if (
((enum rtx_code) (_rtx)->code) != CONST_WIDE_INT) rtl_check_failed_flag
("CWI_GET_NUM_ELEM", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3804, __FUNCTION__); _rtx; })->u2.num_elem)
; i++)
3805 hwi ^= CONST_WIDE_INT_ELT (x, i)((x)->u.hwiv.elem[i]);
3806 goto fold_hwi;
3807 }
3808
3809 case CONST_DOUBLE:
3810 if (TARGET_SUPPORTS_WIDE_INT1 == 0 && mode == VOIDmode((void) 0, E_VOIDmode))
3811 {
3812 hwi = CONST_DOUBLE_LOW (x)((x)->u.hwint[0]) ^ CONST_DOUBLE_HIGH (x)((x)->u.hwint[1]);
3813 goto fold_hwi;
3814 }
3815 else
3816 h ^= real_hash (CONST_DOUBLE_REAL_VALUE (x)((const struct real_value *) (&(x)->u.rv)));
3817 break;
3818
3819 case CONST_FIXED:
3820 h ^= fixed_hash (CONST_FIXED_VALUE (x)((const struct fixed_value *) (&(x)->u.fv)));
3821 break;
3822
3823 case SYMBOL_REF:
3824 h ^= htab_hash_string (XSTR (x, 0)(((x)->u.fld[0]).rt_str));
3825 break;
3826
3827 case LABEL_REF:
3828 h = h * 251 + CODE_LABEL_NUMBER (label_ref_label (x))(((label_ref_label (x))->u.fld[5]).rt_int);
3829 break;
3830
3831 case UNSPEC:
3832 case UNSPEC_VOLATILE:
3833 h = h * 251 + XINT (x, 1)(((x)->u.fld[1]).rt_int);
3834 break;
3835
3836 default:
3837 break;
3838 }
3839
3840 return h;
3841}
3842
3843/* Compute a hash value for X, which should be a constant. */
3844
3845static hashval_t
3846const_rtx_hash (rtx x)
3847{
3848 hashval_t h = 0;
3849 subrtx_iterator::array_type array;
3850 FOR_EACH_SUBRTX (iter, array, x, ALL)for (subrtx_iterator iter (array, x, rtx_all_subrtx_bounds); !
iter.at_end (); iter.next ())
3851 h = h * 509 + const_rtx_hash_1 (*iter);
3852 return h;
3853}
3854
3855
3856/* Create and return a new rtx constant pool. */
3857
3858static struct rtx_constant_pool *
3859create_constant_pool (void)
3860{
3861 struct rtx_constant_pool *pool;
3862
3863 pool = ggc_alloc<rtx_constant_pool> ();
3864 pool->const_rtx_htab = hash_table<const_rtx_desc_hasher>::create_ggc (31);
3865 pool->first = NULLnullptr;
3866 pool->last = NULLnullptr;
3867 pool->offset = 0;
3868 return pool;
3869}
3870
3871/* Initialize constant pool hashing for a new function. */
3872
3873void
3874init_varasm_status (void)
3875{
3876 crtl(&x_rtl)->varasm.pool = create_constant_pool ();
3877 crtl(&x_rtl)->varasm.deferred_constants = 0;
3878}
3879
3880/* Given a MINUS expression, simplify it if both sides
3881 include the same symbol. */
3882
3883rtx
3884simplify_subtraction (rtx x)
3885{
3886 rtx r = simplify_rtx (x);
3887 return r ? r : x;
3888}
3889
3890/* Given a constant rtx X, make (or find) a memory constant for its value
3891 and return a MEM rtx to refer to it in memory. IN_MODE is the mode
3892 of X. */
3893
3894rtx
3895force_const_mem (machine_mode in_mode, rtx x)
3896{
3897 class constant_descriptor_rtx *desc, tmp;
3898 struct rtx_constant_pool *pool;
3899 char label[256];
3900 rtx def, symbol;
3901 hashval_t hash;
3902 unsigned int align;
3903 constant_descriptor_rtx **slot;
3904 fixed_size_mode mode;
3905
3906 /* We can't force variable-sized objects to memory. */
3907 if (!is_a <fixed_size_mode> (in_mode, &mode))
3908 return NULL_RTX(rtx) 0;
3909
3910 /* If we're not allowed to drop X into the constant pool, don't. */
3911 if (targetm.cannot_force_const_mem (mode, x))
3912 return NULL_RTX(rtx) 0;
3913
3914 /* Record that this function has used a constant pool entry. */
3915 crtl(&x_rtl)->uses_const_pool = 1;
3916
3917 /* Decide which pool to use. */
3918 pool = (targetm.use_blocks_for_constant_p (mode, x)
3919 ? shared_constant_pool
3920 : crtl(&x_rtl)->varasm.pool);
3921
3922 /* Lookup the value in the hashtable. */
3923 tmp.constant = x;
3924 tmp.mode = mode;
3925 hash = const_rtx_hash (x);
3926 slot = pool->const_rtx_htab->find_slot_with_hash (&tmp, hash, INSERT);
3927 desc = *slot;
3928
3929 /* If the constant was already present, return its memory. */
3930 if (desc)
3931 return copy_rtx (desc->mem);
3932
3933 /* Otherwise, create a new descriptor. */
3934 desc = ggc_alloc<constant_descriptor_rtx> ();
3935 *slot = desc;
3936
3937 /* Align the location counter as required by EXP's data type. */
3938 machine_mode align_mode = (mode == VOIDmode((void) 0, E_VOIDmode) ? word_mode : mode);
3939 align = targetm.static_rtx_alignment (align_mode);
3940
3941 pool->offset += (align / BITS_PER_UNIT(8)) - 1;
3942 pool->offset &= ~ ((align / BITS_PER_UNIT(8)) - 1);
3943
3944 desc->next = NULLnullptr;
3945 desc->constant = copy_rtx (tmp.constant);
3946 desc->offset = pool->offset;
3947 desc->hash = hash;
3948 desc->mode = mode;
3949 desc->align = align;
3950 desc->labelno = const_labelno;
3951 desc->mark = 0;
3952
3953 pool->offset += GET_MODE_SIZE (mode);
3954 if (pool->last)
3955 pool->last->next = desc;
3956 else
3957 pool->first = pool->last = desc;
3958 pool->last = desc;
3959
3960 /* Create a string containing the label name, in LABEL. */
3961 ASM_GENERATE_INTERNAL_LABEL (label, "LC", const_labelno)do { char *__p; (label)[0] = '*'; (label)[1] = '.'; __p = stpcpy
(&(label)[2], "LC"); sprint_ul (__p, (unsigned long) (const_labelno
)); } while (0)
;
3962 ++const_labelno;
3963
3964 /* Construct the SYMBOL_REF. Make sure to mark it as belonging to
3965 the constants pool. */
3966 if (use_object_blocks_p () && targetm.use_blocks_for_constant_p (mode, x))
3967 {
3968 section *sect = targetm.asm_out.select_rtx_section (mode, x, align);
3969 symbol = create_block_symbol (ggc_strdup (label)ggc_alloc_string ((label), -1 ),
3970 get_block_for_section (sect), -1);
3971 }
3972 else
3973 symbol = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (label))gen_rtx_fmt_s0_stat ((SYMBOL_REF), (((global_options.x_ix86_pmode
== PMODE_DI ? (scalar_int_mode ((scalar_int_mode::from_int) E_DImode
)) : (scalar_int_mode ((scalar_int_mode::from_int) E_SImode))
))), ((ggc_alloc_string ((label), -1 ))) )
;
3974 desc->sym = symbol;
3975 SYMBOL_REF_FLAGS (symbol)(__extension__ ({ __typeof ((symbol)) const _rtx = ((symbol))
; if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag
("SYMBOL_REF_FLAGS", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3975, __FUNCTION__); _rtx; }) ->u2.symbol_ref_flags)
|= SYMBOL_FLAG_LOCAL(1 << 1);
3976 CONSTANT_POOL_ADDRESS_P (symbol)(__extension__ ({ __typeof ((symbol)) const _rtx = ((symbol))
; if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag
("CONSTANT_POOL_ADDRESS_P", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3976, __FUNCTION__); _rtx; })->unchanging)
= 1;
3977 SET_SYMBOL_REF_CONSTANT (symbol, desc)(((void)(!((__extension__ ({ __typeof ((symbol)) const _rtx =
((symbol)); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF
) rtl_check_failed_flag ("CONSTANT_POOL_ADDRESS_P", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3977, __FUNCTION__); _rtx; })->unchanging)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3977, __FUNCTION__), 0 : 0)), ((((symbol))->u.fld[1]).rt_constant
) = (desc))
;
3978
3979 /* Construct the MEM. */
3980 desc->mem = def = gen_const_mem (mode, symbol);
3981 set_mem_align (def, align);
3982
3983 /* If we're dropping a label to the constant pool, make sure we
3984 don't delete it. */
3985 if (GET_CODE (x)((enum rtx_code) (x)->code) == LABEL_REF)
3986 LABEL_PRESERVE_P (XEXP (x, 0))(__extension__ ({ __typeof (((((x)->u.fld[0]).rt_rtx))) const
_rtx = (((((x)->u.fld[0]).rt_rtx))); if (((enum rtx_code)
(_rtx)->code) != CODE_LABEL && ((enum rtx_code) (
_rtx)->code) != NOTE) rtl_check_failed_flag ("LABEL_PRESERVE_P"
,_rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3986, __FUNCTION__); _rtx; })->in_struct)
= 1;
3987
3988 return copy_rtx (def);
3989}
3990
3991/* Given a constant pool SYMBOL_REF, return the corresponding constant. */
3992
3993rtx
3994get_pool_constant (const_rtx addr)
3995{
3996 return SYMBOL_REF_CONSTANT (addr)((__extension__ ({ __typeof ((addr)) const _rtx = ((addr)); if
(((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag
("CONSTANT_POOL_ADDRESS_P", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 3996, __FUNCTION__); _rtx; })->unchanging) ? ((((addr))->
u.fld[1]).rt_constant) : nullptr)
->constant;
3997}
3998
3999/* Given a constant pool SYMBOL_REF, return the corresponding constant
4000 and whether it has been output or not. */
4001
4002rtx
4003get_pool_constant_mark (rtx addr, bool *pmarked)
4004{
4005 class constant_descriptor_rtx *desc;
4006
4007 desc = SYMBOL_REF_CONSTANT (addr)((__extension__ ({ __typeof ((addr)) const _rtx = ((addr)); if
(((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag
("CONSTANT_POOL_ADDRESS_P", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4007, __FUNCTION__); _rtx; })->unchanging) ? ((((addr))->
u.fld[1]).rt_constant) : nullptr)
;
4008 *pmarked = (desc->mark != 0);
4009 return desc->constant;
4010}
4011
4012/* Similar, return the mode. */
4013
4014fixed_size_mode
4015get_pool_mode (const_rtx addr)
4016{
4017 return SYMBOL_REF_CONSTANT (addr)((__extension__ ({ __typeof ((addr)) const _rtx = ((addr)); if
(((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag
("CONSTANT_POOL_ADDRESS_P", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4017, __FUNCTION__); _rtx; })->unchanging) ? ((((addr))->
u.fld[1]).rt_constant) : nullptr)
->mode;
4018}
4019
4020/* Return TRUE if and only if the constant pool has no entries. Note
4021 that even entries we might end up choosing not to emit are counted
4022 here, so there is the potential for missed optimizations. */
4023
4024bool
4025constant_pool_empty_p (void)
4026{
4027 return crtl(&x_rtl)->varasm.pool->first == NULLnullptr;
4028}
4029
4030/* Worker function for output_constant_pool_1. Emit assembly for X
4031 in MODE with known alignment ALIGN. */
4032
4033static void
4034output_constant_pool_2 (fixed_size_mode mode, rtx x, unsigned int align)
4035{
4036 switch (GET_MODE_CLASS (mode)((enum mode_class) mode_class[mode]))
4037 {
4038 case MODE_FLOAT:
4039 case MODE_DECIMAL_FLOAT:
4040 {
4041 gcc_assert (CONST_DOUBLE_AS_FLOAT_P (x))((void)(!((((enum rtx_code) (x)->code) == CONST_DOUBLE &&
((machine_mode) (x)->mode) != ((void) 0, E_VOIDmode))) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4041, __FUNCTION__), 0 : 0))
;
4042 assemble_real (*CONST_DOUBLE_REAL_VALUE (x)((const struct real_value *) (&(x)->u.rv)),
4043 as_a <scalar_float_mode> (mode), align, false);
4044 break;
4045 }
4046
4047 case MODE_INT:
4048 case MODE_PARTIAL_INT:
4049 case MODE_FRACT:
4050 case MODE_UFRACT:
4051 case MODE_ACCUM:
4052 case MODE_UACCUM:
4053 assemble_integer (x, GET_MODE_SIZE (mode), align, 1);
4054 break;
4055
4056 case MODE_VECTOR_BOOL:
4057 {
4058 gcc_assert (GET_CODE (x) == CONST_VECTOR)((void)(!(((enum rtx_code) (x)->code) == CONST_VECTOR) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4058, __FUNCTION__), 0 : 0))
;
4059
4060 /* Pick the smallest integer mode that contains at least one
4061 whole element. Often this is byte_mode and contains more
4062 than one element. */
4063 unsigned int nelts = GET_MODE_NUNITS (mode);
4064 unsigned int elt_bits = GET_MODE_BITSIZE (mode) / nelts;
4065 unsigned int int_bits = MAX (elt_bits, BITS_PER_UNIT)((elt_bits) > ((8)) ? (elt_bits) : ((8)));
4066 scalar_int_mode int_mode = int_mode_for_size (int_bits, 0).require ();
4067
4068 /* Build the constant up one integer at a time. */
4069 unsigned int elts_per_int = int_bits / elt_bits;
4070 for (unsigned int i = 0; i < nelts; i += elts_per_int)
4071 {
4072 unsigned HOST_WIDE_INTlong value = 0;
4073 unsigned int limit = MIN (nelts - i, elts_per_int)((nelts - i) < (elts_per_int) ? (nelts - i) : (elts_per_int
))
;
4074 for (unsigned int j = 0; j < limit; ++j)
4075 if (INTVAL (CONST_VECTOR_ELT (x, i + j))((const_vector_elt (x, i + j))->u.hwint[0]) != 0)
4076 value |= 1 << (j * elt_bits);
4077 output_constant_pool_2 (int_mode, gen_int_mode (value, int_mode),
4078 i != 0 ? MIN (align, int_bits)((align) < (int_bits) ? (align) : (int_bits)) : align);
4079 }
4080 break;
4081 }
4082 case MODE_VECTOR_FLOAT:
4083 case MODE_VECTOR_INT:
4084 case MODE_VECTOR_FRACT:
4085 case MODE_VECTOR_UFRACT:
4086 case MODE_VECTOR_ACCUM:
4087 case MODE_VECTOR_UACCUM:
4088 {
4089 int i, units;
4090 scalar_mode submode = GET_MODE_INNER (mode)(mode_to_inner (mode));
4091 unsigned int subalign = MIN (align, GET_MODE_BITSIZE (submode))((align) < (GET_MODE_BITSIZE (submode)) ? (align) : (GET_MODE_BITSIZE
(submode)))
;
4092
4093 gcc_assert (GET_CODE (x) == CONST_VECTOR)((void)(!(((enum rtx_code) (x)->code) == CONST_VECTOR) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4093, __FUNCTION__), 0 : 0))
;
4094 units = GET_MODE_NUNITS (mode);
4095
4096 for (i = 0; i < units; i++)
4097 {
4098 rtx elt = CONST_VECTOR_ELT (x, i)const_vector_elt (x, i);
4099 output_constant_pool_2 (submode, elt, i ? subalign : align);
4100 }
4101 }
4102 break;
4103
4104 default:
4105 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4105, __FUNCTION__))
;
4106 }
4107}
4108
4109/* Worker function for output_constant_pool. Emit constant DESC,
4110 giving it ALIGN bits of alignment. */
4111
4112static void
4113output_constant_pool_1 (class constant_descriptor_rtx *desc,
4114 unsigned int align)
4115{
4116 rtx x, tmp;
4117
4118 x = desc->constant;
4119
4120 /* See if X is a LABEL_REF (or a CONST referring to a LABEL_REF)
4121 whose CODE_LABEL has been deleted. This can occur if a jump table
4122 is eliminated by optimization. If so, write a constant of zero
4123 instead. Note that this can also happen by turning the
4124 CODE_LABEL into a NOTE. */
4125 /* ??? This seems completely and utterly wrong. Certainly it's
4126 not true for NOTE_INSN_DELETED_LABEL, but I disbelieve proper
4127 functioning even with rtx_insn::deleted and friends. */
4128
4129 tmp = x;
4130 switch (GET_CODE (tmp)((enum rtx_code) (tmp)->code))
4131 {
4132 case CONST:
4133 if (GET_CODE (XEXP (tmp, 0))((enum rtx_code) ((((tmp)->u.fld[0]).rt_rtx))->code) != PLUS
4134 || GET_CODE (XEXP (XEXP (tmp, 0), 0))((enum rtx_code) (((((((tmp)->u.fld[0]).rt_rtx))->u.fld
[0]).rt_rtx))->code)
!= LABEL_REF)
4135 break;
4136 tmp = XEXP (XEXP (tmp, 0), 0)((((((tmp)->u.fld[0]).rt_rtx))->u.fld[0]).rt_rtx);
4137 /* FALLTHRU */
4138
4139 case LABEL_REF:
4140 {
4141 rtx_insn *insn = label_ref_label (tmp);
4142 gcc_assert (!insn->deleted ())((void)(!(!insn->deleted ()) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4142, __FUNCTION__), 0 : 0))
;
4143 gcc_assert (!NOTE_P (insn)((void)(!(!(((enum rtx_code) (insn)->code) == NOTE) || (((
insn)->u.fld[4]).rt_int) != NOTE_INSN_DELETED) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4144, __FUNCTION__), 0 : 0))
4144 || NOTE_KIND (insn) != NOTE_INSN_DELETED)((void)(!(!(((enum rtx_code) (insn)->code) == NOTE) || (((
insn)->u.fld[4]).rt_int) != NOTE_INSN_DELETED) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4144, __FUNCTION__), 0 : 0))
;
4145 break;
4146 }
4147
4148 default:
4149 break;
4150 }
4151
4152#ifdef ASM_OUTPUT_SPECIAL_POOL_ENTRY
4153 ASM_OUTPUT_SPECIAL_POOL_ENTRY (asm_out_file, x, desc->mode,
4154 align, desc->labelno, done);
4155#endif
4156
4157 assemble_align (align);
4158
4159 /* Output the label. */
4160 targetm.asm_out.internal_label (asm_out_file, "LC", desc->labelno);
4161
4162 /* Output the data.
4163 Pass actual alignment value while emitting string constant to asm code
4164 as function 'output_constant_pool_1' explicitly passes the alignment as 1
4165 assuming that the data is already aligned which prevents the generation
4166 of fix-up table entries. */
4167 output_constant_pool_2 (desc->mode, x, desc->align);
4168
4169 /* Make sure all constants in SECTION_MERGE and not SECTION_STRINGS
4170 sections have proper size. */
4171 if (align > GET_MODE_BITSIZE (desc->mode)
4172 && in_section
4173 && (in_section->common.flags & SECTION_MERGE0x08000))
4174 assemble_align (align);
4175
4176#ifdef ASM_OUTPUT_SPECIAL_POOL_ENTRY
4177 done:
4178#endif
4179 return;
4180}
4181
4182/* Recompute the offsets of entries in POOL, and the overall size of
4183 POOL. Do this after calling mark_constant_pool to ensure that we
4184 are computing the offset values for the pool which we will actually
4185 emit. */
4186
4187static void
4188recompute_pool_offsets (struct rtx_constant_pool *pool)
4189{
4190 class constant_descriptor_rtx *desc;
4191 pool->offset = 0;
4192
4193 for (desc = pool->first; desc ; desc = desc->next)
4194 if (desc->mark)
4195 {
4196 /* Recalculate offset. */
4197 unsigned int align = desc->align;
4198 pool->offset += (align / BITS_PER_UNIT(8)) - 1;
4199 pool->offset &= ~ ((align / BITS_PER_UNIT(8)) - 1);
4200 desc->offset = pool->offset;
4201 pool->offset += GET_MODE_SIZE (desc->mode);
4202 }
4203}
4204
4205/* Mark all constants that are referenced by SYMBOL_REFs in X.
4206 Emit referenced deferred strings. */
4207
4208static void
4209mark_constants_in_pattern (rtx insn)
4210{
4211 subrtx_iterator::array_type array;
4212 FOR_EACH_SUBRTX (iter, array, PATTERN (insn), ALL)for (subrtx_iterator iter (array, PATTERN (insn), rtx_all_subrtx_bounds
); !iter.at_end (); iter.next ())
4213 {
4214 const_rtx x = *iter;
4215 if (GET_CODE (x)((enum rtx_code) (x)->code) == SYMBOL_REF)
4216 {
4217 if (CONSTANT_POOL_ADDRESS_P (x)(__extension__ ({ __typeof ((x)) const _rtx = ((x)); if (((enum
rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag
("CONSTANT_POOL_ADDRESS_P", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4217, __FUNCTION__); _rtx; })->unchanging)
)
4218 {
4219 class constant_descriptor_rtx *desc = SYMBOL_REF_CONSTANT (x)((__extension__ ({ __typeof ((x)) const _rtx = ((x)); if (((enum
rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag
("CONSTANT_POOL_ADDRESS_P", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4219, __FUNCTION__); _rtx; })->unchanging) ? ((((x))->
u.fld[1]).rt_constant) : nullptr)
;
4220 if (desc->mark == 0)
4221 {
4222 desc->mark = 1;
4223 iter.substitute (desc->constant);
4224 }
4225 }
4226 else if (TREE_CONSTANT_POOL_ADDRESS_P (x)(__extension__ ({ __typeof ((x)) const _rtx = ((x)); if (((enum
rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag
("TREE_CONSTANT_POOL_ADDRESS_P", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4226, __FUNCTION__); _rtx; })->frame_related)
)
4227 {
4228 tree decl = SYMBOL_REF_DECL (x)((__extension__ ({ __typeof ((x)) const _rtx = ((x)); if (((enum
rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag
("CONSTANT_POOL_ADDRESS_P", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4228, __FUNCTION__); _rtx; })->unchanging) ? nullptr : (
(((x))->u.fld[1]).rt_tree))
;
4229 if (!TREE_ASM_WRITTEN (DECL_INITIAL (decl))((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4229, __FUNCTION__))->decl_common.initial))->base.asm_written_flag
)
)
4230 {
4231 n_deferred_constants((&x_rtl)->varasm.deferred_constants)--;
4232 output_constant_def_contents (CONST_CAST_RTX (x)(const_cast<struct rtx_def *> (((x)))));
4233 }
4234 }
4235 }
4236 }
4237}
4238
4239/* Look through appropriate parts of INSN, marking all entries in the
4240 constant pool which are actually being used. Entries that are only
4241 referenced by other constants are also marked as used. Emit
4242 deferred strings that are used. */
4243
4244static void
4245mark_constants (rtx_insn *insn)
4246{
4247 if (!INSN_P (insn)(((((enum rtx_code) (insn)->code) == INSN) || (((enum rtx_code
) (insn)->code) == JUMP_INSN) || (((enum rtx_code) (insn)->
code) == CALL_INSN)) || (((enum rtx_code) (insn)->code) ==
DEBUG_INSN))
)
4248 return;
4249
4250 /* Insns may appear inside a SEQUENCE. Only check the patterns of
4251 insns, not any notes that may be attached. We don't want to mark
4252 a constant just because it happens to appear in a REG_EQUIV note. */
4253 if (rtx_sequence *seq = dyn_cast <rtx_sequence *> (PATTERN (insn)))
4254 {
4255 int i, n = seq->len ();
4256 for (i = 0; i < n; ++i)
4257 {
4258 rtx subinsn = seq->element (i);
4259 if (INSN_P (subinsn)(((((enum rtx_code) (subinsn)->code) == INSN) || (((enum rtx_code
) (subinsn)->code) == JUMP_INSN) || (((enum rtx_code) (subinsn
)->code) == CALL_INSN)) || (((enum rtx_code) (subinsn)->
code) == DEBUG_INSN))
)
4260 mark_constants_in_pattern (subinsn);
4261 }
4262 }
4263 else
4264 mark_constants_in_pattern (insn);
4265}
4266
4267/* Look through the instructions for this function, and mark all the
4268 entries in POOL which are actually being used. Emit deferred constants
4269 which have indeed been used. */
4270
4271static void
4272mark_constant_pool (void)
4273{
4274 rtx_insn *insn;
4275
4276 if (!crtl(&x_rtl)->uses_const_pool && n_deferred_constants((&x_rtl)->varasm.deferred_constants) == 0)
4277 return;
4278
4279 for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
4280 mark_constants (insn);
4281}
4282
4283/* Write all the constants in POOL. */
4284
4285static void
4286output_constant_pool_contents (struct rtx_constant_pool *pool)
4287{
4288 class constant_descriptor_rtx *desc;
4289
4290 for (desc = pool->first; desc ; desc = desc->next)
4291 if (desc->mark < 0)
4292 {
4293#ifdef ASM_OUTPUT_DEF
4294 const char *name = targetm.strip_name_encoding (XSTR (desc->sym, 0)(((desc->sym)->u.fld[0]).rt_str));
4295 char label[256];
4296 char buffer[256 + 32];
4297 const char *p;
4298
4299 ASM_GENERATE_INTERNAL_LABEL (label, "LC", ~desc->mark)do { char *__p; (label)[0] = '*'; (label)[1] = '.'; __p = stpcpy
(&(label)[2], "LC"); sprint_ul (__p, (unsigned long) (~desc
->mark)); } while (0)
;
4300 p = targetm.strip_name_encoding (label);
4301 if (desc->offset)
4302 {
4303 sprintf (buffer, "%s+%ld", p, (long) (desc->offset));
4304 p = buffer;
4305 }
4306 ASM_OUTPUT_DEF (asm_out_file, name, p)do { fprintf ((asm_out_file), "%s", "\t.set\t"); assemble_name
(asm_out_file, name); fprintf (asm_out_file, ","); assemble_name
(asm_out_file, p); fprintf (asm_out_file, "\n"); } while (0)
;
4307#else
4308 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4308, __FUNCTION__))
;
4309#endif
4310 }
4311 else if (desc->mark)
4312 {
4313 /* If the constant is part of an object_block, make sure that
4314 the constant has been positioned within its block, but do not
4315 write out its definition yet. output_object_blocks will do
4316 that later. */
4317 if (SYMBOL_REF_HAS_BLOCK_INFO_P (desc->sym)(((__extension__ ({ __typeof ((desc->sym)) const _rtx = ((
desc->sym)); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF
) rtl_check_failed_flag ("SYMBOL_REF_FLAGS", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4317, __FUNCTION__); _rtx; }) ->u2.symbol_ref_flags) &
(1 << 7)) != 0)
4318 && SYMBOL_REF_BLOCK (desc->sym)((&(desc->sym)->u.block_sym)->block))
4319 place_block_symbol (desc->sym);
4320 else
4321 {
4322 switch_to_section (targetm.asm_out.select_rtx_section
4323 (desc->mode, desc->constant, desc->align));
4324 output_constant_pool_1 (desc, desc->align);
4325 }
4326 }
4327}
4328
4329struct constant_descriptor_rtx_data {
4330 constant_descriptor_rtx *desc;
4331 target_unit *bytes;
4332 unsigned short size;
4333 unsigned short offset;
4334 unsigned int hash;
4335};
4336
4337/* qsort callback to sort constant_descriptor_rtx_data * vector by
4338 decreasing size. */
4339
4340static int
4341constant_descriptor_rtx_data_cmp (const void *p1, const void *p2)
4342{
4343 constant_descriptor_rtx_data *const data1
4344 = *(constant_descriptor_rtx_data * const *) p1;
4345 constant_descriptor_rtx_data *const data2
4346 = *(constant_descriptor_rtx_data * const *) p2;
4347 if (data1->size > data2->size)
4348 return -1;
4349 if (data1->size < data2->size)
4350 return 1;
4351 if (data1->hash < data2->hash)
4352 return -1;
4353 gcc_assert (data1->hash > data2->hash)((void)(!(data1->hash > data2->hash) ? fancy_abort (
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4353, __FUNCTION__), 0 : 0))
;
4354 return 1;
4355}
4356
4357struct const_rtx_data_hasher : nofree_ptr_hash<constant_descriptor_rtx_data>
4358{
4359 static hashval_t hash (constant_descriptor_rtx_data *);
4360 static bool equal (constant_descriptor_rtx_data *,
4361 constant_descriptor_rtx_data *);
4362};
4363
4364/* Hash and compare functions for const_rtx_data_htab. */
4365
4366hashval_t
4367const_rtx_data_hasher::hash (constant_descriptor_rtx_data *data)
4368{
4369 return data->hash;
4370}
4371
4372bool
4373const_rtx_data_hasher::equal (constant_descriptor_rtx_data *x,
4374 constant_descriptor_rtx_data *y)
4375{
4376 if (x->hash != y->hash || x->size != y->size)
4377 return 0;
4378 unsigned int align1 = x->desc->align;
4379 unsigned int align2 = y->desc->align;
4380 unsigned int offset1 = (x->offset * BITS_PER_UNIT(8)) & (align1 - 1);
4381 unsigned int offset2 = (y->offset * BITS_PER_UNIT(8)) & (align2 - 1);
4382 if (offset1)
4383 align1 = least_bit_hwi (offset1);
4384 if (offset2)
4385 align2 = least_bit_hwi (offset2);
4386 if (align2 > align1)
4387 return 0;
4388 if (memcmp (x->bytes, y->bytes, x->size * sizeof (target_unit)) != 0)
4389 return 0;
4390 return 1;
4391}
4392
4393/* Attempt to optimize constant pool POOL. If it contains both CONST_VECTOR
4394 constants and scalar constants with the values of CONST_VECTOR elements,
4395 try to alias the scalar constants with the CONST_VECTOR elements. */
4396
4397static void
4398optimize_constant_pool (struct rtx_constant_pool *pool)
4399{
4400 auto_vec<target_unit, 128> buffer;
4401 auto_vec<constant_descriptor_rtx_data *, 128> vec;
4402 object_allocator<constant_descriptor_rtx_data>
4403 data_pool ("constant_descriptor_rtx_data_pool");
4404 int idx = 0;
4405 size_t size = 0;
4406 for (constant_descriptor_rtx *desc = pool->first; desc; desc = desc->next)
4407 if (desc->mark > 0
4408 && ! (SYMBOL_REF_HAS_BLOCK_INFO_P (desc->sym)(((__extension__ ({ __typeof ((desc->sym)) const _rtx = ((
desc->sym)); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF
) rtl_check_failed_flag ("SYMBOL_REF_FLAGS", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4408, __FUNCTION__); _rtx; }) ->u2.symbol_ref_flags) &
(1 << 7)) != 0)
4409 && SYMBOL_REF_BLOCK (desc->sym)((&(desc->sym)->u.block_sym)->block)))
4410 {
4411 buffer.truncate (0);
4412 buffer.reserve (GET_MODE_SIZE (desc->mode));
4413 if (native_encode_rtx (desc->mode, desc->constant, buffer, 0,
4414 GET_MODE_SIZE (desc->mode)))
4415 {
4416 constant_descriptor_rtx_data *data = data_pool.allocate ();
4417 data->desc = desc;
4418 data->bytes = NULLnullptr;
4419 data->size = GET_MODE_SIZE (desc->mode);
4420 data->offset = 0;
4421 data->hash = idx++;
4422 size += data->size;
4423 vec.safe_push (data);
4424 }
4425 }
4426 if (idx)
4427 {
4428 vec.qsort (constant_descriptor_rtx_data_cmp)qsort (constant_descriptor_rtx_data_cmp);
4429 unsigned min_size = vec.last ()->size;
4430 target_unit *bytes = XNEWVEC (target_unit, size)((target_unit *) xmalloc (sizeof (target_unit) * (size)));
4431 unsigned int i;
4432 constant_descriptor_rtx_data *data;
4433 hash_table<const_rtx_data_hasher> * htab
4434 = new hash_table<const_rtx_data_hasher> (31);
4435 size = 0;
4436 FOR_EACH_VEC_ELT (vec, i, data)for (i = 0; (vec).iterate ((i), &(data)); ++(i))
4437 {
4438 buffer.truncate (0);
4439 native_encode_rtx (data->desc->mode, data->desc->constant,
4440 buffer, 0, data->size);
4441 memcpy (bytes + size, buffer.address (), data->size);
4442 data->bytes = bytes + size;
4443 data->hash = iterative_hash (data->bytes,
4444 data->size * sizeof (target_unit), 0);
4445 size += data->size;
4446 constant_descriptor_rtx_data **slot
4447 = htab->find_slot_with_hash (data, data->hash, INSERT);
4448 if (*slot)
4449 {
4450 data->desc->mark = ~(*slot)->desc->labelno;
4451 data->desc->offset = (*slot)->offset;
4452 }
4453 else
4454 {
4455 unsigned int sz = 1 << floor_log2 (data->size);
4456
4457 *slot = data;
4458 for (sz >>= 1; sz >= min_size; sz >>= 1)
4459 for (unsigned off = 0; off + sz <= data->size; off += sz)
4460 {
4461 constant_descriptor_rtx_data tmp;
4462 tmp.desc = data->desc;
4463 tmp.bytes = data->bytes + off;
4464 tmp.size = sz;
4465 tmp.offset = off;
4466 tmp.hash = iterative_hash (tmp.bytes,
4467 sz * sizeof (target_unit), 0);
4468 slot = htab->find_slot_with_hash (&tmp, tmp.hash, INSERT);
4469 if (*slot == NULLnullptr)
4470 {
4471 *slot = data_pool.allocate ();
4472 **slot = tmp;
4473 }
4474 }
4475 }
4476 }
4477 delete htab;
4478 XDELETE (bytes)free ((void*) (bytes));
4479 }
4480 data_pool.release ();
4481}
4482
4483/* Mark all constants that are used in the current function, then write
4484 out the function's private constant pool. */
4485
4486static void
4487output_constant_pool (const char *fnname ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
4488 tree fndecl ATTRIBUTE_UNUSED__attribute__ ((__unused__)))
4489{
4490 struct rtx_constant_pool *pool = crtl(&x_rtl)->varasm.pool;
4491
4492 /* It is possible for gcc to call force_const_mem and then to later
4493 discard the instructions which refer to the constant. In such a
4494 case we do not need to output the constant. */
4495 mark_constant_pool ();
4496
4497 /* Having marked the constant pool entries we'll actually emit, we
4498 now need to rebuild the offset information, which may have become
4499 stale. */
4500 recompute_pool_offsets (pool);
4501
4502#ifdef ASM_OUTPUT_POOL_PROLOGUE
4503 ASM_OUTPUT_POOL_PROLOGUE (asm_out_file, fnname, fndecl, pool->offset);
4504#endif
4505
4506 output_constant_pool_contents (pool);
4507
4508#ifdef ASM_OUTPUT_POOL_EPILOGUE
4509 ASM_OUTPUT_POOL_EPILOGUE (asm_out_file, fnname, fndecl, pool->offset);
4510#endif
4511}
4512
4513/* Write the contents of the shared constant pool. */
4514
4515void
4516output_shared_constant_pool (void)
4517{
4518 if (optimizeglobal_options.x_optimize
4519 && TARGET_SUPPORTS_ALIASES1)
4520 optimize_constant_pool (shared_constant_pool);
4521
4522 output_constant_pool_contents (shared_constant_pool);
4523}
4524
4525/* Determine what kind of relocations EXP may need. */
4526
4527int
4528compute_reloc_for_constant (tree exp)
4529{
4530 int reloc = 0, reloc2;
4531 tree tem;
4532
4533 switch (TREE_CODE (exp)((enum tree_code) (exp)->base.code))
4534 {
4535 case ADDR_EXPR:
4536 case FDESC_EXPR:
4537 /* Go inside any operations that get_inner_reference can handle and see
4538 if what's inside is a constant: no need to do anything here for
4539 addresses of variables or functions. */
4540 for (tem = TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4540, __FUNCTION__)))))
; handled_component_p (tem);
4541 tem = TREE_OPERAND (tem, 0)(*((const_cast<tree*> (tree_operand_check ((tem), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4541, __FUNCTION__)))))
)
4542 ;
4543
4544 if (TREE_CODE (tem)((enum tree_code) (tem)->base.code) == MEM_REF
4545 && TREE_CODE (TREE_OPERAND (tem, 0))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((tem), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4545, __FUNCTION__))))))->base.code)
== ADDR_EXPR)
4546 {
4547 reloc = compute_reloc_for_constant (TREE_OPERAND (tem, 0)(*((const_cast<tree*> (tree_operand_check ((tem), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4547, __FUNCTION__)))))
);
4548 break;
4549 }
4550
4551 if (!targetm.binds_local_p (tem))
4552 reloc |= 2;
4553 else
4554 reloc |= 1;
4555 break;
4556
4557 case PLUS_EXPR:
4558 case POINTER_PLUS_EXPR:
4559 reloc = compute_reloc_for_constant (TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4559, __FUNCTION__)))))
);
4560 reloc |= compute_reloc_for_constant (TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4560, __FUNCTION__)))))
);
4561 break;
4562
4563 case MINUS_EXPR:
4564 reloc = compute_reloc_for_constant (TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4564, __FUNCTION__)))))
);
4565 reloc2 = compute_reloc_for_constant (TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4565, __FUNCTION__)))))
);
4566 /* The difference of two local labels is computable at link time. */
4567 if (reloc == 1 && reloc2 == 1)
4568 reloc = 0;
4569 else
4570 reloc |= reloc2;
4571 break;
4572
4573 CASE_CONVERTcase NOP_EXPR: case CONVERT_EXPR:
4574 case VIEW_CONVERT_EXPR:
4575 reloc = compute_reloc_for_constant (TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4575, __FUNCTION__)))))
);
4576 break;
4577
4578 case CONSTRUCTOR:
4579 {
4580 unsigned HOST_WIDE_INTlong idx;
4581 FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (exp), idx, tem)for (idx = 0; (idx >= vec_safe_length (((tree_check ((exp)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4581, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)))
? false : ((tem = (*(((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4581, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)))
[idx].value), true); (idx)++)
4582 if (tem != 0)
4583 reloc |= compute_reloc_for_constant (tem);
4584 }
4585 break;
4586
4587 default:
4588 break;
4589 }
4590 return reloc;
4591}
4592
4593/* Find all the constants whose addresses are referenced inside of EXP,
4594 and make sure assembler code with a label has been output for each one.
4595 Indicate whether an ADDR_EXPR has been encountered. */
4596
4597static void
4598output_addressed_constants (tree exp, int defer)
4599{
4600 tree tem;
4601
4602 switch (TREE_CODE (exp)((enum tree_code) (exp)->base.code))
4603 {
4604 case ADDR_EXPR:
4605 case FDESC_EXPR:
4606 /* Go inside any operations that get_inner_reference can handle and see
4607 if what's inside is a constant: no need to do anything here for
4608 addresses of variables or functions. */
4609 for (tem = TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4609, __FUNCTION__)))))
; handled_component_p (tem);
4610 tem = TREE_OPERAND (tem, 0)(*((const_cast<tree*> (tree_operand_check ((tem), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4610, __FUNCTION__)))))
)
4611 ;
4612
4613 /* If we have an initialized CONST_DECL, retrieve the initializer. */
4614 if (TREE_CODE (tem)((enum tree_code) (tem)->base.code) == CONST_DECL && DECL_INITIAL (tem)((contains_struct_check ((tem), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4614, __FUNCTION__))->decl_common.initial)
)
4615 tem = DECL_INITIAL (tem)((contains_struct_check ((tem), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4615, __FUNCTION__))->decl_common.initial)
;
4616
4617 if (CONSTANT_CLASS_P (tem)(tree_code_type[(int) (((enum tree_code) (tem)->base.code)
)] == tcc_constant)
|| TREE_CODE (tem)((enum tree_code) (tem)->base.code) == CONSTRUCTOR)
4618 output_constant_def (tem, defer);
4619
4620 if (TREE_CODE (tem)((enum tree_code) (tem)->base.code) == MEM_REF)
4621 output_addressed_constants (TREE_OPERAND (tem, 0)(*((const_cast<tree*> (tree_operand_check ((tem), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4621, __FUNCTION__)))))
, defer);
4622 break;
4623
4624 case PLUS_EXPR:
4625 case POINTER_PLUS_EXPR:
4626 case MINUS_EXPR:
4627 output_addressed_constants (TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4627, __FUNCTION__)))))
, defer);
4628 gcc_fallthrough ();
4629
4630 CASE_CONVERTcase NOP_EXPR: case CONVERT_EXPR:
4631 case VIEW_CONVERT_EXPR:
4632 output_addressed_constants (TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4632, __FUNCTION__)))))
, defer);
4633 break;
4634
4635 case CONSTRUCTOR:
4636 {
4637 unsigned HOST_WIDE_INTlong idx;
4638 FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (exp), idx, tem)for (idx = 0; (idx >= vec_safe_length (((tree_check ((exp)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4638, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)))
? false : ((tem = (*(((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4638, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)))
[idx].value), true); (idx)++)
4639 if (tem != 0)
4640 output_addressed_constants (tem, defer);
4641 }
4642 break;
4643
4644 default:
4645 break;
4646 }
4647}
4648
4649/* Whether a constructor CTOR is a valid static constant initializer if all
4650 its elements are. This used to be internal to initializer_constant_valid_p
4651 and has been exposed to let other functions like categorize_ctor_elements
4652 evaluate the property while walking a constructor for other purposes. */
4653
4654bool
4655constructor_static_from_elts_p (const_tree ctor)
4656{
4657 return (TREE_CONSTANT (ctor)((non_type_check ((ctor), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4657, __FUNCTION__))->base.constant_flag)
4658 && (TREE_CODE (TREE_TYPE (ctor))((enum tree_code) (((contains_struct_check ((ctor), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4658, __FUNCTION__))->typed.type))->base.code)
== UNION_TYPE
4659 || TREE_CODE (TREE_TYPE (ctor))((enum tree_code) (((contains_struct_check ((ctor), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4659, __FUNCTION__))->typed.type))->base.code)
== RECORD_TYPE
4660 || TREE_CODE (TREE_TYPE (ctor))((enum tree_code) (((contains_struct_check ((ctor), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4660, __FUNCTION__))->typed.type))->base.code)
== ARRAY_TYPE));
4661}
4662
4663static tree initializer_constant_valid_p_1 (tree value, tree endtype,
4664 tree *cache);
4665
4666/* A subroutine of initializer_constant_valid_p. VALUE is a MINUS_EXPR,
4667 PLUS_EXPR or POINTER_PLUS_EXPR. This looks for cases of VALUE
4668 which are valid when ENDTYPE is an integer of any size; in
4669 particular, this does not accept a pointer minus a constant. This
4670 returns null_pointer_node if the VALUE is an absolute constant
4671 which can be used to initialize a static variable. Otherwise it
4672 returns NULL. */
4673
4674static tree
4675narrowing_initializer_constant_valid_p (tree value, tree endtype, tree *cache)
4676{
4677 tree op0, op1;
4678
4679 if (!INTEGRAL_TYPE_P (endtype)(((enum tree_code) (endtype)->base.code) == ENUMERAL_TYPE ||
((enum tree_code) (endtype)->base.code) == BOOLEAN_TYPE ||
((enum tree_code) (endtype)->base.code) == INTEGER_TYPE)
)
4680 return NULL_TREE(tree) nullptr;
4681
4682 op0 = TREE_OPERAND (value, 0)(*((const_cast<tree*> (tree_operand_check ((value), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4682, __FUNCTION__)))))
;
4683 op1 = TREE_OPERAND (value, 1)(*((const_cast<tree*> (tree_operand_check ((value), (1)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4683, __FUNCTION__)))))
;
4684
4685 /* Like STRIP_NOPS except allow the operand mode to widen. This
4686 works around a feature of fold that simplifies (int)(p1 - p2) to
4687 ((int)p1 - (int)p2) under the theory that the narrower operation
4688 is cheaper. */
4689
4690 while (CONVERT_EXPR_P (op0)((((enum tree_code) (op0)->base.code)) == NOP_EXPR || (((enum
tree_code) (op0)->base.code)) == CONVERT_EXPR)
4691 || TREE_CODE (op0)((enum tree_code) (op0)->base.code) == NON_LVALUE_EXPR)
4692 {
4693 tree inner = TREE_OPERAND (op0, 0)(*((const_cast<tree*> (tree_operand_check ((op0), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4693, __FUNCTION__)))))
;
4694 if (inner == error_mark_nodeglobal_trees[TI_ERROR_MARK]
4695 || ! INTEGRAL_MODE_P (TYPE_MODE (TREE_TYPE (inner)))(((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check
((((contains_struct_check ((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4695, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4695, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4695, __FUNCTION__))->typed.type)) : (((contains_struct_check
((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4695, __FUNCTION__))->typed.type))->type_common.mode)
]) == MODE_INT || ((enum mode_class) mode_class[((((enum tree_code
) ((tree_class_check ((((contains_struct_check ((inner), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4695, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4695, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4695, __FUNCTION__))->typed.type)) : (((contains_struct_check
((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4695, __FUNCTION__))->typed.type))->type_common.mode)
]) == MODE_PARTIAL_INT || ((enum mode_class) mode_class[((((enum
tree_code) ((tree_class_check ((((contains_struct_check ((inner
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4695, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4695, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4695, __FUNCTION__))->typed.type)) : (((contains_struct_check
((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4695, __FUNCTION__))->typed.type))->type_common.mode)
]) == MODE_COMPLEX_INT || ((enum mode_class) mode_class[((((enum
tree_code) ((tree_class_check ((((contains_struct_check ((inner
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4695, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4695, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4695, __FUNCTION__))->typed.type)) : (((contains_struct_check
((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4695, __FUNCTION__))->typed.type))->type_common.mode)
]) == MODE_VECTOR_BOOL || ((enum mode_class) mode_class[((((enum
tree_code) ((tree_class_check ((((contains_struct_check ((inner
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4695, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4695, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4695, __FUNCTION__))->typed.type)) : (((contains_struct_check
((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4695, __FUNCTION__))->typed.type))->type_common.mode)
]) == MODE_VECTOR_INT)
4696 || (GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (TREE_TYPE (op0))(as_a <scalar_int_mode> ((tree_class_check ((((contains_struct_check
((op0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4696, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4696, __FUNCTION__))->type_common.mode))
)
4697 > GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (TREE_TYPE (inner))(as_a <scalar_int_mode> ((tree_class_check ((((contains_struct_check
((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4697, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4697, __FUNCTION__))->type_common.mode))
)))
4698 break;
4699 op0 = inner;
4700 }
4701
4702 while (CONVERT_EXPR_P (op1)((((enum tree_code) (op1)->base.code)) == NOP_EXPR || (((enum
tree_code) (op1)->base.code)) == CONVERT_EXPR)
4703 || TREE_CODE (op1)((enum tree_code) (op1)->base.code) == NON_LVALUE_EXPR)
4704 {
4705 tree inner = TREE_OPERAND (op1, 0)(*((const_cast<tree*> (tree_operand_check ((op1), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4705, __FUNCTION__)))))
;
4706 if (inner == error_mark_nodeglobal_trees[TI_ERROR_MARK]
4707 || ! INTEGRAL_MODE_P (TYPE_MODE (TREE_TYPE (inner)))(((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check
((((contains_struct_check ((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4707, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4707, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4707, __FUNCTION__))->typed.type)) : (((contains_struct_check
((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4707, __FUNCTION__))->typed.type))->type_common.mode)
]) == MODE_INT || ((enum mode_class) mode_class[((((enum tree_code
) ((tree_class_check ((((contains_struct_check ((inner), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4707, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4707, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4707, __FUNCTION__))->typed.type)) : (((contains_struct_check
((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4707, __FUNCTION__))->typed.type))->type_common.mode)
]) == MODE_PARTIAL_INT || ((enum mode_class) mode_class[((((enum
tree_code) ((tree_class_check ((((contains_struct_check ((inner
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4707, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4707, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4707, __FUNCTION__))->typed.type)) : (((contains_struct_check
((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4707, __FUNCTION__))->typed.type))->type_common.mode)
]) == MODE_COMPLEX_INT || ((enum mode_class) mode_class[((((enum
tree_code) ((tree_class_check ((((contains_struct_check ((inner
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4707, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4707, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4707, __FUNCTION__))->typed.type)) : (((contains_struct_check
((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4707, __FUNCTION__))->typed.type))->type_common.mode)
]) == MODE_VECTOR_BOOL || ((enum mode_class) mode_class[((((enum
tree_code) ((tree_class_check ((((contains_struct_check ((inner
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4707, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4707, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4707, __FUNCTION__))->typed.type)) : (((contains_struct_check
((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4707, __FUNCTION__))->typed.type))->type_common.mode)
]) == MODE_VECTOR_INT)
4708 || (GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (TREE_TYPE (op1))(as_a <scalar_int_mode> ((tree_class_check ((((contains_struct_check
((op1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4708, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4708, __FUNCTION__))->type_common.mode))
)
4709 > GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (TREE_TYPE (inner))(as_a <scalar_int_mode> ((tree_class_check ((((contains_struct_check
((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4709, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4709, __FUNCTION__))->type_common.mode))
)))
4710 break;
4711 op1 = inner;
4712 }
4713
4714 op0 = initializer_constant_valid_p_1 (op0, endtype, cache);
4715 if (!op0)
4716 return NULL_TREE(tree) nullptr;
4717
4718 op1 = initializer_constant_valid_p_1 (op1, endtype,
4719 cache ? cache + 2 : NULLnullptr);
4720 /* Both initializers must be known. */
4721 if (op1)
4722 {
4723 if (op0 == op1
4724 && (op0 == null_pointer_nodeglobal_trees[TI_NULL_POINTER]
4725 || TREE_CODE (value)((enum tree_code) (value)->base.code) == MINUS_EXPR))
4726 return null_pointer_nodeglobal_trees[TI_NULL_POINTER];
4727
4728 /* Support differences between labels. */
4729 if (TREE_CODE (op0)((enum tree_code) (op0)->base.code) == LABEL_DECL
4730 && TREE_CODE (op1)((enum tree_code) (op1)->base.code) == LABEL_DECL)
4731 return null_pointer_nodeglobal_trees[TI_NULL_POINTER];
4732
4733 if (TREE_CODE (op0)((enum tree_code) (op0)->base.code) == STRING_CST
4734 && TREE_CODE (op1)((enum tree_code) (op1)->base.code) == STRING_CST
4735 && operand_equal_p (op0, op1, 1))
4736 return null_pointer_nodeglobal_trees[TI_NULL_POINTER];
4737 }
4738
4739 return NULL_TREE(tree) nullptr;
4740}
4741
4742/* Helper function of initializer_constant_valid_p.
4743 Return nonzero if VALUE is a valid constant-valued expression
4744 for use in initializing a static variable; one that can be an
4745 element of a "constant" initializer.
4746
4747 Return null_pointer_node if the value is absolute;
4748 if it is relocatable, return the variable that determines the relocation.
4749 We assume that VALUE has been folded as much as possible;
4750 therefore, we do not need to check for such things as
4751 arithmetic-combinations of integers.
4752
4753 Use CACHE (pointer to 2 tree values) for caching if non-NULL. */
4754
4755static tree
4756initializer_constant_valid_p_1 (tree value, tree endtype, tree *cache)
4757{
4758 tree ret;
4759
4760 switch (TREE_CODE (value)((enum tree_code) (value)->base.code))
4761 {
4762 case CONSTRUCTOR:
4763 if (constructor_static_from_elts_p (value))
4764 {
4765 unsigned HOST_WIDE_INTlong idx;
4766 tree elt;
4767 bool absolute = true;
4768
4769 if (cache && cache[0] == value)
4770 return cache[1];
4771 FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (value), idx, elt)for (idx = 0; (idx >= vec_safe_length (((tree_check ((value
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4771, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)))
? false : ((elt = (*(((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4771, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)))
[idx].value), true); (idx)++)
4772 {
4773 tree reloc;
4774 reloc = initializer_constant_valid_p_1 (elt, TREE_TYPE (elt)((contains_struct_check ((elt), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4774, __FUNCTION__))->typed.type)
,
4775 NULLnullptr);
4776 if (!reloc
4777 /* An absolute value is required with reverse SSO. */
4778 || (reloc != null_pointer_nodeglobal_trees[TI_NULL_POINTER]
4779 && TYPE_REVERSE_STORAGE_ORDER (TREE_TYPE (value))((tree_check4 ((((contains_struct_check ((value), (TS_TYPED),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4779, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4779, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
), (ARRAY_TYPE)))->base.u.bits.saturating_flag)
4780 && !AGGREGATE_TYPE_P (TREE_TYPE (elt))(((enum tree_code) (((contains_struct_check ((elt), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4780, __FUNCTION__))->typed.type))->base.code) == ARRAY_TYPE
|| (((enum tree_code) (((contains_struct_check ((elt), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4780, __FUNCTION__))->typed.type))->base.code) == RECORD_TYPE
|| ((enum tree_code) (((contains_struct_check ((elt), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4780, __FUNCTION__))->typed.type))->base.code) == UNION_TYPE
|| ((enum tree_code) (((contains_struct_check ((elt), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4780, __FUNCTION__))->typed.type))->base.code) == QUAL_UNION_TYPE
))
))
4781 {
4782 if (cache)
4783 {
4784 cache[0] = value;
4785 cache[1] = NULL_TREE(tree) nullptr;
4786 }
4787 return NULL_TREE(tree) nullptr;
4788 }
4789 if (reloc != null_pointer_nodeglobal_trees[TI_NULL_POINTER])
4790 absolute = false;
4791 }
4792 /* For a non-absolute relocation, there is no single
4793 variable that can be "the variable that determines the
4794 relocation." */
4795 if (cache)
4796 {
4797 cache[0] = value;
4798 cache[1] = absolute ? null_pointer_nodeglobal_trees[TI_NULL_POINTER] : error_mark_nodeglobal_trees[TI_ERROR_MARK];
4799 }
4800 return absolute ? null_pointer_nodeglobal_trees[TI_NULL_POINTER] : error_mark_nodeglobal_trees[TI_ERROR_MARK];
4801 }
4802
4803 return TREE_STATIC (value)((value)->base.static_flag) ? null_pointer_nodeglobal_trees[TI_NULL_POINTER] : NULL_TREE(tree) nullptr;
4804
4805 case INTEGER_CST:
4806 case VECTOR_CST:
4807 case REAL_CST:
4808 case FIXED_CST:
4809 case STRING_CST:
4810 case COMPLEX_CST:
4811 return null_pointer_nodeglobal_trees[TI_NULL_POINTER];
4812
4813 case ADDR_EXPR:
4814 case FDESC_EXPR:
4815 {
4816 tree op0 = staticp (TREE_OPERAND (value, 0)(*((const_cast<tree*> (tree_operand_check ((value), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4816, __FUNCTION__)))))
);
4817 if (op0)
4818 {
4819 /* "&(*a).f" is like unto pointer arithmetic. If "a" turns out
4820 to be a constant, this is old-skool offsetof-like nonsense. */
4821 if (TREE_CODE (op0)((enum tree_code) (op0)->base.code) == INDIRECT_REF
4822 && TREE_CONSTANT (TREE_OPERAND (op0, 0))((non_type_check (((*((const_cast<tree*> (tree_operand_check
((op0), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4822, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4822, __FUNCTION__))->base.constant_flag)
)
4823 return null_pointer_nodeglobal_trees[TI_NULL_POINTER];
4824 /* Taking the address of a nested function involves a trampoline,
4825 unless we don't need or want one. */
4826 if (TREE_CODE (op0)((enum tree_code) (op0)->base.code) == FUNCTION_DECL
4827 && DECL_STATIC_CHAIN (op0)((tree_check ((op0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4827, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.regdecl_flag
)
4828 && !TREE_NO_TRAMPOLINE (value)((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4828, __FUNCTION__, (ADDR_EXPR)))->base.static_flag)
)
4829 return NULL_TREE(tree) nullptr;
4830 /* "&{...}" requires a temporary to hold the constructed
4831 object. */
4832 if (TREE_CODE (op0)((enum tree_code) (op0)->base.code) == CONSTRUCTOR)
4833 return NULL_TREE(tree) nullptr;
4834 }
4835 return op0;
4836 }
4837
4838 case NON_LVALUE_EXPR:
4839 return initializer_constant_valid_p_1 (TREE_OPERAND (value, 0)(*((const_cast<tree*> (tree_operand_check ((value), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4839, __FUNCTION__)))))
,
4840 endtype, cache);
4841
4842 case VIEW_CONVERT_EXPR:
4843 {
4844 tree src = TREE_OPERAND (value, 0)(*((const_cast<tree*> (tree_operand_check ((value), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4844, __FUNCTION__)))))
;
4845 tree src_type = TREE_TYPE (src)((contains_struct_check ((src), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4845, __FUNCTION__))->typed.type)
;
4846 tree dest_type = TREE_TYPE (value)((contains_struct_check ((value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4846, __FUNCTION__))->typed.type)
;
4847
4848 /* Allow view-conversions from aggregate to non-aggregate type only
4849 if the bit pattern is fully preserved afterwards; otherwise, the
4850 RTL expander won't be able to apply a subsequent transformation
4851 to the underlying constructor. */
4852 if (AGGREGATE_TYPE_P (src_type)(((enum tree_code) (src_type)->base.code) == ARRAY_TYPE ||
(((enum tree_code) (src_type)->base.code) == RECORD_TYPE ||
((enum tree_code) (src_type)->base.code) == UNION_TYPE ||
((enum tree_code) (src_type)->base.code) == QUAL_UNION_TYPE
))
&& !AGGREGATE_TYPE_P (dest_type)(((enum tree_code) (dest_type)->base.code) == ARRAY_TYPE ||
(((enum tree_code) (dest_type)->base.code) == RECORD_TYPE
|| ((enum tree_code) (dest_type)->base.code) == UNION_TYPE
|| ((enum tree_code) (dest_type)->base.code) == QUAL_UNION_TYPE
))
)
4853 {
4854 if (TYPE_MODE (endtype)((((enum tree_code) ((tree_class_check ((endtype), (tcc_type)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4854, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(endtype) : (endtype)->type_common.mode)
== TYPE_MODE (dest_type)((((enum tree_code) ((tree_class_check ((dest_type), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4854, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(dest_type) : (dest_type)->type_common.mode)
)
4855 return initializer_constant_valid_p_1 (src, endtype, cache);
4856 else
4857 return NULL_TREE(tree) nullptr;
4858 }
4859
4860 /* Allow all other kinds of view-conversion. */
4861 return initializer_constant_valid_p_1 (src, endtype, cache);
4862 }
4863
4864 CASE_CONVERTcase NOP_EXPR: case CONVERT_EXPR:
4865 {
4866 tree src = TREE_OPERAND (value, 0)(*((const_cast<tree*> (tree_operand_check ((value), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4866, __FUNCTION__)))))
;
4867 tree src_type = TREE_TYPE (src)((contains_struct_check ((src), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4867, __FUNCTION__))->typed.type)
;
4868 tree dest_type = TREE_TYPE (value)((contains_struct_check ((value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4868, __FUNCTION__))->typed.type)
;
4869
4870 /* Allow conversions between pointer types, floating-point
4871 types, and offset types. */
4872 if ((POINTER_TYPE_P (dest_type)(((enum tree_code) (dest_type)->base.code) == POINTER_TYPE
|| ((enum tree_code) (dest_type)->base.code) == REFERENCE_TYPE
)
&& POINTER_TYPE_P (src_type)(((enum tree_code) (src_type)->base.code) == POINTER_TYPE ||
((enum tree_code) (src_type)->base.code) == REFERENCE_TYPE
)
)
4873 || (FLOAT_TYPE_P (dest_type)((((enum tree_code) (dest_type)->base.code) == REAL_TYPE) ||
((((enum tree_code) (dest_type)->base.code) == COMPLEX_TYPE
|| (((enum tree_code) (dest_type)->base.code) == VECTOR_TYPE
)) && (((enum tree_code) (((contains_struct_check ((dest_type
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4873, __FUNCTION__))->typed.type))->base.code) == REAL_TYPE
)))
&& FLOAT_TYPE_P (src_type)((((enum tree_code) (src_type)->base.code) == REAL_TYPE) ||
((((enum tree_code) (src_type)->base.code) == COMPLEX_TYPE
|| (((enum tree_code) (src_type)->base.code) == VECTOR_TYPE
)) && (((enum tree_code) (((contains_struct_check ((src_type
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4873, __FUNCTION__))->typed.type))->base.code) == REAL_TYPE
)))
)
4874 || (TREE_CODE (dest_type)((enum tree_code) (dest_type)->base.code) == OFFSET_TYPE
4875 && TREE_CODE (src_type)((enum tree_code) (src_type)->base.code) == OFFSET_TYPE))
4876 return initializer_constant_valid_p_1 (src, endtype, cache);
4877
4878 /* Allow length-preserving conversions between integer types. */
4879 if (INTEGRAL_TYPE_P (dest_type)(((enum tree_code) (dest_type)->base.code) == ENUMERAL_TYPE
|| ((enum tree_code) (dest_type)->base.code) == BOOLEAN_TYPE
|| ((enum tree_code) (dest_type)->base.code) == INTEGER_TYPE
)
&& INTEGRAL_TYPE_P (src_type)(((enum tree_code) (src_type)->base.code) == ENUMERAL_TYPE
|| ((enum tree_code) (src_type)->base.code) == BOOLEAN_TYPE
|| ((enum tree_code) (src_type)->base.code) == INTEGER_TYPE
)
4880 && (TYPE_PRECISION (dest_type)((tree_class_check ((dest_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4880, __FUNCTION__))->type_common.precision)
== TYPE_PRECISION (src_type)((tree_class_check ((src_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4880, __FUNCTION__))->type_common.precision)
))
4881 return initializer_constant_valid_p_1 (src, endtype, cache);
4882
4883 /* Allow conversions between other integer types only if
4884 explicit value. Don't allow sign-extension to a type larger
4885 than word and pointer, there aren't relocations that would
4886 allow to sign extend it to a wider type. */
4887 if (INTEGRAL_TYPE_P (dest_type)(((enum tree_code) (dest_type)->base.code) == ENUMERAL_TYPE
|| ((enum tree_code) (dest_type)->base.code) == BOOLEAN_TYPE
|| ((enum tree_code) (dest_type)->base.code) == INTEGER_TYPE
)
4888 && INTEGRAL_TYPE_P (src_type)(((enum tree_code) (src_type)->base.code) == ENUMERAL_TYPE
|| ((enum tree_code) (src_type)->base.code) == BOOLEAN_TYPE
|| ((enum tree_code) (src_type)->base.code) == INTEGER_TYPE
)
4889 && (TYPE_UNSIGNED (src_type)((tree_class_check ((src_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4889, __FUNCTION__))->base.u.bits.unsigned_flag)
4890 || TYPE_PRECISION (dest_type)((tree_class_check ((dest_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4890, __FUNCTION__))->type_common.precision)
<= TYPE_PRECISION (src_type)((tree_class_check ((src_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4890, __FUNCTION__))->type_common.precision)
4891 || TYPE_PRECISION (dest_type)((tree_class_check ((dest_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4891, __FUNCTION__))->type_common.precision)
<= BITS_PER_WORD((8) * (((global_options.x_ix86_isa_flags & (1UL <<
1)) != 0) ? 8 : 4))
4892 || TYPE_PRECISION (dest_type)((tree_class_check ((dest_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4892, __FUNCTION__))->type_common.precision)
<= POINTER_SIZE(((global_options.x_ix86_isa_flags & (1UL << 58)) !=
0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags & (1UL
<< 1)) != 0) ? 8 : 4)))
))
4893 {
4894 tree inner = initializer_constant_valid_p_1 (src, endtype, cache);
4895 if (inner == null_pointer_nodeglobal_trees[TI_NULL_POINTER])
4896 return null_pointer_nodeglobal_trees[TI_NULL_POINTER];
4897 break;
4898 }
4899
4900 /* Allow (int) &foo provided int is as wide as a pointer. */
4901 if (INTEGRAL_TYPE_P (dest_type)(((enum tree_code) (dest_type)->base.code) == ENUMERAL_TYPE
|| ((enum tree_code) (dest_type)->base.code) == BOOLEAN_TYPE
|| ((enum tree_code) (dest_type)->base.code) == INTEGER_TYPE
)
&& POINTER_TYPE_P (src_type)(((enum tree_code) (src_type)->base.code) == POINTER_TYPE ||
((enum tree_code) (src_type)->base.code) == REFERENCE_TYPE
)
4902 && (TYPE_PRECISION (dest_type)((tree_class_check ((dest_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4902, __FUNCTION__))->type_common.precision)
>= TYPE_PRECISION (src_type)((tree_class_check ((src_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4902, __FUNCTION__))->type_common.precision)
))
4903 return initializer_constant_valid_p_1 (src, endtype, cache);
4904
4905 /* Likewise conversions from int to pointers, but also allow
4906 conversions from 0. */
4907 if ((POINTER_TYPE_P (dest_type)(((enum tree_code) (dest_type)->base.code) == POINTER_TYPE
|| ((enum tree_code) (dest_type)->base.code) == REFERENCE_TYPE
)
4908 || TREE_CODE (dest_type)((enum tree_code) (dest_type)->base.code) == OFFSET_TYPE)
4909 && INTEGRAL_TYPE_P (src_type)(((enum tree_code) (src_type)->base.code) == ENUMERAL_TYPE
|| ((enum tree_code) (src_type)->base.code) == BOOLEAN_TYPE
|| ((enum tree_code) (src_type)->base.code) == INTEGER_TYPE
)
)
4910 {
4911 if (TREE_CODE (src)((enum tree_code) (src)->base.code) == INTEGER_CST
4912 && TYPE_PRECISION (dest_type)((tree_class_check ((dest_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4912, __FUNCTION__))->type_common.precision)
>= TYPE_PRECISION (src_type)((tree_class_check ((src_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4912, __FUNCTION__))->type_common.precision)
)
4913 return null_pointer_nodeglobal_trees[TI_NULL_POINTER];
4914 if (integer_zerop (src))
4915 return null_pointer_nodeglobal_trees[TI_NULL_POINTER];
4916 else if (TYPE_PRECISION (dest_type)((tree_class_check ((dest_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4916, __FUNCTION__))->type_common.precision)
<= TYPE_PRECISION (src_type)((tree_class_check ((src_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4916, __FUNCTION__))->type_common.precision)
)
4917 return initializer_constant_valid_p_1 (src, endtype, cache);
4918 }
4919
4920 /* Allow conversions to struct or union types if the value
4921 inside is okay. */
4922 if (TREE_CODE (dest_type)((enum tree_code) (dest_type)->base.code) == RECORD_TYPE
4923 || TREE_CODE (dest_type)((enum tree_code) (dest_type)->base.code) == UNION_TYPE)
4924 return initializer_constant_valid_p_1 (src, endtype, cache);
4925 }
4926 break;
4927
4928 case POINTER_PLUS_EXPR:
4929 case PLUS_EXPR:
4930 /* Any valid floating-point constants will have been folded by now;
4931 with -frounding-math we hit this with addition of two constants. */
4932 if (TREE_CODE (endtype)((enum tree_code) (endtype)->base.code) == REAL_TYPE)
4933 return NULL_TREE(tree) nullptr;
4934 if (cache && cache[0] == value)
4935 return cache[1];
4936 if (! INTEGRAL_TYPE_P (endtype)(((enum tree_code) (endtype)->base.code) == ENUMERAL_TYPE ||
((enum tree_code) (endtype)->base.code) == BOOLEAN_TYPE ||
((enum tree_code) (endtype)->base.code) == INTEGER_TYPE)
4937 || TYPE_PRECISION (endtype)((tree_class_check ((endtype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4937, __FUNCTION__))->type_common.precision)
>= TYPE_PRECISION (TREE_TYPE (value))((tree_class_check ((((contains_struct_check ((value), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4937, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4937, __FUNCTION__))->type_common.precision)
)
4938 {
4939 tree ncache[4] = { NULL_TREE(tree) nullptr, NULL_TREE(tree) nullptr, NULL_TREE(tree) nullptr, NULL_TREE(tree) nullptr };
4940 tree valid0
4941 = initializer_constant_valid_p_1 (TREE_OPERAND (value, 0)(*((const_cast<tree*> (tree_operand_check ((value), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4941, __FUNCTION__)))))
,
4942 endtype, ncache);
4943 tree valid1
4944 = initializer_constant_valid_p_1 (TREE_OPERAND (value, 1)(*((const_cast<tree*> (tree_operand_check ((value), (1)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4944, __FUNCTION__)))))
,
4945 endtype, ncache + 2);
4946 /* If either term is absolute, use the other term's relocation. */
4947 if (valid0 == null_pointer_nodeglobal_trees[TI_NULL_POINTER])
4948 ret = valid1;
4949 else if (valid1 == null_pointer_nodeglobal_trees[TI_NULL_POINTER])
4950 ret = valid0;
4951 /* Support narrowing pointer differences. */
4952 else
4953 ret = narrowing_initializer_constant_valid_p (value, endtype,
4954 ncache);
4955 }
4956 else
4957 /* Support narrowing pointer differences. */
4958 ret = narrowing_initializer_constant_valid_p (value, endtype, NULLnullptr);
4959 if (cache)
4960 {
4961 cache[0] = value;
4962 cache[1] = ret;
4963 }
4964 return ret;
4965
4966 case POINTER_DIFF_EXPR:
4967 case MINUS_EXPR:
4968 if (TREE_CODE (endtype)((enum tree_code) (endtype)->base.code) == REAL_TYPE)
4969 return NULL_TREE(tree) nullptr;
4970 if (cache && cache[0] == value)
4971 return cache[1];
4972 if (! INTEGRAL_TYPE_P (endtype)(((enum tree_code) (endtype)->base.code) == ENUMERAL_TYPE ||
((enum tree_code) (endtype)->base.code) == BOOLEAN_TYPE ||
((enum tree_code) (endtype)->base.code) == INTEGER_TYPE)
4973 || TYPE_PRECISION (endtype)((tree_class_check ((endtype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4973, __FUNCTION__))->type_common.precision)
>= TYPE_PRECISION (TREE_TYPE (value))((tree_class_check ((((contains_struct_check ((value), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4973, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4973, __FUNCTION__))->type_common.precision)
)
4974 {
4975 tree ncache[4] = { NULL_TREE(tree) nullptr, NULL_TREE(tree) nullptr, NULL_TREE(tree) nullptr, NULL_TREE(tree) nullptr };
4976 tree valid0
4977 = initializer_constant_valid_p_1 (TREE_OPERAND (value, 0)(*((const_cast<tree*> (tree_operand_check ((value), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4977, __FUNCTION__)))))
,
4978 endtype, ncache);
4979 tree valid1
4980 = initializer_constant_valid_p_1 (TREE_OPERAND (value, 1)(*((const_cast<tree*> (tree_operand_check ((value), (1)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 4980, __FUNCTION__)))))
,
4981 endtype, ncache + 2);
4982 /* Win if second argument is absolute. */
4983 if (valid1 == null_pointer_nodeglobal_trees[TI_NULL_POINTER])
4984 ret = valid0;
4985 /* Win if both arguments have the same relocation.
4986 Then the value is absolute. */
4987 else if (valid0 == valid1 && valid0 != 0)
4988 ret = null_pointer_nodeglobal_trees[TI_NULL_POINTER];
4989 /* Since GCC guarantees that string constants are unique in the
4990 generated code, a subtraction between two copies of the same
4991 constant string is absolute. */
4992 else if (valid0 && TREE_CODE (valid0)((enum tree_code) (valid0)->base.code) == STRING_CST
4993 && valid1 && TREE_CODE (valid1)((enum tree_code) (valid1)->base.code) == STRING_CST
4994 && operand_equal_p (valid0, valid1, 1))
4995 ret = null_pointer_nodeglobal_trees[TI_NULL_POINTER];
4996 /* Support narrowing differences. */
4997 else
4998 ret = narrowing_initializer_constant_valid_p (value, endtype,
4999 ncache);
5000 }
5001 else
5002 /* Support narrowing differences. */
5003 ret = narrowing_initializer_constant_valid_p (value, endtype, NULLnullptr);
5004 if (cache)
5005 {
5006 cache[0] = value;
5007 cache[1] = ret;
5008 }
5009 return ret;
5010
5011 default:
5012 break;
5013 }
5014
5015 return NULL_TREE(tree) nullptr;
5016}
5017
5018/* Return nonzero if VALUE is a valid constant-valued expression
5019 for use in initializing a static variable; one that can be an
5020 element of a "constant" initializer.
5021
5022 Return null_pointer_node if the value is absolute;
5023 if it is relocatable, return the variable that determines the relocation.
5024 We assume that VALUE has been folded as much as possible;
5025 therefore, we do not need to check for such things as
5026 arithmetic-combinations of integers. */
5027tree
5028initializer_constant_valid_p (tree value, tree endtype, bool reverse)
5029{
5030 tree reloc = initializer_constant_valid_p_1 (value, endtype, NULLnullptr);
5031
5032 /* An absolute value is required with reverse storage order. */
5033 if (reloc
5034 && reloc != null_pointer_nodeglobal_trees[TI_NULL_POINTER]
5035 && reverse
5036 && !AGGREGATE_TYPE_P (endtype)(((enum tree_code) (endtype)->base.code) == ARRAY_TYPE || (
((enum tree_code) (endtype)->base.code) == RECORD_TYPE || (
(enum tree_code) (endtype)->base.code) == UNION_TYPE || ((
enum tree_code) (endtype)->base.code) == QUAL_UNION_TYPE))
5037 && !VECTOR_TYPE_P (endtype)(((enum tree_code) (endtype)->base.code) == VECTOR_TYPE))
5038 reloc = NULL_TREE(tree) nullptr;
5039
5040 return reloc;
5041}
5042
5043/* Return true if VALUE is a valid constant-valued expression
5044 for use in initializing a static bit-field; one that can be
5045 an element of a "constant" initializer. */
5046
5047bool
5048initializer_constant_valid_for_bitfield_p (tree value)
5049{
5050 /* For bitfields we support integer constants or possibly nested aggregates
5051 of such. */
5052 switch (TREE_CODE (value)((enum tree_code) (value)->base.code))
5053 {
5054 case CONSTRUCTOR:
5055 {
5056 unsigned HOST_WIDE_INTlong idx;
5057 tree elt;
5058
5059 FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (value), idx, elt)for (idx = 0; (idx >= vec_safe_length (((tree_check ((value
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 5059, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)))
? false : ((elt = (*(((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 5059, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)))
[idx].value), true); (idx)++)
5060 if (!initializer_constant_valid_for_bitfield_p (elt))
5061 return false;
5062 return true;
5063 }
5064
5065 case INTEGER_CST:
5066 case REAL_CST:
5067 return true;
5068
5069 case VIEW_CONVERT_EXPR:
5070 case NON_LVALUE_EXPR:
5071 return
5072 initializer_constant_valid_for_bitfield_p (TREE_OPERAND (value, 0)(*((const_cast<tree*> (tree_operand_check ((value), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/varasm.c"
, 5072, __FUNCTION__)))))
);
5073
5074 default:
5075 break;
5076 }
5077
5078 return false;
5079}
5080
5081/* Check if a STRING_CST fits into the field.
5082 Tolerate only the case when the NUL termination
5083 does not fit into the field. */
5084
5085static bool
5086check_string_literal (tree string, unsigned HOST_WIDE_INTlong size)
5087{
5088 tree type = TREE_TYPE (string)((contains_struct_check ((st