Bug Summary

File:build/gcc/tree.c
Warning:line 3466, column 5
Called C++ object pointer is null

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 tree.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 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/objdir/gcc -resource-dir /usr/lib64/clang/13.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/11/../../../../include/c++/11 -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/11/../../../../include/c++/11/x86_64-suse-linux -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/11/../../../../include/c++/11/backward -internal-isystem /usr/lib64/clang/13.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/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 -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/objdir/clang-static-analyzer/2021-11-20-133755-20252-1/report-jWGr8e.plist -x c++ /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c

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

1/* Language-independent node constructors for parse phase of 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/* This file contains the low level primitives for operating on tree nodes,
21 including allocation, list operations, interning of identifiers,
22 construction of data type nodes and statement nodes,
23 and construction of type conversion nodes. It also contains
24 tables index by tree code that describe how to take apart
25 nodes of that code.
26
27 It is intended to be language-independent but can occasionally
28 calls language-dependent routines. */
29
30#include "config.h"
31#include "system.h"
32#include "coretypes.h"
33#include "backend.h"
34#include "target.h"
35#include "tree.h"
36#include "gimple.h"
37#include "tree-pass.h"
38#include "ssa.h"
39#include "cgraph.h"
40#include "diagnostic.h"
41#include "flags.h"
42#include "alias.h"
43#include "fold-const.h"
44#include "stor-layout.h"
45#include "calls.h"
46#include "attribs.h"
47#include "toplev.h" /* get_random_seed */
48#include "output.h"
49#include "common/common-target.h"
50#include "langhooks.h"
51#include "tree-inline.h"
52#include "tree-iterator.h"
53#include "internal-fn.h"
54#include "gimple-iterator.h"
55#include "gimplify.h"
56#include "tree-dfa.h"
57#include "langhooks-def.h"
58#include "tree-diagnostic.h"
59#include "except.h"
60#include "builtins.h"
61#include "print-tree.h"
62#include "ipa-utils.h"
63#include "selftest.h"
64#include "stringpool.h"
65#include "attribs.h"
66#include "rtl.h"
67#include "regs.h"
68#include "tree-vector-builder.h"
69#include "gimple-fold.h"
70#include "escaped_string.h"
71#include "gimple-range.h"
72
73/* Tree code classes. */
74
75#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
76#define END_OF_BASE_TREE_CODES tcc_exceptional,
77
78const enum tree_code_class tree_code_type[] = {
79#include "all-tree.def"
80};
81
82#undef DEFTREECODE
83#undef END_OF_BASE_TREE_CODES
84
85/* Table indexed by tree code giving number of expression
86 operands beyond the fixed part of the node structure.
87 Not used for types or decls. */
88
89#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
90#define END_OF_BASE_TREE_CODES 0,
91
92const unsigned char tree_code_length[] = {
93#include "all-tree.def"
94};
95
96#undef DEFTREECODE
97#undef END_OF_BASE_TREE_CODES
98
99/* Names of tree components.
100 Used for printing out the tree and error messages. */
101#define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME,
102#define END_OF_BASE_TREE_CODES "@dummy",
103
104static const char *const tree_code_name[] = {
105#include "all-tree.def"
106};
107
108#undef DEFTREECODE
109#undef END_OF_BASE_TREE_CODES
110
111/* Each tree code class has an associated string representation.
112 These must correspond to the tree_code_class entries. */
113
114const char *const tree_code_class_strings[] =
115{
116 "exceptional",
117 "constant",
118 "type",
119 "declaration",
120 "reference",
121 "comparison",
122 "unary",
123 "binary",
124 "statement",
125 "vl_exp",
126 "expression"
127};
128
129/* obstack.[ch] explicitly declined to prototype this. */
130extern int _obstack_allocated_p (struct obstack *h, void *obj);
131
132/* Statistics-gathering stuff. */
133
134static uint64_t tree_code_counts[MAX_TREE_CODES];
135uint64_t tree_node_counts[(int) all_kinds];
136uint64_t tree_node_sizes[(int) all_kinds];
137
138/* Keep in sync with tree.h:enum tree_node_kind. */
139static const char * const tree_node_kind_names[] = {
140 "decls",
141 "types",
142 "blocks",
143 "stmts",
144 "refs",
145 "exprs",
146 "constants",
147 "identifiers",
148 "vecs",
149 "binfos",
150 "ssa names",
151 "constructors",
152 "random kinds",
153 "lang_decl kinds",
154 "lang_type kinds",
155 "omp clauses",
156};
157
158/* Unique id for next decl created. */
159static GTY(()) int next_decl_uid;
160/* Unique id for next type created. */
161static GTY(()) unsigned next_type_uid = 1;
162/* Unique id for next debug decl created. Use negative numbers,
163 to catch erroneous uses. */
164static GTY(()) int next_debug_decl_uid;
165
166/* Since we cannot rehash a type after it is in the table, we have to
167 keep the hash code. */
168
169struct GTY((for_user)) type_hash {
170 unsigned long hash;
171 tree type;
172};
173
174/* Initial size of the hash table (rounded to next prime). */
175#define TYPE_HASH_INITIAL_SIZE1000 1000
176
177struct type_cache_hasher : ggc_cache_ptr_hash<type_hash>
178{
179 static hashval_t hash (type_hash *t) { return t->hash; }
180 static bool equal (type_hash *a, type_hash *b);
181
182 static int
183 keep_cache_entry (type_hash *&t)
184 {
185 return ggc_marked_p (t->type);
186 }
187};
188
189/* Now here is the hash table. When recording a type, it is added to
190 the slot whose index is the hash code. Note that the hash table is
191 used for several kinds of types (function types, array types and
192 array index range types, for now). While all these live in the
193 same table, they are completely independent, and the hash code is
194 computed differently for each of these. */
195
196static GTY ((cache)) hash_table<type_cache_hasher> *type_hash_table;
197
198/* Hash table and temporary node for larger integer const values. */
199static GTY (()) tree int_cst_node;
200
201struct int_cst_hasher : ggc_cache_ptr_hash<tree_node>
202{
203 static hashval_t hash (tree t);
204 static bool equal (tree x, tree y);
205};
206
207static GTY ((cache)) hash_table<int_cst_hasher> *int_cst_hash_table;
208
209/* Class and variable for making sure that there is a single POLY_INT_CST
210 for a given value. */
211struct poly_int_cst_hasher : ggc_cache_ptr_hash<tree_node>
212{
213 typedef std::pair<tree, const poly_wide_int *> compare_type;
214 static hashval_t hash (tree t);
215 static bool equal (tree x, const compare_type &y);
216};
217
218static GTY ((cache)) hash_table<poly_int_cst_hasher> *poly_int_cst_hash_table;
219
220/* Hash table for optimization flags and target option flags. Use the same
221 hash table for both sets of options. Nodes for building the current
222 optimization and target option nodes. The assumption is most of the time
223 the options created will already be in the hash table, so we avoid
224 allocating and freeing up a node repeatably. */
225static GTY (()) tree cl_optimization_node;
226static GTY (()) tree cl_target_option_node;
227
228struct cl_option_hasher : ggc_cache_ptr_hash<tree_node>
229{
230 static hashval_t hash (tree t);
231 static bool equal (tree x, tree y);
232};
233
234static GTY ((cache)) hash_table<cl_option_hasher> *cl_option_hash_table;
235
236/* General tree->tree mapping structure for use in hash tables. */
237
238
239static GTY ((cache))
240 hash_table<tree_decl_map_cache_hasher> *debug_expr_for_decl;
241
242static GTY ((cache))
243 hash_table<tree_decl_map_cache_hasher> *value_expr_for_decl;
244
245struct tree_vec_map_cache_hasher : ggc_cache_ptr_hash<tree_vec_map>
246{
247 static hashval_t hash (tree_vec_map *m) { return DECL_UID (m->base.from)((contains_struct_check ((m->base.from), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 247, __FUNCTION__))->decl_minimal.uid)
; }
248
249 static bool
250 equal (tree_vec_map *a, tree_vec_map *b)
251 {
252 return a->base.from == b->base.from;
253 }
254
255 static int
256 keep_cache_entry (tree_vec_map *&m)
257 {
258 return ggc_marked_p (m->base.from);
259 }
260};
261
262static GTY ((cache))
263 hash_table<tree_vec_map_cache_hasher> *debug_args_for_decl;
264
265static void set_type_quals (tree, int);
266static void print_type_hash_statistics (void);
267static void print_debug_expr_statistics (void);
268static void print_value_expr_statistics (void);
269
270tree global_trees[TI_MAX];
271tree integer_types[itk_none];
272
273bool int_n_enabled_p[NUM_INT_N_ENTS1];
274struct int_n_trees_t int_n_trees [NUM_INT_N_ENTS1];
275
276bool tree_contains_struct[MAX_TREE_CODES][64];
277
278/* Number of operands for each OMP clause. */
279unsigned const char omp_clause_num_ops[] =
280{
281 0, /* OMP_CLAUSE_ERROR */
282 1, /* OMP_CLAUSE_PRIVATE */
283 1, /* OMP_CLAUSE_SHARED */
284 1, /* OMP_CLAUSE_FIRSTPRIVATE */
285 2, /* OMP_CLAUSE_LASTPRIVATE */
286 5, /* OMP_CLAUSE_REDUCTION */
287 5, /* OMP_CLAUSE_TASK_REDUCTION */
288 5, /* OMP_CLAUSE_IN_REDUCTION */
289 1, /* OMP_CLAUSE_COPYIN */
290 1, /* OMP_CLAUSE_COPYPRIVATE */
291 3, /* OMP_CLAUSE_LINEAR */
292 1, /* OMP_CLAUSE_AFFINITY */
293 2, /* OMP_CLAUSE_ALIGNED */
294 3, /* OMP_CLAUSE_ALLOCATE */
295 1, /* OMP_CLAUSE_DEPEND */
296 1, /* OMP_CLAUSE_NONTEMPORAL */
297 1, /* OMP_CLAUSE_UNIFORM */
298 1, /* OMP_CLAUSE_TO_DECLARE */
299 1, /* OMP_CLAUSE_LINK */
300 1, /* OMP_CLAUSE_DETACH */
301 1, /* OMP_CLAUSE_USE_DEVICE_PTR */
302 1, /* OMP_CLAUSE_USE_DEVICE_ADDR */
303 1, /* OMP_CLAUSE_IS_DEVICE_PTR */
304 1, /* OMP_CLAUSE_INCLUSIVE */
305 1, /* OMP_CLAUSE_EXCLUSIVE */
306 2, /* OMP_CLAUSE_FROM */
307 2, /* OMP_CLAUSE_TO */
308 2, /* OMP_CLAUSE_MAP */
309 2, /* OMP_CLAUSE__CACHE_ */
310 2, /* OMP_CLAUSE_GANG */
311 1, /* OMP_CLAUSE_ASYNC */
312 1, /* OMP_CLAUSE_WAIT */
313 0, /* OMP_CLAUSE_AUTO */
314 0, /* OMP_CLAUSE_SEQ */
315 1, /* OMP_CLAUSE__LOOPTEMP_ */
316 1, /* OMP_CLAUSE__REDUCTEMP_ */
317 1, /* OMP_CLAUSE__CONDTEMP_ */
318 1, /* OMP_CLAUSE__SCANTEMP_ */
319 1, /* OMP_CLAUSE_IF */
320 1, /* OMP_CLAUSE_NUM_THREADS */
321 1, /* OMP_CLAUSE_SCHEDULE */
322 0, /* OMP_CLAUSE_NOWAIT */
323 1, /* OMP_CLAUSE_ORDERED */
324 0, /* OMP_CLAUSE_DEFAULT */
325 3, /* OMP_CLAUSE_COLLAPSE */
326 0, /* OMP_CLAUSE_UNTIED */
327 1, /* OMP_CLAUSE_FINAL */
328 0, /* OMP_CLAUSE_MERGEABLE */
329 1, /* OMP_CLAUSE_DEVICE */
330 1, /* OMP_CLAUSE_DIST_SCHEDULE */
331 0, /* OMP_CLAUSE_INBRANCH */
332 0, /* OMP_CLAUSE_NOTINBRANCH */
333 2, /* OMP_CLAUSE_NUM_TEAMS */
334 1, /* OMP_CLAUSE_THREAD_LIMIT */
335 0, /* OMP_CLAUSE_PROC_BIND */
336 1, /* OMP_CLAUSE_SAFELEN */
337 1, /* OMP_CLAUSE_SIMDLEN */
338 0, /* OMP_CLAUSE_DEVICE_TYPE */
339 0, /* OMP_CLAUSE_FOR */
340 0, /* OMP_CLAUSE_PARALLEL */
341 0, /* OMP_CLAUSE_SECTIONS */
342 0, /* OMP_CLAUSE_TASKGROUP */
343 1, /* OMP_CLAUSE_PRIORITY */
344 1, /* OMP_CLAUSE_GRAINSIZE */
345 1, /* OMP_CLAUSE_NUM_TASKS */
346 0, /* OMP_CLAUSE_NOGROUP */
347 0, /* OMP_CLAUSE_THREADS */
348 0, /* OMP_CLAUSE_SIMD */
349 1, /* OMP_CLAUSE_HINT */
350 0, /* OMP_CLAUSE_DEFAULTMAP */
351 0, /* OMP_CLAUSE_ORDER */
352 0, /* OMP_CLAUSE_BIND */
353 1, /* OMP_CLAUSE_FILTER */
354 1, /* OMP_CLAUSE__SIMDUID_ */
355 0, /* OMP_CLAUSE__SIMT_ */
356 0, /* OMP_CLAUSE_INDEPENDENT */
357 1, /* OMP_CLAUSE_WORKER */
358 1, /* OMP_CLAUSE_VECTOR */
359 1, /* OMP_CLAUSE_NUM_GANGS */
360 1, /* OMP_CLAUSE_NUM_WORKERS */
361 1, /* OMP_CLAUSE_VECTOR_LENGTH */
362 3, /* OMP_CLAUSE_TILE */
363 0, /* OMP_CLAUSE_IF_PRESENT */
364 0, /* OMP_CLAUSE_FINALIZE */
365 0, /* OMP_CLAUSE_NOHOST */
366};
367
368const char * const omp_clause_code_name[] =
369{
370 "error_clause",
371 "private",
372 "shared",
373 "firstprivate",
374 "lastprivate",
375 "reduction",
376 "task_reduction",
377 "in_reduction",
378 "copyin",
379 "copyprivate",
380 "linear",
381 "affinity",
382 "aligned",
383 "allocate",
384 "depend",
385 "nontemporal",
386 "uniform",
387 "to",
388 "link",
389 "detach",
390 "use_device_ptr",
391 "use_device_addr",
392 "is_device_ptr",
393 "inclusive",
394 "exclusive",
395 "from",
396 "to",
397 "map",
398 "_cache_",
399 "gang",
400 "async",
401 "wait",
402 "auto",
403 "seq",
404 "_looptemp_",
405 "_reductemp_",
406 "_condtemp_",
407 "_scantemp_",
408 "if",
409 "num_threads",
410 "schedule",
411 "nowait",
412 "ordered",
413 "default",
414 "collapse",
415 "untied",
416 "final",
417 "mergeable",
418 "device",
419 "dist_schedule",
420 "inbranch",
421 "notinbranch",
422 "num_teams",
423 "thread_limit",
424 "proc_bind",
425 "safelen",
426 "simdlen",
427 "device_type",
428 "for",
429 "parallel",
430 "sections",
431 "taskgroup",
432 "priority",
433 "grainsize",
434 "num_tasks",
435 "nogroup",
436 "threads",
437 "simd",
438 "hint",
439 "defaultmap",
440 "order",
441 "bind",
442 "filter",
443 "_simduid_",
444 "_simt_",
445 "independent",
446 "worker",
447 "vector",
448 "num_gangs",
449 "num_workers",
450 "vector_length",
451 "tile",
452 "if_present",
453 "finalize",
454 "nohost",
455};
456
457
458/* Return the tree node structure used by tree code CODE. */
459
460static inline enum tree_node_structure_enum
461tree_node_structure_for_code (enum tree_code code)
462{
463 switch (TREE_CODE_CLASS (code)tree_code_type[(int) (code)])
464 {
465 case tcc_declaration:
466 switch (code)
467 {
468 case CONST_DECL: return TS_CONST_DECL;
469 case DEBUG_EXPR_DECL: return TS_DECL_WRTL;
470 case FIELD_DECL: return TS_FIELD_DECL;
471 case FUNCTION_DECL: return TS_FUNCTION_DECL;
472 case LABEL_DECL: return TS_LABEL_DECL;
473 case PARM_DECL: return TS_PARM_DECL;
474 case RESULT_DECL: return TS_RESULT_DECL;
475 case TRANSLATION_UNIT_DECL: return TS_TRANSLATION_UNIT_DECL;
476 case TYPE_DECL: return TS_TYPE_DECL;
477 case VAR_DECL: return TS_VAR_DECL;
478 default: return TS_DECL_NON_COMMON;
479 }
480
481 case tcc_type: return TS_TYPE_NON_COMMON;
482
483 case tcc_binary:
484 case tcc_comparison:
485 case tcc_expression:
486 case tcc_reference:
487 case tcc_statement:
488 case tcc_unary:
489 case tcc_vl_exp: return TS_EXP;
490
491 default: /* tcc_constant and tcc_exceptional */
492 break;
493 }
494
495 switch (code)
496 {
497 /* tcc_constant cases. */
498 case COMPLEX_CST: return TS_COMPLEX;
499 case FIXED_CST: return TS_FIXED_CST;
500 case INTEGER_CST: return TS_INT_CST;
501 case POLY_INT_CST: return TS_POLY_INT_CST;
502 case REAL_CST: return TS_REAL_CST;
503 case STRING_CST: return TS_STRING;
504 case VECTOR_CST: return TS_VECTOR;
505 case VOID_CST: return TS_TYPED;
506
507 /* tcc_exceptional cases. */
508 case BLOCK: return TS_BLOCK;
509 case CONSTRUCTOR: return TS_CONSTRUCTOR;
510 case ERROR_MARK: return TS_COMMON;
511 case IDENTIFIER_NODE: return TS_IDENTIFIER;
512 case OMP_CLAUSE: return TS_OMP_CLAUSE;
513 case OPTIMIZATION_NODE: return TS_OPTIMIZATION;
514 case PLACEHOLDER_EXPR: return TS_COMMON;
515 case SSA_NAME: return TS_SSA_NAME;
516 case STATEMENT_LIST: return TS_STATEMENT_LIST;
517 case TARGET_OPTION_NODE: return TS_TARGET_OPTION;
518 case TREE_BINFO: return TS_BINFO;
519 case TREE_LIST: return TS_LIST;
520 case TREE_VEC: return TS_VEC;
521
522 default:
523 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 523, __FUNCTION__))
;
524 }
525}
526
527
528/* Initialize tree_contains_struct to describe the hierarchy of tree
529 nodes. */
530
531static void
532initialize_tree_contains_struct (void)
533{
534 unsigned i;
535
536 for (i = ERROR_MARK; i < LAST_AND_UNUSED_TREE_CODE; i++)
537 {
538 enum tree_code code;
539 enum tree_node_structure_enum ts_code;
540
541 code = (enum tree_code) i;
542 ts_code = tree_node_structure_for_code (code);
543
544 /* Mark the TS structure itself. */
545 tree_contains_struct[code][ts_code] = 1;
546
547 /* Mark all the structures that TS is derived from. */
548 switch (ts_code)
549 {
550 case TS_TYPED:
551 case TS_BLOCK:
552 case TS_OPTIMIZATION:
553 case TS_TARGET_OPTION:
554 MARK_TS_BASE (code)(tree_contains_struct[code][TS_BASE] = true);
555 break;
556
557 case TS_COMMON:
558 case TS_INT_CST:
559 case TS_POLY_INT_CST:
560 case TS_REAL_CST:
561 case TS_FIXED_CST:
562 case TS_VECTOR:
563 case TS_STRING:
564 case TS_COMPLEX:
565 case TS_SSA_NAME:
566 case TS_CONSTRUCTOR:
567 case TS_EXP:
568 case TS_STATEMENT_LIST:
569 MARK_TS_TYPED (code)((tree_contains_struct[code][TS_BASE] = true), tree_contains_struct
[code][TS_TYPED] = true)
;
570 break;
571
572 case TS_IDENTIFIER:
573 case TS_DECL_MINIMAL:
574 case TS_TYPE_COMMON:
575 case TS_LIST:
576 case TS_VEC:
577 case TS_BINFO:
578 case TS_OMP_CLAUSE:
579 MARK_TS_COMMON (code)(((tree_contains_struct[code][TS_BASE] = true), tree_contains_struct
[code][TS_TYPED] = true), tree_contains_struct[code][TS_COMMON
] = true)
;
580 break;
581
582 case TS_TYPE_WITH_LANG_SPECIFIC:
583 MARK_TS_TYPE_COMMON (code)((((tree_contains_struct[code][TS_BASE] = true), tree_contains_struct
[code][TS_TYPED] = true), tree_contains_struct[code][TS_COMMON
] = true), tree_contains_struct[code][TS_TYPE_COMMON] = true)
;
584 break;
585
586 case TS_TYPE_NON_COMMON:
587 MARK_TS_TYPE_WITH_LANG_SPECIFIC (code)(((((tree_contains_struct[code][TS_BASE] = true), tree_contains_struct
[code][TS_TYPED] = true), tree_contains_struct[code][TS_COMMON
] = true), tree_contains_struct[code][TS_TYPE_COMMON] = true)
, tree_contains_struct[code][TS_TYPE_WITH_LANG_SPECIFIC] = true
)
;
588 break;
589
590 case TS_DECL_COMMON:
591 MARK_TS_DECL_MINIMAL (code)((((tree_contains_struct[code][TS_BASE] = true), tree_contains_struct
[code][TS_TYPED] = true), tree_contains_struct[code][TS_COMMON
] = true), tree_contains_struct[code][TS_DECL_MINIMAL] = true
)
;
592 break;
593
594 case TS_DECL_WRTL:
595 case TS_CONST_DECL:
596 MARK_TS_DECL_COMMON (code)(((((tree_contains_struct[code][TS_BASE] = true), tree_contains_struct
[code][TS_TYPED] = true), tree_contains_struct[code][TS_COMMON
] = true), tree_contains_struct[code][TS_DECL_MINIMAL] = true
), tree_contains_struct[code][TS_DECL_COMMON] = true)
;
597 break;
598
599 case TS_DECL_NON_COMMON:
600 MARK_TS_DECL_WITH_VIS (code)(((((((tree_contains_struct[code][TS_BASE] = true), tree_contains_struct
[code][TS_TYPED] = true), tree_contains_struct[code][TS_COMMON
] = true), tree_contains_struct[code][TS_DECL_MINIMAL] = true
), tree_contains_struct[code][TS_DECL_COMMON] = true), tree_contains_struct
[code][TS_DECL_WRTL] = true), tree_contains_struct[code][TS_DECL_WITH_VIS
] = true)
;
601 break;
602
603 case TS_DECL_WITH_VIS:
604 case TS_PARM_DECL:
605 case TS_LABEL_DECL:
606 case TS_RESULT_DECL:
607 MARK_TS_DECL_WRTL (code)((((((tree_contains_struct[code][TS_BASE] = true), tree_contains_struct
[code][TS_TYPED] = true), tree_contains_struct[code][TS_COMMON
] = true), tree_contains_struct[code][TS_DECL_MINIMAL] = true
), tree_contains_struct[code][TS_DECL_COMMON] = true), tree_contains_struct
[code][TS_DECL_WRTL] = true)
;
608 break;
609
610 case TS_FIELD_DECL:
611 MARK_TS_DECL_COMMON (code)(((((tree_contains_struct[code][TS_BASE] = true), tree_contains_struct
[code][TS_TYPED] = true), tree_contains_struct[code][TS_COMMON
] = true), tree_contains_struct[code][TS_DECL_MINIMAL] = true
), tree_contains_struct[code][TS_DECL_COMMON] = true)
;
612 break;
613
614 case TS_VAR_DECL:
615 MARK_TS_DECL_WITH_VIS (code)(((((((tree_contains_struct[code][TS_BASE] = true), tree_contains_struct
[code][TS_TYPED] = true), tree_contains_struct[code][TS_COMMON
] = true), tree_contains_struct[code][TS_DECL_MINIMAL] = true
), tree_contains_struct[code][TS_DECL_COMMON] = true), tree_contains_struct
[code][TS_DECL_WRTL] = true), tree_contains_struct[code][TS_DECL_WITH_VIS
] = true)
;
616 break;
617
618 case TS_TYPE_DECL:
619 case TS_FUNCTION_DECL:
620 MARK_TS_DECL_NON_COMMON (code)((((((((tree_contains_struct[code][TS_BASE] = true), tree_contains_struct
[code][TS_TYPED] = true), tree_contains_struct[code][TS_COMMON
] = true), tree_contains_struct[code][TS_DECL_MINIMAL] = true
), tree_contains_struct[code][TS_DECL_COMMON] = true), tree_contains_struct
[code][TS_DECL_WRTL] = true), tree_contains_struct[code][TS_DECL_WITH_VIS
] = true), tree_contains_struct[code][TS_DECL_NON_COMMON] = true
)
;
621 break;
622
623 case TS_TRANSLATION_UNIT_DECL:
624 MARK_TS_DECL_COMMON (code)(((((tree_contains_struct[code][TS_BASE] = true), tree_contains_struct
[code][TS_TYPED] = true), tree_contains_struct[code][TS_COMMON
] = true), tree_contains_struct[code][TS_DECL_MINIMAL] = true
), tree_contains_struct[code][TS_DECL_COMMON] = true)
;
625 break;
626
627 default:
628 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 628, __FUNCTION__))
;
629 }
630 }
631
632 /* Basic consistency checks for attributes used in fold. */
633 gcc_assert (tree_contains_struct[FUNCTION_DECL][TS_DECL_NON_COMMON])((void)(!(tree_contains_struct[FUNCTION_DECL][TS_DECL_NON_COMMON
]) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 633, __FUNCTION__), 0 : 0))
;
634 gcc_assert (tree_contains_struct[TYPE_DECL][TS_DECL_NON_COMMON])((void)(!(tree_contains_struct[TYPE_DECL][TS_DECL_NON_COMMON]
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 634, __FUNCTION__), 0 : 0))
;
635 gcc_assert (tree_contains_struct[CONST_DECL][TS_DECL_COMMON])((void)(!(tree_contains_struct[CONST_DECL][TS_DECL_COMMON]) ?
fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 635, __FUNCTION__), 0 : 0))
;
636 gcc_assert (tree_contains_struct[VAR_DECL][TS_DECL_COMMON])((void)(!(tree_contains_struct[VAR_DECL][TS_DECL_COMMON]) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 636, __FUNCTION__), 0 : 0))
;
637 gcc_assert (tree_contains_struct[PARM_DECL][TS_DECL_COMMON])((void)(!(tree_contains_struct[PARM_DECL][TS_DECL_COMMON]) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 637, __FUNCTION__), 0 : 0))
;
638 gcc_assert (tree_contains_struct[RESULT_DECL][TS_DECL_COMMON])((void)(!(tree_contains_struct[RESULT_DECL][TS_DECL_COMMON]) ?
fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 638, __FUNCTION__), 0 : 0))
;
639 gcc_assert (tree_contains_struct[FUNCTION_DECL][TS_DECL_COMMON])((void)(!(tree_contains_struct[FUNCTION_DECL][TS_DECL_COMMON]
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 639, __FUNCTION__), 0 : 0))
;
640 gcc_assert (tree_contains_struct[TYPE_DECL][TS_DECL_COMMON])((void)(!(tree_contains_struct[TYPE_DECL][TS_DECL_COMMON]) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 640, __FUNCTION__), 0 : 0))
;
641 gcc_assert (tree_contains_struct[TRANSLATION_UNIT_DECL][TS_DECL_COMMON])((void)(!(tree_contains_struct[TRANSLATION_UNIT_DECL][TS_DECL_COMMON
]) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 641, __FUNCTION__), 0 : 0))
;
642 gcc_assert (tree_contains_struct[LABEL_DECL][TS_DECL_COMMON])((void)(!(tree_contains_struct[LABEL_DECL][TS_DECL_COMMON]) ?
fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 642, __FUNCTION__), 0 : 0))
;
643 gcc_assert (tree_contains_struct[FIELD_DECL][TS_DECL_COMMON])((void)(!(tree_contains_struct[FIELD_DECL][TS_DECL_COMMON]) ?
fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 643, __FUNCTION__), 0 : 0))
;
644 gcc_assert (tree_contains_struct[VAR_DECL][TS_DECL_WRTL])((void)(!(tree_contains_struct[VAR_DECL][TS_DECL_WRTL]) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 644, __FUNCTION__), 0 : 0))
;
645 gcc_assert (tree_contains_struct[PARM_DECL][TS_DECL_WRTL])((void)(!(tree_contains_struct[PARM_DECL][TS_DECL_WRTL]) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 645, __FUNCTION__), 0 : 0))
;
646 gcc_assert (tree_contains_struct[RESULT_DECL][TS_DECL_WRTL])((void)(!(tree_contains_struct[RESULT_DECL][TS_DECL_WRTL]) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 646, __FUNCTION__), 0 : 0))
;
647 gcc_assert (tree_contains_struct[FUNCTION_DECL][TS_DECL_WRTL])((void)(!(tree_contains_struct[FUNCTION_DECL][TS_DECL_WRTL]) ?
fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 647, __FUNCTION__), 0 : 0))
;
648 gcc_assert (tree_contains_struct[LABEL_DECL][TS_DECL_WRTL])((void)(!(tree_contains_struct[LABEL_DECL][TS_DECL_WRTL]) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 648, __FUNCTION__), 0 : 0))
;
649 gcc_assert (tree_contains_struct[CONST_DECL][TS_DECL_MINIMAL])((void)(!(tree_contains_struct[CONST_DECL][TS_DECL_MINIMAL]) ?
fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 649, __FUNCTION__), 0 : 0))
;
650 gcc_assert (tree_contains_struct[VAR_DECL][TS_DECL_MINIMAL])((void)(!(tree_contains_struct[VAR_DECL][TS_DECL_MINIMAL]) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 650, __FUNCTION__), 0 : 0))
;
651 gcc_assert (tree_contains_struct[PARM_DECL][TS_DECL_MINIMAL])((void)(!(tree_contains_struct[PARM_DECL][TS_DECL_MINIMAL]) ?
fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 651, __FUNCTION__), 0 : 0))
;
652 gcc_assert (tree_contains_struct[RESULT_DECL][TS_DECL_MINIMAL])((void)(!(tree_contains_struct[RESULT_DECL][TS_DECL_MINIMAL])
? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 652, __FUNCTION__), 0 : 0))
;
653 gcc_assert (tree_contains_struct[FUNCTION_DECL][TS_DECL_MINIMAL])((void)(!(tree_contains_struct[FUNCTION_DECL][TS_DECL_MINIMAL
]) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 653, __FUNCTION__), 0 : 0))
;
654 gcc_assert (tree_contains_struct[TYPE_DECL][TS_DECL_MINIMAL])((void)(!(tree_contains_struct[TYPE_DECL][TS_DECL_MINIMAL]) ?
fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 654, __FUNCTION__), 0 : 0))
;
655 gcc_assert (tree_contains_struct[TRANSLATION_UNIT_DECL][TS_DECL_MINIMAL])((void)(!(tree_contains_struct[TRANSLATION_UNIT_DECL][TS_DECL_MINIMAL
]) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 655, __FUNCTION__), 0 : 0))
;
656 gcc_assert (tree_contains_struct[LABEL_DECL][TS_DECL_MINIMAL])((void)(!(tree_contains_struct[LABEL_DECL][TS_DECL_MINIMAL]) ?
fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 656, __FUNCTION__), 0 : 0))
;
657 gcc_assert (tree_contains_struct[FIELD_DECL][TS_DECL_MINIMAL])((void)(!(tree_contains_struct[FIELD_DECL][TS_DECL_MINIMAL]) ?
fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 657, __FUNCTION__), 0 : 0))
;
658 gcc_assert (tree_contains_struct[VAR_DECL][TS_DECL_WITH_VIS])((void)(!(tree_contains_struct[VAR_DECL][TS_DECL_WITH_VIS]) ?
fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 658, __FUNCTION__), 0 : 0))
;
659 gcc_assert (tree_contains_struct[FUNCTION_DECL][TS_DECL_WITH_VIS])((void)(!(tree_contains_struct[FUNCTION_DECL][TS_DECL_WITH_VIS
]) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 659, __FUNCTION__), 0 : 0))
;
660 gcc_assert (tree_contains_struct[TYPE_DECL][TS_DECL_WITH_VIS])((void)(!(tree_contains_struct[TYPE_DECL][TS_DECL_WITH_VIS]) ?
fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 660, __FUNCTION__), 0 : 0))
;
661 gcc_assert (tree_contains_struct[VAR_DECL][TS_VAR_DECL])((void)(!(tree_contains_struct[VAR_DECL][TS_VAR_DECL]) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 661, __FUNCTION__), 0 : 0))
;
662 gcc_assert (tree_contains_struct[FIELD_DECL][TS_FIELD_DECL])((void)(!(tree_contains_struct[FIELD_DECL][TS_FIELD_DECL]) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 662, __FUNCTION__), 0 : 0))
;
663 gcc_assert (tree_contains_struct[PARM_DECL][TS_PARM_DECL])((void)(!(tree_contains_struct[PARM_DECL][TS_PARM_DECL]) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 663, __FUNCTION__), 0 : 0))
;
664 gcc_assert (tree_contains_struct[LABEL_DECL][TS_LABEL_DECL])((void)(!(tree_contains_struct[LABEL_DECL][TS_LABEL_DECL]) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 664, __FUNCTION__), 0 : 0))
;
665 gcc_assert (tree_contains_struct[RESULT_DECL][TS_RESULT_DECL])((void)(!(tree_contains_struct[RESULT_DECL][TS_RESULT_DECL]) ?
fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 665, __FUNCTION__), 0 : 0))
;
666 gcc_assert (tree_contains_struct[CONST_DECL][TS_CONST_DECL])((void)(!(tree_contains_struct[CONST_DECL][TS_CONST_DECL]) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 666, __FUNCTION__), 0 : 0))
;
667 gcc_assert (tree_contains_struct[TYPE_DECL][TS_TYPE_DECL])((void)(!(tree_contains_struct[TYPE_DECL][TS_TYPE_DECL]) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 667, __FUNCTION__), 0 : 0))
;
668 gcc_assert (tree_contains_struct[FUNCTION_DECL][TS_FUNCTION_DECL])((void)(!(tree_contains_struct[FUNCTION_DECL][TS_FUNCTION_DECL
]) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 668, __FUNCTION__), 0 : 0))
;
669 gcc_assert (tree_contains_struct[IMPORTED_DECL][TS_DECL_MINIMAL])((void)(!(tree_contains_struct[IMPORTED_DECL][TS_DECL_MINIMAL
]) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 669, __FUNCTION__), 0 : 0))
;
670 gcc_assert (tree_contains_struct[IMPORTED_DECL][TS_DECL_COMMON])((void)(!(tree_contains_struct[IMPORTED_DECL][TS_DECL_COMMON]
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 670, __FUNCTION__), 0 : 0))
;
671 gcc_assert (tree_contains_struct[NAMELIST_DECL][TS_DECL_MINIMAL])((void)(!(tree_contains_struct[NAMELIST_DECL][TS_DECL_MINIMAL
]) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 671, __FUNCTION__), 0 : 0))
;
672 gcc_assert (tree_contains_struct[NAMELIST_DECL][TS_DECL_COMMON])((void)(!(tree_contains_struct[NAMELIST_DECL][TS_DECL_COMMON]
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 672, __FUNCTION__), 0 : 0))
;
673}
674
675
676/* Init tree.c. */
677
678void
679init_ttree (void)
680{
681 /* Initialize the hash table of types. */
682 type_hash_table
683 = hash_table<type_cache_hasher>::create_ggc (TYPE_HASH_INITIAL_SIZE1000);
684
685 debug_expr_for_decl
686 = hash_table<tree_decl_map_cache_hasher>::create_ggc (512);
687
688 value_expr_for_decl
689 = hash_table<tree_decl_map_cache_hasher>::create_ggc (512);
690
691 int_cst_hash_table = hash_table<int_cst_hasher>::create_ggc (1024);
692
693 poly_int_cst_hash_table = hash_table<poly_int_cst_hasher>::create_ggc (64);
694
695 int_cst_node = make_int_cst (1, 1);
696
697 cl_option_hash_table = hash_table<cl_option_hasher>::create_ggc (64);
698
699 cl_optimization_node = make_node (OPTIMIZATION_NODE);
700 cl_target_option_node = make_node (TARGET_OPTION_NODE);
701
702 /* Initialize the tree_contains_struct array. */
703 initialize_tree_contains_struct ();
704 lang_hooks.init_ts ();
705}
706
707
708/* The name of the object as the assembler will see it (but before any
709 translations made by ASM_OUTPUT_LABELREF). Often this is the same
710 as DECL_NAME. It is an IDENTIFIER_NODE. */
711tree
712decl_assembler_name (tree decl)
713{
714 if (!DECL_ASSEMBLER_NAME_SET_P (decl)(((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 714, __FUNCTION__))->decl_with_vis.assembler_name) != (tree
) nullptr)
)
715 lang_hooks.set_decl_assembler_name (decl);
716 return DECL_ASSEMBLER_NAME_RAW (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 716, __FUNCTION__))->decl_with_vis.assembler_name)
;
717}
718
719/* The DECL_ASSEMBLER_NAME_RAW of DECL is being explicitly set to NAME
720 (either of which may be NULL). Inform the FE, if this changes the
721 name. */
722
723void
724overwrite_decl_assembler_name (tree decl, tree name)
725{
726 if (DECL_ASSEMBLER_NAME_RAW (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 726, __FUNCTION__))->decl_with_vis.assembler_name)
!= name)
727 lang_hooks.overwrite_decl_assembler_name (decl, name);
728}
729
730/* Return true if DECL may need an assembler name to be set. */
731
732static inline bool
733need_assembler_name_p (tree decl)
734{
735 /* We use DECL_ASSEMBLER_NAME to hold mangled type names for One Definition
736 Rule merging. This makes type_odr_p to return true on those types during
737 LTO and by comparing the mangled name, we can say what types are intended
738 to be equivalent across compilation unit.
739
740 We do not store names of type_in_anonymous_namespace_p.
741
742 Record, union and enumeration type have linkage that allows use
743 to check type_in_anonymous_namespace_p. We do not mangle compound types
744 that always can be compared structurally.
745
746 Similarly for builtin types, we compare properties of their main variant.
747 A special case are integer types where mangling do make differences
748 between char/signed char/unsigned char etc. Storing name for these makes
749 e.g. -fno-signed-char/-fsigned-char mismatches to be handled well.
750 See cp/mangle.c:write_builtin_type for details. */
751
752 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL)
753 {
754 if (DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 754, __FUNCTION__))->decl_minimal.name)
755 && decl == TYPE_NAME (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 755, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 755, __FUNCTION__))->type_common.name)
756 && TYPE_MAIN_VARIANT (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 756, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 756, __FUNCTION__))->type_common.main_variant)
== TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 756, __FUNCTION__))->typed.type)
757 && !TYPE_ARTIFICIAL (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 757, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 757, __FUNCTION__))->base.nowarning_flag)
758 && ((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/tree.c"
, 758, __FUNCTION__))->typed.type))->base.code)
!= RECORD_TYPE
759 && 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/tree.c"
, 759, __FUNCTION__))->typed.type))->base.code)
!= UNION_TYPE)
760 || TYPE_CXX_ODR_P (TREE_TYPE (decl))((tree_check3 ((((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 760, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 760, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_common.string_flag)
)
761 && (type_with_linkage_p (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 761, __FUNCTION__))->typed.type)
)
762 || 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/tree.c"
, 762, __FUNCTION__))->typed.type))->base.code)
== INTEGER_TYPE)
763 && !variably_modified_type_p (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 763, __FUNCTION__))->typed.type)
, NULL_TREE(tree) nullptr))
764 return !DECL_ASSEMBLER_NAME_SET_P (decl)(((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 764, __FUNCTION__))->decl_with_vis.assembler_name) != (tree
) nullptr)
;
765 return false;
766 }
767 /* Only FUNCTION_DECLs and VAR_DECLs are considered. */
768 if (!VAR_OR_FUNCTION_DECL_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL || ((enum
tree_code) (decl)->base.code) == FUNCTION_DECL)
)
769 return false;
770
771 /* If DECL already has its assembler name set, it does not need a
772 new one. */
773 if (!HAS_DECL_ASSEMBLER_NAME_P (decl)((tree_contains_struct[(((enum tree_code) (decl)->base.code
))][(TS_DECL_WITH_VIS)]))
774 || DECL_ASSEMBLER_NAME_SET_P (decl)(((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 774, __FUNCTION__))->decl_with_vis.assembler_name) != (tree
) nullptr)
)
775 return false;
776
777 /* Abstract decls do not need an assembler name. */
778 if (DECL_ABSTRACT_P (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 778, __FUNCTION__))->decl_common.abstract_flag)
)
779 return false;
780
781 /* For VAR_DECLs, only static, public and external symbols need an
782 assembler name. */
783 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)
784 && !TREE_STATIC (decl)((decl)->base.static_flag)
785 && !TREE_PUBLIC (decl)((decl)->base.public_flag)
786 && !DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 786, __FUNCTION__))->decl_common.decl_flag_1)
)
787 return false;
788
789 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL)
790 {
791 /* Do not set assembler name on builtins. Allow RTL expansion to
792 decide whether to expand inline or via a regular call. */
793 if (fndecl_built_in_p (decl)
794 && DECL_BUILT_IN_CLASS (decl)((built_in_class) (tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 794, __FUNCTION__, (FUNCTION_DECL)))->function_decl.built_in_class
)
!= BUILT_IN_FRONTEND)
795 return false;
796
797 /* Functions represented in the callgraph need an assembler name. */
798 if (cgraph_node::get (decl) != NULLnullptr)
799 return true;
800
801 /* Unused and not public functions don't need an assembler name. */
802 if (!TREE_USED (decl)((decl)->base.used_flag) && !TREE_PUBLIC (decl)((decl)->base.public_flag))
803 return false;
804 }
805
806 return true;
807}
808
809/* If T needs an assembler name, have one created for it. */
810
811void
812assign_assembler_name_if_needed (tree t)
813{
814 if (need_assembler_name_p (t))
815 {
816 /* When setting DECL_ASSEMBLER_NAME, the C++ mangler may emit
817 diagnostics that use input_location to show locus
818 information. The problem here is that, at this point,
819 input_location is generally anchored to the end of the file
820 (since the parser is long gone), so we don't have a good
821 position to pin it to.
822
823 To alleviate this problem, this uses the location of T's
824 declaration. Examples of this are
825 testsuite/g++.dg/template/cond2.C and
826 testsuite/g++.dg/template/pr35240.C. */
827 location_t saved_location = input_location;
828 input_location = DECL_SOURCE_LOCATION (t)((contains_struct_check ((t), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 828, __FUNCTION__))->decl_minimal.locus)
;
829
830 decl_assembler_name (t);
831
832 input_location = saved_location;
833 }
834}
835
836/* When the target supports COMDAT groups, this indicates which group the
837 DECL is associated with. This can be either an IDENTIFIER_NODE or a
838 decl, in which case its DECL_ASSEMBLER_NAME identifies the group. */
839tree
840decl_comdat_group (const_tree node)
841{
842 struct symtab_node *snode = symtab_node::get (node);
843 if (!snode)
844 return NULLnullptr;
845 return snode->get_comdat_group ();
846}
847
848/* Likewise, but make sure it's been reduced to an IDENTIFIER_NODE. */
849tree
850decl_comdat_group_id (const_tree node)
851{
852 struct symtab_node *snode = symtab_node::get (node);
853 if (!snode)
854 return NULLnullptr;
855 return snode->get_comdat_group_id ();
856}
857
858/* When the target supports named section, return its name as IDENTIFIER_NODE
859 or NULL if it is in no section. */
860const char *
861decl_section_name (const_tree node)
862{
863 struct symtab_node *snode = symtab_node::get (node);
864 if (!snode)
865 return NULLnullptr;
866 return snode->get_section ();
867}
868
869/* Set section name of NODE to VALUE (that is expected to be
870 identifier node) */
871void
872set_decl_section_name (tree node, const char *value)
873{
874 struct symtab_node *snode;
875
876 if (value == NULLnullptr)
877 {
878 snode = symtab_node::get (node);
879 if (!snode)
880 return;
881 }
882 else if (VAR_P (node)(((enum tree_code) (node)->base.code) == VAR_DECL))
883 snode = varpool_node::get_create (node);
884 else
885 snode = cgraph_node::get_create (node);
886 snode->set_section (value);
887}
888
889/* Set section name of NODE to match the section name of OTHER.
890
891 set_decl_section_name (decl, other) is equivalent to
892 set_decl_section_name (decl, DECL_SECTION_NAME (other)), but possibly more
893 efficient. */
894void
895set_decl_section_name (tree decl, const_tree other)
896{
897 struct symtab_node *other_node = symtab_node::get (other);
898 if (other_node)
899 {
900 struct symtab_node *decl_node;
901 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL))
902 decl_node = varpool_node::get_create (decl);
903 else
904 decl_node = cgraph_node::get_create (decl);
905 decl_node->set_section (*other_node);
906 }
907 else
908 {
909 struct symtab_node *decl_node = symtab_node::get (decl);
910 if (!decl_node)
911 return;
912 decl_node->set_section (NULLnullptr);
913 }
914}
915
916/* Return TLS model of a variable NODE. */
917enum tls_model
918decl_tls_model (const_tree node)
919{
920 struct varpool_node *snode = varpool_node::get (node);
921 if (!snode)
922 return TLS_MODEL_NONE;
923 return snode->tls_model;
924}
925
926/* Set TLS model of variable NODE to MODEL. */
927void
928set_decl_tls_model (tree node, enum tls_model model)
929{
930 struct varpool_node *vnode;
931
932 if (model == TLS_MODEL_NONE)
933 {
934 vnode = varpool_node::get (node);
935 if (!vnode)
936 return;
937 }
938 else
939 vnode = varpool_node::get_create (node);
940 vnode->tls_model = model;
941}
942
943/* Compute the number of bytes occupied by a tree with code CODE.
944 This function cannot be used for nodes that have variable sizes,
945 including TREE_VEC, INTEGER_CST, STRING_CST, and CALL_EXPR. */
946size_t
947tree_code_size (enum tree_code code)
948{
949 switch (TREE_CODE_CLASS (code)tree_code_type[(int) (code)])
950 {
951 case tcc_declaration: /* A decl node */
952 switch (code)
953 {
954 case FIELD_DECL: return sizeof (tree_field_decl);
955 case PARM_DECL: return sizeof (tree_parm_decl);
956 case VAR_DECL: return sizeof (tree_var_decl);
957 case LABEL_DECL: return sizeof (tree_label_decl);
958 case RESULT_DECL: return sizeof (tree_result_decl);
959 case CONST_DECL: return sizeof (tree_const_decl);
960 case TYPE_DECL: return sizeof (tree_type_decl);
961 case FUNCTION_DECL: return sizeof (tree_function_decl);
962 case DEBUG_EXPR_DECL: return sizeof (tree_decl_with_rtl);
963 case TRANSLATION_UNIT_DECL: return sizeof (tree_translation_unit_decl);
964 case NAMESPACE_DECL:
965 case IMPORTED_DECL:
966 case NAMELIST_DECL: return sizeof (tree_decl_non_common);
967 default:
968 gcc_checking_assert (code >= NUM_TREE_CODES)((void)(!(code >= ((int) LAST_AND_UNUSED_TREE_CODE)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 968, __FUNCTION__), 0 : 0))
;
969 return lang_hooks.tree_size (code);
970 }
971
972 case tcc_type: /* a type node */
973 switch (code)
974 {
975 case OFFSET_TYPE:
976 case ENUMERAL_TYPE:
977 case BOOLEAN_TYPE:
978 case INTEGER_TYPE:
979 case REAL_TYPE:
980 case OPAQUE_TYPE:
981 case POINTER_TYPE:
982 case REFERENCE_TYPE:
983 case NULLPTR_TYPE:
984 case FIXED_POINT_TYPE:
985 case COMPLEX_TYPE:
986 case VECTOR_TYPE:
987 case ARRAY_TYPE:
988 case RECORD_TYPE:
989 case UNION_TYPE:
990 case QUAL_UNION_TYPE:
991 case VOID_TYPE:
992 case FUNCTION_TYPE:
993 case METHOD_TYPE:
994 case LANG_TYPE: return sizeof (tree_type_non_common);
995 default:
996 gcc_checking_assert (code >= NUM_TREE_CODES)((void)(!(code >= ((int) LAST_AND_UNUSED_TREE_CODE)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 996, __FUNCTION__), 0 : 0))
;
997 return lang_hooks.tree_size (code);
998 }
999
1000 case tcc_reference: /* a reference */
1001 case tcc_expression: /* an expression */
1002 case tcc_statement: /* an expression with side effects */
1003 case tcc_comparison: /* a comparison expression */
1004 case tcc_unary: /* a unary arithmetic expression */
1005 case tcc_binary: /* a binary arithmetic expression */
1006 return (sizeof (struct tree_exp)
1007 + (TREE_CODE_LENGTH (code)tree_code_length[(int) (code)] - 1) * sizeof (tree));
1008
1009 case tcc_constant: /* a constant */
1010 switch (code)
1011 {
1012 case VOID_CST: return sizeof (tree_typed);
1013 case INTEGER_CST: gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1013, __FUNCTION__))
;
1014 case POLY_INT_CST: return sizeof (tree_poly_int_cst);
1015 case REAL_CST: return sizeof (tree_real_cst);
1016 case FIXED_CST: return sizeof (tree_fixed_cst);
1017 case COMPLEX_CST: return sizeof (tree_complex);
1018 case VECTOR_CST: gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1018, __FUNCTION__))
;
1019 case STRING_CST: gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1019, __FUNCTION__))
;
1020 default:
1021 gcc_checking_assert (code >= NUM_TREE_CODES)((void)(!(code >= ((int) LAST_AND_UNUSED_TREE_CODE)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1021, __FUNCTION__), 0 : 0))
;
1022 return lang_hooks.tree_size (code);
1023 }
1024
1025 case tcc_exceptional: /* something random, like an identifier. */
1026 switch (code)
1027 {
1028 case IDENTIFIER_NODE: return lang_hooks.identifier_size;
1029 case TREE_LIST: return sizeof (tree_list);
1030
1031 case ERROR_MARK:
1032 case PLACEHOLDER_EXPR: return sizeof (tree_common);
1033
1034 case TREE_VEC: gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1034, __FUNCTION__))
;
1035 case OMP_CLAUSE: gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1035, __FUNCTION__))
;
1036
1037 case SSA_NAME: return sizeof (tree_ssa_name);
1038
1039 case STATEMENT_LIST: return sizeof (tree_statement_list);
1040 case BLOCK: return sizeof (struct tree_block);
1041 case CONSTRUCTOR: return sizeof (tree_constructor);
1042 case OPTIMIZATION_NODE: return sizeof (tree_optimization_option);
1043 case TARGET_OPTION_NODE: return sizeof (tree_target_option);
1044
1045 default:
1046 gcc_checking_assert (code >= NUM_TREE_CODES)((void)(!(code >= ((int) LAST_AND_UNUSED_TREE_CODE)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1046, __FUNCTION__), 0 : 0))
;
1047 return lang_hooks.tree_size (code);
1048 }
1049
1050 default:
1051 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1051, __FUNCTION__))
;
1052 }
1053}
1054
1055/* Compute the number of bytes occupied by NODE. This routine only
1056 looks at TREE_CODE, except for those nodes that have variable sizes. */
1057size_t
1058tree_size (const_tree node)
1059{
1060 const enum tree_code code = TREE_CODE (node)((enum tree_code) (node)->base.code);
1061 switch (code)
1062 {
1063 case INTEGER_CST:
1064 return (sizeof (struct tree_int_cst)
1065 + (TREE_INT_CST_EXT_NUNITS (node)((tree_check ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1065, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.extended
)
- 1) * sizeof (HOST_WIDE_INTlong));
1066
1067 case TREE_BINFO:
1068 return (offsetof (struct tree_binfo, base_binfos)__builtin_offsetof(struct tree_binfo, base_binfos)
1069 + vec<tree, va_gc>
1070 ::embedded_size (BINFO_N_BASE_BINFOS (node)((&(tree_check ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1070, __FUNCTION__, (TREE_BINFO)))->binfo.base_binfos)->
length ())
));
1071
1072 case TREE_VEC:
1073 return (sizeof (struct tree_vec)
1074 + (TREE_VEC_LENGTH (node)((tree_check ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1074, __FUNCTION__, (TREE_VEC)))->base.u.length)
- 1) * sizeof (tree));
1075
1076 case VECTOR_CST:
1077 return (sizeof (struct tree_vector)
1078 + (vector_cst_encoded_nelts (node) - 1) * sizeof (tree));
1079
1080 case STRING_CST:
1081 return TREE_STRING_LENGTH (node)((tree_check ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1081, __FUNCTION__, (STRING_CST)))->string.length)
+ offsetof (struct tree_string, str)__builtin_offsetof(struct tree_string, str) + 1;
1082
1083 case OMP_CLAUSE:
1084 return (sizeof (struct tree_omp_clause)
1085 + (omp_clause_num_ops[OMP_CLAUSE_CODE (node)((tree_check ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1085, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code
] - 1)
1086 * sizeof (tree));
1087
1088 default:
1089 if (TREE_CODE_CLASS (code)tree_code_type[(int) (code)] == tcc_vl_exp)
1090 return (sizeof (struct tree_exp)
1091 + (VL_EXP_OPERAND_LENGTH (node)((int)((unsigned long) (*tree_int_cst_elt_check (((tree_class_check
((node), (tcc_vl_exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1091, __FUNCTION__))->exp.operands[0]), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1091, __FUNCTION__))))
- 1) * sizeof (tree));
1092 else
1093 return tree_code_size (code);
1094 }
1095}
1096
1097/* Return tree node kind based on tree CODE. */
1098
1099static tree_node_kind
1100get_stats_node_kind (enum tree_code code)
1101{
1102 enum tree_code_class type = TREE_CODE_CLASS (code)tree_code_type[(int) (code)];
1103
1104 switch (type)
1105 {
1106 case tcc_declaration: /* A decl node */
1107 return d_kind;
1108 case tcc_type: /* a type node */
1109 return t_kind;
1110 case tcc_statement: /* an expression with side effects */
1111 return s_kind;
1112 case tcc_reference: /* a reference */
1113 return r_kind;
1114 case tcc_expression: /* an expression */
1115 case tcc_comparison: /* a comparison expression */
1116 case tcc_unary: /* a unary arithmetic expression */
1117 case tcc_binary: /* a binary arithmetic expression */
1118 return e_kind;
1119 case tcc_constant: /* a constant */
1120 return c_kind;
1121 case tcc_exceptional: /* something random, like an identifier. */
1122 switch (code)
1123 {
1124 case IDENTIFIER_NODE:
1125 return id_kind;
1126 case TREE_VEC:
1127 return vec_kind;
1128 case TREE_BINFO:
1129 return binfo_kind;
1130 case SSA_NAME:
1131 return ssa_name_kind;
1132 case BLOCK:
1133 return b_kind;
1134 case CONSTRUCTOR:
1135 return constr_kind;
1136 case OMP_CLAUSE:
1137 return omp_clause_kind;
1138 default:
1139 return x_kind;
1140 }
1141 break;
1142 case tcc_vl_exp:
1143 return e_kind;
1144 default:
1145 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1145, __FUNCTION__))
;
1146 }
1147}
1148
1149/* Record interesting allocation statistics for a tree node with CODE
1150 and LENGTH. */
1151
1152static void
1153record_node_allocation_statistics (enum tree_code code, size_t length)
1154{
1155 if (!GATHER_STATISTICS0)
1156 return;
1157
1158 tree_node_kind kind = get_stats_node_kind (code);
1159
1160 tree_code_counts[(int) code]++;
1161 tree_node_counts[(int) kind]++;
1162 tree_node_sizes[(int) kind] += length;
1163}
1164
1165/* Allocate and return a new UID from the DECL_UID namespace. */
1166
1167int
1168allocate_decl_uid (void)
1169{
1170 return next_decl_uid++;
1171}
1172
1173/* Return a newly allocated node of code CODE. For decl and type
1174 nodes, some other fields are initialized. The rest of the node is
1175 initialized to zero. This function cannot be used for TREE_VEC,
1176 INTEGER_CST or OMP_CLAUSE nodes, which is enforced by asserts in
1177 tree_code_size.
1178
1179 Achoo! I got a code in the node. */
1180
1181tree
1182make_node (enum tree_code code MEM_STAT_DECL)
1183{
1184 tree t;
1185 enum tree_code_class type = TREE_CODE_CLASS (code)tree_code_type[(int) (code)];
1186 size_t length = tree_code_size (code);
1187
1188 record_node_allocation_statistics (code, length);
1189
1190 t = ggc_alloc_cleared_tree_node_stat (length PASS_MEM_STAT);
1191 TREE_SET_CODE (t, code)((t)->base.code = (code));
1192
1193 switch (type)
1194 {
1195 case tcc_statement:
1196 if (code != DEBUG_BEGIN_STMT)
1197 TREE_SIDE_EFFECTS (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1197, __FUNCTION__))->base.side_effects_flag)
= 1;
1198 break;
1199
1200 case tcc_declaration:
1201 if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON)(tree_contains_struct[(code)][(TS_DECL_COMMON)]))
1202 {
1203 if (code == FUNCTION_DECL)
1204 {
1205 SET_DECL_ALIGN (t, FUNCTION_ALIGNMENT (FUNCTION_BOUNDARY))(((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1205, __FUNCTION__))->decl_common.align) = ffs_hwi ((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))))
;
1206 SET_DECL_MODE (t, FUNCTION_MODE)((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1206, __FUNCTION__))->decl_common.mode = ((scalar_int_mode
((scalar_int_mode::from_int) E_QImode))))
;
1207 }
1208 else
1209 SET_DECL_ALIGN (t, 1)(((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1209, __FUNCTION__))->decl_common.align) = ffs_hwi (1))
;
1210 }
1211 DECL_SOURCE_LOCATION (t)((contains_struct_check ((t), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1211, __FUNCTION__))->decl_minimal.locus)
= input_location;
1212 if (TREE_CODE (t)((enum tree_code) (t)->base.code) == DEBUG_EXPR_DECL)
1213 DECL_UID (t)((contains_struct_check ((t), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1213, __FUNCTION__))->decl_minimal.uid)
= --next_debug_decl_uid;
1214 else
1215 {
1216 DECL_UID (t)((contains_struct_check ((t), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1216, __FUNCTION__))->decl_minimal.uid)
= allocate_decl_uid ();
1217 SET_DECL_PT_UID (t, -1)((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1217, __FUNCTION__))->decl_common.pt_uid = (-1))
;
1218 }
1219 if (TREE_CODE (t)((enum tree_code) (t)->base.code) == LABEL_DECL)
1220 LABEL_DECL_UID (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1220, __FUNCTION__, (LABEL_DECL)))->label_decl.label_decl_uid
)
= -1;
1221
1222 break;
1223
1224 case tcc_type:
1225 TYPE_UID (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1225, __FUNCTION__))->type_common.uid)
= next_type_uid++;
1226 SET_TYPE_ALIGN (t, BITS_PER_UNIT)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1226, __FUNCTION__))->type_common.align = ffs_hwi ((8)))
;
1227 TYPE_USER_ALIGN (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1227, __FUNCTION__))->base.u.bits.user_align)
= 0;
1228 TYPE_MAIN_VARIANT (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1228, __FUNCTION__))->type_common.main_variant)
= t;
1229 TYPE_CANONICAL (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1229, __FUNCTION__))->type_common.canonical)
= t;
1230
1231 /* Default to no attributes for type, but let target change that. */
1232 TYPE_ATTRIBUTES (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1232, __FUNCTION__))->type_common.attributes)
= NULL_TREE(tree) nullptr;
1233 targetm.set_default_type_attributes (t);
1234
1235 /* We have not yet computed the alias set for this type. */
1236 TYPE_ALIAS_SET (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1236, __FUNCTION__))->type_common.alias_set)
= -1;
1237 break;
1238
1239 case tcc_constant:
1240 TREE_CONSTANT (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1240, __FUNCTION__))->base.constant_flag)
= 1;
1241 break;
1242
1243 case tcc_expression:
1244 switch (code)
1245 {
1246 case INIT_EXPR:
1247 case MODIFY_EXPR:
1248 case VA_ARG_EXPR:
1249 case PREDECREMENT_EXPR:
1250 case PREINCREMENT_EXPR:
1251 case POSTDECREMENT_EXPR:
1252 case POSTINCREMENT_EXPR:
1253 /* All of these have side-effects, no matter what their
1254 operands are. */
1255 TREE_SIDE_EFFECTS (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1255, __FUNCTION__))->base.side_effects_flag)
= 1;
1256 break;
1257
1258 default:
1259 break;
1260 }
1261 break;
1262
1263 case tcc_exceptional:
1264 switch (code)
1265 {
1266 case TARGET_OPTION_NODE:
1267 TREE_TARGET_OPTION(t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1267, __FUNCTION__, (TARGET_OPTION_NODE)))->target_option
.opts)
1268 = ggc_cleared_alloc<struct cl_target_option> ();
1269 break;
1270
1271 case OPTIMIZATION_NODE:
1272 TREE_OPTIMIZATION (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1272, __FUNCTION__, (OPTIMIZATION_NODE)))->optimization.
opts)
1273 = ggc_cleared_alloc<struct cl_optimization> ();
1274 break;
1275
1276 default:
1277 break;
1278 }
1279 break;
1280
1281 default:
1282 /* Other classes need no special treatment. */
1283 break;
1284 }
1285
1286 return t;
1287}
1288
1289/* Free tree node. */
1290
1291void
1292free_node (tree node)
1293{
1294 enum tree_code code = TREE_CODE (node)((enum tree_code) (node)->base.code);
1295 if (GATHER_STATISTICS0)
1296 {
1297 enum tree_node_kind kind = get_stats_node_kind (code);
1298
1299 gcc_checking_assert (tree_code_counts[(int) TREE_CODE (node)] != 0)((void)(!(tree_code_counts[(int) ((enum tree_code) (node)->
base.code)] != 0) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1299, __FUNCTION__), 0 : 0))
;
1300 gcc_checking_assert (tree_node_counts[(int) kind] != 0)((void)(!(tree_node_counts[(int) kind] != 0) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1300, __FUNCTION__), 0 : 0))
;
1301 gcc_checking_assert (tree_node_sizes[(int) kind] >= tree_size (node))((void)(!(tree_node_sizes[(int) kind] >= tree_size (node))
? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1301, __FUNCTION__), 0 : 0))
;
1302
1303 tree_code_counts[(int) TREE_CODE (node)((enum tree_code) (node)->base.code)]--;
1304 tree_node_counts[(int) kind]--;
1305 tree_node_sizes[(int) kind] -= tree_size (node);
1306 }
1307 if (CODE_CONTAINS_STRUCT (code, TS_CONSTRUCTOR)(tree_contains_struct[(code)][(TS_CONSTRUCTOR)]))
1308 vec_free (CONSTRUCTOR_ELTS (node)((tree_check ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1308, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)
);
1309 else if (code == BLOCK)
1310 vec_free (BLOCK_NONLOCALIZED_VARS (node)((tree_check ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1310, __FUNCTION__, (BLOCK)))->block.nonlocalized_vars)
);
1311 else if (code == TREE_BINFO)
1312 vec_free (BINFO_BASE_ACCESSES (node)((tree_check ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1312, __FUNCTION__, (TREE_BINFO)))->binfo.base_accesses)
);
1313 else if (code == OPTIMIZATION_NODE)
1314 cl_optimization_option_free (TREE_OPTIMIZATION (node)((tree_check ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1314, __FUNCTION__, (OPTIMIZATION_NODE)))->optimization.
opts)
);
1315 else if (code == TARGET_OPTION_NODE)
1316 cl_target_option_free (TREE_TARGET_OPTION (node)((tree_check ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1316, __FUNCTION__, (TARGET_OPTION_NODE)))->target_option
.opts)
);
1317 ggc_free (node);
1318}
1319
1320/* Return a new node with the same contents as NODE except that its
1321 TREE_CHAIN, if it has one, is zero and it has a fresh uid. */
1322
1323tree
1324copy_node (tree node MEM_STAT_DECL)
1325{
1326 tree t;
1327 enum tree_code code = TREE_CODE (node)((enum tree_code) (node)->base.code);
1328 size_t length;
1329
1330 gcc_assert (code != STATEMENT_LIST)((void)(!(code != STATEMENT_LIST) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1330, __FUNCTION__), 0 : 0))
;
1331
1332 length = tree_size (node);
1333 record_node_allocation_statistics (code, length);
1334 t = ggc_alloc_tree_node_stat (length PASS_MEM_STAT);
1335 memcpy (t, node, length);
1336
1337 if (CODE_CONTAINS_STRUCT (code, TS_COMMON)(tree_contains_struct[(code)][(TS_COMMON)]))
1338 TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1338, __FUNCTION__))->common.chain)
= 0;
1339 TREE_ASM_WRITTEN (t)((t)->base.asm_written_flag) = 0;
1340 TREE_VISITED (t)((t)->base.visited) = 0;
1341
1342 if (TREE_CODE_CLASS (code)tree_code_type[(int) (code)] == tcc_declaration)
1343 {
1344 if (code == DEBUG_EXPR_DECL)
1345 DECL_UID (t)((contains_struct_check ((t), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1345, __FUNCTION__))->decl_minimal.uid)
= --next_debug_decl_uid;
1346 else
1347 {
1348 DECL_UID (t)((contains_struct_check ((t), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1348, __FUNCTION__))->decl_minimal.uid)
= allocate_decl_uid ();
1349 if (DECL_PT_UID_SET_P (node)((contains_struct_check ((node), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1349, __FUNCTION__))->decl_common.pt_uid != -1u)
)
1350 SET_DECL_PT_UID (t, DECL_PT_UID (node))((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1350, __FUNCTION__))->decl_common.pt_uid = (((contains_struct_check
((node), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1350, __FUNCTION__))->decl_common.pt_uid == -1u ? (node)
->decl_minimal.uid : (node)->decl_common.pt_uid)))
;
1351 }
1352 if ((TREE_CODE (node)((enum tree_code) (node)->base.code) == PARM_DECL || VAR_P (node)(((enum tree_code) (node)->base.code) == VAR_DECL))
1353 && DECL_HAS_VALUE_EXPR_P (node)((tree_check3 ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1353, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL))
) ->decl_common.decl_flag_2)
)
1354 {
1355 SET_DECL_VALUE_EXPR (t, DECL_VALUE_EXPR (node))(decl_value_expr_insert ((contains_struct_check ((t), (TS_DECL_WRTL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1355, __FUNCTION__)), (decl_value_expr_lookup ((contains_struct_check
((node), (TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1355, __FUNCTION__))))))
;
1356 DECL_HAS_VALUE_EXPR_P (t)((tree_check3 ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1356, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL))
) ->decl_common.decl_flag_2)
= 1;
1357 }
1358 /* DECL_DEBUG_EXPR is copied explicitly by callers. */
1359 if (VAR_P (node)(((enum tree_code) (node)->base.code) == VAR_DECL))
1360 {
1361 DECL_HAS_DEBUG_EXPR_P (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1361, __FUNCTION__, (VAR_DECL)))->decl_common.debug_expr_is_from
)
= 0;
1362 t->decl_with_vis.symtab_node = NULLnullptr;
1363 }
1364 if (VAR_P (node)(((enum tree_code) (node)->base.code) == VAR_DECL) && DECL_HAS_INIT_PRIORITY_P (node)((tree_check ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1364, __FUNCTION__, (VAR_DECL)))->decl_with_vis.init_priority_p
)
)
1365 {
1366 SET_DECL_INIT_PRIORITY (t, DECL_INIT_PRIORITY (node))(decl_init_priority_insert (t, (decl_init_priority_lookup (node
))))
;
1367 DECL_HAS_INIT_PRIORITY_P (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1367, __FUNCTION__, (VAR_DECL)))->decl_with_vis.init_priority_p
)
= 1;
1368 }
1369 if (TREE_CODE (node)((enum tree_code) (node)->base.code) == FUNCTION_DECL)
1370 {
1371 DECL_STRUCT_FUNCTION (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1371, __FUNCTION__, (FUNCTION_DECL)))->function_decl.f)
= NULLnullptr;
1372 t->decl_with_vis.symtab_node = NULLnullptr;
1373 }
1374 }
1375 else if (TREE_CODE_CLASS (code)tree_code_type[(int) (code)] == tcc_type)
1376 {
1377 TYPE_UID (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1377, __FUNCTION__))->type_common.uid)
= next_type_uid++;
1378 /* The following is so that the debug code for
1379 the copy is different from the original type.
1380 The two statements usually duplicate each other
1381 (because they clear fields of the same union),
1382 but the optimizer should catch that. */
1383 TYPE_SYMTAB_ADDRESS (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1383, __FUNCTION__))->type_common.symtab.address)
= 0;
1384 TYPE_SYMTAB_DIE (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1384, __FUNCTION__))->type_common.symtab.die)
= 0;
1385
1386 /* Do not copy the values cache. */
1387 if (TYPE_CACHED_VALUES_P (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1387, __FUNCTION__))->base.public_flag)
)
1388 {
1389 TYPE_CACHED_VALUES_P (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1389, __FUNCTION__))->base.public_flag)
= 0;
1390 TYPE_CACHED_VALUES (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1390, __FUNCTION__))->type_non_common.values)
= NULL_TREE(tree) nullptr;
1391 }
1392 }
1393 else if (code == TARGET_OPTION_NODE)
1394 {
1395 TREE_TARGET_OPTION (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1395, __FUNCTION__, (TARGET_OPTION_NODE)))->target_option
.opts)
= ggc_alloc<struct cl_target_option>();
1396 memcpy (TREE_TARGET_OPTION (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1396, __FUNCTION__, (TARGET_OPTION_NODE)))->target_option
.opts)
, TREE_TARGET_OPTION (node)((tree_check ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1396, __FUNCTION__, (TARGET_OPTION_NODE)))->target_option
.opts)
,
1397 sizeof (struct cl_target_option));
1398 }
1399 else if (code == OPTIMIZATION_NODE)
1400 {
1401 TREE_OPTIMIZATION (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1401, __FUNCTION__, (OPTIMIZATION_NODE)))->optimization.
opts)
= ggc_alloc<struct cl_optimization>();
1402 memcpy (TREE_OPTIMIZATION (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1402, __FUNCTION__, (OPTIMIZATION_NODE)))->optimization.
opts)
, TREE_OPTIMIZATION (node)((tree_check ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1402, __FUNCTION__, (OPTIMIZATION_NODE)))->optimization.
opts)
,
1403 sizeof (struct cl_optimization));
1404 }
1405
1406 return t;
1407}
1408
1409/* Return a copy of a chain of nodes, chained through the TREE_CHAIN field.
1410 For example, this can copy a list made of TREE_LIST nodes. */
1411
1412tree
1413copy_list (tree list)
1414{
1415 tree head;
1416 tree prev, next;
1417
1418 if (list == 0)
1419 return 0;
1420
1421 head = prev = copy_node (list);
1422 next = TREE_CHAIN (list)((contains_struct_check ((list), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1422, __FUNCTION__))->common.chain)
;
1423 while (next)
1424 {
1425 TREE_CHAIN (prev)((contains_struct_check ((prev), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1425, __FUNCTION__))->common.chain)
= copy_node (next);
1426 prev = TREE_CHAIN (prev)((contains_struct_check ((prev), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1426, __FUNCTION__))->common.chain)
;
1427 next = TREE_CHAIN (next)((contains_struct_check ((next), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1427, __FUNCTION__))->common.chain)
;
1428 }
1429 return head;
1430}
1431
1432
1433/* Return the value that TREE_INT_CST_EXT_NUNITS should have for an
1434 INTEGER_CST with value CST and type TYPE. */
1435
1436static unsigned int
1437get_int_cst_ext_nunits (tree type, const wide_int &cst)
1438{
1439 gcc_checking_assert (cst.get_precision () == TYPE_PRECISION (type))((void)(!(cst.get_precision () == ((tree_class_check ((type),
(tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1439, __FUNCTION__))->type_common.precision)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1439, __FUNCTION__), 0 : 0))
;
1440 /* We need extra HWIs if CST is an unsigned integer with its
1441 upper bit set. */
1442 if (TYPE_UNSIGNED (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1442, __FUNCTION__))->base.u.bits.unsigned_flag)
&& wi::neg_p (cst))
1443 return cst.get_precision () / HOST_BITS_PER_WIDE_INT64 + 1;
1444 return cst.get_len ();
1445}
1446
1447/* Return a new INTEGER_CST with value CST and type TYPE. */
1448
1449static tree
1450build_new_int_cst (tree type, const wide_int &cst)
1451{
1452 unsigned int len = cst.get_len ();
1453 unsigned int ext_len = get_int_cst_ext_nunits (type, cst);
1454 tree nt = make_int_cst (len, ext_len);
1455
1456 if (len < ext_len)
1457 {
1458 --ext_len;
1459 TREE_INT_CST_ELT (nt, ext_len)(*tree_int_cst_elt_check ((nt), (ext_len), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1459, __FUNCTION__))
1460 = zext_hwi (-1, cst.get_precision () % HOST_BITS_PER_WIDE_INT64);
1461 for (unsigned int i = len; i < ext_len; ++i)
1462 TREE_INT_CST_ELT (nt, i)(*tree_int_cst_elt_check ((nt), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1462, __FUNCTION__))
= -1;
1463 }
1464 else if (TYPE_UNSIGNED (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1464, __FUNCTION__))->base.u.bits.unsigned_flag)
1465 && cst.get_precision () < len * HOST_BITS_PER_WIDE_INT64)
1466 {
1467 len--;
1468 TREE_INT_CST_ELT (nt, len)(*tree_int_cst_elt_check ((nt), (len), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1468, __FUNCTION__))
1469 = zext_hwi (cst.elt (len),
1470 cst.get_precision () % HOST_BITS_PER_WIDE_INT64);
1471 }
1472
1473 for (unsigned int i = 0; i < len; i++)
1474 TREE_INT_CST_ELT (nt, i)(*tree_int_cst_elt_check ((nt), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1474, __FUNCTION__))
= cst.elt (i);
1475 TREE_TYPE (nt)((contains_struct_check ((nt), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1475, __FUNCTION__))->typed.type)
= type;
1476 return nt;
1477}
1478
1479/* Return a new POLY_INT_CST with coefficients COEFFS and type TYPE. */
1480
1481static tree
1482build_new_poly_int_cst (tree type, tree (&coeffs)[NUM_POLY_INT_COEFFS1]
1483 CXX_MEM_STAT_INFO)
1484{
1485 size_t length = sizeof (struct tree_poly_int_cst);
1486 record_node_allocation_statistics (POLY_INT_CST, length);
1487
1488 tree t = ggc_alloc_cleared_tree_node_stat (length PASS_MEM_STAT);
1489
1490 TREE_SET_CODE (t, POLY_INT_CST)((t)->base.code = (POLY_INT_CST));
1491 TREE_CONSTANT (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1491, __FUNCTION__))->base.constant_flag)
= 1;
1492 TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1492, __FUNCTION__))->typed.type)
= type;
1493 for (unsigned int i = 0; i < NUM_POLY_INT_COEFFS1; ++i)
1494 POLY_INT_CST_COEFF (t, i)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1494, __FUNCTION__, (POLY_INT_CST)))->poly_int_cst.coeffs
[i])
= coeffs[i];
1495 return t;
1496}
1497
1498/* Create a constant tree that contains CST sign-extended to TYPE. */
1499
1500tree
1501build_int_cst (tree type, poly_int64 cst)
1502{
1503 /* Support legacy code. */
1504 if (!type)
1505 type = integer_type_nodeinteger_types[itk_int];
1506
1507 return wide_int_to_tree (type, wi::shwi (cst, TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1507, __FUNCTION__))->type_common.precision)
));
1508}
1509
1510/* Create a constant tree that contains CST zero-extended to TYPE. */
1511
1512tree
1513build_int_cstu (tree type, poly_uint64 cst)
1514{
1515 return wide_int_to_tree (type, wi::uhwi (cst, TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1515, __FUNCTION__))->type_common.precision)
));
1516}
1517
1518/* Create a constant tree that contains CST sign-extended to TYPE. */
1519
1520tree
1521build_int_cst_type (tree type, poly_int64 cst)
1522{
1523 gcc_assert (type)((void)(!(type) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1523, __FUNCTION__), 0 : 0))
;
1524 return wide_int_to_tree (type, wi::shwi (cst, TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1524, __FUNCTION__))->type_common.precision)
));
1525}
1526
1527/* Constructs tree in type TYPE from with value given by CST. Signedness
1528 of CST is assumed to be the same as the signedness of TYPE. */
1529
1530tree
1531double_int_to_tree (tree type, double_int cst)
1532{
1533 return wide_int_to_tree (type, widest_int::from (cst, TYPE_SIGN (type)((signop) ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1533, __FUNCTION__))->base.u.bits.unsigned_flag))
));
1534}
1535
1536/* We force the wide_int CST to the range of the type TYPE by sign or
1537 zero extending it. OVERFLOWABLE indicates if we are interested in
1538 overflow of the value, when >0 we are only interested in signed
1539 overflow, for <0 we are interested in any overflow. OVERFLOWED
1540 indicates whether overflow has already occurred. CONST_OVERFLOWED
1541 indicates whether constant overflow has already occurred. We force
1542 T's value to be within range of T's type (by setting to 0 or 1 all
1543 the bits outside the type's range). We set TREE_OVERFLOWED if,
1544 OVERFLOWED is nonzero,
1545 or OVERFLOWABLE is >0 and signed overflow occurs
1546 or OVERFLOWABLE is <0 and any overflow occurs
1547 We return a new tree node for the extended wide_int. The node
1548 is shared if no overflow flags are set. */
1549
1550
1551tree
1552force_fit_type (tree type, const poly_wide_int_ref &cst,
1553 int overflowable, bool overflowed)
1554{
1555 signop sign = TYPE_SIGN (type)((signop) ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1555, __FUNCTION__))->base.u.bits.unsigned_flag))
;
1556
1557 /* If we need to set overflow flags, return a new unshared node. */
1558 if (overflowed || !wi::fits_to_tree_p (cst, type))
1559 {
1560 if (overflowed
1561 || overflowable < 0
1562 || (overflowable > 0 && sign == SIGNED))
1563 {
1564 poly_wide_int tmp = poly_wide_int::from (cst, TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1564, __FUNCTION__))->type_common.precision)
,
1565 sign);
1566 tree t;
1567 if (tmp.is_constant ())
1568 t = build_new_int_cst (type, tmp.coeffs[0]);
1569 else
1570 {
1571 tree coeffs[NUM_POLY_INT_COEFFS1];
1572 for (unsigned int i = 0; i < NUM_POLY_INT_COEFFS1; ++i)
1573 {
1574 coeffs[i] = build_new_int_cst (type, tmp.coeffs[i]);
1575 TREE_OVERFLOW (coeffs[i])((tree_class_check ((coeffs[i]), (tcc_constant), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1575, __FUNCTION__))->base.public_flag)
= 1;
1576 }
1577 t = build_new_poly_int_cst (type, coeffs);
1578 }
1579 TREE_OVERFLOW (t)((tree_class_check ((t), (tcc_constant), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1579, __FUNCTION__))->base.public_flag)
= 1;
1580 return t;
1581 }
1582 }
1583
1584 /* Else build a shared node. */
1585 return wide_int_to_tree (type, cst);
1586}
1587
1588/* These are the hash table functions for the hash table of INTEGER_CST
1589 nodes of a sizetype. */
1590
1591/* Return the hash code X, an INTEGER_CST. */
1592
1593hashval_t
1594int_cst_hasher::hash (tree x)
1595{
1596 const_tree const t = x;
1597 hashval_t code = TYPE_UID (TREE_TYPE (t))((tree_class_check ((((contains_struct_check ((t), (TS_TYPED)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1597, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1597, __FUNCTION__))->type_common.uid)
;
1598 int i;
1599
1600 for (i = 0; i < TREE_INT_CST_NUNITS (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1600, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.unextended
)
; i++)
1601 code = iterative_hash_host_wide_int (TREE_INT_CST_ELT(t, i)(*tree_int_cst_elt_check ((t), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1601, __FUNCTION__))
, code);
1602
1603 return code;
1604}
1605
1606/* Return nonzero if the value represented by *X (an INTEGER_CST tree node)
1607 is the same as that given by *Y, which is the same. */
1608
1609bool
1610int_cst_hasher::equal (tree x, tree y)
1611{
1612 const_tree const xt = x;
1613 const_tree const yt = y;
1614
1615 if (TREE_TYPE (xt)((contains_struct_check ((xt), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1615, __FUNCTION__))->typed.type)
!= TREE_TYPE (yt)((contains_struct_check ((yt), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1615, __FUNCTION__))->typed.type)
1616 || TREE_INT_CST_NUNITS (xt)((tree_check ((xt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1616, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.unextended
)
!= TREE_INT_CST_NUNITS (yt)((tree_check ((yt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1616, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.unextended
)
1617 || TREE_INT_CST_EXT_NUNITS (xt)((tree_check ((xt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1617, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.extended
)
!= TREE_INT_CST_EXT_NUNITS (yt)((tree_check ((yt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1617, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.extended
)
)
1618 return false;
1619
1620 for (int i = 0; i < TREE_INT_CST_NUNITS (xt)((tree_check ((xt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1620, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.unextended
)
; i++)
1621 if (TREE_INT_CST_ELT (xt, i)(*tree_int_cst_elt_check ((xt), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1621, __FUNCTION__))
!= TREE_INT_CST_ELT (yt, i)(*tree_int_cst_elt_check ((yt), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1621, __FUNCTION__))
)
1622 return false;
1623
1624 return true;
1625}
1626
1627/* Cache wide_int CST into the TYPE_CACHED_VALUES cache for TYPE.
1628 SLOT is the slot entry to store it in, and MAX_SLOTS is the maximum
1629 number of slots that can be cached for the type. */
1630
1631static inline tree
1632cache_wide_int_in_type_cache (tree type, const wide_int &cst,
1633 int slot, int max_slots)
1634{
1635 gcc_checking_assert (slot >= 0)((void)(!(slot >= 0) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1635, __FUNCTION__), 0 : 0))
;
1636 /* Initialize cache. */
1637 if (!TYPE_CACHED_VALUES_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1637, __FUNCTION__))->base.public_flag)
)
1638 {
1639 TYPE_CACHED_VALUES_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1639, __FUNCTION__))->base.public_flag)
= 1;
1640 TYPE_CACHED_VALUES (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1640, __FUNCTION__))->type_non_common.values)
= make_tree_vec (max_slots);
1641 }
1642 tree t = TREE_VEC_ELT (TYPE_CACHED_VALUES (type), slot)(*((const_cast<tree *> (tree_vec_elt_check ((((tree_class_check
((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1642, __FUNCTION__))->type_non_common.values)), (slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1642, __FUNCTION__)))))
;
1643 if (!t)
1644 {
1645 /* Create a new shared int. */
1646 t = build_new_int_cst (type, cst);
1647 TREE_VEC_ELT (TYPE_CACHED_VALUES (type), slot)(*((const_cast<tree *> (tree_vec_elt_check ((((tree_class_check
((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1647, __FUNCTION__))->type_non_common.values)), (slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1647, __FUNCTION__)))))
= t;
1648 }
1649 return t;
1650}
1651
1652/* Create an INT_CST node of TYPE and value CST.
1653 The returned node is always shared. For small integers we use a
1654 per-type vector cache, for larger ones we use a single hash table.
1655 The value is extended from its precision according to the sign of
1656 the type to be a multiple of HOST_BITS_PER_WIDE_INT. This defines
1657 the upper bits and ensures that hashing and value equality based
1658 upon the underlying HOST_WIDE_INTs works without masking. */
1659
1660static tree
1661wide_int_to_tree_1 (tree type, const wide_int_ref &pcst)
1662{
1663 tree t;
1664 int ix = -1;
1665 int limit = 0;
1666
1667 gcc_assert (type)((void)(!(type) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1667, __FUNCTION__), 0 : 0))
;
1668 unsigned int prec = TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1668, __FUNCTION__))->type_common.precision)
;
1669 signop sgn = TYPE_SIGN (type)((signop) ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1669, __FUNCTION__))->base.u.bits.unsigned_flag))
;
1670
1671 /* Verify that everything is canonical. */
1672 int l = pcst.get_len ();
1673 if (l > 1)
1674 {
1675 if (pcst.elt (l - 1) == 0)
1676 gcc_checking_assert (pcst.elt (l - 2) < 0)((void)(!(pcst.elt (l - 2) < 0) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1676, __FUNCTION__), 0 : 0))
;
1677 if (pcst.elt (l - 1) == HOST_WIDE_INT_M1-1L)
1678 gcc_checking_assert (pcst.elt (l - 2) >= 0)((void)(!(pcst.elt (l - 2) >= 0) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1678, __FUNCTION__), 0 : 0))
;
1679 }
1680
1681 wide_int cst = wide_int::from (pcst, prec, sgn);
1682 unsigned int ext_len = get_int_cst_ext_nunits (type, cst);
1683
1684 enum tree_code code = TREE_CODE (type)((enum tree_code) (type)->base.code);
1685 if (code == POINTER_TYPE || code == REFERENCE_TYPE)
1686 {
1687 /* Cache NULL pointer and zero bounds. */
1688 if (cst == 0)
1689 ix = 0;
1690 /* Cache upper bounds of pointers. */
1691 else if (cst == wi::max_value (prec, sgn))
1692 ix = 1;
1693 /* Cache 1 which is used for a non-zero range. */
1694 else if (cst == 1)
1695 ix = 2;
1696
1697 if (ix >= 0)
1698 {
1699 t = cache_wide_int_in_type_cache (type, cst, ix, 3);
1700 /* Make sure no one is clobbering the shared constant. */
1701 gcc_checking_assert (TREE_TYPE (t) == type((void)(!(((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1701, __FUNCTION__))->typed.type) == type && cst
== wi::to_wide (t)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1702, __FUNCTION__), 0 : 0))
1702 && cst == wi::to_wide (t))((void)(!(((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1701, __FUNCTION__))->typed.type) == type && cst
== wi::to_wide (t)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1702, __FUNCTION__), 0 : 0))
;
1703 return t;
1704 }
1705 }
1706 if (ext_len == 1)
1707 {
1708 /* We just need to store a single HOST_WIDE_INT. */
1709 HOST_WIDE_INTlong hwi;
1710 if (TYPE_UNSIGNED (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1710, __FUNCTION__))->base.u.bits.unsigned_flag)
)
1711 hwi = cst.to_uhwi ();
1712 else
1713 hwi = cst.to_shwi ();
1714
1715 switch (code)
1716 {
1717 case NULLPTR_TYPE:
1718 gcc_assert (hwi == 0)((void)(!(hwi == 0) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1718, __FUNCTION__), 0 : 0))
;
1719 /* Fallthru. */
1720
1721 case POINTER_TYPE:
1722 case REFERENCE_TYPE:
1723 /* Ignore pointers, as they were already handled above. */
1724 break;
1725
1726 case BOOLEAN_TYPE:
1727 /* Cache false or true. */
1728 limit = 2;
1729 if (IN_RANGE (hwi, 0, 1)((unsigned long) (hwi) - (unsigned long) (0) <= (unsigned long
) (1) - (unsigned long) (0))
)
1730 ix = hwi;
1731 break;
1732
1733 case INTEGER_TYPE:
1734 case OFFSET_TYPE:
1735 if (TYPE_SIGN (type)((signop) ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1735, __FUNCTION__))->base.u.bits.unsigned_flag))
== UNSIGNED)
1736 {
1737 /* Cache [0, N). */
1738 limit = param_integer_share_limitglobal_options.x_param_integer_share_limit;
1739 if (IN_RANGE (hwi, 0, param_integer_share_limit - 1)((unsigned long) (hwi) - (unsigned long) (0) <= (unsigned long
) (global_options.x_param_integer_share_limit - 1) - (unsigned
long) (0))
)
1740 ix = hwi;
1741 }
1742 else
1743 {
1744 /* Cache [-1, N). */
1745 limit = param_integer_share_limitglobal_options.x_param_integer_share_limit + 1;
1746 if (IN_RANGE (hwi, -1, param_integer_share_limit - 1)((unsigned long) (hwi) - (unsigned long) (-1) <= (unsigned
long) (global_options.x_param_integer_share_limit - 1) - (unsigned
long) (-1))
)
1747 ix = hwi + 1;
1748 }
1749 break;
1750
1751 case ENUMERAL_TYPE:
1752 break;
1753
1754 default:
1755 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1755, __FUNCTION__))
;
1756 }
1757
1758 if (ix >= 0)
1759 {
1760 t = cache_wide_int_in_type_cache (type, cst, ix, limit);
1761 /* Make sure no one is clobbering the shared constant. */
1762 gcc_checking_assert (TREE_TYPE (t) == type((void)(!(((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1762, __FUNCTION__))->typed.type) == type && ((tree_check
((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1763, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.unextended
) == 1 && ((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1764, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.offset
) == 1 && ((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1765, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.extended
) == 1 && (*tree_int_cst_elt_check ((t), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1766, __FUNCTION__)) == hwi) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1766, __FUNCTION__), 0 : 0))
1763 && TREE_INT_CST_NUNITS (t) == 1((void)(!(((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1762, __FUNCTION__))->typed.type) == type && ((tree_check
((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1763, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.unextended
) == 1 && ((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1764, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.offset
) == 1 && ((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1765, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.extended
) == 1 && (*tree_int_cst_elt_check ((t), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1766, __FUNCTION__)) == hwi) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1766, __FUNCTION__), 0 : 0))
1764 && TREE_INT_CST_OFFSET_NUNITS (t) == 1((void)(!(((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1762, __FUNCTION__))->typed.type) == type && ((tree_check
((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1763, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.unextended
) == 1 && ((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1764, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.offset
) == 1 && ((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1765, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.extended
) == 1 && (*tree_int_cst_elt_check ((t), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1766, __FUNCTION__)) == hwi) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1766, __FUNCTION__), 0 : 0))
1765 && TREE_INT_CST_EXT_NUNITS (t) == 1((void)(!(((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1762, __FUNCTION__))->typed.type) == type && ((tree_check
((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1763, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.unextended
) == 1 && ((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1764, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.offset
) == 1 && ((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1765, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.extended
) == 1 && (*tree_int_cst_elt_check ((t), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1766, __FUNCTION__)) == hwi) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1766, __FUNCTION__), 0 : 0))
1766 && TREE_INT_CST_ELT (t, 0) == hwi)((void)(!(((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1762, __FUNCTION__))->typed.type) == type && ((tree_check
((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1763, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.unextended
) == 1 && ((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1764, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.offset
) == 1 && ((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1765, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.extended
) == 1 && (*tree_int_cst_elt_check ((t), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1766, __FUNCTION__)) == hwi) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1766, __FUNCTION__), 0 : 0))
;
1767 return t;
1768 }
1769 else
1770 {
1771 /* Use the cache of larger shared ints, using int_cst_node as
1772 a temporary. */
1773
1774 TREE_INT_CST_ELT (int_cst_node, 0)(*tree_int_cst_elt_check ((int_cst_node), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1774, __FUNCTION__))
= hwi;
1775 TREE_TYPE (int_cst_node)((contains_struct_check ((int_cst_node), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1775, __FUNCTION__))->typed.type)
= type;
1776
1777 tree *slot = int_cst_hash_table->find_slot (int_cst_node, INSERT);
1778 t = *slot;
1779 if (!t)
1780 {
1781 /* Insert this one into the hash table. */
1782 t = int_cst_node;
1783 *slot = t;
1784 /* Make a new node for next time round. */
1785 int_cst_node = make_int_cst (1, 1);
1786 }
1787 }
1788 }
1789 else
1790 {
1791 /* The value either hashes properly or we drop it on the floor
1792 for the gc to take care of. There will not be enough of them
1793 to worry about. */
1794
1795 tree nt = build_new_int_cst (type, cst);
1796 tree *slot = int_cst_hash_table->find_slot (nt, INSERT);
1797 t = *slot;
1798 if (!t)
1799 {
1800 /* Insert this one into the hash table. */
1801 t = nt;
1802 *slot = t;
1803 }
1804 else
1805 ggc_free (nt);
1806 }
1807
1808 return t;
1809}
1810
1811hashval_t
1812poly_int_cst_hasher::hash (tree t)
1813{
1814 inchash::hash hstate;
1815
1816 hstate.add_int (TYPE_UID (TREE_TYPE (t))((tree_class_check ((((contains_struct_check ((t), (TS_TYPED)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1816, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1816, __FUNCTION__))->type_common.uid)
);
1817 for (unsigned int i = 0; i < NUM_POLY_INT_COEFFS1; ++i)
1818 hstate.add_wide_int (wi::to_wide (POLY_INT_CST_COEFF (t, i)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1818, __FUNCTION__, (POLY_INT_CST)))->poly_int_cst.coeffs
[i])
));
1819
1820 return hstate.end ();
1821}
1822
1823bool
1824poly_int_cst_hasher::equal (tree x, const compare_type &y)
1825{
1826 if (TREE_TYPE (x)((contains_struct_check ((x), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1826, __FUNCTION__))->typed.type)
!= y.first)
1827 return false;
1828 for (unsigned int i = 0; i < NUM_POLY_INT_COEFFS1; ++i)
1829 if (wi::to_wide (POLY_INT_CST_COEFF (x, i)((tree_check ((x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1829, __FUNCTION__, (POLY_INT_CST)))->poly_int_cst.coeffs
[i])
) != y.second->coeffs[i])
1830 return false;
1831 return true;
1832}
1833
1834/* Build a POLY_INT_CST node with type TYPE and with the elements in VALUES.
1835 The elements must also have type TYPE. */
1836
1837tree
1838build_poly_int_cst (tree type, const poly_wide_int_ref &values)
1839{
1840 unsigned int prec = TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1840, __FUNCTION__))->type_common.precision)
;
1841 gcc_assert (prec <= values.coeffs[0].get_precision ())((void)(!(prec <= values.coeffs[0].get_precision ()) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1841, __FUNCTION__), 0 : 0))
;
1842 poly_wide_int c = poly_wide_int::from (values, prec, SIGNED);
1843
1844 inchash::hash h;
1845 h.add_int (TYPE_UID (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1845, __FUNCTION__))->type_common.uid)
);
1846 for (unsigned int i = 0; i < NUM_POLY_INT_COEFFS1; ++i)
1847 h.add_wide_int (c.coeffs[i]);
1848 poly_int_cst_hasher::compare_type comp (type, &c);
1849 tree *slot = poly_int_cst_hash_table->find_slot_with_hash (comp, h.end (),
1850 INSERT);
1851 if (*slot == NULL_TREE(tree) nullptr)
1852 {
1853 tree coeffs[NUM_POLY_INT_COEFFS1];
1854 for (unsigned int i = 0; i < NUM_POLY_INT_COEFFS1; ++i)
1855 coeffs[i] = wide_int_to_tree_1 (type, c.coeffs[i]);
1856 *slot = build_new_poly_int_cst (type, coeffs);
1857 }
1858 return *slot;
1859}
1860
1861/* Create a constant tree with value VALUE in type TYPE. */
1862
1863tree
1864wide_int_to_tree (tree type, const poly_wide_int_ref &value)
1865{
1866 if (value.is_constant ())
1867 return wide_int_to_tree_1 (type, value.coeffs[0]);
1868 return build_poly_int_cst (type, value);
1869}
1870
1871/* Insert INTEGER_CST T into a cache of integer constants. And return
1872 the cached constant (which may or may not be T). If MIGHT_DUPLICATE
1873 is false, and T falls into the type's 'smaller values' range, there
1874 cannot be an existing entry. Otherwise, if MIGHT_DUPLICATE is true,
1875 or the value is large, should an existing entry exist, it is
1876 returned (rather than inserting T). */
1877
1878tree
1879cache_integer_cst (tree t, bool might_duplicate ATTRIBUTE_UNUSED__attribute__ ((__unused__)))
1880{
1881 tree type = TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1881, __FUNCTION__))->typed.type)
;
1882 int ix = -1;
1883 int limit = 0;
1884 int prec = TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1884, __FUNCTION__))->type_common.precision)
;
1885
1886 gcc_assert (!TREE_OVERFLOW (t))((void)(!(!((tree_class_check ((t), (tcc_constant), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1886, __FUNCTION__))->base.public_flag)) ? fancy_abort (
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1886, __FUNCTION__), 0 : 0))
;
1887
1888 /* The caching indices here must match those in
1889 wide_int_to_type_1. */
1890 switch (TREE_CODE (type)((enum tree_code) (type)->base.code))
1891 {
1892 case NULLPTR_TYPE:
1893 gcc_checking_assert (integer_zerop (t))((void)(!(integer_zerop (t)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1893, __FUNCTION__), 0 : 0))
;
1894 /* Fallthru. */
1895
1896 case POINTER_TYPE:
1897 case REFERENCE_TYPE:
1898 {
1899 if (integer_zerop (t))
1900 ix = 0;
1901 else if (integer_onep (t))
1902 ix = 2;
1903
1904 if (ix >= 0)
1905 limit = 3;
1906 }
1907 break;
1908
1909 case BOOLEAN_TYPE:
1910 /* Cache false or true. */
1911 limit = 2;
1912 if (wi::ltu_p (wi::to_wide (t), 2))
1913 ix = TREE_INT_CST_ELT (t, 0)(*tree_int_cst_elt_check ((t), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1913, __FUNCTION__))
;
1914 break;
1915
1916 case INTEGER_TYPE:
1917 case OFFSET_TYPE:
1918 if (TYPE_UNSIGNED (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1918, __FUNCTION__))->base.u.bits.unsigned_flag)
)
1919 {
1920 /* Cache 0..N */
1921 limit = param_integer_share_limitglobal_options.x_param_integer_share_limit;
1922
1923 /* This is a little hokie, but if the prec is smaller than
1924 what is necessary to hold param_integer_share_limit, then the
1925 obvious test will not get the correct answer. */
1926 if (prec < HOST_BITS_PER_WIDE_INT64)
1927 {
1928 if (tree_to_uhwi (t)
1929 < (unsigned HOST_WIDE_INTlong) param_integer_share_limitglobal_options.x_param_integer_share_limit)
1930 ix = tree_to_uhwi (t);
1931 }
1932 else if (wi::ltu_p (wi::to_wide (t), param_integer_share_limitglobal_options.x_param_integer_share_limit))
1933 ix = tree_to_uhwi (t);
1934 }
1935 else
1936 {
1937 /* Cache -1..N */
1938 limit = param_integer_share_limitglobal_options.x_param_integer_share_limit + 1;
1939
1940 if (integer_minus_onep (t))
1941 ix = 0;
1942 else if (!wi::neg_p (wi::to_wide (t)))
1943 {
1944 if (prec < HOST_BITS_PER_WIDE_INT64)
1945 {
1946 if (tree_to_shwi (t) < param_integer_share_limitglobal_options.x_param_integer_share_limit)
1947 ix = tree_to_shwi (t) + 1;
1948 }
1949 else if (wi::ltu_p (wi::to_wide (t), param_integer_share_limitglobal_options.x_param_integer_share_limit))
1950 ix = tree_to_shwi (t) + 1;
1951 }
1952 }
1953 break;
1954
1955 case ENUMERAL_TYPE:
1956 /* The slot used by TYPE_CACHED_VALUES is used for the enum
1957 members. */
1958 break;
1959
1960 default:
1961 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1961, __FUNCTION__))
;
1962 }
1963
1964 if (ix >= 0)
1965 {
1966 /* Look for it in the type's vector of small shared ints. */
1967 if (!TYPE_CACHED_VALUES_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1967, __FUNCTION__))->base.public_flag)
)
1968 {
1969 TYPE_CACHED_VALUES_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1969, __FUNCTION__))->base.public_flag)
= 1;
1970 TYPE_CACHED_VALUES (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1970, __FUNCTION__))->type_non_common.values)
= make_tree_vec (limit);
1971 }
1972
1973 if (tree r = TREE_VEC_ELT (TYPE_CACHED_VALUES (type), ix)(*((const_cast<tree *> (tree_vec_elt_check ((((tree_class_check
((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1973, __FUNCTION__))->type_non_common.values)), (ix), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1973, __FUNCTION__)))))
)
1974 {
1975 gcc_checking_assert (might_duplicate)((void)(!(might_duplicate) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1975, __FUNCTION__), 0 : 0))
;
1976 t = r;
1977 }
1978 else
1979 TREE_VEC_ELT (TYPE_CACHED_VALUES (type), ix)(*((const_cast<tree *> (tree_vec_elt_check ((((tree_class_check
((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1979, __FUNCTION__))->type_non_common.values)), (ix), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1979, __FUNCTION__)))))
= t;
1980 }
1981 else
1982 {
1983 /* Use the cache of larger shared ints. */
1984 tree *slot = int_cst_hash_table->find_slot (t, INSERT);
1985 if (tree r = *slot)
1986 {
1987 /* If there is already an entry for the number verify it's the
1988 same value. */
1989 gcc_checking_assert (wi::to_wide (tree (r)) == wi::to_wide (t))((void)(!(wi::to_wide (tree (r)) == wi::to_wide (t)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 1989, __FUNCTION__), 0 : 0))
;
1990 /* And return the cached value. */
1991 t = r;
1992 }
1993 else
1994 /* Otherwise insert this one into the hash table. */
1995 *slot = t;
1996 }
1997
1998 return t;
1999}
2000
2001
2002/* Builds an integer constant in TYPE such that lowest BITS bits are ones
2003 and the rest are zeros. */
2004
2005tree
2006build_low_bits_mask (tree type, unsigned bits)
2007{
2008 gcc_assert (bits <= TYPE_PRECISION (type))((void)(!(bits <= ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2008, __FUNCTION__))->type_common.precision)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2008, __FUNCTION__), 0 : 0))
;
2009
2010 return wide_int_to_tree (type, wi::mask (bits, false,
2011 TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2011, __FUNCTION__))->type_common.precision)
));
2012}
2013
2014/* Checks that X is integer constant that can be expressed in (unsigned)
2015 HOST_WIDE_INT without loss of precision. */
2016
2017bool
2018cst_and_fits_in_hwi (const_tree x)
2019{
2020 return (TREE_CODE (x)((enum tree_code) (x)->base.code) == INTEGER_CST
2021 && (tree_fits_shwi_p (x) || tree_fits_uhwi_p (x)));
2022}
2023
2024/* Build a newly constructed VECTOR_CST with the given values of
2025 (VECTOR_CST_)LOG2_NPATTERNS and (VECTOR_CST_)NELTS_PER_PATTERN. */
2026
2027tree
2028make_vector (unsigned log2_npatterns,
2029 unsigned int nelts_per_pattern MEM_STAT_DECL)
2030{
2031 gcc_assert (IN_RANGE (nelts_per_pattern, 1, 3))((void)(!(((unsigned long) (nelts_per_pattern) - (unsigned long
) (1) <= (unsigned long) (3) - (unsigned long) (1))) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2031, __FUNCTION__), 0 : 0))
;
2032 tree t;
2033 unsigned npatterns = 1 << log2_npatterns;
2034 unsigned encoded_nelts = npatterns * nelts_per_pattern;
2035 unsigned length = (sizeof (struct tree_vector)
2036 + (encoded_nelts - 1) * sizeof (tree));
2037
2038 record_node_allocation_statistics (VECTOR_CST, length);
2039
2040 t = ggc_alloc_cleared_tree_node_stat (length PASS_MEM_STAT);
2041
2042 TREE_SET_CODE (t, VECTOR_CST)((t)->base.code = (VECTOR_CST));
2043 TREE_CONSTANT (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2043, __FUNCTION__))->base.constant_flag)
= 1;
2044 VECTOR_CST_LOG2_NPATTERNS (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2044, __FUNCTION__, (VECTOR_CST)))->base.u.vector_cst.log2_npatterns
)
= log2_npatterns;
2045 VECTOR_CST_NELTS_PER_PATTERN (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2045, __FUNCTION__, (VECTOR_CST)))->base.u.vector_cst.nelts_per_pattern
)
= nelts_per_pattern;
2046
2047 return t;
2048}
2049
2050/* Return a new VECTOR_CST node whose type is TYPE and whose values
2051 are extracted from V, a vector of CONSTRUCTOR_ELT. */
2052
2053tree
2054build_vector_from_ctor (tree type, const vec<constructor_elt, va_gc> *v)
2055{
2056 if (vec_safe_length (v) == 0)
2057 return build_zero_cst (type);
2058
2059 unsigned HOST_WIDE_INTlong idx, nelts;
2060 tree value;
2061
2062 /* We can't construct a VECTOR_CST for a variable number of elements. */
2063 nelts = TYPE_VECTOR_SUBPARTS (type).to_constant ();
2064 tree_vector_builder vec (type, nelts, 1);
2065 FOR_EACH_CONSTRUCTOR_VALUE (v, idx, value)for (idx = 0; (idx >= vec_safe_length (v)) ? false : ((value
= (*(v))[idx].value), true); (idx)++)
2066 {
2067 if (TREE_CODE (value)((enum tree_code) (value)->base.code) == VECTOR_CST)
2068 {
2069 /* If NELTS is constant then this must be too. */
2070 unsigned int sub_nelts = VECTOR_CST_NELTS (value)(TYPE_VECTOR_SUBPARTS (((contains_struct_check ((value), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2070, __FUNCTION__))->typed.type)))
.to_constant ();
2071 for (unsigned i = 0; i < sub_nelts; ++i)
2072 vec.quick_push (VECTOR_CST_ELT (value, i)vector_cst_elt (value, i));
2073 }
2074 else
2075 vec.quick_push (value);
2076 }
2077 while (vec.length () < nelts)
2078 vec.quick_push (build_zero_cst (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2078, __FUNCTION__))->typed.type)
));
2079
2080 return vec.build ();
2081}
2082
2083/* Build a vector of type VECTYPE where all the elements are SCs. */
2084tree
2085build_vector_from_val (tree vectype, tree sc)
2086{
2087 unsigned HOST_WIDE_INTlong i, nunits;
2088
2089 if (sc == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2090 return sc;
2091
2092 /* Verify that the vector type is suitable for SC. Note that there
2093 is some inconsistency in the type-system with respect to restrict
2094 qualifications of pointers. Vector types always have a main-variant
2095 element type and the qualification is applied to the vector-type.
2096 So TREE_TYPE (vector-type) does not return a properly qualified
2097 vector element-type. */
2098 gcc_checking_assert (types_compatible_p (TYPE_MAIN_VARIANT (TREE_TYPE (sc)),((void)(!(types_compatible_p (((tree_class_check ((((contains_struct_check
((sc), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2098, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2098, __FUNCTION__))->type_common.main_variant), ((contains_struct_check
((vectype), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2099, __FUNCTION__))->typed.type))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2099, __FUNCTION__), 0 : 0))
2099 TREE_TYPE (vectype)))((void)(!(types_compatible_p (((tree_class_check ((((contains_struct_check
((sc), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2098, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2098, __FUNCTION__))->type_common.main_variant), ((contains_struct_check
((vectype), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2099, __FUNCTION__))->typed.type))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2099, __FUNCTION__), 0 : 0))
;
2100
2101 if (CONSTANT_CLASS_P (sc)(tree_code_type[(int) (((enum tree_code) (sc)->base.code))
] == tcc_constant)
)
2102 {
2103 tree_vector_builder v (vectype, 1, 1);
2104 v.quick_push (sc);
2105 return v.build ();
2106 }
2107 else if (!TYPE_VECTOR_SUBPARTS (vectype).is_constant (&nunits))
2108 return fold_build1 (VEC_DUPLICATE_EXPR, vectype, sc)fold_build1_loc (((location_t) 0), VEC_DUPLICATE_EXPR, vectype
, sc )
;
2109 else
2110 {
2111 vec<constructor_elt, va_gc> *v;
2112 vec_alloc (v, nunits);
2113 for (i = 0; i < nunits; ++i)
2114 CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, sc)do { constructor_elt _ce___ = {(tree) nullptr, sc}; vec_safe_push
((v), _ce___); } while (0)
;
2115 return build_constructor (vectype, v);
2116 }
2117}
2118
2119/* If TYPE is not a vector type, just return SC, otherwise return
2120 build_vector_from_val (TYPE, SC). */
2121
2122tree
2123build_uniform_cst (tree type, tree sc)
2124{
2125 if (!VECTOR_TYPE_P (type)(((enum tree_code) (type)->base.code) == VECTOR_TYPE))
2126 return sc;
2127
2128 return build_vector_from_val (type, sc);
2129}
2130
2131/* Build a vector series of type TYPE in which element I has the value
2132 BASE + I * STEP. The result is a constant if BASE and STEP are constant
2133 and a VEC_SERIES_EXPR otherwise. */
2134
2135tree
2136build_vec_series (tree type, tree base, tree step)
2137{
2138 if (integer_zerop (step))
2139 return build_vector_from_val (type, base);
2140 if (TREE_CODE (base)((enum tree_code) (base)->base.code) == INTEGER_CST && TREE_CODE (step)((enum tree_code) (step)->base.code) == INTEGER_CST)
2141 {
2142 tree_vector_builder builder (type, 1, 3);
2143 tree elt1 = wide_int_to_tree (TREE_TYPE (base)((contains_struct_check ((base), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2143, __FUNCTION__))->typed.type)
,
2144 wi::to_wide (base) + wi::to_wide (step));
2145 tree elt2 = wide_int_to_tree (TREE_TYPE (base)((contains_struct_check ((base), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2145, __FUNCTION__))->typed.type)
,
2146 wi::to_wide (elt1) + wi::to_wide (step));
2147 builder.quick_push (base);
2148 builder.quick_push (elt1);
2149 builder.quick_push (elt2);
2150 return builder.build ();
2151 }
2152 return build2 (VEC_SERIES_EXPR, type, base, step);
2153}
2154
2155/* Return a vector with the same number of units and number of bits
2156 as VEC_TYPE, but in which the elements are a linear series of unsigned
2157 integers { BASE, BASE + STEP, BASE + STEP * 2, ... }. */
2158
2159tree
2160build_index_vector (tree vec_type, poly_uint64 base, poly_uint64 step)
2161{
2162 tree index_vec_type = vec_type;
2163 tree index_elt_type = TREE_TYPE (vec_type)((contains_struct_check ((vec_type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2163, __FUNCTION__))->typed.type)
;
2164 poly_uint64 nunits = TYPE_VECTOR_SUBPARTS (vec_type);
2165 if (!INTEGRAL_TYPE_P (index_elt_type)(((enum tree_code) (index_elt_type)->base.code) == ENUMERAL_TYPE
|| ((enum tree_code) (index_elt_type)->base.code) == BOOLEAN_TYPE
|| ((enum tree_code) (index_elt_type)->base.code) == INTEGER_TYPE
)
|| !TYPE_UNSIGNED (index_elt_type)((tree_class_check ((index_elt_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2165, __FUNCTION__))->base.u.bits.unsigned_flag)
)
2166 {
2167 index_elt_type = build_nonstandard_integer_type
2168 (GET_MODE_BITSIZE (SCALAR_TYPE_MODE (index_elt_type)(as_a <scalar_mode> ((tree_class_check ((index_elt_type
), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2168, __FUNCTION__))->type_common.mode))
), true);
2169 index_vec_type = build_vector_type (index_elt_type, nunits);
2170 }
2171
2172 tree_vector_builder v (index_vec_type, 1, 3);
2173 for (unsigned int i = 0; i < 3; ++i)
2174 v.quick_push (build_int_cstu (index_elt_type, base + i * step));
2175 return v.build ();
2176}
2177
2178/* Return a VECTOR_CST of type VEC_TYPE in which the first NUM_A
2179 elements are A and the rest are B. */
2180
2181tree
2182build_vector_a_then_b (tree vec_type, unsigned int num_a, tree a, tree b)
2183{
2184 gcc_assert (known_le (num_a, TYPE_VECTOR_SUBPARTS (vec_type)))((void)(!((!maybe_lt (TYPE_VECTOR_SUBPARTS (vec_type), num_a)
)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2184, __FUNCTION__), 0 : 0))
;
2185 unsigned int count = constant_lower_bound (TYPE_VECTOR_SUBPARTS (vec_type));
2186 /* Optimize the constant case. */
2187 if ((count & 1) == 0 && TYPE_VECTOR_SUBPARTS (vec_type).is_constant ())
2188 count /= 2;
2189 tree_vector_builder builder (vec_type, count, 2);
2190 for (unsigned int i = 0; i < count * 2; ++i)
2191 builder.quick_push (i < num_a ? a : b);
2192 return builder.build ();
2193}
2194
2195/* Something has messed with the elements of CONSTRUCTOR C after it was built;
2196 calculate TREE_CONSTANT and TREE_SIDE_EFFECTS. */
2197
2198void
2199recompute_constructor_flags (tree c)
2200{
2201 unsigned int i;
2202 tree val;
2203 bool constant_p = true;
2204 bool side_effects_p = false;
2205 vec<constructor_elt, va_gc> *vals = CONSTRUCTOR_ELTS (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2205, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)
;
2206
2207 FOR_EACH_CONSTRUCTOR_VALUE (vals, i, val)for (i = 0; (i >= vec_safe_length (vals)) ? false : ((val =
(*(vals))[i].value), true); (i)++)
2208 {
2209 /* Mostly ctors will have elts that don't have side-effects, so
2210 the usual case is to scan all the elements. Hence a single
2211 loop for both const and side effects, rather than one loop
2212 each (with early outs). */
2213 if (!TREE_CONSTANT (val)((non_type_check ((val), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2213, __FUNCTION__))->base.constant_flag)
)
2214 constant_p = false;
2215 if (TREE_SIDE_EFFECTS (val)((non_type_check ((val), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2215, __FUNCTION__))->base.side_effects_flag)
)
2216 side_effects_p = true;
2217 }
2218
2219 TREE_SIDE_EFFECTS (c)((non_type_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2219, __FUNCTION__))->base.side_effects_flag)
= side_effects_p;
2220 TREE_CONSTANT (c)((non_type_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2220, __FUNCTION__))->base.constant_flag)
= constant_p;
2221}
2222
2223/* Make sure that TREE_CONSTANT and TREE_SIDE_EFFECTS are correct for
2224 CONSTRUCTOR C. */
2225
2226void
2227verify_constructor_flags (tree c)
2228{
2229 unsigned int i;
2230 tree val;
2231 bool constant_p = TREE_CONSTANT (c)((non_type_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2231, __FUNCTION__))->base.constant_flag)
;
2232 bool side_effects_p = TREE_SIDE_EFFECTS (c)((non_type_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2232, __FUNCTION__))->base.side_effects_flag)
;
2233 vec<constructor_elt, va_gc> *vals = CONSTRUCTOR_ELTS (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2233, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)
;
2234
2235 FOR_EACH_CONSTRUCTOR_VALUE (vals, i, val)for (i = 0; (i >= vec_safe_length (vals)) ? false : ((val =
(*(vals))[i].value), true); (i)++)
2236 {
2237 if (constant_p && !TREE_CONSTANT (val)((non_type_check ((val), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2237, __FUNCTION__))->base.constant_flag)
)
2238 internal_error ("non-constant element in constant CONSTRUCTOR");
2239 if (!side_effects_p && TREE_SIDE_EFFECTS (val)((non_type_check ((val), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2239, __FUNCTION__))->base.side_effects_flag)
)
2240 internal_error ("side-effects element in no-side-effects CONSTRUCTOR");
2241 }
2242}
2243
2244/* Return a new CONSTRUCTOR node whose type is TYPE and whose values
2245 are in the vec pointed to by VALS. */
2246tree
2247build_constructor (tree type, vec<constructor_elt, va_gc> *vals MEM_STAT_DECL)
2248{
2249 tree c = make_node (CONSTRUCTOR PASS_MEM_STAT);
2250
2251 TREE_TYPE (c)((contains_struct_check ((c), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2251, __FUNCTION__))->typed.type)
= type;
2252 CONSTRUCTOR_ELTS (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2252, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)
= vals;
2253
2254 recompute_constructor_flags (c);
2255
2256 return c;
2257}
2258
2259/* Build a CONSTRUCTOR node made of a single initializer, with the specified
2260 INDEX and VALUE. */
2261tree
2262build_constructor_single (tree type, tree index, tree value)
2263{
2264 vec<constructor_elt, va_gc> *v;
2265 constructor_elt elt = {index, value};
2266
2267 vec_alloc (v, 1);
2268 v->quick_push (elt);
2269
2270 return build_constructor (type, v);
2271}
2272
2273
2274/* Return a new CONSTRUCTOR node whose type is TYPE and whose values
2275 are in a list pointed to by VALS. */
2276tree
2277build_constructor_from_list (tree type, tree vals)
2278{
2279 tree t;
2280 vec<constructor_elt, va_gc> *v = NULLnullptr;
2281
2282 if (vals)
2283 {
2284 vec_alloc (v, list_length (vals));
2285 for (t = vals; t; t = TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2285, __FUNCTION__))->common.chain)
)
2286 CONSTRUCTOR_APPEND_ELT (v, TREE_PURPOSE (t), TREE_VALUE (t))do { constructor_elt _ce___ = {((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2286, __FUNCTION__, (TREE_LIST)))->list.purpose), ((tree_check
((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2286, __FUNCTION__, (TREE_LIST)))->list.value)}; vec_safe_push
((v), _ce___); } while (0)
;
2287 }
2288
2289 return build_constructor (type, v);
2290}
2291
2292/* Return a new CONSTRUCTOR node whose type is TYPE and whose values
2293 are in a vector pointed to by VALS. Note that the TREE_PURPOSE
2294 fields in the constructor remain null. */
2295
2296tree
2297build_constructor_from_vec (tree type, const vec<tree, va_gc> *vals)
2298{
2299 vec<constructor_elt, va_gc> *v = NULLnullptr;
2300
2301 for (tree t : vals)
2302 CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, t)do { constructor_elt _ce___ = {(tree) nullptr, t}; vec_safe_push
((v), _ce___); } while (0)
;
2303
2304 return build_constructor (type, v);
2305}
2306
2307/* Return a new CONSTRUCTOR node whose type is TYPE. NELTS is the number
2308 of elements, provided as index/value pairs. */
2309
2310tree
2311build_constructor_va (tree type, int nelts, ...)
2312{
2313 vec<constructor_elt, va_gc> *v = NULLnullptr;
2314 va_list p;
2315
2316 va_start (p, nelts)__builtin_va_start(p, nelts);
2317 vec_alloc (v, nelts);
2318 while (nelts--)
2319 {
2320 tree index = va_arg (p, tree)__builtin_va_arg(p, tree);
2321 tree value = va_arg (p, tree)__builtin_va_arg(p, tree);
2322 CONSTRUCTOR_APPEND_ELT (v, index, value)do { constructor_elt _ce___ = {index, value}; vec_safe_push (
(v), _ce___); } while (0)
;
2323 }
2324 va_end (p)__builtin_va_end(p);
2325 return build_constructor (type, v);
2326}
2327
2328/* Return a node of type TYPE for which TREE_CLOBBER_P is true. */
2329
2330tree
2331build_clobber (tree type)
2332{
2333 tree clobber = build_constructor (type, NULLnullptr);
2334 TREE_THIS_VOLATILE (clobber)((clobber)->base.volatile_flag) = true;
2335 return clobber;
2336}
2337
2338/* Return a new FIXED_CST node whose type is TYPE and value is F. */
2339
2340tree
2341build_fixed (tree type, FIXED_VALUE_TYPEstruct fixed_value f)
2342{
2343 tree v;
2344 FIXED_VALUE_TYPEstruct fixed_value *fp;
2345
2346 v = make_node (FIXED_CST);
2347 fp = ggc_alloc<fixed_value> ();
2348 memcpy (fp, &f, sizeof (FIXED_VALUE_TYPEstruct fixed_value));
2349
2350 TREE_TYPE (v)((contains_struct_check ((v), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2350, __FUNCTION__))->typed.type)
= type;
2351 TREE_FIXED_CST_PTR (v)((tree_check ((v), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2351, __FUNCTION__, (FIXED_CST)))->fixed_cst.fixed_cst_ptr
)
= fp;
2352 return v;
2353}
2354
2355/* Return a new REAL_CST node whose type is TYPE and value is D. */
2356
2357tree
2358build_real (tree type, REAL_VALUE_TYPEstruct real_value d)
2359{
2360 tree v;
2361 REAL_VALUE_TYPEstruct real_value *dp;
2362 int overflow = 0;
2363
2364 /* ??? Used to check for overflow here via CHECK_FLOAT_TYPE.
2365 Consider doing it via real_convert now. */
2366
2367 v = make_node (REAL_CST);
2368 dp = ggc_alloc<real_value> ();
2369 memcpy (dp, &d, sizeof (REAL_VALUE_TYPEstruct real_value));
2370
2371 TREE_TYPE (v)((contains_struct_check ((v), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2371, __FUNCTION__))->typed.type)
= type;
2372 TREE_REAL_CST_PTR (v)((tree_check ((v), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2372, __FUNCTION__, (REAL_CST)))->real_cst.real_cst_ptr)
= dp;
2373 TREE_OVERFLOW (v)((tree_class_check ((v), (tcc_constant), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2373, __FUNCTION__))->base.public_flag)
= overflow;
2374 return v;
2375}
2376
2377/* Like build_real, but first truncate D to the type. */
2378
2379tree
2380build_real_truncate (tree type, REAL_VALUE_TYPEstruct real_value d)
2381{
2382 return build_real (type, real_value_truncate (TYPE_MODE (type)((((enum tree_code) ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2382, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(type) : (type)->type_common.mode)
, d));
2383}
2384
2385/* Return a new REAL_CST node whose type is TYPE
2386 and whose value is the integer value of the INTEGER_CST node I. */
2387
2388REAL_VALUE_TYPEstruct real_value
2389real_value_from_int_cst (const_tree type, const_tree i)
2390{
2391 REAL_VALUE_TYPEstruct real_value d;
2392
2393 /* Clear all bits of the real value type so that we can later do
2394 bitwise comparisons to see if two values are the same. */
2395 memset (&d, 0, sizeof d);
2396
2397 real_from_integer (&d, type ? TYPE_MODE (type)((((enum tree_code) ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2397, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(type) : (type)->type_common.mode)
: VOIDmode((void) 0, E_VOIDmode), wi::to_wide (i),
2398 TYPE_SIGN (TREE_TYPE (i))((signop) ((tree_class_check ((((contains_struct_check ((i), (
TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2398, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2398, __FUNCTION__))->base.u.bits.unsigned_flag))
);
2399 return d;
2400}
2401
2402/* Given a tree representing an integer constant I, return a tree
2403 representing the same value as a floating-point constant of type TYPE. */
2404
2405tree
2406build_real_from_int_cst (tree type, const_tree i)
2407{
2408 tree v;
2409 int overflow = TREE_OVERFLOW (i)((tree_class_check ((i), (tcc_constant), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2409, __FUNCTION__))->base.public_flag)
;
2410
2411 v = build_real (type, real_value_from_int_cst (type, i));
2412
2413 TREE_OVERFLOW (v)((tree_class_check ((v), (tcc_constant), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2413, __FUNCTION__))->base.public_flag)
|= overflow;
2414 return v;
2415}
2416
2417/* Return a new REAL_CST node whose type is TYPE
2418 and whose value is the integer value I which has sign SGN. */
2419
2420tree
2421build_real_from_wide (tree type, const wide_int_ref &i, signop sgn)
2422{
2423 REAL_VALUE_TYPEstruct real_value d;
2424
2425 /* Clear all bits of the real value type so that we can later do
2426 bitwise comparisons to see if two values are the same. */
2427 memset (&d, 0, sizeof d);
2428
2429 real_from_integer (&d, TYPE_MODE (type)((((enum tree_code) ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2429, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(type) : (type)->type_common.mode)
, i, sgn);
2430 return build_real (type, d);
2431}
2432
2433/* Return a newly constructed STRING_CST node whose value is the LEN
2434 characters at STR when STR is nonnull, or all zeros otherwise.
2435 Note that for a C string literal, LEN should include the trailing NUL.
2436 The TREE_TYPE is not initialized. */
2437
2438tree
2439build_string (unsigned len, const char *str /*= NULL */)
2440{
2441 /* Do not waste bytes provided by padding of struct tree_string. */
2442 unsigned size = len + offsetof (struct tree_string, str)__builtin_offsetof(struct tree_string, str) + 1;
2443
2444 record_node_allocation_statistics (STRING_CST, size);
2445
2446 tree s = (tree) ggc_internal_alloc (size);
2447
2448 memset (s, 0, sizeof (struct tree_typed));
2449 TREE_SET_CODE (s, STRING_CST)((s)->base.code = (STRING_CST));
2450 TREE_CONSTANT (s)((non_type_check ((s), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2450, __FUNCTION__))->base.constant_flag)
= 1;
2451 TREE_STRING_LENGTH (s)((tree_check ((s), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2451, __FUNCTION__, (STRING_CST)))->string.length)
= len;
2452 if (str)
2453 memcpy (s->string.str, str, len);
2454 else
2455 memset (s->string.str, 0, len);
2456 s->string.str[len] = '\0';
2457
2458 return s;
2459}
2460
2461/* Return a newly constructed COMPLEX_CST node whose value is
2462 specified by the real and imaginary parts REAL and IMAG.
2463 Both REAL and IMAG should be constant nodes. TYPE, if specified,
2464 will be the type of the COMPLEX_CST; otherwise a new type will be made. */
2465
2466tree
2467build_complex (tree type, tree real, tree imag)
2468{
2469 gcc_assert (CONSTANT_CLASS_P (real))((void)(!((tree_code_type[(int) (((enum tree_code) (real)->
base.code))] == tcc_constant)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2469, __FUNCTION__), 0 : 0))
;
2470 gcc_assert (CONSTANT_CLASS_P (imag))((void)(!((tree_code_type[(int) (((enum tree_code) (imag)->
base.code))] == tcc_constant)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2470, __FUNCTION__), 0 : 0))
;
2471
2472 tree t = make_node (COMPLEX_CST);
2473
2474 TREE_REALPART (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2474, __FUNCTION__, (COMPLEX_CST)))->complex.real)
= real;
2475 TREE_IMAGPART (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2475, __FUNCTION__, (COMPLEX_CST)))->complex.imag)
= imag;
2476 TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2476, __FUNCTION__))->typed.type)
= type ? type : build_complex_type (TREE_TYPE (real)((contains_struct_check ((real), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2476, __FUNCTION__))->typed.type)
);
2477 TREE_OVERFLOW (t)((tree_class_check ((t), (tcc_constant), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2477, __FUNCTION__))->base.public_flag)
= TREE_OVERFLOW (real)((tree_class_check ((real), (tcc_constant), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2477, __FUNCTION__))->base.public_flag)
| TREE_OVERFLOW (imag)((tree_class_check ((imag), (tcc_constant), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2477, __FUNCTION__))->base.public_flag)
;
2478 return t;
2479}
2480
2481/* Build a complex (inf +- 0i), such as for the result of cproj.
2482 TYPE is the complex tree type of the result. If NEG is true, the
2483 imaginary zero is negative. */
2484
2485tree
2486build_complex_inf (tree type, bool neg)
2487{
2488 REAL_VALUE_TYPEstruct real_value rinf, rzero = dconst0;
2489
2490 real_inf (&rinf);
2491 rzero.sign = neg;
2492 return build_complex (type, build_real (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2492, __FUNCTION__))->typed.type)
, rinf),
2493 build_real (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2493, __FUNCTION__))->typed.type)
, rzero));
2494}
2495
2496/* Return the constant 1 in type TYPE. If TYPE has several elements, each
2497 element is set to 1. In particular, this is 1 + i for complex types. */
2498
2499tree
2500build_each_one_cst (tree type)
2501{
2502 if (TREE_CODE (type)((enum tree_code) (type)->base.code) == COMPLEX_TYPE)
2503 {
2504 tree scalar = build_one_cst (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2504, __FUNCTION__))->typed.type)
);
2505 return build_complex (type, scalar, scalar);
2506 }
2507 else
2508 return build_one_cst (type);
2509}
2510
2511/* Return a constant of arithmetic type TYPE which is the
2512 multiplicative identity of the set TYPE. */
2513
2514tree
2515build_one_cst (tree type)
2516{
2517 switch (TREE_CODE (type)((enum tree_code) (type)->base.code))
2518 {
2519 case INTEGER_TYPE: case ENUMERAL_TYPE: case BOOLEAN_TYPE:
2520 case POINTER_TYPE: case REFERENCE_TYPE:
2521 case OFFSET_TYPE:
2522 return build_int_cst (type, 1);
2523
2524 case REAL_TYPE:
2525 return build_real (type, dconst1);
2526
2527 case FIXED_POINT_TYPE:
2528 /* We can only generate 1 for accum types. */
2529 gcc_assert (ALL_SCALAR_ACCUM_MODE_P (TYPE_MODE (type)))((void)(!(((((enum mode_class) mode_class[((((enum tree_code)
((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2529, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(type) : (type)->type_common.mode)]) == MODE_ACCUM) || ((
(enum mode_class) mode_class[((((enum tree_code) ((tree_class_check
((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2529, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(type) : (type)->type_common.mode)]) == MODE_UACCUM))) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2529, __FUNCTION__), 0 : 0))
;
2530 return build_fixed (type, FCONST1 (TYPE_MODE (type))fconst1[((((enum tree_code) ((tree_class_check ((type), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2530, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(type) : (type)->type_common.mode) - (scalar_mode ((scalar_mode
::from_int) E_HAmode))]
);
2531
2532 case VECTOR_TYPE:
2533 {
2534 tree scalar = build_one_cst (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2534, __FUNCTION__))->typed.type)
);
2535
2536 return build_vector_from_val (type, scalar);
2537 }
2538
2539 case COMPLEX_TYPE:
2540 return build_complex (type,
2541 build_one_cst (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2541, __FUNCTION__))->typed.type)
),
2542 build_zero_cst (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2542, __FUNCTION__))->typed.type)
));
2543
2544 default:
2545 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2545, __FUNCTION__))
;
2546 }
2547}
2548
2549/* Return an integer of type TYPE containing all 1's in as much precision as
2550 it contains, or a complex or vector whose subparts are such integers. */
2551
2552tree
2553build_all_ones_cst (tree type)
2554{
2555 if (TREE_CODE (type)((enum tree_code) (type)->base.code) == COMPLEX_TYPE)
2556 {
2557 tree scalar = build_all_ones_cst (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2557, __FUNCTION__))->typed.type)
);
2558 return build_complex (type, scalar, scalar);
2559 }
2560 else
2561 return build_minus_one_cst (type);
2562}
2563
2564/* Return a constant of arithmetic type TYPE which is the
2565 opposite of the multiplicative identity of the set TYPE. */
2566
2567tree
2568build_minus_one_cst (tree type)
2569{
2570 switch (TREE_CODE (type)((enum tree_code) (type)->base.code))
2571 {
2572 case INTEGER_TYPE: case ENUMERAL_TYPE: case BOOLEAN_TYPE:
2573 case POINTER_TYPE: case REFERENCE_TYPE:
2574 case OFFSET_TYPE:
2575 return build_int_cst (type, -1);
2576
2577 case REAL_TYPE:
2578 return build_real (type, dconstm1);
2579
2580 case FIXED_POINT_TYPE:
2581 /* We can only generate 1 for accum types. */
2582 gcc_assert (ALL_SCALAR_ACCUM_MODE_P (TYPE_MODE (type)))((void)(!(((((enum mode_class) mode_class[((((enum tree_code)
((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2582, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(type) : (type)->type_common.mode)]) == MODE_ACCUM) || ((
(enum mode_class) mode_class[((((enum tree_code) ((tree_class_check
((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2582, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(type) : (type)->type_common.mode)]) == MODE_UACCUM))) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2582, __FUNCTION__), 0 : 0))
;
2583 return build_fixed (type,
2584 fixed_from_double_int (double_int_minus_one(double_int::from_shwi (-1)),
2585 SCALAR_TYPE_MODE (type)(as_a <scalar_mode> ((tree_class_check ((type), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2585, __FUNCTION__))->type_common.mode))
));
2586
2587 case VECTOR_TYPE:
2588 {
2589 tree scalar = build_minus_one_cst (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2589, __FUNCTION__))->typed.type)
);
2590
2591 return build_vector_from_val (type, scalar);
2592 }
2593
2594 case COMPLEX_TYPE:
2595 return build_complex (type,
2596 build_minus_one_cst (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2596, __FUNCTION__))->typed.type)
),
2597 build_zero_cst (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2597, __FUNCTION__))->typed.type)
));
2598
2599 default:
2600 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2600, __FUNCTION__))
;
2601 }
2602}
2603
2604/* Build 0 constant of type TYPE. This is used by constructor folding
2605 and thus the constant should be represented in memory by
2606 zero(es). */
2607
2608tree
2609build_zero_cst (tree type)
2610{
2611 switch (TREE_CODE (type)((enum tree_code) (type)->base.code))
2612 {
2613 case INTEGER_TYPE: case ENUMERAL_TYPE: case BOOLEAN_TYPE:
2614 case POINTER_TYPE: case REFERENCE_TYPE:
2615 case OFFSET_TYPE: case NULLPTR_TYPE:
2616 return build_int_cst (type, 0);
2617
2618 case REAL_TYPE:
2619 return build_real (type, dconst0);
2620
2621 case FIXED_POINT_TYPE:
2622 return build_fixed (type, FCONST0 (TYPE_MODE (type))fconst0[((((enum tree_code) ((tree_class_check ((type), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2622, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(type) : (type)->type_common.mode) - (scalar_mode ((scalar_mode
::from_int) E_QQmode))]
);
2623
2624 case VECTOR_TYPE:
2625 {
2626 tree scalar = build_zero_cst (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2626, __FUNCTION__))->typed.type)
);
2627
2628 return build_vector_from_val (type, scalar);
2629 }
2630
2631 case COMPLEX_TYPE:
2632 {
2633 tree zero = build_zero_cst (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2633, __FUNCTION__))->typed.type)
);
2634
2635 return build_complex (type, zero, zero);
2636 }
2637
2638 default:
2639 if (!AGGREGATE_TYPE_P (type)(((enum tree_code) (type)->base.code) == ARRAY_TYPE || (((
enum tree_code) (type)->base.code) == RECORD_TYPE || ((enum
tree_code) (type)->base.code) == UNION_TYPE || ((enum tree_code
) (type)->base.code) == QUAL_UNION_TYPE))
)
2640 return fold_convert (type, integer_zero_node)fold_convert_loc (((location_t) 0), type, global_trees[TI_INTEGER_ZERO
])
;
2641 return build_constructor (type, NULLnullptr);
2642 }
2643}
2644
2645
2646/* Build a BINFO with LEN language slots. */
2647
2648tree
2649make_tree_binfo (unsigned base_binfos MEM_STAT_DECL)
2650{
2651 tree t;
2652 size_t length = (offsetof (struct tree_binfo, base_binfos)__builtin_offsetof(struct tree_binfo, base_binfos)
2653 + vec<tree, va_gc>::embedded_size (base_binfos));
2654
2655 record_node_allocation_statistics (TREE_BINFO, length);
2656
2657 t = ggc_alloc_tree_node_stat (length PASS_MEM_STAT);
2658
2659 memset (t, 0, offsetof (struct tree_binfo, base_binfos)__builtin_offsetof(struct tree_binfo, base_binfos));
2660
2661 TREE_SET_CODE (t, TREE_BINFO)((t)->base.code = (TREE_BINFO));
2662
2663 BINFO_BASE_BINFOS (t)(&(tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2663, __FUNCTION__, (TREE_BINFO)))->binfo.base_binfos)
->embedded_init (base_binfos);
2664
2665 return t;
2666}
2667
2668/* Create a CASE_LABEL_EXPR tree node and return it. */
2669
2670tree
2671build_case_label (tree low_value, tree high_value, tree label_decl)
2672{
2673 tree t = make_node (CASE_LABEL_EXPR);
2674
2675 TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2675, __FUNCTION__))->typed.type)
= void_type_nodeglobal_trees[TI_VOID_TYPE];
2676 SET_EXPR_LOCATION (t, DECL_SOURCE_LOCATION (label_decl))(expr_check (((t)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2676, __FUNCTION__))->exp.locus = (((contains_struct_check
((label_decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2676, __FUNCTION__))->decl_minimal.locus))
;
2677
2678 CASE_LOW (t)(*((const_cast<tree*> (tree_operand_check (((tree_check
((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2678, __FUNCTION__, (CASE_LABEL_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2678, __FUNCTION__)))))
= low_value;
2679 CASE_HIGH (t)(*((const_cast<tree*> (tree_operand_check (((tree_check
((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2679, __FUNCTION__, (CASE_LABEL_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2679, __FUNCTION__)))))
= high_value;
2680 CASE_LABEL (t)(*((const_cast<tree*> (tree_operand_check (((tree_check
((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2680, __FUNCTION__, (CASE_LABEL_EXPR)))), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2680, __FUNCTION__)))))
= label_decl;
2681 CASE_CHAIN (t)(*((const_cast<tree*> (tree_operand_check (((tree_check
((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2681, __FUNCTION__, (CASE_LABEL_EXPR)))), (3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2681, __FUNCTION__)))))
= NULL_TREE(tree) nullptr;
2682
2683 return t;
2684}
2685
2686/* Build a newly constructed INTEGER_CST node. LEN and EXT_LEN are the
2687 values of TREE_INT_CST_NUNITS and TREE_INT_CST_EXT_NUNITS respectively.
2688 The latter determines the length of the HOST_WIDE_INT vector. */
2689
2690tree
2691make_int_cst (int len, int ext_len MEM_STAT_DECL)
2692{
2693 tree t;
2694 int length = ((ext_len - 1) * sizeof (HOST_WIDE_INTlong)
2695 + sizeof (struct tree_int_cst));
2696
2697 gcc_assert (len)((void)(!(len) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2697, __FUNCTION__), 0 : 0))
;
2698 record_node_allocation_statistics (INTEGER_CST, length);
2699
2700 t = ggc_alloc_cleared_tree_node_stat (length PASS_MEM_STAT);
2701
2702 TREE_SET_CODE (t, INTEGER_CST)((t)->base.code = (INTEGER_CST));
2703 TREE_INT_CST_NUNITS (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2703, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.unextended
)
= len;
2704 TREE_INT_CST_EXT_NUNITS (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2704, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.extended
)
= ext_len;
2705 /* to_offset can only be applied to trees that are offset_int-sized
2706 or smaller. EXT_LEN is correct if it fits, otherwise the constant
2707 must be exactly the precision of offset_int and so LEN is correct. */
2708 if (ext_len <= OFFSET_INT_ELTS(((64 + 4 + 64 - 1) & ~(64 - 1)) / 64))
2709 TREE_INT_CST_OFFSET_NUNITS (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2709, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.offset
)
= ext_len;
2710 else
2711 TREE_INT_CST_OFFSET_NUNITS (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2711, __FUNCTION__, (INTEGER_CST)))->base.u.int_length.offset
)
= len;
2712
2713 TREE_CONSTANT (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2713, __FUNCTION__))->base.constant_flag)
= 1;
2714
2715 return t;
2716}
2717
2718/* Build a newly constructed TREE_VEC node of length LEN. */
2719
2720tree
2721make_tree_vec (int len MEM_STAT_DECL)
2722{
2723 tree t;
2724 size_t length = (len - 1) * sizeof (tree) + sizeof (struct tree_vec);
2725
2726 record_node_allocation_statistics (TREE_VEC, length);
2727
2728 t = ggc_alloc_cleared_tree_node_stat (length PASS_MEM_STAT);
2729
2730 TREE_SET_CODE (t, TREE_VEC)((t)->base.code = (TREE_VEC));
2731 TREE_VEC_LENGTH (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2731, __FUNCTION__, (TREE_VEC)))->base.u.length)
= len;
2732
2733 return t;
2734}
2735
2736/* Grow a TREE_VEC node to new length LEN. */
2737
2738tree
2739grow_tree_vec (tree v, int len MEM_STAT_DECL)
2740{
2741 gcc_assert (TREE_CODE (v) == TREE_VEC)((void)(!(((enum tree_code) (v)->base.code) == TREE_VEC) ?
fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2741, __FUNCTION__), 0 : 0))
;
2742
2743 int oldlen = TREE_VEC_LENGTH (v)((tree_check ((v), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2743, __FUNCTION__, (TREE_VEC)))->base.u.length)
;
2744 gcc_assert (len > oldlen)((void)(!(len > oldlen) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2744, __FUNCTION__), 0 : 0))
;
2745
2746 size_t oldlength = (oldlen - 1) * sizeof (tree) + sizeof (struct tree_vec);
2747 size_t length = (len - 1) * sizeof (tree) + sizeof (struct tree_vec);
2748
2749 record_node_allocation_statistics (TREE_VEC, length - oldlength);
2750
2751 v = (tree) ggc_realloc (v, length PASS_MEM_STAT);
2752
2753 TREE_VEC_LENGTH (v)((tree_check ((v), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2753, __FUNCTION__, (TREE_VEC)))->base.u.length)
= len;
2754
2755 return v;
2756}
2757
2758/* Return 1 if EXPR is the constant zero, whether it is integral, float or
2759 fixed, and scalar, complex or vector. */
2760
2761bool
2762zerop (const_tree expr)
2763{
2764 return (integer_zerop (expr)
2765 || real_zerop (expr)
2766 || fixed_zerop (expr));
2767}
2768
2769/* Return 1 if EXPR is the integer constant zero or a complex constant
2770 of zero, or a location wrapper for such a constant. */
2771
2772bool
2773integer_zerop (const_tree expr)
2774{
2775 STRIP_ANY_LOCATION_WRAPPER (expr)(expr) = tree_strip_any_location_wrapper ((const_cast<union
tree_node *> (((expr)))))
;
2776
2777 switch (TREE_CODE (expr)((enum tree_code) (expr)->base.code))
2778 {
2779 case INTEGER_CST:
2780 return wi::to_wide (expr) == 0;
2781 case COMPLEX_CST:
2782 return (integer_zerop (TREE_REALPART (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2782, __FUNCTION__, (COMPLEX_CST)))->complex.real)
)
2783 && integer_zerop (TREE_IMAGPART (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2783, __FUNCTION__, (COMPLEX_CST)))->complex.imag)
));
2784 case VECTOR_CST:
2785 return (VECTOR_CST_NPATTERNS (expr)(1U << ((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2785, __FUNCTION__, (VECTOR_CST)))->base.u.vector_cst.log2_npatterns
))
== 1
2786 && VECTOR_CST_DUPLICATE_P (expr)(((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2786, __FUNCTION__, (VECTOR_CST)))->base.u.vector_cst.nelts_per_pattern
) == 1)
2787 && integer_zerop (VECTOR_CST_ENCODED_ELT (expr, 0)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2787, __FUNCTION__, (VECTOR_CST)))->vector.elts[0])
));
2788 default:
2789 return false;
2790 }
2791}
2792
2793/* Return 1 if EXPR is the integer constant one or the corresponding
2794 complex constant, or a location wrapper for such a constant. */
2795
2796bool
2797integer_onep (const_tree expr)
2798{
2799 STRIP_ANY_LOCATION_WRAPPER (expr)(expr) = tree_strip_any_location_wrapper ((const_cast<union
tree_node *> (((expr)))))
;
2800
2801 switch (TREE_CODE (expr)((enum tree_code) (expr)->base.code))
2802 {
2803 case INTEGER_CST:
2804 return wi::eq_p (wi::to_widest (expr), 1);
2805 case COMPLEX_CST:
2806 return (integer_onep (TREE_REALPART (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2806, __FUNCTION__, (COMPLEX_CST)))->complex.real)
)
2807 && integer_zerop (TREE_IMAGPART (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2807, __FUNCTION__, (COMPLEX_CST)))->complex.imag)
));
2808 case VECTOR_CST:
2809 return (VECTOR_CST_NPATTERNS (expr)(1U << ((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2809, __FUNCTION__, (VECTOR_CST)))->base.u.vector_cst.log2_npatterns
))
== 1
2810 && VECTOR_CST_DUPLICATE_P (expr)(((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2810, __FUNCTION__, (VECTOR_CST)))->base.u.vector_cst.nelts_per_pattern
) == 1)
2811 && integer_onep (VECTOR_CST_ENCODED_ELT (expr, 0)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2811, __FUNCTION__, (VECTOR_CST)))->vector.elts[0])
));
2812 default:
2813 return false;
2814 }
2815}
2816
2817/* Return 1 if EXPR is the integer constant one. For complex and vector,
2818 return 1 if every piece is the integer constant one.
2819 Also return 1 for location wrappers for such a constant. */
2820
2821bool
2822integer_each_onep (const_tree expr)
2823{
2824 STRIP_ANY_LOCATION_WRAPPER (expr)(expr) = tree_strip_any_location_wrapper ((const_cast<union
tree_node *> (((expr)))))
;
2825
2826 if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == COMPLEX_CST)
2827 return (integer_onep (TREE_REALPART (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2827, __FUNCTION__, (COMPLEX_CST)))->complex.real)
)
2828 && integer_onep (TREE_IMAGPART (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2828, __FUNCTION__, (COMPLEX_CST)))->complex.imag)
));
2829 else
2830 return integer_onep (expr);
2831}
2832
2833/* Return 1 if EXPR is an integer containing all 1's in as much precision as
2834 it contains, or a complex or vector whose subparts are such integers,
2835 or a location wrapper for such a constant. */
2836
2837bool
2838integer_all_onesp (const_tree expr)
2839{
2840 STRIP_ANY_LOCATION_WRAPPER (expr)(expr) = tree_strip_any_location_wrapper ((const_cast<union
tree_node *> (((expr)))))
;
2841
2842 if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == COMPLEX_CST
2843 && integer_all_onesp (TREE_REALPART (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2843, __FUNCTION__, (COMPLEX_CST)))->complex.real)
)
2844 && integer_all_onesp (TREE_IMAGPART (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2844, __FUNCTION__, (COMPLEX_CST)))->complex.imag)
))
2845 return true;
2846
2847 else if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == VECTOR_CST)
2848 return (VECTOR_CST_NPATTERNS (expr)(1U << ((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2848, __FUNCTION__, (VECTOR_CST)))->base.u.vector_cst.log2_npatterns
))
== 1
2849 && VECTOR_CST_DUPLICATE_P (expr)(((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2849, __FUNCTION__, (VECTOR_CST)))->base.u.vector_cst.nelts_per_pattern
) == 1)
2850 && integer_all_onesp (VECTOR_CST_ENCODED_ELT (expr, 0)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2850, __FUNCTION__, (VECTOR_CST)))->vector.elts[0])
));
2851
2852 else if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) != INTEGER_CST)
2853 return false;
2854
2855 return (wi::max_value (TYPE_PRECISION (TREE_TYPE (expr))((tree_class_check ((((contains_struct_check ((expr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2855, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2855, __FUNCTION__))->type_common.precision)
, UNSIGNED)
2856 == wi::to_wide (expr));
2857}
2858
2859/* Return 1 if EXPR is the integer constant minus one, or a location wrapper
2860 for such a constant. */
2861
2862bool
2863integer_minus_onep (const_tree expr)
2864{
2865 STRIP_ANY_LOCATION_WRAPPER (expr)(expr) = tree_strip_any_location_wrapper ((const_cast<union
tree_node *> (((expr)))))
;
2866
2867 if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == COMPLEX_CST)
2868 return (integer_all_onesp (TREE_REALPART (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2868, __FUNCTION__, (COMPLEX_CST)))->complex.real)
)
2869 && integer_zerop (TREE_IMAGPART (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2869, __FUNCTION__, (COMPLEX_CST)))->complex.imag)
));
2870 else
2871 return integer_all_onesp (expr);
2872}
2873
2874/* Return 1 if EXPR is an integer constant that is a power of 2 (i.e., has only
2875 one bit on), or a location wrapper for such a constant. */
2876
2877bool
2878integer_pow2p (const_tree expr)
2879{
2880 STRIP_ANY_LOCATION_WRAPPER (expr)(expr) = tree_strip_any_location_wrapper ((const_cast<union
tree_node *> (((expr)))))
;
2881
2882 if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == COMPLEX_CST
2883 && integer_pow2p (TREE_REALPART (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2883, __FUNCTION__, (COMPLEX_CST)))->complex.real)
)
2884 && integer_zerop (TREE_IMAGPART (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2884, __FUNCTION__, (COMPLEX_CST)))->complex.imag)
))
2885 return true;
2886
2887 if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) != INTEGER_CST)
2888 return false;
2889
2890 return wi::popcount (wi::to_wide (expr)) == 1;
2891}
2892
2893/* Return 1 if EXPR is an integer constant other than zero or a
2894 complex constant other than zero, or a location wrapper for such a
2895 constant. */
2896
2897bool
2898integer_nonzerop (const_tree expr)
2899{
2900 STRIP_ANY_LOCATION_WRAPPER (expr)(expr) = tree_strip_any_location_wrapper ((const_cast<union
tree_node *> (((expr)))))
;
2901
2902 return ((TREE_CODE (expr)((enum tree_code) (expr)->base.code) == INTEGER_CST
2903 && wi::to_wide (expr) != 0)
2904 || (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == COMPLEX_CST
2905 && (integer_nonzerop (TREE_REALPART (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2905, __FUNCTION__, (COMPLEX_CST)))->complex.real)
)
2906 || integer_nonzerop (TREE_IMAGPART (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2906, __FUNCTION__, (COMPLEX_CST)))->complex.imag)
))));
2907}
2908
2909/* Return 1 if EXPR is the integer constant one. For vector,
2910 return 1 if every piece is the integer constant minus one
2911 (representing the value TRUE).
2912 Also return 1 for location wrappers for such a constant. */
2913
2914bool
2915integer_truep (const_tree expr)
2916{
2917 STRIP_ANY_LOCATION_WRAPPER (expr)(expr) = tree_strip_any_location_wrapper ((const_cast<union
tree_node *> (((expr)))))
;
2918
2919 if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == VECTOR_CST)
2920 return integer_all_onesp (expr);
2921 return integer_onep (expr);
2922}
2923
2924/* Return 1 if EXPR is the fixed-point constant zero, or a location wrapper
2925 for such a constant. */
2926
2927bool
2928fixed_zerop (const_tree expr)
2929{
2930 STRIP_ANY_LOCATION_WRAPPER (expr)(expr) = tree_strip_any_location_wrapper ((const_cast<union
tree_node *> (((expr)))))
;
2931
2932 return (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == FIXED_CST
2933 && TREE_FIXED_CST (expr)(*((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2933, __FUNCTION__, (FIXED_CST)))->fixed_cst.fixed_cst_ptr
))
.data.is_zero ());
2934}
2935
2936/* Return the power of two represented by a tree node known to be a
2937 power of two. */
2938
2939int
2940tree_log2 (const_tree expr)
2941{
2942 if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == COMPLEX_CST)
2943 return tree_log2 (TREE_REALPART (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2943, __FUNCTION__, (COMPLEX_CST)))->complex.real)
);
2944
2945 return wi::exact_log2 (wi::to_wide (expr));
2946}
2947
2948/* Similar, but return the largest integer Y such that 2 ** Y is less
2949 than or equal to EXPR. */
2950
2951int
2952tree_floor_log2 (const_tree expr)
2953{
2954 if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == COMPLEX_CST)
2955 return tree_log2 (TREE_REALPART (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2955, __FUNCTION__, (COMPLEX_CST)))->complex.real)
);
2956
2957 return wi::floor_log2 (wi::to_wide (expr));
2958}
2959
2960/* Return number of known trailing zero bits in EXPR, or, if the value of
2961 EXPR is known to be zero, the precision of it's type. */
2962
2963unsigned int
2964tree_ctz (const_tree expr)
2965{
2966 if (!INTEGRAL_TYPE_P (TREE_TYPE (expr))(((enum tree_code) (((contains_struct_check ((expr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2966, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE
|| ((enum tree_code) (((contains_struct_check ((expr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2966, __FUNCTION__))->typed.type))->base.code) == BOOLEAN_TYPE
|| ((enum tree_code) (((contains_struct_check ((expr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2966, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE
)
2967 && !POINTER_TYPE_P (TREE_TYPE (expr))(((enum tree_code) (((contains_struct_check ((expr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2967, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((expr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2967, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)
)
2968 return 0;
2969
2970 unsigned int ret1, ret2, prec = TYPE_PRECISION (TREE_TYPE (expr))((tree_class_check ((((contains_struct_check ((expr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2970, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2970, __FUNCTION__))->type_common.precision)
;
2971 switch (TREE_CODE (expr)((enum tree_code) (expr)->base.code))
2972 {
2973 case INTEGER_CST:
2974 ret1 = wi::ctz (wi::to_wide (expr));
2975 return MIN (ret1, prec)((ret1) < (prec) ? (ret1) : (prec));
2976 case SSA_NAME:
2977 ret1 = wi::ctz (get_nonzero_bits (expr));
2978 return MIN (ret1, prec)((ret1) < (prec) ? (ret1) : (prec));
2979 case PLUS_EXPR:
2980 case MINUS_EXPR:
2981 case BIT_IOR_EXPR:
2982 case BIT_XOR_EXPR:
2983 case MIN_EXPR:
2984 case MAX_EXPR:
2985 ret1 = tree_ctz (TREE_OPERAND (expr, 0)(*((const_cast<tree*> (tree_operand_check ((expr), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2985, __FUNCTION__)))))
);
2986 if (ret1 == 0)
2987 return ret1;
2988 ret2 = tree_ctz (TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2988, __FUNCTION__)))))
);
2989 return MIN (ret1, ret2)((ret1) < (ret2) ? (ret1) : (ret2));
2990 case POINTER_PLUS_EXPR:
2991 ret1 = tree_ctz (TREE_OPERAND (expr, 0)(*((const_cast<tree*> (tree_operand_check ((expr), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2991, __FUNCTION__)))))
);
2992 ret2 = tree_ctz (TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2992, __FUNCTION__)))))
);
2993 /* Second operand is sizetype, which could be in theory
2994 wider than pointer's precision. Make sure we never
2995 return more than prec. */
2996 ret2 = MIN (ret2, prec)((ret2) < (prec) ? (ret2) : (prec));
2997 return MIN (ret1, ret2)((ret1) < (ret2) ? (ret1) : (ret2));
2998 case BIT_AND_EXPR:
2999 ret1 = tree_ctz (TREE_OPERAND (expr, 0)(*((const_cast<tree*> (tree_operand_check ((expr), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 2999, __FUNCTION__)))))
);
3000 ret2 = tree_ctz (TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3000, __FUNCTION__)))))
);
3001 return MAX (ret1, ret2)((ret1) > (ret2) ? (ret1) : (ret2));
3002 case MULT_EXPR:
3003 ret1 = tree_ctz (TREE_OPERAND (expr, 0)(*((const_cast<tree*> (tree_operand_check ((expr), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3003, __FUNCTION__)))))
);
3004 ret2 = tree_ctz (TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3004, __FUNCTION__)))))
);
3005 return MIN (ret1 + ret2, prec)((ret1 + ret2) < (prec) ? (ret1 + ret2) : (prec));
3006 case LSHIFT_EXPR:
3007 ret1 = tree_ctz (TREE_OPERAND (expr, 0)(*((const_cast<tree*> (tree_operand_check ((expr), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3007, __FUNCTION__)))))
);
3008 if (tree_fits_uhwi_p (TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3008, __FUNCTION__)))))
)
3009 && (tree_to_uhwi (TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3009, __FUNCTION__)))))
) < prec))
3010 {
3011 ret2 = tree_to_uhwi (TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3011, __FUNCTION__)))))
);
3012 return MIN (ret1 + ret2, prec)((ret1 + ret2) < (prec) ? (ret1 + ret2) : (prec));
3013 }
3014 return ret1;
3015 case RSHIFT_EXPR:
3016 if (tree_fits_uhwi_p (TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3016, __FUNCTION__)))))
)
3017 && (tree_to_uhwi (TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3017, __FUNCTION__)))))
) < prec))
3018 {
3019 ret1 = tree_ctz (TREE_OPERAND (expr, 0)(*((const_cast<tree*> (tree_operand_check ((expr), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3019, __FUNCTION__)))))
);
3020 ret2 = tree_to_uhwi (TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3020, __FUNCTION__)))))
);
3021 if (ret1 > ret2)
3022 return ret1 - ret2;
3023 }
3024 return 0;
3025 case TRUNC_DIV_EXPR:
3026 case CEIL_DIV_EXPR:
3027 case FLOOR_DIV_EXPR:
3028 case ROUND_DIV_EXPR:
3029 case EXACT_DIV_EXPR:
3030 if (TREE_CODE (TREE_OPERAND (expr, 1))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((expr), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3030, __FUNCTION__))))))->base.code)
== INTEGER_CST
3031 && tree_int_cst_sgn (TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3031, __FUNCTION__)))))
) == 1)
3032 {
3033 int l = tree_log2 (TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3033, __FUNCTION__)))))
);
3034 if (l >= 0)
3035 {
3036 ret1 = tree_ctz (TREE_OPERAND (expr, 0)(*((const_cast<tree*> (tree_operand_check ((expr), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3036, __FUNCTION__)))))
);
3037 ret2 = l;
3038 if (ret1 > ret2)
3039 return ret1 - ret2;
3040 }
3041 }
3042 return 0;
3043 CASE_CONVERTcase NOP_EXPR: case CONVERT_EXPR:
3044 ret1 = tree_ctz (TREE_OPERAND (expr, 0)(*((const_cast<tree*> (tree_operand_check ((expr), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3044, __FUNCTION__)))))
);
3045 if (ret1 && ret1 == TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (expr, 0)))((tree_class_check ((((contains_struct_check (((*((const_cast
<tree*> (tree_operand_check ((expr), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3045, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3045, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3045, __FUNCTION__))->type_common.precision)
)
3046 ret1 = prec;
3047 return MIN (ret1, prec)((ret1) < (prec) ? (ret1) : (prec));
3048 case SAVE_EXPR:
3049 return tree_ctz (TREE_OPERAND (expr, 0)(*((const_cast<tree*> (tree_operand_check ((expr), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3049, __FUNCTION__)))))
);
3050 case COND_EXPR:
3051 ret1 = tree_ctz (TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3051, __FUNCTION__)))))
);
3052 if (ret1 == 0)
3053 return 0;
3054 ret2 = tree_ctz (TREE_OPERAND (expr, 2)(*((const_cast<tree*> (tree_operand_check ((expr), (2),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3054, __FUNCTION__)))))
);
3055 return MIN (ret1, ret2)((ret1) < (ret2) ? (ret1) : (ret2));
3056 case COMPOUND_EXPR:
3057 return tree_ctz (TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3057, __FUNCTION__)))))
);
3058 case ADDR_EXPR:
3059 ret1 = get_pointer_alignment (CONST_CAST_TREE (expr)(const_cast<union tree_node *> (((expr)))));
3060 if (ret1 > BITS_PER_UNIT(8))
3061 {
3062 ret1 = ctz_hwi (ret1 / BITS_PER_UNIT(8));
3063 return MIN (ret1, prec)((ret1) < (prec) ? (ret1) : (prec));
3064 }
3065 return 0;
3066 default:
3067 return 0;
3068 }
3069}
3070
3071/* Return 1 if EXPR is the real constant zero. Trailing zeroes matter for
3072 decimal float constants, so don't return 1 for them.
3073 Also return 1 for location wrappers around such a constant. */
3074
3075bool
3076real_zerop (const_tree expr)
3077{
3078 STRIP_ANY_LOCATION_WRAPPER (expr)(expr) = tree_strip_any_location_wrapper ((const_cast<union
tree_node *> (((expr)))))
;
3079
3080 switch (TREE_CODE (expr)((enum tree_code) (expr)->base.code))
3081 {
3082 case REAL_CST:
3083 return real_equal (&TREE_REAL_CST (expr)(*((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3083, __FUNCTION__, (REAL_CST)))->real_cst.real_cst_ptr)
)
, &dconst0)
3084 && !(DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (expr)))(((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check
((((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3084, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3084, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3084, __FUNCTION__))->typed.type)) : (((contains_struct_check
((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3084, __FUNCTION__))->typed.type))->type_common.mode)
]) == MODE_DECIMAL_FLOAT)
);
3085 case COMPLEX_CST:
3086 return real_zerop (TREE_REALPART (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3086, __FUNCTION__, (COMPLEX_CST)))->complex.real)
)
3087 && real_zerop (TREE_IMAGPART (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3087, __FUNCTION__, (COMPLEX_CST)))->complex.imag)
);
3088 case VECTOR_CST:
3089 {
3090 /* Don't simply check for a duplicate because the predicate
3091 accepts both +0.0 and -0.0. */
3092 unsigned count = vector_cst_encoded_nelts (expr);
3093 for (unsigned int i = 0; i < count; ++i)
3094 if (!real_zerop (VECTOR_CST_ENCODED_ELT (expr, i)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3094, __FUNCTION__, (VECTOR_CST)))->vector.elts[i])
))
3095 return false;
3096 return true;
3097 }
3098 default:
3099 return false;
3100 }
3101}
3102
3103/* Return 1 if EXPR is the real constant one in real or complex form.
3104 Trailing zeroes matter for decimal float constants, so don't return
3105 1 for them.
3106 Also return 1 for location wrappers around such a constant. */
3107
3108bool
3109real_onep (const_tree expr)
3110{
3111 STRIP_ANY_LOCATION_WRAPPER (expr)(expr) = tree_strip_any_location_wrapper ((const_cast<union
tree_node *> (((expr)))))
;
3112
3113 switch (TREE_CODE (expr)((enum tree_code) (expr)->base.code))
3114 {
3115 case REAL_CST:
3116 return real_equal (&TREE_REAL_CST (expr)(*((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3116, __FUNCTION__, (REAL_CST)))->real_cst.real_cst_ptr)
)
, &dconst1)
3117 && !(DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (expr)))(((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check
((((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3117, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3117, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3117, __FUNCTION__))->typed.type)) : (((contains_struct_check
((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3117, __FUNCTION__))->typed.type))->type_common.mode)
]) == MODE_DECIMAL_FLOAT)
);
3118 case COMPLEX_CST:
3119 return real_onep (TREE_REALPART (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3119, __FUNCTION__, (COMPLEX_CST)))->complex.real)
)
3120 && real_zerop (TREE_IMAGPART (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3120, __FUNCTION__, (COMPLEX_CST)))->complex.imag)
);
3121 case VECTOR_CST:
3122 return (VECTOR_CST_NPATTERNS (expr)(1U << ((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3122, __FUNCTION__, (VECTOR_CST)))->base.u.vector_cst.log2_npatterns
))
== 1
3123 && VECTOR_CST_DUPLICATE_P (expr)(((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3123, __FUNCTION__, (VECTOR_CST)))->base.u.vector_cst.nelts_per_pattern
) == 1)
3124 && real_onep (VECTOR_CST_ENCODED_ELT (expr, 0)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3124, __FUNCTION__, (VECTOR_CST)))->vector.elts[0])
));
3125 default:
3126 return false;
3127 }
3128}
3129
3130/* Return 1 if EXPR is the real constant minus one. Trailing zeroes
3131 matter for decimal float constants, so don't return 1 for them.
3132 Also return 1 for location wrappers around such a constant. */
3133
3134bool
3135real_minus_onep (const_tree expr)
3136{
3137 STRIP_ANY_LOCATION_WRAPPER (expr)(expr) = tree_strip_any_location_wrapper ((const_cast<union
tree_node *> (((expr)))))
;
3138
3139 switch (TREE_CODE (expr)((enum tree_code) (expr)->base.code))
3140 {
3141 case REAL_CST:
3142 return real_equal (&TREE_REAL_CST (expr)(*((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3142, __FUNCTION__, (REAL_CST)))->real_cst.real_cst_ptr)
)
, &dconstm1)
3143 && !(DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (expr)))(((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check
((((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3143, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3143, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3143, __FUNCTION__))->typed.type)) : (((contains_struct_check
((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3143, __FUNCTION__))->typed.type))->type_common.mode)
]) == MODE_DECIMAL_FLOAT)
);
3144 case COMPLEX_CST:
3145 return real_minus_onep (TREE_REALPART (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3145, __FUNCTION__, (COMPLEX_CST)))->complex.real)
)
3146 && real_zerop (TREE_IMAGPART (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3146, __FUNCTION__, (COMPLEX_CST)))->complex.imag)
);
3147 case VECTOR_CST:
3148 return (VECTOR_CST_NPATTERNS (expr)(1U << ((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3148, __FUNCTION__, (VECTOR_CST)))->base.u.vector_cst.log2_npatterns
))
== 1
3149 && VECTOR_CST_DUPLICATE_P (expr)(((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3149, __FUNCTION__, (VECTOR_CST)))->base.u.vector_cst.nelts_per_pattern
) == 1)
3150 && real_minus_onep (VECTOR_CST_ENCODED_ELT (expr, 0)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3150, __FUNCTION__, (VECTOR_CST)))->vector.elts[0])
));
3151 default:
3152 return false;
3153 }
3154}
3155
3156/* Nonzero if EXP is a constant or a cast of a constant. */
3157
3158bool
3159really_constant_p (const_tree exp)
3160{
3161 /* This is not quite the same as STRIP_NOPS. It does more. */
3162 while (CONVERT_EXPR_P (exp)((((enum tree_code) (exp)->base.code)) == NOP_EXPR || (((enum
tree_code) (exp)->base.code)) == CONVERT_EXPR)
3163 || TREE_CODE (exp)((enum tree_code) (exp)->base.code) == NON_LVALUE_EXPR)
3164 exp = TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3164, __FUNCTION__)))))
;
3165 return TREE_CONSTANT (exp)((non_type_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3165, __FUNCTION__))->base.constant_flag)
;
3166}
3167
3168/* Return true if T holds a polynomial pointer difference, storing it in
3169 *VALUE if so. A true return means that T's precision is no greater
3170 than 64 bits, which is the largest address space we support, so *VALUE
3171 never loses precision. However, the signedness of the result does
3172 not necessarily match the signedness of T: sometimes an unsigned type
3173 like sizetype is used to encode a value that is actually negative. */
3174
3175bool
3176ptrdiff_tree_p (const_tree t, poly_int64_pod *value)
3177{
3178 if (!t)
3179 return false;
3180 if (TREE_CODE (t)((enum tree_code) (t)->base.code) == INTEGER_CST)
3181 {
3182 if (!cst_and_fits_in_hwi (t))
3183 return false;
3184 *value = int_cst_value (t);
3185 return true;
3186 }
3187 if (POLY_INT_CST_P (t)(1 > 1 && ((enum tree_code) (t)->base.code) == POLY_INT_CST
)
)
3188 {
3189 for (unsigned int i = 0; i < NUM_POLY_INT_COEFFS1; ++i)
3190 if (!cst_and_fits_in_hwi (POLY_INT_CST_COEFF (t, i)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3190, __FUNCTION__, (POLY_INT_CST)))->poly_int_cst.coeffs
[i])
))
3191 return false;
3192 for (unsigned int i = 0; i < NUM_POLY_INT_COEFFS1; ++i)
3193 value->coeffs[i] = int_cst_value (POLY_INT_CST_COEFF (t, i)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3193, __FUNCTION__, (POLY_INT_CST)))->poly_int_cst.coeffs
[i])
);
3194 return true;
3195 }
3196 return false;
3197}
3198
3199poly_int64
3200tree_to_poly_int64 (const_tree t)
3201{
3202 gcc_assert (tree_fits_poly_int64_p (t))((void)(!(tree_fits_poly_int64_p (t)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3202, __FUNCTION__), 0 : 0))
;
3203 if (POLY_INT_CST_P (t)(1 > 1 && ((enum tree_code) (t)->base.code) == POLY_INT_CST
)
)
3204 return poly_int_cst_value (t).force_shwi ();
3205 return TREE_INT_CST_LOW (t)((unsigned long) (*tree_int_cst_elt_check ((t), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3205, __FUNCTION__)))
;
3206}
3207
3208poly_uint64
3209tree_to_poly_uint64 (const_tree t)
3210{
3211 gcc_assert (tree_fits_poly_uint64_p (t))((void)(!(tree_fits_poly_uint64_p (t)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3211, __FUNCTION__), 0 : 0))
;
3212 if (POLY_INT_CST_P (t)(1 > 1 && ((enum tree_code) (t)->base.code) == POLY_INT_CST
)
)
3213 return poly_int_cst_value (t).force_uhwi ();
3214 return TREE_INT_CST_LOW (t)((unsigned long) (*tree_int_cst_elt_check ((t), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3214, __FUNCTION__)))
;
3215}
3216
3217/* Return first list element whose TREE_VALUE is ELEM.
3218 Return 0 if ELEM is not in LIST. */
3219
3220tree
3221value_member (tree elem, tree list)
3222{
3223 while (list)
3224 {
3225 if (elem == TREE_VALUE (list)((tree_check ((list), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3225, __FUNCTION__, (TREE_LIST)))->list.value)
)
3226 return list;
3227 list = TREE_CHAIN (list)((contains_struct_check ((list), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3227, __FUNCTION__))->common.chain)
;
3228 }
3229 return NULL_TREE(tree) nullptr;
3230}
3231
3232/* Return first list element whose TREE_PURPOSE is ELEM.
3233 Return 0 if ELEM is not in LIST. */
3234
3235tree
3236purpose_member (const_tree elem, tree list)
3237{
3238 while (list)
3239 {
3240 if (elem == TREE_PURPOSE (list)((tree_check ((list), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3240, __FUNCTION__, (TREE_LIST)))->list.purpose)
)
3241 return list;
3242 list = TREE_CHAIN (list)((contains_struct_check ((list), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3242, __FUNCTION__))->common.chain)
;
3243 }
3244 return NULL_TREE(tree) nullptr;
3245}
3246
3247/* Return true if ELEM is in V. */
3248
3249bool
3250vec_member (const_tree elem, vec<tree, va_gc> *v)
3251{
3252 unsigned ix;
3253 tree t;
3254 FOR_EACH_VEC_SAFE_ELT (v, ix, t)for (ix = 0; vec_safe_iterate ((v), (ix), &(t)); ++(ix))
3255 if (elem == t)
3256 return true;
3257 return false;
3258}
3259
3260/* Returns element number IDX (zero-origin) of chain CHAIN, or
3261 NULL_TREE. */
3262
3263tree
3264chain_index (int idx, tree chain)
3265{
3266 for (; chain && idx > 0; --idx)
3267 chain = TREE_CHAIN (chain)((contains_struct_check ((chain), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3267, __FUNCTION__))->common.chain)
;
3268 return chain;
3269}
3270
3271/* Return nonzero if ELEM is part of the chain CHAIN. */
3272
3273bool
3274chain_member (const_tree elem, const_tree chain)
3275{
3276 while (chain)
3277 {
3278 if (elem == chain)
3279 return true;
3280 chain = DECL_CHAIN (chain)(((contains_struct_check (((contains_struct_check ((chain), (
TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3280, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3280, __FUNCTION__))->common.chain))
;
3281 }
3282
3283 return false;
3284}
3285
3286/* Return the length of a chain of nodes chained through TREE_CHAIN.
3287 We expect a null pointer to mark the end of the chain.
3288 This is the Lisp primitive `length'. */
3289
3290int
3291list_length (const_tree t)
3292{
3293 const_tree p = t;
3294#ifdef ENABLE_TREE_CHECKING1
3295 const_tree q = t;
3296#endif
3297 int len = 0;
3298
3299 while (p)
3300 {
3301 p = TREE_CHAIN (p)((contains_struct_check ((p), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3301, __FUNCTION__))->common.chain)
;
3302#ifdef ENABLE_TREE_CHECKING1
3303 if (len % 2)
3304 q = TREE_CHAIN (q)((contains_struct_check ((q), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3304, __FUNCTION__))->common.chain)
;
3305 gcc_assert (p != q)((void)(!(p != q) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3305, __FUNCTION__), 0 : 0))
;
3306#endif
3307 len++;
3308 }
3309
3310 return len;
3311}
3312
3313/* Returns the first FIELD_DECL in the TYPE_FIELDS of the RECORD_TYPE or
3314 UNION_TYPE TYPE, or NULL_TREE if none. */
3315
3316tree
3317first_field (const_tree type)
3318{
3319 tree t = TYPE_FIELDS (type)((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3319, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
;
3320 while (t && TREE_CODE (t)((enum tree_code) (t)->base.code) != FIELD_DECL)
3321 t = TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3321, __FUNCTION__))->common.chain)
;
3322 return t;
3323}
3324
3325/* Returns the last FIELD_DECL in the TYPE_FIELDS of the RECORD_TYPE or
3326 UNION_TYPE TYPE, or NULL_TREE if none. */
3327
3328tree
3329last_field (const_tree type)
3330{
3331 tree last = NULL_TREE(tree) nullptr;
3332
3333 for (tree fld = TYPE_FIELDS (type)((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3333, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
; fld; fld = TREE_CHAIN (fld)((contains_struct_check ((fld), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3333, __FUNCTION__))->common.chain)
)
3334 {
3335 if (TREE_CODE (fld)((enum tree_code) (fld)->base.code) != FIELD_DECL)
3336 continue;
3337
3338 last = fld;
3339 }
3340
3341 return last;
3342}
3343
3344/* Concatenate two chains of nodes (chained through TREE_CHAIN)
3345 by modifying the last node in chain 1 to point to chain 2.
3346 This is the Lisp primitive `nconc'. */
3347
3348tree
3349chainon (tree op1, tree op2)
3350{
3351 tree t1;
3352
3353 if (!op1)
3354 return op2;
3355 if (!op2)
3356 return op1;
3357
3358 for (t1 = op1; TREE_CHAIN (t1)((contains_struct_check ((t1), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3358, __FUNCTION__))->common.chain)
; t1 = TREE_CHAIN (t1)((contains_struct_check ((t1), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3358, __FUNCTION__))->common.chain)
)
3359 continue;
3360 TREE_CHAIN (t1)((contains_struct_check ((t1), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3360, __FUNCTION__))->common.chain)
= op2;
3361
3362#ifdef ENABLE_TREE_CHECKING1
3363 {
3364 tree t2;
3365 for (t2 = op2; t2; t2 = TREE_CHAIN (t2)((contains_struct_check ((t2), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3365, __FUNCTION__))->common.chain)
)
3366 gcc_assert (t2 != t1)((void)(!(t2 != t1) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3366, __FUNCTION__), 0 : 0))
;
3367 }
3368#endif
3369
3370 return op1;
3371}
3372
3373/* Return the last node in a chain of nodes (chained through TREE_CHAIN). */
3374
3375tree
3376tree_last (tree chain)
3377{
3378 tree next;
3379 if (chain)
3380 while ((next = TREE_CHAIN (chain)((contains_struct_check ((chain), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3380, __FUNCTION__))->common.chain)
))
3381 chain = next;
3382 return chain;
3383}
3384
3385/* Reverse the order of elements in the chain T,
3386 and return the new head of the chain (old last element). */
3387
3388tree
3389nreverse (tree t)
3390{
3391 tree prev = 0, decl, next;
3392 for (decl = t; decl; decl = next)
3393 {
3394 /* We shouldn't be using this function to reverse BLOCK chains; we
3395 have blocks_nreverse for that. */
3396 gcc_checking_assert (TREE_CODE (decl) != BLOCK)((void)(!(((enum tree_code) (decl)->base.code) != BLOCK) ?
fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3396, __FUNCTION__), 0 : 0))
;
3397 next = TREE_CHAIN (decl)((contains_struct_check ((decl), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3397, __FUNCTION__))->common.chain)
;
3398 TREE_CHAIN (decl)((contains_struct_check ((decl), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3398, __FUNCTION__))->common.chain)
= prev;
3399 prev = decl;
3400 }
3401 return prev;
3402}
3403
3404/* Return a newly created TREE_LIST node whose
3405 purpose and value fields are PARM and VALUE. */
3406
3407tree
3408build_tree_list (tree parm, tree value MEM_STAT_DECL)
3409{
3410 tree t = make_node (TREE_LIST PASS_MEM_STAT);
3411 TREE_PURPOSE (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3411, __FUNCTION__, (TREE_LIST)))->list.purpose)
= parm;
3412 TREE_VALUE (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3412, __FUNCTION__, (TREE_LIST)))->list.value)
= value;
3413 return t;
3414}
3415
3416/* Build a chain of TREE_LIST nodes from a vector. */
3417
3418tree
3419build_tree_list_vec (const vec<tree, va_gc> *vec MEM_STAT_DECL)
3420{
3421 tree ret = NULL_TREE(tree) nullptr;
3422 tree *pp = &ret;
3423 unsigned int i;
3424 tree t;
3425 FOR_EACH_VEC_SAFE_ELT (vec, i, t)for (i = 0; vec_safe_iterate ((vec), (i), &(t)); ++(i))
3426 {
3427 *pp = build_tree_list (NULLnullptr, t PASS_MEM_STAT);
3428 pp = &TREE_CHAIN (*pp)((contains_struct_check ((*pp), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3428, __FUNCTION__))->common.chain)
;
3429 }
3430 return ret;
3431}
3432
3433/* Return a newly created TREE_LIST node whose
3434 purpose and value fields are PURPOSE and VALUE
3435 and whose TREE_CHAIN is CHAIN. */
3436
3437tree
3438tree_cons (tree purpose, tree value, tree chain MEM_STAT_DECL)
3439{
3440 tree node;
3441
3442 node = ggc_alloc_tree_node_stat (sizeof (struct tree_list) PASS_MEM_STAT);
3443 memset (node, 0, sizeof (struct tree_common));
3444
3445 record_node_allocation_statistics (TREE_LIST, sizeof (struct tree_list));
3446
3447 TREE_SET_CODE (node, TREE_LIST)((node)->base.code = (TREE_LIST));
3448 TREE_CHAIN (node)((contains_struct_check ((node), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3448, __FUNCTION__))->common.chain)
= chain;
3449 TREE_PURPOSE (node)((tree_check ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3449, __FUNCTION__, (TREE_LIST)))->list.purpose)
= purpose;
3450 TREE_VALUE (node)((tree_check ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3450, __FUNCTION__, (TREE_LIST)))->list.value)
= value;
3451 return node;
3452}
3453
3454/* Return the values of the elements of a CONSTRUCTOR as a vector of
3455 trees. */
3456
3457vec<tree, va_gc> *
3458ctor_to_vec (tree ctor)
3459{
3460 vec<tree, va_gc> *vec;
3461 vec_alloc (vec, CONSTRUCTOR_NELTS (ctor)(vec_safe_length (((tree_check ((ctor), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3461, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)))
)
;
1
Calling 'vec_alloc<tree_node *, va_gc>'
9
Returning from 'vec_alloc<tree_node *, va_gc>'
3462 unsigned int ix;
3463 tree val;
3464
3465 FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (ctor), ix, val)for (ix = 0; (ix >= vec_safe_length (((tree_check ((ctor),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3465, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)))
? false : ((val = (*(((tree_check ((ctor), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3465, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)))
[ix].value), true); (ix)++)
10
Assuming the condition is false
11
'?' condition is false
12
Loop condition is true. Entering loop body
3466 vec->quick_push (val);
13
Called C++ object pointer is null
3467
3468 return vec;
3469}
3470
3471/* Return the size nominally occupied by an object of type TYPE
3472 when it resides in memory. The value is measured in units of bytes,
3473 and its data type is that normally used for type sizes
3474 (which is the first type created by make_signed_type or
3475 make_unsigned_type). */
3476
3477tree
3478size_in_bytes_loc (location_t loc, const_tree type)
3479{
3480 tree t;
3481
3482 if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3483 return integer_zero_nodeglobal_trees[TI_INTEGER_ZERO];
3484
3485 type = TYPE_MAIN_VARIANT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3485, __FUNCTION__))->type_common.main_variant)
;
3486 t = TYPE_SIZE_UNIT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3486, __FUNCTION__))->type_common.size_unit)
;
3487
3488 if (t == 0)
3489 {
3490 lang_hooks.types.incomplete_type_error (loc, NULL_TREE(tree) nullptr, type);
3491 return size_zero_nodeglobal_trees[TI_SIZE_ZERO];
3492 }
3493
3494 return t;
3495}
3496
3497/* Return the size of TYPE (in bytes) as a wide integer
3498 or return -1 if the size can vary or is larger than an integer. */
3499
3500HOST_WIDE_INTlong
3501int_size_in_bytes (const_tree type)
3502{
3503 tree t;
3504
3505 if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3506 return 0;
3507
3508 type = TYPE_MAIN_VARIANT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3508, __FUNCTION__))->type_common.main_variant)
;
3509 t = TYPE_SIZE_UNIT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3509, __FUNCTION__))->type_common.size_unit)
;
3510
3511 if (t && tree_fits_uhwi_p (t))
3512 return TREE_INT_CST_LOW (t)((unsigned long) (*tree_int_cst_elt_check ((t), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3512, __FUNCTION__)))
;
3513 else
3514 return -1;
3515}
3516
3517/* Return the maximum size of TYPE (in bytes) as a wide integer
3518 or return -1 if the size can vary or is larger than an integer. */
3519
3520HOST_WIDE_INTlong
3521max_int_size_in_bytes (const_tree type)
3522{
3523 HOST_WIDE_INTlong size = -1;
3524 tree size_tree;
3525
3526 /* If this is an array type, check for a possible MAX_SIZE attached. */
3527
3528 if (TREE_CODE (type)((enum tree_code) (type)->base.code) == ARRAY_TYPE)
3529 {
3530 size_tree = TYPE_ARRAY_MAX_SIZE (type)((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3530, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.maxval
)
;
3531
3532 if (size_tree && tree_fits_uhwi_p (size_tree))
3533 size = tree_to_uhwi (size_tree);
3534 }
3535
3536 /* If we still haven't been able to get a size, see if the language
3537 can compute a maximum size. */
3538
3539 if (size == -1)
3540 {
3541 size_tree = lang_hooks.types.max_size (type);
3542
3543 if (size_tree && tree_fits_uhwi_p (size_tree))
3544 size = tree_to_uhwi (size_tree);
3545 }
3546
3547 return size;
3548}
3549
3550/* Return the bit position of FIELD, in bits from the start of the record.
3551 This is a tree of type bitsizetype. */
3552
3553tree
3554bit_position (const_tree field)
3555{
3556 return bit_from_pos (DECL_FIELD_OFFSET (field)((tree_check ((field), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3556, __FUNCTION__, (FIELD_DECL)))->field_decl.offset)
,
3557 DECL_FIELD_BIT_OFFSET (field)((tree_check ((field), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3557, __FUNCTION__, (FIELD_DECL)))->field_decl.bit_offset
)
);
3558}
3559
3560/* Return the byte position of FIELD, in bytes from the start of the record.
3561 This is a tree of type sizetype. */
3562
3563tree
3564byte_position (const_tree field)
3565{
3566 return byte_from_pos (DECL_FIELD_OFFSET (field)((tree_check ((field), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3566, __FUNCTION__, (FIELD_DECL)))->field_decl.offset)
,
3567 DECL_FIELD_BIT_OFFSET (field)((tree_check ((field), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3567, __FUNCTION__, (FIELD_DECL)))->field_decl.bit_offset
)
);
3568}
3569
3570/* Likewise, but return as an integer. It must be representable in
3571 that way (since it could be a signed value, we don't have the
3572 option of returning -1 like int_size_in_byte can. */
3573
3574HOST_WIDE_INTlong
3575int_byte_position (const_tree field)
3576{
3577 return tree_to_shwi (byte_position (field));
3578}
3579
3580/* Return, as a tree node, the number of elements for TYPE (which is an
3581 ARRAY_TYPE) minus one. This counts only elements of the top array. */
3582
3583tree
3584array_type_nelts (const_tree type)
3585{
3586 tree index_type, min, max;
3587
3588 /* If they did it with unspecified bounds, then we should have already
3589 given an error about it before we got here. */
3590 if (! TYPE_DOMAIN (type)((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3590, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
)
3591 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3592
3593 index_type = TYPE_DOMAIN (type)((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3593, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
;
3594 min = TYPE_MIN_VALUE (index_type)((tree_check5 ((index_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3594, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.minval
)
;
3595 max = TYPE_MAX_VALUE (index_type)((tree_check5 ((index_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3595, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)
;
3596
3597 /* TYPE_MAX_VALUE may not be set if the array has unknown length. */
3598 if (!max)
3599 {
3600 /* zero sized arrays are represented from C FE as complete types with
3601 NULL TYPE_MAX_VALUE and zero TYPE_SIZE, while C++ FE represents
3602 them as min 0, max -1. */
3603 if (COMPLETE_TYPE_P (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3603, __FUNCTION__))->type_common.size) != (tree) nullptr
)
3604 && integer_zerop (TYPE_SIZE (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3604, __FUNCTION__))->type_common.size)
)
3605 && integer_zerop (min))
3606 return build_int_cst (TREE_TYPE (min)((contains_struct_check ((min), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3606, __FUNCTION__))->typed.type)
, -1);
3607
3608 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3609 }
3610
3611 return (integer_zerop (min)
3612 ? max
3613 : fold_build2 (MINUS_EXPR, TREE_TYPE (max), max, min)fold_build2_loc (((location_t) 0), MINUS_EXPR, ((contains_struct_check
((max), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3613, __FUNCTION__))->typed.type), max, min )
);
3614}
3615
3616/* If arg is static -- a reference to an object in static storage -- then
3617 return the object. This is not the same as the C meaning of `static'.
3618 If arg isn't static, return NULL. */
3619
3620tree
3621staticp (tree arg)
3622{
3623 switch (TREE_CODE (arg)((enum tree_code) (arg)->base.code))
3624 {
3625 case FUNCTION_DECL:
3626 /* Nested functions are static, even though taking their address will
3627 involve a trampoline as we unnest the nested function and create
3628 the trampoline on the tree level. */
3629 return arg;
3630
3631 case VAR_DECL:
3632 return ((TREE_STATIC (arg)((arg)->base.static_flag) || DECL_EXTERNAL (arg)((contains_struct_check ((arg), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3632, __FUNCTION__))->decl_common.decl_flag_1)
)
3633 && ! DECL_THREAD_LOCAL_P (arg)((((arg)->base.static_flag) || ((contains_struct_check ((arg
), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3633, __FUNCTION__))->decl_common.decl_flag_1)) &&
decl_tls_model (arg) >= TLS_MODEL_REAL)
3634 && ! DECL_DLLIMPORT_P (arg)((contains_struct_check ((arg), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3634, __FUNCTION__))->decl_with_vis.dllimport_flag)
3635 ? arg : NULLnullptr);
3636
3637 case CONST_DECL:
3638 return ((TREE_STATIC (arg)((arg)->base.static_flag) || DECL_EXTERNAL (arg)((contains_struct_check ((arg), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3638, __FUNCTION__))->decl_common.decl_flag_1)
)
3639 ? arg : NULLnullptr);
3640
3641 case CONSTRUCTOR:
3642 return TREE_STATIC (arg)((arg)->base.static_flag) ? arg : NULLnullptr;
3643
3644 case LABEL_DECL:
3645 case STRING_CST:
3646 return arg;
3647
3648 case COMPONENT_REF:
3649 /* If the thing being referenced is not a field, then it is
3650 something language specific. */
3651 gcc_assert (TREE_CODE (TREE_OPERAND (arg, 1)) == FIELD_DECL)((void)(!(((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((arg), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3651, __FUNCTION__))))))->base.code) == FIELD_DECL) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3651, __FUNCTION__), 0 : 0))
;
3652
3653 /* If we are referencing a bitfield, we can't evaluate an
3654 ADDR_EXPR at compile time and so it isn't a constant. */
3655 if (DECL_BIT_FIELD (TREE_OPERAND (arg, 1))((tree_check (((*((const_cast<tree*> (tree_operand_check
((arg), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3655, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3655, __FUNCTION__, (FIELD_DECL)))->decl_common.decl_flag_1
)
)
3656 return NULLnullptr;
3657
3658 return staticp (TREE_OPERAND (arg, 0)(*((const_cast<tree*> (tree_operand_check ((arg), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3658, __FUNCTION__)))))
);
3659
3660 case BIT_FIELD_REF:
3661 return NULLnullptr;
3662
3663 case INDIRECT_REF:
3664 return TREE_CONSTANT (TREE_OPERAND (arg, 0))((non_type_check (((*((const_cast<tree*> (tree_operand_check
((arg), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3664, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3664, __FUNCTION__))->base.constant_flag)
? arg : NULLnullptr;
3665
3666 case ARRAY_REF:
3667 case ARRAY_RANGE_REF:
3668 if (TREE_CODE (TYPE_SIZE (TREE_TYPE (arg)))((enum tree_code) (((tree_class_check ((((contains_struct_check
((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3668, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3668, __FUNCTION__))->type_common.size))->base.code)
== INTEGER_CST
3669 && TREE_CODE (TREE_OPERAND (arg, 1))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((arg), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3669, __FUNCTION__))))))->base.code)
== INTEGER_CST)
3670 return staticp (TREE_OPERAND (arg, 0)(*((const_cast<tree*> (tree_operand_check ((arg), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3670, __FUNCTION__)))))
);
3671 else
3672 return NULLnullptr;
3673
3674 case COMPOUND_LITERAL_EXPR:
3675 return TREE_STATIC (COMPOUND_LITERAL_EXPR_DECL (arg))(((*((const_cast<tree*> (tree_operand_check (((tree_check
(((*((const_cast<tree*> (tree_operand_check (((tree_check
((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3675, __FUNCTION__, (COMPOUND_LITERAL_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3675, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3675, __FUNCTION__, (DECL_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3675, __FUNCTION__))))))->base.static_flag)
? arg : NULLnullptr;
3676
3677 default:
3678 return NULLnullptr;
3679 }
3680}
3681
3682
3683
3684
3685/* Return whether OP is a DECL whose address is function-invariant. */
3686
3687bool
3688decl_address_invariant_p (const_tree op)
3689{
3690 /* The conditions below are slightly less strict than the one in
3691 staticp. */
3692
3693 switch (TREE_CODE (op)((enum tree_code) (op)->base.code))
3694 {
3695 case PARM_DECL:
3696 case RESULT_DECL:
3697 case LABEL_DECL:
3698 case FUNCTION_DECL:
3699 return true;
3700
3701 case VAR_DECL:
3702 if ((TREE_STATIC (op)((op)->base.static_flag) || DECL_EXTERNAL (op)((contains_struct_check ((op), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3702, __FUNCTION__))->decl_common.decl_flag_1)
)
3703 || DECL_THREAD_LOCAL_P (op)((((op)->base.static_flag) || ((contains_struct_check ((op
), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3703, __FUNCTION__))->decl_common.decl_flag_1)) &&
decl_tls_model (op) >= TLS_MODEL_REAL)
3704 || DECL_CONTEXT (op)((contains_struct_check ((op), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3704, __FUNCTION__))->decl_minimal.context)
== current_function_decl
3705 || decl_function_context (op) == current_function_decl)
3706 return true;
3707 break;
3708
3709 case CONST_DECL:
3710 if ((TREE_STATIC (op)((op)->base.static_flag) || DECL_EXTERNAL (op)((contains_struct_check ((op), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3710, __FUNCTION__))->decl_common.decl_flag_1)
)
3711 || decl_function_context (op) == current_function_decl)
3712 return true;
3713 break;
3714
3715 default:
3716 break;
3717 }
3718
3719 return false;
3720}
3721
3722/* Return whether OP is a DECL whose address is interprocedural-invariant. */
3723
3724bool
3725decl_address_ip_invariant_p (const_tree op)
3726{
3727 /* The conditions below are slightly less strict than the one in
3728 staticp. */
3729
3730 switch (TREE_CODE (op)((enum tree_code) (op)->base.code))
3731 {
3732 case LABEL_DECL:
3733 case FUNCTION_DECL:
3734 case STRING_CST:
3735 return true;
3736
3737 case VAR_DECL:
3738 if (((TREE_STATIC (op)((op)->base.static_flag) || DECL_EXTERNAL (op)((contains_struct_check ((op), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3738, __FUNCTION__))->decl_common.decl_flag_1)
)
3739 && !DECL_DLLIMPORT_P (op)((contains_struct_check ((op), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3739, __FUNCTION__))->decl_with_vis.dllimport_flag)
)
3740 || DECL_THREAD_LOCAL_P (op)((((op)->base.static_flag) || ((contains_struct_check ((op
), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3740, __FUNCTION__))->decl_common.decl_flag_1)) &&
decl_tls_model (op) >= TLS_MODEL_REAL)
)
3741 return true;
3742 break;
3743
3744 case CONST_DECL:
3745 if ((TREE_STATIC (op)((op)->base.static_flag) || DECL_EXTERNAL (op)((contains_struct_check ((op), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3745, __FUNCTION__))->decl_common.decl_flag_1)
))
3746 return true;
3747 break;
3748
3749 default:
3750 break;
3751 }
3752
3753 return false;
3754}
3755
3756
3757/* Return true if T is function-invariant (internal function, does
3758 not handle arithmetic; that's handled in skip_simple_arithmetic and
3759 tree_invariant_p). */
3760
3761static bool
3762tree_invariant_p_1 (tree t)
3763{
3764 tree op;
3765
3766 if (TREE_CONSTANT (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3766, __FUNCTION__))->base.constant_flag)
3767 || (TREE_READONLY (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3767, __FUNCTION__))->base.readonly_flag)
&& !TREE_SIDE_EFFECTS (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3767, __FUNCTION__))->base.side_effects_flag)
))
3768 return true;
3769
3770 switch (TREE_CODE (t)((enum tree_code) (t)->base.code))
3771 {
3772 case SAVE_EXPR:
3773 return true;
3774
3775 case ADDR_EXPR:
3776 op = TREE_OPERAND (t, 0)(*((const_cast<tree*> (tree_operand_check ((t), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3776, __FUNCTION__)))))
;
3777 while (handled_component_p (op))
3778 {
3779 switch (TREE_CODE (op)((enum tree_code) (op)->base.code))
3780 {
3781 case ARRAY_REF:
3782 case ARRAY_RANGE_REF:
3783 if (!tree_invariant_p (TREE_OPERAND (op, 1)(*((const_cast<tree*> (tree_operand_check ((op), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3783, __FUNCTION__)))))
)
3784 || TREE_OPERAND (op, 2)(*((const_cast<tree*> (tree_operand_check ((op), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3784, __FUNCTION__)))))
!= NULL_TREE(tree) nullptr
3785 || TREE_OPERAND (op, 3)(*((const_cast<tree*> (tree_operand_check ((op), (3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3785, __FUNCTION__)))))
!= NULL_TREE(tree) nullptr)
3786 return false;
3787 break;
3788
3789 case COMPONENT_REF:
3790 if (TREE_OPERAND (op, 2)(*((const_cast<tree*> (tree_operand_check ((op), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3790, __FUNCTION__)))))
!= NULL_TREE(tree) nullptr)
3791 return false;
3792 break;
3793
3794 default:;
3795 }
3796 op = TREE_OPERAND (op, 0)(*((const_cast<tree*> (tree_operand_check ((op), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3796, __FUNCTION__)))))
;
3797 }
3798
3799 return CONSTANT_CLASS_P (op)(tree_code_type[(int) (((enum tree_code) (op)->base.code))
] == tcc_constant)
|| decl_address_invariant_p (op);
3800
3801 default:
3802 break;
3803 }
3804
3805 return false;
3806}
3807
3808/* Return true if T is function-invariant. */
3809
3810bool
3811tree_invariant_p (tree t)
3812{
3813 tree inner = skip_simple_arithmetic (t);
3814 return tree_invariant_p_1 (inner);
3815}
3816
3817/* Wrap a SAVE_EXPR around EXPR, if appropriate.
3818 Do this to any expression which may be used in more than one place,
3819 but must be evaluated only once.
3820
3821 Normally, expand_expr would reevaluate the expression each time.
3822 Calling save_expr produces something that is evaluated and recorded
3823 the first time expand_expr is called on it. Subsequent calls to
3824 expand_expr just reuse the recorded value.
3825
3826 The call to expand_expr that generates code that actually computes
3827 the value is the first call *at compile time*. Subsequent calls
3828 *at compile time* generate code to use the saved value.
3829 This produces correct result provided that *at run time* control
3830 always flows through the insns made by the first expand_expr
3831 before reaching the other places where the save_expr was evaluated.
3832 You, the caller of save_expr, must make sure this is so.
3833
3834 Constants, and certain read-only nodes, are returned with no
3835 SAVE_EXPR because that is safe. Expressions containing placeholders
3836 are not touched; see tree.def for an explanation of what these
3837 are used for. */
3838
3839tree
3840save_expr (tree expr)
3841{
3842 tree inner;
3843
3844 /* If the tree evaluates to a constant, then we don't want to hide that
3845 fact (i.e. this allows further folding, and direct checks for constants).
3846 However, a read-only object that has side effects cannot be bypassed.
3847 Since it is no problem to reevaluate literals, we just return the
3848 literal node. */
3849 inner = skip_simple_arithmetic (expr);
3850 if (TREE_CODE (inner)((enum tree_code) (inner)->base.code) == ERROR_MARK)
3851 return inner;
3852
3853 if (tree_invariant_p_1 (inner))
3854 return expr;
3855
3856 /* If INNER contains a PLACEHOLDER_EXPR, we must evaluate it each time, since
3857 it means that the size or offset of some field of an object depends on
3858 the value within another field.
3859
3860 Note that it must not be the case that EXPR contains both a PLACEHOLDER_EXPR
3861 and some variable since it would then need to be both evaluated once and
3862 evaluated more than once. Front-ends must assure this case cannot
3863 happen by surrounding any such subexpressions in their own SAVE_EXPR
3864 and forcing evaluation at the proper time. */
3865 if (contains_placeholder_p (inner))
3866 return expr;
3867
3868 expr = build1_loc (EXPR_LOCATION (expr)((((expr)) && ((tree_code_type[(int) (((enum tree_code
) ((expr))->base.code))]) >= tcc_reference && (
tree_code_type[(int) (((enum tree_code) ((expr))->base.code
))]) <= tcc_expression)) ? (expr)->exp.locus : ((location_t
) 0))
, SAVE_EXPR, TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3868, __FUNCTION__))->typed.type)
, expr);
3869
3870 /* This expression might be placed ahead of a jump to ensure that the
3871 value was computed on both sides of the jump. So make sure it isn't
3872 eliminated as dead. */
3873 TREE_SIDE_EFFECTS (expr)((non_type_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3873, __FUNCTION__))->base.side_effects_flag)
= 1;
3874 return expr;
3875}
3876
3877/* Look inside EXPR into any simple arithmetic operations. Return the
3878 outermost non-arithmetic or non-invariant node. */
3879
3880tree
3881skip_simple_arithmetic (tree expr)
3882{
3883 /* We don't care about whether this can be used as an lvalue in this
3884 context. */
3885 while (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == NON_LVALUE_EXPR)
3886 expr = TREE_OPERAND (expr, 0)(*((const_cast<tree*> (tree_operand_check ((expr), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3886, __FUNCTION__)))))
;
3887
3888 /* If we have simple operations applied to a SAVE_EXPR or to a SAVE_EXPR and
3889 a constant, it will be more efficient to not make another SAVE_EXPR since
3890 it will allow better simplification and GCSE will be able to merge the
3891 computations if they actually occur. */
3892 while (true)
3893 {
3894 if (UNARY_CLASS_P (expr)(tree_code_type[(int) (((enum tree_code) (expr)->base.code
))] == tcc_unary)
)
3895 expr = TREE_OPERAND (expr, 0)(*((const_cast<tree*> (tree_operand_check ((expr), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3895, __FUNCTION__)))))
;
3896 else if (BINARY_CLASS_P (expr)(tree_code_type[(int) (((enum tree_code) (expr)->base.code
))] == tcc_binary)
)
3897 {
3898 if (tree_invariant_p (TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3898, __FUNCTION__)))))
))
3899 expr = TREE_OPERAND (expr, 0)(*((const_cast<tree*> (tree_operand_check ((expr), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3899, __FUNCTION__)))))
;
3900 else if (tree_invariant_p (TREE_OPERAND (expr, 0)(*((const_cast<tree*> (tree_operand_check ((expr), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3900, __FUNCTION__)))))
))
3901 expr = TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3901, __FUNCTION__)))))
;
3902 else
3903 break;
3904 }
3905 else
3906 break;
3907 }
3908
3909 return expr;
3910}
3911
3912/* Look inside EXPR into simple arithmetic operations involving constants.
3913 Return the outermost non-arithmetic or non-constant node. */
3914
3915tree
3916skip_simple_constant_arithmetic (tree expr)
3917{
3918 while (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == NON_LVALUE_EXPR)
3919 expr = TREE_OPERAND (expr, 0)(*((const_cast<tree*> (tree_operand_check ((expr), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3919, __FUNCTION__)))))
;
3920
3921 while (true)
3922 {
3923 if (UNARY_CLASS_P (expr)(tree_code_type[(int) (((enum tree_code) (expr)->base.code
))] == tcc_unary)
)
3924 expr = TREE_OPERAND (expr, 0)(*((const_cast<tree*> (tree_operand_check ((expr), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3924, __FUNCTION__)))))
;
3925 else if (BINARY_CLASS_P (expr)(tree_code_type[(int) (((enum tree_code) (expr)->base.code
))] == tcc_binary)
)
3926 {
3927 if (TREE_CONSTANT (TREE_OPERAND (expr, 1))((non_type_check (((*((const_cast<tree*> (tree_operand_check
((expr), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3927, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3927, __FUNCTION__))->base.constant_flag)
)
3928 expr = TREE_OPERAND (expr, 0)(*((const_cast<tree*> (tree_operand_check ((expr), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3928, __FUNCTION__)))))
;
3929 else if (TREE_CONSTANT (TREE_OPERAND (expr, 0))((non_type_check (((*((const_cast<tree*> (tree_operand_check
((expr), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3929, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3929, __FUNCTION__))->base.constant_flag)
)
3930 expr = TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3930, __FUNCTION__)))))
;
3931 else
3932 break;
3933 }
3934 else
3935 break;
3936 }
3937
3938 return expr;
3939}
3940
3941/* Return which tree structure is used by T. */
3942
3943enum tree_node_structure_enum
3944tree_node_structure (const_tree t)
3945{
3946 const enum tree_code code = TREE_CODE (t)((enum tree_code) (t)->base.code);
3947 return tree_node_structure_for_code (code);
3948}
3949
3950/* Set various status flags when building a CALL_EXPR object T. */
3951
3952static void
3953process_call_operands (tree t)
3954{
3955 bool side_effects = TREE_SIDE_EFFECTS (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3955, __FUNCTION__))->base.side_effects_flag)
;
3956 bool read_only = false;
3957 int i = call_expr_flags (t);
3958
3959 /* Calls have side-effects, except those to const or pure functions. */
3960 if ((i & ECF_LOOPING_CONST_OR_PURE(1 << 2)) || !(i & (ECF_CONST(1 << 0) | ECF_PURE(1 << 1))))
3961 side_effects = true;
3962 /* Propagate TREE_READONLY of arguments for const functions. */
3963 if (i & ECF_CONST(1 << 0))
3964 read_only = true;
3965
3966 if (!side_effects || read_only)
3967 for (i = 1; i < TREE_OPERAND_LENGTH (t)tree_operand_length (t); i++)
3968 {
3969 tree op = TREE_OPERAND (t, i)(*((const_cast<tree*> (tree_operand_check ((t), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3969, __FUNCTION__)))))
;
3970 if (op && TREE_SIDE_EFFECTS (op)((non_type_check ((op), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3970, __FUNCTION__))->base.side_effects_flag)
)
3971 side_effects = true;
3972 if (op && !TREE_READONLY (op)((non_type_check ((op), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3972, __FUNCTION__))->base.readonly_flag)
&& !CONSTANT_CLASS_P (op)(tree_code_type[(int) (((enum tree_code) (op)->base.code))
] == tcc_constant)
)
3973 read_only = false;
3974 }
3975
3976 TREE_SIDE_EFFECTS (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3976, __FUNCTION__))->base.side_effects_flag)
= side_effects;
3977 TREE_READONLY (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 3977, __FUNCTION__))->base.readonly_flag)
= read_only;
3978}
3979
3980/* Return true if EXP contains a PLACEHOLDER_EXPR, i.e. if it represents a
3981 size or offset that depends on a field within a record. */
3982
3983bool
3984contains_placeholder_p (const_tree exp)
3985{
3986 enum tree_code code;
3987
3988 if (!exp)
3989 return 0;
3990
3991 code = TREE_CODE (exp)((enum tree_code) (exp)->base.code);
3992 if (code == PLACEHOLDER_EXPR)
3993 return 1;
3994
3995 switch (TREE_CODE_CLASS (code)tree_code_type[(int) (code)])
3996 {
3997 case tcc_reference:
3998 /* Don't look at any PLACEHOLDER_EXPRs that might be in index or bit
3999 position computations since they will be converted into a
4000 WITH_RECORD_EXPR involving the reference, which will assume
4001 here will be valid. */
4002 return CONTAINS_PLACEHOLDER_P (TREE_OPERAND (exp, 0))(((*((const_cast<tree*> (tree_operand_check ((exp), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4002, __FUNCTION__)))))) != 0 && ! ((non_type_check
(((*((const_cast<tree*> (tree_operand_check ((exp), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4002, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4002, __FUNCTION__))->base.constant_flag) && contains_placeholder_p
((*((const_cast<tree*> (tree_operand_check ((exp), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4002, __FUNCTION__)))))))
;
4003
4004 case tcc_exceptional:
4005 if (code == TREE_LIST)
4006 return (CONTAINS_PLACEHOLDER_P (TREE_VALUE (exp))((((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4006, __FUNCTION__, (TREE_LIST)))->list.value)) != 0 &&
! ((non_type_check ((((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4006, __FUNCTION__, (TREE_LIST)))->list.value)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4006, __FUNCTION__))->base.constant_flag) && contains_placeholder_p
(((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4006, __FUNCTION__, (TREE_LIST)))->list.value)))
4007 || CONTAINS_PLACEHOLDER_P (TREE_CHAIN (exp))((((contains_struct_check ((exp), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4007, __FUNCTION__))->common.chain)) != 0 && ! (
(non_type_check ((((contains_struct_check ((exp), (TS_COMMON)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4007, __FUNCTION__))->common.chain)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4007, __FUNCTION__))->base.constant_flag) && contains_placeholder_p
(((contains_struct_check ((exp), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4007, __FUNCTION__))->common.chain)))
);
4008 break;
4009
4010 case tcc_unary:
4011 case tcc_binary:
4012 case tcc_comparison:
4013 case tcc_expression:
4014 switch (code)
4015 {
4016 case COMPOUND_EXPR:
4017 /* Ignoring the first operand isn't quite right, but works best. */
4018 return CONTAINS_PLACEHOLDER_P (TREE_OPERAND (exp, 1))(((*((const_cast<tree*> (tree_operand_check ((exp), (1)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4018, __FUNCTION__)))))) != 0 && ! ((non_type_check
(((*((const_cast<tree*> (tree_operand_check ((exp), (1
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4018, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4018, __FUNCTION__))->base.constant_flag) && contains_placeholder_p
((*((const_cast<tree*> (tree_operand_check ((exp), (1)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4018, __FUNCTION__)))))))
;
4019
4020 case COND_EXPR:
4021 return (CONTAINS_PLACEHOLDER_P (TREE_OPERAND (exp, 0))(((*((const_cast<tree*> (tree_operand_check ((exp), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4021, __FUNCTION__)))))) != 0 && ! ((non_type_check
(((*((const_cast<tree*> (tree_operand_check ((exp), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4021, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4021, __FUNCTION__))->base.constant_flag) && contains_placeholder_p
((*((const_cast<tree*> (tree_operand_check ((exp), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4021, __FUNCTION__)))))))
4022 || CONTAINS_PLACEHOLDER_P (TREE_OPERAND (exp, 1))(((*((const_cast<tree*> (tree_operand_check ((exp), (1)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4022, __FUNCTION__)))))) != 0 && ! ((non_type_check
(((*((const_cast<tree*> (tree_operand_check ((exp), (1
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4022, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4022, __FUNCTION__))->base.constant_flag) && contains_placeholder_p
((*((const_cast<tree*> (tree_operand_check ((exp), (1)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4022, __FUNCTION__)))))))
4023 || CONTAINS_PLACEHOLDER_P (TREE_OPERAND (exp, 2))(((*((const_cast<tree*> (tree_operand_check ((exp), (2)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4023, __FUNCTION__)))))) != 0 && ! ((non_type_check
(((*((const_cast<tree*> (tree_operand_check ((exp), (2
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4023, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4023, __FUNCTION__))->base.constant_flag) && contains_placeholder_p
((*((const_cast<tree*> (tree_operand_check ((exp), (2)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4023, __FUNCTION__)))))))
);
4024
4025 case SAVE_EXPR:
4026 /* The save_expr function never wraps anything containing
4027 a PLACEHOLDER_EXPR. */
4028 return 0;
4029
4030 default:
4031 break;
4032 }
4033
4034 switch (TREE_CODE_LENGTH (code)tree_code_length[(int) (code)])
4035 {
4036 case 1:
4037 return CONTAINS_PLACEHOLDER_P (TREE_OPERAND (exp, 0))(((*((const_cast<tree*> (tree_operand_check ((exp), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4037, __FUNCTION__)))))) != 0 && ! ((non_type_check
(((*((const_cast<tree*> (tree_operand_check ((exp), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4037, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4037, __FUNCTION__))->base.constant_flag) && contains_placeholder_p
((*((const_cast<tree*> (tree_operand_check ((exp), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4037, __FUNCTION__)))))))
;
4038 case 2:
4039 return (CONTAINS_PLACEHOLDER_P (TREE_OPERAND (exp, 0))(((*((const_cast<tree*> (tree_operand_check ((exp), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4039, __FUNCTION__)))))) != 0 && ! ((non_type_check
(((*((const_cast<tree*> (tree_operand_check ((exp), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4039, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4039, __FUNCTION__))->base.constant_flag) && contains_placeholder_p
((*((const_cast<tree*> (tree_operand_check ((exp), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4039, __FUNCTION__)))))))
4040 || CONTAINS_PLACEHOLDER_P (TREE_OPERAND (exp, 1))(((*((const_cast<tree*> (tree_operand_check ((exp), (1)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4040, __FUNCTION__)))))) != 0 && ! ((non_type_check
(((*((const_cast<tree*> (tree_operand_check ((exp), (1
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4040, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4040, __FUNCTION__))->base.constant_flag) && contains_placeholder_p
((*((const_cast<tree*> (tree_operand_check ((exp), (1)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4040, __FUNCTION__)))))))
);
4041 default:
4042 return 0;
4043 }
4044
4045 case tcc_vl_exp:
4046 switch (code)
4047 {
4048 case CALL_EXPR:
4049 {
4050 const_tree arg;
4051 const_call_expr_arg_iterator iter;
4052 FOR_EACH_CONST_CALL_EXPR_ARG (arg, iter, exp)for ((arg) = first_const_call_expr_arg ((exp), &(iter)); (
arg); (arg) = next_const_call_expr_arg (&(iter)))
4053 if (CONTAINS_PLACEHOLDER_P (arg)((arg) != 0 && ! ((non_type_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4053, __FUNCTION__))->base.constant_flag) && contains_placeholder_p
(arg))
)
4054 return 1;
4055 return 0;
4056 }
4057 default:
4058 return 0;
4059 }
4060
4061 default:
4062 return 0;
4063 }
4064 return 0;
4065}
4066
4067/* Return true if any part of the structure of TYPE involves a PLACEHOLDER_EXPR
4068 directly. This includes size, bounds, qualifiers (for QUAL_UNION_TYPE) and
4069 field positions. */
4070
4071static bool
4072type_contains_placeholder_1 (const_tree type)
4073{
4074 /* If the size contains a placeholder or the parent type (component type in
4075 the case of arrays) type involves a placeholder, this type does. */
4076 if (CONTAINS_PLACEHOLDER_P (TYPE_SIZE (type))((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4076, __FUNCTION__))->type_common.size)) != 0 &&
! ((non_type_check ((((tree_class_check ((type), (tcc_type),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4076, __FUNCTION__))->type_common.size)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4076, __FUNCTION__))->base.constant_flag) && contains_placeholder_p
(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4076, __FUNCTION__))->type_common.size)))
4077 || CONTAINS_PLACEHOLDER_P (TYPE_SIZE_UNIT (type))((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4077, __FUNCTION__))->type_common.size_unit)) != 0 &&
! ((non_type_check ((((tree_class_check ((type), (tcc_type),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4077, __FUNCTION__))->type_common.size_unit)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4077, __FUNCTION__))->base.constant_flag) && contains_placeholder_p
(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4077, __FUNCTION__))->type_common.size_unit)))
4078 || (!POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || (
(enum tree_code) (type)->base.code) == REFERENCE_TYPE)
4079 && TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4079, __FUNCTION__))->typed.type)
4080 && type_contains_placeholder_p (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4080, __FUNCTION__))->typed.type)
)))
4081 return true;
4082
4083 /* Now do type-specific checks. Note that the last part of the check above
4084 greatly limits what we have to do below. */
4085 switch (TREE_CODE (type)((enum tree_code) (type)->base.code))
4086 {
4087 case VOID_TYPE:
4088 case OPAQUE_TYPE:
4089 case COMPLEX_TYPE:
4090 case ENUMERAL_TYPE:
4091 case BOOLEAN_TYPE:
4092 case POINTER_TYPE:
4093 case OFFSET_TYPE:
4094 case REFERENCE_TYPE:
4095 case METHOD_TYPE:
4096 case FUNCTION_TYPE:
4097 case VECTOR_TYPE:
4098 case NULLPTR_TYPE:
4099 return false;
4100
4101 case INTEGER_TYPE:
4102 case REAL_TYPE:
4103 case FIXED_POINT_TYPE:
4104 /* Here we just check the bounds. */
4105 return (CONTAINS_PLACEHOLDER_P (TYPE_MIN_VALUE (type))((((tree_check5 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4105, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.minval
)) != 0 && ! ((non_type_check ((((tree_check5 ((type)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4105, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.minval
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4105, __FUNCTION__))->base.constant_flag) && contains_placeholder_p
(((tree_check5 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4105, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.minval
)))
4106 || CONTAINS_PLACEHOLDER_P (TYPE_MAX_VALUE (type))((((tree_check5 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4106, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)) != 0 && ! ((non_type_check ((((tree_check5 ((type)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4106, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4106, __FUNCTION__))->base.constant_flag) && contains_placeholder_p
(((tree_check5 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4106, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)))
);
4107
4108 case ARRAY_TYPE:
4109 /* We have already checked the component type above, so just check
4110 the domain type. Flexible array members have a null domain. */
4111 return TYPE_DOMAIN (type)((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4111, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
?
4112 type_contains_placeholder_p (TYPE_DOMAIN (type)((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4112, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
) : false;
4113
4114 case RECORD_TYPE:
4115 case UNION_TYPE:
4116 case QUAL_UNION_TYPE:
4117 {
4118 tree field;
4119
4120 for (field = TYPE_FIELDS (type)((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4120, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
; field; field = DECL_CHAIN (field)(((contains_struct_check (((contains_struct_check ((field), (
TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4120, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4120, __FUNCTION__))->common.chain))
)
4121 if (TREE_CODE (field)((enum tree_code) (field)->base.code) == FIELD_DECL
4122 && (CONTAINS_PLACEHOLDER_P (DECL_FIELD_OFFSET (field))((((tree_check ((field), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4122, __FUNCTION__, (FIELD_DECL)))->field_decl.offset)) !=
0 && ! ((non_type_check ((((tree_check ((field), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4122, __FUNCTION__, (FIELD_DECL)))->field_decl.offset)),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4122, __FUNCTION__))->base.constant_flag) && contains_placeholder_p
(((tree_check ((field), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4122, __FUNCTION__, (FIELD_DECL)))->field_decl.offset)))
4123 || (TREE_CODE (type)((enum tree_code) (type)->base.code) == QUAL_UNION_TYPE
4124 && CONTAINS_PLACEHOLDER_P (DECL_QUALIFIER (field))((((tree_check ((field), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4124, __FUNCTION__, (FIELD_DECL)))->field_decl.qualifier
)) != 0 && ! ((non_type_check ((((tree_check ((field)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4124, __FUNCTION__, (FIELD_DECL)))->field_decl.qualifier
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4124, __FUNCTION__))->base.constant_flag) && contains_placeholder_p
(((tree_check ((field), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4124, __FUNCTION__, (FIELD_DECL)))->field_decl.qualifier
)))
)
4125 || type_contains_placeholder_p (TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4125, __FUNCTION__))->typed.type)
)))
4126 return true;
4127
4128 return false;
4129 }
4130
4131 default:
4132 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4132, __FUNCTION__))
;
4133 }
4134}
4135
4136/* Wrapper around above function used to cache its result. */
4137
4138bool
4139type_contains_placeholder_p (tree type)
4140{
4141 bool result;
4142
4143 /* If the contains_placeholder_bits field has been initialized,
4144 then we know the answer. */
4145 if (TYPE_CONTAINS_PLACEHOLDER_INTERNAL (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4145, __FUNCTION__))->type_common.contains_placeholder_bits
)
> 0)
4146 return TYPE_CONTAINS_PLACEHOLDER_INTERNAL (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4146, __FUNCTION__))->type_common.contains_placeholder_bits
)
- 1;
4147
4148 /* Indicate that we've seen this type node, and the answer is false.
4149 This is what we want to return if we run into recursion via fields. */
4150 TYPE_CONTAINS_PLACEHOLDER_INTERNAL (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4150, __FUNCTION__))->type_common.contains_placeholder_bits
)
= 1;
4151
4152 /* Compute the real value. */
4153 result = type_contains_placeholder_1 (type);
4154
4155 /* Store the real value. */
4156 TYPE_CONTAINS_PLACEHOLDER_INTERNAL (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4156, __FUNCTION__))->type_common.contains_placeholder_bits
)
= result + 1;
4157
4158 return result;
4159}
4160
4161/* Push tree EXP onto vector QUEUE if it is not already present. */
4162
4163static void
4164push_without_duplicates (tree exp, vec<tree> *queue)
4165{
4166 unsigned int i;
4167 tree iter;
4168
4169 FOR_EACH_VEC_ELT (*queue, i, iter)for (i = 0; (*queue).iterate ((i), &(iter)); ++(i))
4170 if (simple_cst_equal (iter, exp) == 1)
4171 break;
4172
4173 if (!iter)
4174 queue->safe_push (exp);
4175}
4176
4177/* Given a tree EXP, find all occurrences of references to fields
4178 in a PLACEHOLDER_EXPR and place them in vector REFS without
4179 duplicates. Also record VAR_DECLs and CONST_DECLs. Note that
4180 we assume here that EXP contains only arithmetic expressions
4181 or CALL_EXPRs with PLACEHOLDER_EXPRs occurring only in their
4182 argument list. */
4183
4184void
4185find_placeholder_in_expr (tree exp, vec<tree> *refs)
4186{
4187 enum tree_code code = TREE_CODE (exp)((enum tree_code) (exp)->base.code);
4188 tree inner;
4189 int i;
4190
4191 /* We handle TREE_LIST and COMPONENT_REF separately. */
4192 if (code == TREE_LIST)
4193 {
4194 FIND_PLACEHOLDER_IN_EXPR (TREE_CHAIN (exp), refs)do { if((((contains_struct_check ((exp), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4194, __FUNCTION__))->common.chain)) && !((non_type_check
((((contains_struct_check ((exp), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4194, __FUNCTION__))->common.chain)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4194, __FUNCTION__))->base.constant_flag)) find_placeholder_in_expr
(((contains_struct_check ((exp), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4194, __FUNCTION__))->common.chain), refs); } while (0)
;
4195 FIND_PLACEHOLDER_IN_EXPR (TREE_VALUE (exp), refs)do { if((((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4195, __FUNCTION__, (TREE_LIST)))->list.value)) &&
!((non_type_check ((((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4195, __FUNCTION__, (TREE_LIST)))->list.value)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4195, __FUNCTION__))->base.constant_flag)) find_placeholder_in_expr
(((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4195, __FUNCTION__, (TREE_LIST)))->list.value), refs); }
while (0)
;
4196 }
4197 else if (code == COMPONENT_REF)
4198 {
4199 for (inner = TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4199, __FUNCTION__)))))
;
4200 REFERENCE_CLASS_P (inner)(tree_code_type[(int) (((enum tree_code) (inner)->base.code
))] == tcc_reference)
;
4201 inner = TREE_OPERAND (inner, 0)(*((const_cast<tree*> (tree_operand_check ((inner), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4201, __FUNCTION__)))))
)
4202 ;
4203
4204 if (TREE_CODE (inner)((enum tree_code) (inner)->base.code) == PLACEHOLDER_EXPR)
4205 push_without_duplicates (exp, refs);
4206 else
4207 FIND_PLACEHOLDER_IN_EXPR (TREE_OPERAND (exp, 0), refs)do { if(((*((const_cast<tree*> (tree_operand_check ((exp
), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4207, __FUNCTION__)))))) && !((non_type_check (((*(
(const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4207, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4207, __FUNCTION__))->base.constant_flag)) find_placeholder_in_expr
((*((const_cast<tree*> (tree_operand_check ((exp), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4207, __FUNCTION__))))), refs); } while (0)
;
4208 }
4209 else
4210 switch (TREE_CODE_CLASS (code)tree_code_type[(int) (code)])
4211 {
4212 case tcc_constant:
4213 break;
4214
4215 case tcc_declaration:
4216 /* Variables allocated to static storage can stay. */
4217 if (!TREE_STATIC (exp)((exp)->base.static_flag))
4218 push_without_duplicates (exp, refs);
4219 break;
4220
4221 case tcc_expression:
4222 /* This is the pattern built in ada/make_aligning_type. */
4223 if (code == ADDR_EXPR
4224 && TREE_CODE (TREE_OPERAND (exp, 0))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4224, __FUNCTION__))))))->base.code)
== PLACEHOLDER_EXPR)
4225 {
4226 push_without_duplicates (exp, refs);
4227 break;
4228 }
4229
4230 /* Fall through. */
4231
4232 case tcc_exceptional:
4233 case tcc_unary:
4234 case tcc_binary:
4235 case tcc_comparison:
4236 case tcc_reference:
4237 for (i = 0; i < TREE_CODE_LENGTH (code)tree_code_length[(int) (code)]; i++)
4238 FIND_PLACEHOLDER_IN_EXPR (TREE_OPERAND (exp, i), refs)do { if(((*((const_cast<tree*> (tree_operand_check ((exp
), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4238, __FUNCTION__)))))) && !((non_type_check (((*(
(const_cast<tree*> (tree_operand_check ((exp), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4238, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4238, __FUNCTION__))->base.constant_flag)) find_placeholder_in_expr
((*((const_cast<tree*> (tree_operand_check ((exp), (i)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4238, __FUNCTION__))))), refs); } while (0)
;
4239 break;
4240
4241 case tcc_vl_exp:
4242 for (i = 1; i < TREE_OPERAND_LENGTH (exp)tree_operand_length (exp); i++)
4243 FIND_PLACEHOLDER_IN_EXPR (TREE_OPERAND (exp, i), refs)do { if(((*((const_cast<tree*> (tree_operand_check ((exp
), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4243, __FUNCTION__)))))) && !((non_type_check (((*(
(const_cast<tree*> (tree_operand_check ((exp), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4243, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4243, __FUNCTION__))->base.constant_flag)) find_placeholder_in_expr
((*((const_cast<tree*> (tree_operand_check ((exp), (i)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4243, __FUNCTION__))))), refs); } while (0)
;
4244 break;
4245
4246 default:
4247 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4247, __FUNCTION__))
;
4248 }
4249}
4250
4251/* Given a tree EXP, a FIELD_DECL F, and a replacement value R,
4252 return a tree with all occurrences of references to F in a
4253 PLACEHOLDER_EXPR replaced by R. Also handle VAR_DECLs and
4254 CONST_DECLs. Note that we assume here that EXP contains only
4255 arithmetic expressions or CALL_EXPRs with PLACEHOLDER_EXPRs
4256 occurring only in their argument list. */
4257
4258tree
4259substitute_in_expr (tree exp, tree f, tree r)
4260{
4261 enum tree_code code = TREE_CODE (exp)((enum tree_code) (exp)->base.code);
4262 tree op0, op1, op2, op3;
4263 tree new_tree;
4264
4265 /* We handle TREE_LIST and COMPONENT_REF separately. */
4266 if (code == TREE_LIST)
4267 {
4268 op0 = SUBSTITUTE_IN_EXPR (TREE_CHAIN (exp), f, r)((((contains_struct_check ((exp), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4268, __FUNCTION__))->common.chain)) == 0 || ((non_type_check
((((contains_struct_check ((exp), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4268, __FUNCTION__))->common.chain)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4268, __FUNCTION__))->base.constant_flag) ? (((contains_struct_check
((exp), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4268, __FUNCTION__))->common.chain)) : substitute_in_expr
(((contains_struct_check ((exp), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4268, __FUNCTION__))->common.chain), f, r))
;
4269 op1 = SUBSTITUTE_IN_EXPR (TREE_VALUE (exp), f, r)((((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4269, __FUNCTION__, (TREE_LIST)))->list.value)) == 0 || (
(non_type_check ((((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4269, __FUNCTION__, (TREE_LIST)))->list.value)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4269, __FUNCTION__))->base.constant_flag) ? (((tree_check
((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4269, __FUNCTION__, (TREE_LIST)))->list.value)) : substitute_in_expr
(((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4269, __FUNCTION__, (TREE_LIST)))->list.value), f, r))
;
4270 if (op0 == TREE_CHAIN (exp)((contains_struct_check ((exp), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4270, __FUNCTION__))->common.chain)
&& op1 == TREE_VALUE (exp)((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4270, __FUNCTION__, (TREE_LIST)))->list.value)
)
4271 return exp;
4272
4273 return tree_cons (TREE_PURPOSE (exp)((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4273, __FUNCTION__, (TREE_LIST)))->list.purpose)
, op1, op0);
4274 }
4275 else if (code == COMPONENT_REF)
4276 {
4277 tree inner;
4278
4279 /* If this expression is getting a value from a PLACEHOLDER_EXPR
4280 and it is the right field, replace it with R. */
4281 for (inner = TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4281, __FUNCTION__)))))
;
4282 REFERENCE_CLASS_P (inner)(tree_code_type[(int) (((enum tree_code) (inner)->base.code
))] == tcc_reference)
;
4283 inner = TREE_OPERAND (inner, 0)(*((const_cast<tree*> (tree_operand_check ((inner), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4283, __FUNCTION__)))))
)
4284 ;
4285
4286 /* The field. */
4287 op1 = TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4287, __FUNCTION__)))))
;
4288
4289 if (TREE_CODE (inner)((enum tree_code) (inner)->base.code) == PLACEHOLDER_EXPR && op1 == f)
4290 return r;
4291
4292 /* If this expression hasn't been completed let, leave it alone. */
4293 if (TREE_CODE (inner)((enum tree_code) (inner)->base.code) == PLACEHOLDER_EXPR && !TREE_TYPE (inner)((contains_struct_check ((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4293, __FUNCTION__))->typed.type)
)
4294 return exp;
4295
4296 op0 = SUBSTITUTE_IN_EXPR (TREE_OPERAND (exp, 0), f, r)(((*((const_cast<tree*> (tree_operand_check ((exp), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4296, __FUNCTION__)))))) == 0 || ((non_type_check (((*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4296, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4296, __FUNCTION__))->base.constant_flag) ? ((*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4296, __FUNCTION__)))))) : substitute_in_expr ((*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4296, __FUNCTION__))))), f, r))
;
4297 if (op0 == TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4297, __FUNCTION__)))))
)
4298 return exp;
4299
4300 new_tree
4301 = fold_build3 (COMPONENT_REF, TREE_TYPE (exp), op0, op1, NULL_TREE)fold_build3_loc (((location_t) 0), COMPONENT_REF, ((contains_struct_check
((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4301, __FUNCTION__))->typed.type), op0, op1, (tree) nullptr
)
;
4302 }
4303 else
4304 switch (TREE_CODE_CLASS (code)tree_code_type[(int) (code)])
4305 {
4306 case tcc_constant:
4307 return exp;
4308
4309 case tcc_declaration:
4310 if (exp == f)
4311 return r;
4312 else
4313 return exp;
4314
4315 case tcc_expression:
4316 if (exp == f)
4317 return r;
4318
4319 /* Fall through. */
4320
4321 case tcc_exceptional:
4322 case tcc_unary:
4323 case tcc_binary:
4324 case tcc_comparison:
4325 case tcc_reference:
4326 switch (TREE_CODE_LENGTH (code)tree_code_length[(int) (code)])
4327 {
4328 case 0:
4329 return exp;
4330
4331 case 1:
4332 op0 = SUBSTITUTE_IN_EXPR (TREE_OPERAND (exp, 0), f, r)(((*((const_cast<tree*> (tree_operand_check ((exp), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4332, __FUNCTION__)))))) == 0 || ((non_type_check (((*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4332, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4332, __FUNCTION__))->base.constant_flag) ? ((*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4332, __FUNCTION__)))))) : substitute_in_expr ((*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4332, __FUNCTION__))))), f, r))
;
4333 if (op0 == TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4333, __FUNCTION__)))))
)
4334 return exp;
4335
4336 new_tree = fold_build1 (code, TREE_TYPE (exp), op0)fold_build1_loc (((location_t) 0), code, ((contains_struct_check
((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4336, __FUNCTION__))->typed.type), op0 )
;
4337 break;
4338
4339 case 2:
4340 op0 = SUBSTITUTE_IN_EXPR (TREE_OPERAND (exp, 0), f, r)(((*((const_cast<tree*> (tree_operand_check ((exp), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4340, __FUNCTION__)))))) == 0 || ((non_type_check (((*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4340, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4340, __FUNCTION__))->base.constant_flag) ? ((*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4340, __FUNCTION__)))))) : substitute_in_expr ((*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4340, __FUNCTION__))))), f, r))
;
4341 op1 = SUBSTITUTE_IN_EXPR (TREE_OPERAND (exp, 1), f, r)(((*((const_cast<tree*> (tree_operand_check ((exp), (1)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4341, __FUNCTION__)))))) == 0 || ((non_type_check (((*((const_cast
<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4341, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4341, __FUNCTION__))->base.constant_flag) ? ((*((const_cast
<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4341, __FUNCTION__)))))) : substitute_in_expr ((*((const_cast
<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4341, __FUNCTION__))))), f, r))
;
4342
4343 if (op0 == TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4343, __FUNCTION__)))))
&& op1 == TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4343, __FUNCTION__)))))
)
4344 return exp;
4345
4346 new_tree = fold_build2 (code, TREE_TYPE (exp), op0, op1)fold_build2_loc (((location_t) 0), code, ((contains_struct_check
((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4346, __FUNCTION__))->typed.type), op0, op1 )
;
4347 break;
4348
4349 case 3:
4350 op0 = SUBSTITUTE_IN_EXPR (TREE_OPERAND (exp, 0), f, r)(((*((const_cast<tree*> (tree_operand_check ((exp), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4350, __FUNCTION__)))))) == 0 || ((non_type_check (((*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4350, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4350, __FUNCTION__))->base.constant_flag) ? ((*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4350, __FUNCTION__)))))) : substitute_in_expr ((*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4350, __FUNCTION__))))), f, r))
;
4351 op1 = SUBSTITUTE_IN_EXPR (TREE_OPERAND (exp, 1), f, r)(((*((const_cast<tree*> (tree_operand_check ((exp), (1)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4351, __FUNCTION__)))))) == 0 || ((non_type_check (((*((const_cast
<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4351, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4351, __FUNCTION__))->base.constant_flag) ? ((*((const_cast
<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4351, __FUNCTION__)))))) : substitute_in_expr ((*((const_cast
<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4351, __FUNCTION__))))), f, r))
;
4352 op2 = SUBSTITUTE_IN_EXPR (TREE_OPERAND (exp, 2), f, r)(((*((const_cast<tree*> (tree_operand_check ((exp), (2)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4352, __FUNCTION__)))))) == 0 || ((non_type_check (((*((const_cast
<tree*> (tree_operand_check ((exp), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4352, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4352, __FUNCTION__))->base.constant_flag) ? ((*((const_cast
<tree*> (tree_operand_check ((exp), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4352, __FUNCTION__)))))) : substitute_in_expr ((*((const_cast
<tree*> (tree_operand_check ((exp), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4352, __FUNCTION__))))), f, r))
;
4353
4354 if (op0 == TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4354, __FUNCTION__)))))
&& op1 == TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4354, __FUNCTION__)))))
4355 && op2 == TREE_OPERAND (exp, 2)(*((const_cast<tree*> (tree_operand_check ((exp), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4355, __FUNCTION__)))))
)
4356 return exp;
4357
4358 new_tree = fold_build3 (code, TREE_TYPE (exp), op0, op1, op2)fold_build3_loc (((location_t) 0), code, ((contains_struct_check
((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4358, __FUNCTION__))->typed.type), op0, op1, op2 )
;
4359 break;
4360
4361 case 4:
4362 op0 = SUBSTITUTE_IN_EXPR (TREE_OPERAND (exp, 0), f, r)(((*((const_cast<tree*> (tree_operand_check ((exp), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4362, __FUNCTION__)))))) == 0 || ((non_type_check (((*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4362, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4362, __FUNCTION__))->base.constant_flag) ? ((*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4362, __FUNCTION__)))))) : substitute_in_expr ((*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4362, __FUNCTION__))))), f, r))
;
4363 op1 = SUBSTITUTE_IN_EXPR (TREE_OPERAND (exp, 1), f, r)(((*((const_cast<tree*> (tree_operand_check ((exp), (1)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4363, __FUNCTION__)))))) == 0 || ((non_type_check (((*((const_cast
<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4363, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4363, __FUNCTION__))->base.constant_flag) ? ((*((const_cast
<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4363, __FUNCTION__)))))) : substitute_in_expr ((*((const_cast
<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4363, __FUNCTION__))))), f, r))
;
4364 op2 = SUBSTITUTE_IN_EXPR (TREE_OPERAND (exp, 2), f, r)(((*((const_cast<tree*> (tree_operand_check ((exp), (2)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4364, __FUNCTION__)))))) == 0 || ((non_type_check (((*((const_cast
<tree*> (tree_operand_check ((exp), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4364, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4364, __FUNCTION__))->base.constant_flag) ? ((*((const_cast
<tree*> (tree_operand_check ((exp), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4364, __FUNCTION__)))))) : substitute_in_expr ((*((const_cast
<tree*> (tree_operand_check ((exp), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4364, __FUNCTION__))))), f, r))
;
4365 op3 = SUBSTITUTE_IN_EXPR (TREE_OPERAND (exp, 3), f, r)(((*((const_cast<tree*> (tree_operand_check ((exp), (3)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4365, __FUNCTION__)))))) == 0 || ((non_type_check (((*((const_cast
<tree*> (tree_operand_check ((exp), (3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4365, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4365, __FUNCTION__))->base.constant_flag) ? ((*((const_cast
<tree*> (tree_operand_check ((exp), (3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4365, __FUNCTION__)))))) : substitute_in_expr ((*((const_cast
<tree*> (tree_operand_check ((exp), (3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4365, __FUNCTION__))))), f, r))
;
4366
4367 if (op0 == TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4367, __FUNCTION__)))))
&& op1 == TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4367, __FUNCTION__)))))
4368 && op2 == TREE_OPERAND (exp, 2)(*((const_cast<tree*> (tree_operand_check ((exp), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4368, __FUNCTION__)))))
4369 && op3 == TREE_OPERAND (exp, 3)(*((const_cast<tree*> (tree_operand_check ((exp), (3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4369, __FUNCTION__)))))
)
4370 return exp;
4371
4372 new_tree
4373 = fold (build4 (code, TREE_TYPE (exp)((contains_struct_check ((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4373, __FUNCTION__))->typed.type)
, op0, op1, op2, op3));
4374 break;
4375
4376 default:
4377 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4377, __FUNCTION__))
;
4378 }
4379 break;
4380
4381 case tcc_vl_exp:
4382 {
4383 int i;
4384
4385 new_tree = NULL_TREE(tree) nullptr;
4386
4387 /* If we are trying to replace F with a constant or with another
4388 instance of one of the arguments of the call, inline back
4389 functions which do nothing else than computing a value from
4390 the arguments they are passed. This makes it possible to
4391 fold partially or entirely the replacement expression. */
4392 if (code == CALL_EXPR)
4393 {
4394 bool maybe_inline = false;
4395 if (CONSTANT_CLASS_P (r)(tree_code_type[(int) (((enum tree_code) (r)->base.code))]
== tcc_constant)
)
4396 maybe_inline = true;
4397 else
4398 for (i = 3; i < TREE_OPERAND_LENGTH (exp)tree_operand_length (exp); i++)
4399 if (operand_equal_p (TREE_OPERAND (exp, i)(*((const_cast<tree*> (tree_operand_check ((exp), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4399, __FUNCTION__)))))
, r, 0))
4400 {
4401 maybe_inline = true;
4402 break;
4403 }
4404 if (maybe_inline)
4405 {
4406 tree t = maybe_inline_call_in_expr (exp);
4407 if (t)
4408 return SUBSTITUTE_IN_EXPR (t, f, r)((t) == 0 || ((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4408, __FUNCTION__))->base.constant_flag) ? (t) : substitute_in_expr
(t, f, r))
;
4409 }
4410 }
4411
4412 for (i = 1; i < TREE_OPERAND_LENGTH (exp)tree_operand_length (exp); i++)
4413 {
4414 tree op = TREE_OPERAND (exp, i)(*((const_cast<tree*> (tree_operand_check ((exp), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4414, __FUNCTION__)))))
;
4415 tree new_op = SUBSTITUTE_IN_EXPR (op, f, r)((op) == 0 || ((non_type_check ((op), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4415, __FUNCTION__))->base.constant_flag) ? (op) : substitute_in_expr
(op, f, r))
;
4416 if (new_op != op)
4417 {
4418 if (!new_tree)
4419 new_tree = copy_node (exp);
4420 TREE_OPERAND (new_tree, i)(*((const_cast<tree*> (tree_operand_check ((new_tree), (
i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4420, __FUNCTION__)))))
= new_op;
4421 }
4422 }
4423
4424 if (new_tree)
4425 {
4426 new_tree = fold (new_tree);
4427 if (TREE_CODE (new_tree)((enum tree_code) (new_tree)->base.code) == CALL_EXPR)
4428 process_call_operands (new_tree);
4429 }
4430 else
4431 return exp;
4432 }
4433 break;
4434
4435 default:
4436 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4436, __FUNCTION__))
;
4437 }
4438
4439 TREE_READONLY (new_tree)((non_type_check ((new_tree), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4439, __FUNCTION__))->base.readonly_flag)
|= TREE_READONLY (exp)((non_type_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4439, __FUNCTION__))->base.readonly_flag)
;
4440
4441 if (code == INDIRECT_REF || code == ARRAY_REF || code == ARRAY_RANGE_REF)
4442 TREE_THIS_NOTRAP (new_tree)((tree_check5 ((new_tree), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4442, __FUNCTION__, (INDIRECT_REF), (MEM_REF), (TARGET_MEM_REF
), (ARRAY_REF), (ARRAY_RANGE_REF)))->base.nothrow_flag)
|= TREE_THIS_NOTRAP (exp)((tree_check5 ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4442, __FUNCTION__, (INDIRECT_REF), (MEM_REF), (TARGET_MEM_REF
), (ARRAY_REF), (ARRAY_RANGE_REF)))->base.nothrow_flag)
;
4443
4444 return new_tree;
4445}
4446
4447/* Similar, but look for a PLACEHOLDER_EXPR in EXP and find a replacement
4448 for it within OBJ, a tree that is an object or a chain of references. */
4449
4450tree
4451substitute_placeholder_in_expr (tree exp, tree obj)
4452{
4453 enum tree_code code = TREE_CODE (exp)((enum tree_code) (exp)->base.code);
4454 tree op0, op1, op2, op3;
4455 tree new_tree;
4456
4457 /* If this is a PLACEHOLDER_EXPR, see if we find a corresponding type
4458 in the chain of OBJ. */
4459 if (code == PLACEHOLDER_EXPR)
4460 {
4461 tree need_type = TYPE_MAIN_VARIANT (TREE_TYPE (exp))((tree_class_check ((((contains_struct_check ((exp), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4461, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4461, __FUNCTION__))->type_common.main_variant)
;
4462 tree elt;
4463
4464 for (elt = obj; elt != 0;
4465 elt = ((TREE_CODE (elt)((enum tree_code) (elt)->base.code) == COMPOUND_EXPR
4466 || TREE_CODE (elt)((enum tree_code) (elt)->base.code) == COND_EXPR)
4467 ? TREE_OPERAND (elt, 1)(*((const_cast<tree*> (tree_operand_check ((elt), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4467, __FUNCTION__)))))
4468 : (REFERENCE_CLASS_P (elt)(tree_code_type[(int) (((enum tree_code) (elt)->base.code)
)] == tcc_reference)
4469 || UNARY_CLASS_P (elt)(tree_code_type[(int) (((enum tree_code) (elt)->base.code)
)] == tcc_unary)
4470 || BINARY_CLASS_P (elt)(tree_code_type[(int) (((enum tree_code) (elt)->base.code)
)] == tcc_binary)
4471 || VL_EXP_CLASS_P (elt)(tree_code_type[(int) (((enum tree_code) (elt)->base.code)
)] == tcc_vl_exp)
4472 || EXPRESSION_CLASS_P (elt)(tree_code_type[(int) (((enum tree_code) (elt)->base.code)
)] == tcc_expression)
)
4473 ? TREE_OPERAND (elt, 0)(*((const_cast<tree*> (tree_operand_check ((elt), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4473, __FUNCTION__)))))
: 0))
4474 if (TYPE_MAIN_VARIANT (TREE_TYPE (elt))((tree_class_check ((((contains_struct_check ((elt), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4474, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4474, __FUNCTION__))->type_common.main_variant)
== need_type)
4475 return elt;
4476
4477 for (elt = obj; elt != 0;
4478 elt = ((TREE_CODE (elt)((enum tree_code) (elt)->base.code) == COMPOUND_EXPR
4479 || TREE_CODE (elt)((enum tree_code) (elt)->base.code) == COND_EXPR)
4480 ? TREE_OPERAND (elt, 1)(*((const_cast<tree*> (tree_operand_check ((elt), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4480, __FUNCTION__)))))
4481 : (REFERENCE_CLASS_P (elt)(tree_code_type[(int) (((enum tree_code) (elt)->base.code)
)] == tcc_reference)
4482 || UNARY_CLASS_P (elt)(tree_code_type[(int) (((enum tree_code) (elt)->base.code)
)] == tcc_unary)
4483 || BINARY_CLASS_P (elt)(tree_code_type[(int) (((enum tree_code) (elt)->base.code)
)] == tcc_binary)
4484 || VL_EXP_CLASS_P (elt)(tree_code_type[(int) (((enum tree_code) (elt)->base.code)
)] == tcc_vl_exp)
4485 || EXPRESSION_CLASS_P (elt)(tree_code_type[(int) (((enum tree_code) (elt)->base.code)
)] == tcc_expression)
)
4486 ? TREE_OPERAND (elt, 0)(*((const_cast<tree*> (tree_operand_check ((elt), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4486, __FUNCTION__)))))
: 0))
4487 if (POINTER_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/tree.c"
, 4487, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((elt), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4487, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)
4488 && (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (elt)))((tree_class_check ((((contains_struct_check ((((contains_struct_check
((elt), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4488, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4488, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4488, __FUNCTION__))->type_common.main_variant)
4489 == need_type))
4490 return fold_build1 (INDIRECT_REF, need_type, elt)fold_build1_loc (((location_t) 0), INDIRECT_REF, need_type, elt
)
;
4491
4492 /* If we didn't find it, return the original PLACEHOLDER_EXPR. If it
4493 survives until RTL generation, there will be an error. */
4494 return exp;
4495 }
4496
4497 /* TREE_LIST is special because we need to look at TREE_VALUE
4498 and TREE_CHAIN, not TREE_OPERANDS. */
4499 else if (code == TREE_LIST)
4500 {
4501 op0 = SUBSTITUTE_PLACEHOLDER_IN_EXPR (TREE_CHAIN (exp), obj)((((contains_struct_check ((exp), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4501, __FUNCTION__))->common.chain)) == 0 || ((non_type_check
((((contains_struct_check ((exp), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4501, __FUNCTION__))->common.chain)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4501, __FUNCTION__))->base.constant_flag) ? (((contains_struct_check
((exp), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4501, __FUNCTION__))->common.chain)) : substitute_placeholder_in_expr
(((contains_struct_check ((exp), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4501, __FUNCTION__))->common.chain), obj))
;
4502 op1 = SUBSTITUTE_PLACEHOLDER_IN_EXPR (TREE_VALUE (exp), obj)((((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4502, __FUNCTION__, (TREE_LIST)))->list.value)) == 0 || (
(non_type_check ((((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4502, __FUNCTION__, (TREE_LIST)))->list.value)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4502, __FUNCTION__))->base.constant_flag) ? (((tree_check
((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4502, __FUNCTION__, (TREE_LIST)))->list.value)) : substitute_placeholder_in_expr
(((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4502, __FUNCTION__, (TREE_LIST)))->list.value), obj))
;
4503 if (op0 == TREE_CHAIN (exp)((contains_struct_check ((exp), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4503, __FUNCTION__))->common.chain)
&& op1 == TREE_VALUE (exp)((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4503, __FUNCTION__, (TREE_LIST)))->list.value)
)
4504 return exp;
4505
4506 return tree_cons (TREE_PURPOSE (exp)((tree_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4506, __FUNCTION__, (TREE_LIST)))->list.purpose)
, op1, op0);
4507 }
4508 else
4509 switch (TREE_CODE_CLASS (code)tree_code_type[(int) (code)])
4510 {
4511 case tcc_constant:
4512 case tcc_declaration:
4513 return exp;
4514
4515 case tcc_exceptional:
4516 case tcc_unary:
4517 case tcc_binary:
4518 case tcc_comparison:
4519 case tcc_expression:
4520 case tcc_reference:
4521 case tcc_statement:
4522 switch (TREE_CODE_LENGTH (code)tree_code_length[(int) (code)])
4523 {
4524 case 0:
4525 return exp;
4526
4527 case 1:
4528 op0 = SUBSTITUTE_PLACEHOLDER_IN_EXPR (TREE_OPERAND (exp, 0), obj)(((*((const_cast<tree*> (tree_operand_check ((exp), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4528, __FUNCTION__)))))) == 0 || ((non_type_check (((*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4528, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4528, __FUNCTION__))->base.constant_flag) ? ((*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4528, __FUNCTION__)))))) : substitute_placeholder_in_expr (
(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4528, __FUNCTION__))))), obj))
;
4529 if (op0 == TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4529, __FUNCTION__)))))
)
4530 return exp;
4531
4532 new_tree = fold_build1 (code, TREE_TYPE (exp), op0)fold_build1_loc (((location_t) 0), code, ((contains_struct_check
((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4532, __FUNCTION__))->typed.type), op0 )
;
4533 break;
4534
4535 case 2:
4536 op0 = SUBSTITUTE_PLACEHOLDER_IN_EXPR (TREE_OPERAND (exp, 0), obj)(((*((const_cast<tree*> (tree_operand_check ((exp), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4536, __FUNCTION__)))))) == 0 || ((non_type_check (((*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4536, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4536, __FUNCTION__))->base.constant_flag) ? ((*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4536, __FUNCTION__)))))) : substitute_placeholder_in_expr (
(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4536, __FUNCTION__))))), obj))
;
4537 op1 = SUBSTITUTE_PLACEHOLDER_IN_EXPR (TREE_OPERAND (exp, 1), obj)(((*((const_cast<tree*> (tree_operand_check ((exp), (1)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4537, __FUNCTION__)))))) == 0 || ((non_type_check (((*((const_cast
<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4537, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4537, __FUNCTION__))->base.constant_flag) ? ((*((const_cast
<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4537, __FUNCTION__)))))) : substitute_placeholder_in_expr (
(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4537, __FUNCTION__))))), obj))
;
4538
4539 if (op0 == TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4539, __FUNCTION__)))))
&& op1 == TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4539, __FUNCTION__)))))
)
4540 return exp;
4541
4542 new_tree = fold_build2 (code, TREE_TYPE (exp), op0, op1)fold_build2_loc (((location_t) 0), code, ((contains_struct_check
((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4542, __FUNCTION__))->typed.type), op0, op1 )
;
4543 break;
4544
4545 case 3:
4546 op0 = SUBSTITUTE_PLACEHOLDER_IN_EXPR (TREE_OPERAND (exp, 0), obj)(((*((const_cast<tree*> (tree_operand_check ((exp), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4546, __FUNCTION__)))))) == 0 || ((non_type_check (((*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4546, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4546, __FUNCTION__))->base.constant_flag) ? ((*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4546, __FUNCTION__)))))) : substitute_placeholder_in_expr (
(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4546, __FUNCTION__))))), obj))
;
4547 op1 = SUBSTITUTE_PLACEHOLDER_IN_EXPR (TREE_OPERAND (exp, 1), obj)(((*((const_cast<tree*> (tree_operand_check ((exp), (1)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4547, __FUNCTION__)))))) == 0 || ((non_type_check (((*((const_cast
<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4547, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4547, __FUNCTION__))->base.constant_flag) ? ((*((const_cast
<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4547, __FUNCTION__)))))) : substitute_placeholder_in_expr (
(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4547, __FUNCTION__))))), obj))
;
4548 op2 = SUBSTITUTE_PLACEHOLDER_IN_EXPR (TREE_OPERAND (exp, 2), obj)(((*((const_cast<tree*> (tree_operand_check ((exp), (2)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4548, __FUNCTION__)))))) == 0 || ((non_type_check (((*((const_cast
<tree*> (tree_operand_check ((exp), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4548, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4548, __FUNCTION__))->base.constant_flag) ? ((*((const_cast
<tree*> (tree_operand_check ((exp), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4548, __FUNCTION__)))))) : substitute_placeholder_in_expr (
(*((const_cast<tree*> (tree_operand_check ((exp), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4548, __FUNCTION__))))), obj))
;
4549
4550 if (op0 == TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4550, __FUNCTION__)))))
&& op1 == TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4550, __FUNCTION__)))))
4551 && op2 == TREE_OPERAND (exp, 2)(*((const_cast<tree*> (tree_operand_check ((exp), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4551, __FUNCTION__)))))
)
4552 return exp;
4553
4554 new_tree = fold_build3 (code, TREE_TYPE (exp), op0, op1, op2)fold_build3_loc (((location_t) 0), code, ((contains_struct_check
((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4554, __FUNCTION__))->typed.type), op0, op1, op2 )
;
4555 break;
4556
4557 case 4:
4558 op0 = SUBSTITUTE_PLACEHOLDER_IN_EXPR (TREE_OPERAND (exp, 0), obj)(((*((const_cast<tree*> (tree_operand_check ((exp), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4558, __FUNCTION__)))))) == 0 || ((non_type_check (((*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4558, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4558, __FUNCTION__))->base.constant_flag) ? ((*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4558, __FUNCTION__)))))) : substitute_placeholder_in_expr (
(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4558, __FUNCTION__))))), obj))
;
4559 op1 = SUBSTITUTE_PLACEHOLDER_IN_EXPR (TREE_OPERAND (exp, 1), obj)(((*((const_cast<tree*> (tree_operand_check ((exp), (1)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4559, __FUNCTION__)))))) == 0 || ((non_type_check (((*((const_cast
<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4559, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4559, __FUNCTION__))->base.constant_flag) ? ((*((const_cast
<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4559, __FUNCTION__)))))) : substitute_placeholder_in_expr (
(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4559, __FUNCTION__))))), obj))
;
4560 op2 = SUBSTITUTE_PLACEHOLDER_IN_EXPR (TREE_OPERAND (exp, 2), obj)(((*((const_cast<tree*> (tree_operand_check ((exp), (2)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4560, __FUNCTION__)))))) == 0 || ((non_type_check (((*((const_cast
<tree*> (tree_operand_check ((exp), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4560, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4560, __FUNCTION__))->base.constant_flag) ? ((*((const_cast
<tree*> (tree_operand_check ((exp), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4560, __FUNCTION__)))))) : substitute_placeholder_in_expr (
(*((const_cast<tree*> (tree_operand_check ((exp), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4560, __FUNCTION__))))), obj))
;
4561 op3 = SUBSTITUTE_PLACEHOLDER_IN_EXPR (TREE_OPERAND (exp, 3), obj)(((*((const_cast<tree*> (tree_operand_check ((exp), (3)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4561, __FUNCTION__)))))) == 0 || ((non_type_check (((*((const_cast
<tree*> (tree_operand_check ((exp), (3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4561, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4561, __FUNCTION__))->base.constant_flag) ? ((*((const_cast
<tree*> (tree_operand_check ((exp), (3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4561, __FUNCTION__)))))) : substitute_placeholder_in_expr (
(*((const_cast<tree*> (tree_operand_check ((exp), (3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4561, __FUNCTION__))))), obj))
;
4562
4563 if (op0 == TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4563, __FUNCTION__)))))
&& op1 == TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4563, __FUNCTION__)))))
4564 && op2 == TREE_OPERAND (exp, 2)(*((const_cast<tree*> (tree_operand_check ((exp), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4564, __FUNCTION__)))))
4565 && op3 == TREE_OPERAND (exp, 3)(*((const_cast<tree*> (tree_operand_check ((exp), (3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4565, __FUNCTION__)))))
)
4566 return exp;
4567
4568 new_tree
4569 = fold (build4 (code, TREE_TYPE (exp)((contains_struct_check ((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4569, __FUNCTION__))->typed.type)
, op0, op1, op2, op3));
4570 break;
4571
4572 default:
4573 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4573, __FUNCTION__))
;
4574 }
4575 break;
4576
4577 case tcc_vl_exp:
4578 {
4579 int i;
4580
4581 new_tree = NULL_TREE(tree) nullptr;
4582
4583 for (i = 1; i < TREE_OPERAND_LENGTH (exp)tree_operand_length (exp); i++)
4584 {
4585 tree op = TREE_OPERAND (exp, i)(*((const_cast<tree*> (tree_operand_check ((exp), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4585, __FUNCTION__)))))
;
4586 tree new_op = SUBSTITUTE_PLACEHOLDER_IN_EXPR (op, obj)((op) == 0 || ((non_type_check ((op), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4586, __FUNCTION__))->base.constant_flag) ? (op) : substitute_placeholder_in_expr
(op, obj))
;
4587 if (new_op != op)
4588 {
4589 if (!new_tree)
4590 new_tree = copy_node (exp);
4591 TREE_OPERAND (new_tree, i)(*((const_cast<tree*> (tree_operand_check ((new_tree), (
i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4591, __FUNCTION__)))))
= new_op;
4592 }
4593 }
4594
4595 if (new_tree)
4596 {
4597 new_tree = fold (new_tree);
4598 if (TREE_CODE (new_tree)((enum tree_code) (new_tree)->base.code) == CALL_EXPR)
4599 process_call_operands (new_tree);
4600 }
4601 else
4602 return exp;
4603 }
4604 break;
4605
4606 default:
4607 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4607, __FUNCTION__))
;
4608 }
4609
4610 TREE_READONLY (new_tree)((non_type_check ((new_tree), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4610, __FUNCTION__))->base.readonly_flag)
|= TREE_READONLY (exp)((non_type_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4610, __FUNCTION__))->base.readonly_flag)
;
4611
4612 if (code == INDIRECT_REF || code == ARRAY_REF || code == ARRAY_RANGE_REF)
4613 TREE_THIS_NOTRAP (new_tree)((tree_check5 ((new_tree), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4613, __FUNCTION__, (INDIRECT_REF), (MEM_REF), (TARGET_MEM_REF
), (ARRAY_REF), (ARRAY_RANGE_REF)))->base.nothrow_flag)
|= TREE_THIS_NOTRAP (exp)((tree_check5 ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4613, __FUNCTION__, (INDIRECT_REF), (MEM_REF), (TARGET_MEM_REF
), (ARRAY_REF), (ARRAY_RANGE_REF)))->base.nothrow_flag)
;
4614
4615 return new_tree;
4616}
4617
4618
4619/* Subroutine of stabilize_reference; this is called for subtrees of
4620 references. Any expression with side-effects must be put in a SAVE_EXPR
4621 to ensure that it is only evaluated once.
4622
4623 We don't put SAVE_EXPR nodes around everything, because assigning very
4624 simple expressions to temporaries causes us to miss good opportunities
4625 for optimizations. Among other things, the opportunity to fold in the
4626 addition of a constant into an addressing mode often gets lost, e.g.
4627 "y[i+1] += x;". In general, we take the approach that we should not make
4628 an assignment unless we are forced into it - i.e., that any non-side effect
4629 operator should be allowed, and that cse should take care of coalescing
4630 multiple utterances of the same expression should that prove fruitful. */
4631
4632static tree
4633stabilize_reference_1 (tree e)
4634{
4635 tree result;
4636 enum tree_code code = TREE_CODE (e)((enum tree_code) (e)->base.code);
4637
4638 /* We cannot ignore const expressions because it might be a reference
4639 to a const array but whose index contains side-effects. But we can
4640 ignore things that are actual constant or that already have been
4641 handled by this function. */
4642
4643 if (tree_invariant_p (e))
4644 return e;
4645
4646 switch (TREE_CODE_CLASS (code)tree_code_type[(int) (code)])
4647 {
4648 case tcc_exceptional:
4649 /* Always wrap STATEMENT_LIST into SAVE_EXPR, even if it doesn't
4650 have side-effects. */
4651 if (code == STATEMENT_LIST)
4652 return save_expr (e);
4653 /* FALLTHRU */
4654 case tcc_type:
4655 case tcc_declaration:
4656 case tcc_comparison:
4657 case tcc_statement:
4658 case tcc_expression:
4659 case tcc_reference:
4660 case tcc_vl_exp:
4661 /* If the expression has side-effects, then encase it in a SAVE_EXPR
4662 so that it will only be evaluated once. */
4663 /* The reference (r) and comparison (<) classes could be handled as
4664 below, but it is generally faster to only evaluate them once. */
4665 if (TREE_SIDE_EFFECTS (e)((non_type_check ((e), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4665, __FUNCTION__))->base.side_effects_flag)
)
4666 return save_expr (e);
4667 return e;
4668
4669 case tcc_constant:
4670 /* Constants need no processing. In fact, we should never reach
4671 here. */
4672 return e;
4673
4674 case tcc_binary:
4675 /* Division is slow and tends to be compiled with jumps,
4676 especially the division by powers of 2 that is often
4677 found inside of an array reference. So do it just once. */
4678 if (code == TRUNC_DIV_EXPR || code == TRUNC_MOD_EXPR
4679 || code == FLOOR_DIV_EXPR || code == FLOOR_MOD_EXPR
4680 || code == CEIL_DIV_EXPR || code == CEIL_MOD_EXPR
4681 || code == ROUND_DIV_EXPR || code == ROUND_MOD_EXPR)
4682 return save_expr (e);
4683 /* Recursively stabilize each operand. */
4684 result = build_nt (code, stabilize_reference_1 (TREE_OPERAND (e, 0)(*((const_cast<tree*> (tree_operand_check ((e), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4684, __FUNCTION__)))))
),
4685 stabilize_reference_1 (TREE_OPERAND (e, 1)(*((const_cast<tree*> (tree_operand_check ((e), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4685, __FUNCTION__)))))
));
4686 break;
4687
4688 case tcc_unary:
4689 /* Recursively stabilize each operand. */
4690 result = build_nt (code, stabilize_reference_1 (TREE_OPERAND (e, 0)(*((const_cast<tree*> (tree_operand_check ((e), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4690, __FUNCTION__)))))
));
4691 break;
4692
4693 default:
4694 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4694, __FUNCTION__))
;
4695 }
4696
4697 TREE_TYPE (result)((contains_struct_check ((result), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4697, __FUNCTION__))->typed.type)
= TREE_TYPE (e)((contains_struct_check ((e), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4697, __FUNCTION__))->typed.type)
;
4698 TREE_READONLY (result)((non_type_check ((result), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4698, __FUNCTION__))->base.readonly_flag)
= TREE_READONLY (e)((non_type_check ((e), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4698, __FUNCTION__))->base.readonly_flag)
;
4699 TREE_SIDE_EFFECTS (result)((non_type_check ((result), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4699, __FUNCTION__))->base.side_effects_flag)
= TREE_SIDE_EFFECTS (e)((non_type_check ((e), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4699, __FUNCTION__))->base.side_effects_flag)
;
4700 TREE_THIS_VOLATILE (result)((result)->base.volatile_flag) = TREE_THIS_VOLATILE (e)((e)->base.volatile_flag);
4701
4702 return result;
4703}
4704
4705/* Stabilize a reference so that we can use it any number of times
4706 without causing its operands to be evaluated more than once.
4707 Returns the stabilized reference. This works by means of save_expr,
4708 so see the caveats in the comments about save_expr.
4709
4710 Also allows conversion expressions whose operands are references.
4711 Any other kind of expression is returned unchanged. */
4712
4713tree
4714stabilize_reference (tree ref)
4715{
4716 tree result;
4717 enum tree_code code = TREE_CODE (ref)((enum tree_code) (ref)->base.code);
4718
4719 switch (code)
4720 {
4721 case VAR_DECL:
4722 case PARM_DECL:
4723 case RESULT_DECL:
4724 /* No action is needed in this case. */
4725 return ref;
4726
4727 CASE_CONVERTcase NOP_EXPR: case CONVERT_EXPR:
4728 case FLOAT_EXPR:
4729 case FIX_TRUNC_EXPR:
4730 result = build_nt (code, stabilize_reference (TREE_OPERAND (ref, 0)(*((const_cast<tree*> (tree_operand_check ((ref), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4730, __FUNCTION__)))))
));
4731 break;
4732
4733 case INDIRECT_REF:
4734 result = build_nt (INDIRECT_REF,
4735 stabilize_reference_1 (TREE_OPERAND (ref, 0)(*((const_cast<tree*> (tree_operand_check ((ref), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4735, __FUNCTION__)))))
));
4736 break;
4737
4738 case COMPONENT_REF:
4739 result = build_nt (COMPONENT_REF,
4740 stabilize_reference (TREE_OPERAND (ref, 0)(*((const_cast<tree*> (tree_operand_check ((ref), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4740, __FUNCTION__)))))
),
4741 TREE_OPERAND (ref, 1)(*((const_cast<tree*> (tree_operand_check ((ref), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4741, __FUNCTION__)))))
, NULL_TREE(tree) nullptr);
4742 break;
4743
4744 case BIT_FIELD_REF:
4745 result = build_nt (BIT_FIELD_REF,
4746 stabilize_reference (TREE_OPERAND (ref, 0)(*((const_cast<tree*> (tree_operand_check ((ref), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4746, __FUNCTION__)))))
),
4747 TREE_OPERAND (ref, 1)(*((const_cast<tree*> (tree_operand_check ((ref), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4747, __FUNCTION__)))))
, TREE_OPERAND (ref, 2)(*((const_cast<tree*> (tree_operand_check ((ref), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4747, __FUNCTION__)))))
);
4748 REF_REVERSE_STORAGE_ORDER (result)((tree_check2 ((result), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4748, __FUNCTION__, (BIT_FIELD_REF), (MEM_REF)))->base.default_def_flag
)
= REF_REVERSE_STORAGE_ORDER (ref)((tree_check2 ((ref), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4748, __FUNCTION__, (BIT_FIELD_REF), (MEM_REF)))->base.default_def_flag
)
;
4749 break;
4750
4751 case ARRAY_REF:
4752 result = build_nt (ARRAY_REF,
4753 stabilize_reference (TREE_OPERAND (ref, 0)(*((const_cast<tree*> (tree_operand_check ((ref), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4753, __FUNCTION__)))))
),
4754 stabilize_reference_1 (TREE_OPERAND (ref, 1)(*((const_cast<tree*> (tree_operand_check ((ref), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4754, __FUNCTION__)))))
),
4755 TREE_OPERAND (ref, 2)(*((const_cast<tree*> (tree_operand_check ((ref), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4755, __FUNCTION__)))))
, TREE_OPERAND (ref, 3)(*((const_cast<tree*> (tree_operand_check ((ref), (3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4755, __FUNCTION__)))))
);
4756 break;
4757
4758 case ARRAY_RANGE_REF:
4759 result = build_nt (ARRAY_RANGE_REF,
4760 stabilize_reference (TREE_OPERAND (ref, 0)(*((const_cast<tree*> (tree_operand_check ((ref), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4760, __FUNCTION__)))))
),
4761 stabilize_reference_1 (TREE_OPERAND (ref, 1)(*((const_cast<tree*> (tree_operand_check ((ref), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4761, __FUNCTION__)))))
),
4762 TREE_OPERAND (ref, 2)(*((const_cast<tree*> (tree_operand_check ((ref), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4762, __FUNCTION__)))))
, TREE_OPERAND (ref, 3)(*((const_cast<tree*> (tree_operand_check ((ref), (3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4762, __FUNCTION__)))))
);
4763 break;
4764
4765 case COMPOUND_EXPR:
4766 /* We cannot wrap the first expression in a SAVE_EXPR, as then
4767 it wouldn't be ignored. This matters when dealing with
4768 volatiles. */
4769 return stabilize_reference_1 (ref);
4770
4771 /* If arg isn't a kind of lvalue we recognize, make no change.
4772 Caller should recognize the error for an invalid lvalue. */
4773 default:
4774 return ref;
4775
4776 case ERROR_MARK:
4777 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
4778 }
4779
4780 TREE_TYPE (result)((contains_struct_check ((result), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4780, __FUNCTION__))->typed.type)
= TREE_TYPE (ref)((contains_struct_check ((ref), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4780, __FUNCTION__))->typed.type)
;
4781 TREE_READONLY (result)((non_type_check ((result), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4781, __FUNCTION__))->base.readonly_flag)
= TREE_READONLY (ref)((non_type_check ((ref), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4781, __FUNCTION__))->base.readonly_flag)
;
4782 TREE_SIDE_EFFECTS (result)((non_type_check ((result), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4782, __FUNCTION__))->base.side_effects_flag)
= TREE_SIDE_EFFECTS (ref)((non_type_check ((ref), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4782, __FUNCTION__))->base.side_effects_flag)
;
4783 TREE_THIS_VOLATILE (result)((result)->base.volatile_flag) = TREE_THIS_VOLATILE (ref)((ref)->base.volatile_flag);
4784 protected_set_expr_location (result, EXPR_LOCATION (ref)((((ref)) && ((tree_code_type[(int) (((enum tree_code
) ((ref))->base.code))]) >= tcc_reference && (tree_code_type
[(int) (((enum tree_code) ((ref))->base.code))]) <= tcc_expression
)) ? (ref)->exp.locus : ((location_t) 0))
);
4785
4786 return result;
4787}
4788
4789/* Low-level constructors for expressions. */
4790
4791/* A helper function for build1 and constant folders. Set TREE_CONSTANT,
4792 and TREE_SIDE_EFFECTS for an ADDR_EXPR. */
4793
4794void
4795recompute_tree_invariant_for_addr_expr (tree t)
4796{
4797 tree node;
4798 bool tc = true, se = false;
4799
4800 gcc_assert (TREE_CODE (t) == ADDR_EXPR)((void)(!(((enum tree_code) (t)->base.code) == ADDR_EXPR) ?
fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4800, __FUNCTION__), 0 : 0))
;
4801
4802 /* We started out assuming this address is both invariant and constant, but
4803 does not have side effects. Now go down any handled components and see if
4804 any of them involve offsets that are either non-constant or non-invariant.
4805 Also check for side-effects.
4806
4807 ??? Note that this code makes no attempt to deal with the case where
4808 taking the address of something causes a copy due to misalignment. */
4809
4810#define UPDATE_FLAGS(NODE) \
4811do { tree _node = (NODE); \
4812 if (_node && !TREE_CONSTANT (_node)((non_type_check ((_node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4812, __FUNCTION__))->base.constant_flag)
) tc = false; \
4813 if (_node && TREE_SIDE_EFFECTS (_node)((non_type_check ((_node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4813, __FUNCTION__))->base.side_effects_flag)
) se = true; } while (0)
4814
4815 for (node = TREE_OPERAND (t, 0)(*((const_cast<tree*> (tree_operand_check ((t), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4815, __FUNCTION__)))))
; handled_component_p (node);
4816 node = TREE_OPERAND (node, 0)(*((const_cast<tree*> (tree_operand_check ((node), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4816, __FUNCTION__)))))
)
4817 {
4818 /* If the first operand doesn't have an ARRAY_TYPE, this is a bogus
4819 array reference (probably made temporarily by the G++ front end),
4820 so ignore all the operands. */
4821 if ((TREE_CODE (node)((enum tree_code) (node)->base.code) == ARRAY_REF
4822 || TREE_CODE (node)((enum tree_code) (node)->base.code) == ARRAY_RANGE_REF)
4823 && TREE_CODE (TREE_TYPE (TREE_OPERAND (node, 0)))((enum tree_code) (((contains_struct_check (((*((const_cast<
tree*> (tree_operand_check ((node), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4823, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4823, __FUNCTION__))->typed.type))->base.code)
== ARRAY_TYPE)
4824 {
4825 UPDATE_FLAGS (TREE_OPERAND (node, 1)(*((const_cast<tree*> (tree_operand_check ((node), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4825, __FUNCTION__)))))
);
4826 if (TREE_OPERAND (node, 2)(*((const_cast<tree*> (tree_operand_check ((node), (2),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4826, __FUNCTION__)))))
)
4827 UPDATE_FLAGS (TREE_OPERAND (node, 2)(*((const_cast<tree*> (tree_operand_check ((node), (2),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4827, __FUNCTION__)))))
);
4828 if (TREE_OPERAND (node, 3)(*((const_cast<tree*> (tree_operand_check ((node), (3),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4828, __FUNCTION__)))))
)
4829 UPDATE_FLAGS (TREE_OPERAND (node, 3)(*((const_cast<tree*> (tree_operand_check ((node), (3),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4829, __FUNCTION__)))))
);
4830 }
4831 /* Likewise, just because this is a COMPONENT_REF doesn't mean we have a
4832 FIELD_DECL, apparently. The G++ front end can put something else
4833 there, at least temporarily. */
4834 else if (TREE_CODE (node)((enum tree_code) (node)->base.code) == COMPONENT_REF
4835 && TREE_CODE (TREE_OPERAND (node, 1))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((node), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4835, __FUNCTION__))))))->base.code)
== FIELD_DECL)
4836 {
4837 if (TREE_OPERAND (node, 2)(*((const_cast<tree*> (tree_operand_check ((node), (2),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4837, __FUNCTION__)))))
)
4838 UPDATE_FLAGS (TREE_OPERAND (node, 2)(*((const_cast<tree*> (tree_operand_check ((node), (2),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4838, __FUNCTION__)))))
);
4839 }
4840 }
4841
4842 node = lang_hooks.expr_to_decl (node, &tc, &se);
4843
4844 /* Now see what's inside. If it's an INDIRECT_REF, copy our properties from
4845 the address, since &(*a)->b is a form of addition. If it's a constant, the
4846 address is constant too. If it's a decl, its address is constant if the
4847 decl is static. Everything else is not constant and, furthermore,
4848 taking the address of a volatile variable is not volatile. */
4849 if (TREE_CODE (node)((enum tree_code) (node)->base.code) == INDIRECT_REF
4850 || TREE_CODE (node)((enum tree_code) (node)->base.code) == MEM_REF)
4851 UPDATE_FLAGS (TREE_OPERAND (node, 0)(*((const_cast<tree*> (tree_operand_check ((node), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4851, __FUNCTION__)))))
);
4852 else if (CONSTANT_CLASS_P (node)(tree_code_type[(int) (((enum tree_code) (node)->base.code
))] == tcc_constant)
)
4853 ;
4854 else if (DECL_P (node)(tree_code_type[(int) (((enum tree_code) (node)->base.code
))] == tcc_declaration)
)
4855 tc &= (staticp (node) != NULL_TREE(tree) nullptr);
4856 else
4857 {
4858 tc = false;
4859 se |= TREE_SIDE_EFFECTS (node)((non_type_check ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4859, __FUNCTION__))->base.side_effects_flag)
;
4860 }
4861
4862
4863 TREE_CONSTANT (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4863, __FUNCTION__))->base.constant_flag)
= tc;
4864 TREE_SIDE_EFFECTS (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4864, __FUNCTION__))->base.side_effects_flag)
= se;
4865#undef UPDATE_FLAGS
4866}
4867
4868/* Build an expression of code CODE, data type TYPE, and operands as
4869 specified. Expressions and reference nodes can be created this way.
4870 Constants, decls, types and misc nodes cannot be.
4871
4872 We define 5 non-variadic functions, from 0 to 4 arguments. This is
4873 enough for all extant tree codes. */
4874
4875tree
4876build0 (enum tree_code code, tree tt MEM_STAT_DECL)
4877{
4878 tree t;
4879
4880 gcc_assert (TREE_CODE_LENGTH (code) == 0)((void)(!(tree_code_length[(int) (code)] == 0) ? fancy_abort (
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4880, __FUNCTION__), 0 : 0))
;
4881
4882 t = make_node (code PASS_MEM_STAT);
4883 TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4883, __FUNCTION__))->typed.type)
= tt;
4884
4885 return t;
4886}
4887
4888tree
4889build1 (enum tree_code code, tree type, tree node MEM_STAT_DECL)
4890{
4891 int length = sizeof (struct tree_exp);
4892 tree t;
4893
4894 record_node_allocation_statistics (code, length);
4895
4896 gcc_assert (TREE_CODE_LENGTH (code) == 1)((void)(!(tree_code_length[(int) (code)] == 1) ? fancy_abort (
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4896, __FUNCTION__), 0 : 0))
;
4897
4898 t = ggc_alloc_tree_node_stat (length PASS_MEM_STAT);
4899
4900 memset (t, 0, sizeof (struct tree_common));
4901
4902 TREE_SET_CODE (t, code)((t)->base.code = (code));
4903
4904 TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4904, __FUNCTION__))->typed.type)
= type;
4905 SET_EXPR_LOCATION (t, UNKNOWN_LOCATION)(expr_check (((t)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4905, __FUNCTION__))->exp.locus = (((location_t) 0))
;
4906 TREE_OPERAND (t, 0)(*((const_cast<tree*> (tree_operand_check ((t), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4906, __FUNCTION__)))))
= node;
4907 if (node && !TYPE_P (node)(tree_code_type[(int) (((enum tree_code) (node)->base.code
))] == tcc_type)
)
4908 {
4909 TREE_SIDE_EFFECTS (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4909, __FUNCTION__))->base.side_effects_flag)
= TREE_SIDE_EFFECTS (node)((non_type_check ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4909, __FUNCTION__))->base.side_effects_flag)
;
4910 TREE_READONLY (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4910, __FUNCTION__))->base.readonly_flag)
= TREE_READONLY (node)((non_type_check ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4910, __FUNCTION__))->base.readonly_flag)
;
4911 }
4912
4913 if (TREE_CODE_CLASS (code)tree_code_type[(int) (code)] == tcc_statement)
4914 {
4915 if (code != DEBUG_BEGIN_STMT)
4916 TREE_SIDE_EFFECTS (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4916, __FUNCTION__))->base.side_effects_flag)
= 1;
4917 }
4918 else switch (code)
4919 {
4920 case VA_ARG_EXPR:
4921 /* All of these have side-effects, no matter what their
4922 operands are. */
4923 TREE_SIDE_EFFECTS (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4923, __FUNCTION__))->base.side_effects_flag)
= 1;
4924 TREE_READONLY (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4924, __FUNCTION__))->base.readonly_flag)
= 0;
4925 break;
4926
4927 case INDIRECT_REF:
4928 /* Whether a dereference is readonly has nothing to do with whether
4929 its operand is readonly. */
4930 TREE_READONLY (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4930, __FUNCTION__))->base.readonly_flag)
= 0;
4931 break;
4932
4933 case ADDR_EXPR:
4934 if (node)
4935 recompute_tree_invariant_for_addr_expr (t);
4936 break;
4937
4938 default:
4939 if ((TREE_CODE_CLASS (code)tree_code_type[(int) (code)] == tcc_unary || code == VIEW_CONVERT_EXPR)
4940 && node && !TYPE_P (node)(tree_code_type[(int) (((enum tree_code) (node)->base.code
))] == tcc_type)
4941 && TREE_CONSTANT (node)((non_type_check ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4941, __FUNCTION__))->base.constant_flag)
)
4942 TREE_CONSTANT (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4942, __FUNCTION__))->base.constant_flag)
= 1;
4943 if (TREE_CODE_CLASS (code)tree_code_type[(int) (code)] == tcc_reference
4944 && node && TREE_THIS_VOLATILE (node)((node)->base.volatile_flag))
4945 TREE_THIS_VOLATILE (t)((t)->base.volatile_flag) = 1;
4946 break;
4947 }
4948
4949 return t;
4950}
4951
4952#define PROCESS_ARG(N)do { (*((const_cast<tree*> (tree_operand_check ((t), (N
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4952, __FUNCTION__))))) = argN; if (argN &&!(tree_code_type
[(int) (((enum tree_code) (argN)->base.code))] == tcc_type
)) { if (((non_type_check ((argN), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4952, __FUNCTION__))->base.side_effects_flag)) side_effects
= 1; if (!((non_type_check ((argN), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4952, __FUNCTION__))->base.readonly_flag) && !(tree_code_type
[(int) (((enum tree_code) (argN)->base.code))] == tcc_constant
)) (void) (read_only = 0); if (!((non_type_check ((argN), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4952, __FUNCTION__))->base.constant_flag)) (void) (constant
= 0); } } while (0)
\
4953 do { \
4954 TREE_OPERAND (t, N)(*((const_cast<tree*> (tree_operand_check ((t), (N), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4954, __FUNCTION__)))))
= arg##N; \
4955 if (arg##N &&!TYPE_P (arg##N)(tree_code_type[(int) (((enum tree_code) (arg##N)->base.code
))] == tcc_type)
) \
4956 { \
4957 if (TREE_SIDE_EFFECTS (arg##N)((non_type_check ((arg##N), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4957, __FUNCTION__))->base.side_effects_flag)
) \
4958 side_effects = 1; \
4959 if (!TREE_READONLY (arg##N)((non_type_check ((arg##N), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4959, __FUNCTION__))->base.readonly_flag)
\
4960 && !CONSTANT_CLASS_P (arg##N)(tree_code_type[(int) (((enum tree_code) (arg##N)->base.code
))] == tcc_constant)
) \
4961 (void) (read_only = 0); \
4962 if (!TREE_CONSTANT (arg##N)((non_type_check ((arg##N), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4962, __FUNCTION__))->base.constant_flag)
) \
4963 (void) (constant = 0); \
4964 } \
4965 } while (0)
4966
4967tree
4968build2 (enum tree_code code, tree tt, tree arg0, tree arg1 MEM_STAT_DECL)
4969{
4970 bool constant, read_only, side_effects, div_by_zero;
4971 tree t;
4972
4973 gcc_assert (TREE_CODE_LENGTH (code) == 2)((void)(!(tree_code_length[(int) (code)] == 2) ? fancy_abort (
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4973, __FUNCTION__), 0 : 0))
;
4974
4975 if ((code == MINUS_EXPR || code == PLUS_EXPR || code == MULT_EXPR)
4976 && arg0 && arg1 && tt && POINTER_TYPE_P (tt)(((enum tree_code) (tt)->base.code) == POINTER_TYPE || ((enum
tree_code) (tt)->base.code) == REFERENCE_TYPE)
4977 /* When sizetype precision doesn't match that of pointers
4978 we need to be able to build explicit extensions or truncations
4979 of the offset argument. */
4980 && TYPE_PRECISION (sizetype)((tree_class_check ((sizetype_tab[(int) stk_sizetype]), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4980, __FUNCTION__))->type_common.precision)
== TYPE_PRECISION (tt)((tree_class_check ((tt), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4980, __FUNCTION__))->type_common.precision)
)
4981 gcc_assert (TREE_CODE (arg0) == INTEGER_CST((void)(!(((enum tree_code) (arg0)->base.code) == INTEGER_CST
&& ((enum tree_code) (arg1)->base.code) == INTEGER_CST
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4982, __FUNCTION__), 0 : 0))
4982 && TREE_CODE (arg1) == INTEGER_CST)((void)(!(((enum tree_code) (arg0)->base.code) == INTEGER_CST
&& ((enum tree_code) (arg1)->base.code) == INTEGER_CST
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4982, __FUNCTION__), 0 : 0))
;
4983
4984 if (code == POINTER_PLUS_EXPR && arg0 && arg1 && tt)
4985 gcc_assert (POINTER_TYPE_P (tt) && POINTER_TYPE_P (TREE_TYPE (arg0))((void)(!((((enum tree_code) (tt)->base.code) == POINTER_TYPE
|| ((enum tree_code) (tt)->base.code) == REFERENCE_TYPE) &&
(((enum tree_code) (((contains_struct_check ((arg0), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4985, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((arg0), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4985, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
) && ptrofftype_p (((contains_struct_check ((arg1), (
TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4986, __FUNCTION__))->typed.type))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4986, __FUNCTION__), 0 : 0))
4986 && ptrofftype_p (TREE_TYPE (arg1)))((void)(!((((enum tree_code) (tt)->base.code) == POINTER_TYPE
|| ((enum tree_code) (tt)->base.code) == REFERENCE_TYPE) &&
(((enum tree_code) (((contains_struct_check ((arg0), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4985, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((arg0), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4985, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
) && ptrofftype_p (((contains_struct_check ((arg1), (
TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4986, __FUNCTION__))->typed.type))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4986, __FUNCTION__), 0 : 0))
;
4987
4988 t = make_node (code PASS_MEM_STAT);
4989 TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 4989, __FUNCTION__))->typed.type)
= tt;
4990
4991 /* Below, we automatically set TREE_SIDE_EFFECTS and TREE_READONLY for the
4992 result based on those same flags for the arguments. But if the
4993 arguments aren't really even `tree' expressions, we shouldn't be trying
4994 to do this. */
4995
4996 /* Expressions without side effects may be constant if their
4997 arguments are as well. */
4998 constant = (TREE_CODE_CLASS (code)tree_code_type[(int) (code)] == tcc_comparison
4999 || TREE_CODE_CLASS (code)tree_code_type[(int) (code)] == tcc_binary);
5000 read_only = 1;
5001 side_effects = TREE_SIDE_EFFECTS (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 5001, __FUNCTION__))->base.side_effects_flag)
;
5002
5003 switch (code)
5004 {
5005 case TRUNC_DIV_EXPR:
5006 case CEIL_DIV_EXPR:
5007 case FLOOR_DIV_EXPR:
5008 case ROUND_DIV_EXPR:
5009 case EXACT_DIV_EXPR:
5010 case CEIL_MOD_EXPR:
5011 case FLOOR_MOD_EXPR:
5012 case ROUND_MOD_EXPR:
5013 case TRUNC_MOD_EXPR:
5014 div_by_zero = integer_zerop (arg1);
5015 break;
5016 default:
5017 div_by_zero = false;
5018 }
5019
5020 PROCESS_ARG (0)do { (*((const_cast<tree*> (tree_operand_check ((t), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 5020, __FUNCTION__))))) = arg0; if (arg0 &&!(tree_code_type
[(int) (((enum tree_code) (arg0)->base.code))] == tcc_type
)) { if (((non_type_check ((arg0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 5020, __FUNCTION__))->base.side_effects_flag)) side_effects
= 1; if (!((non_type_check ((arg0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 5020, __FUNCTION__))->base.readonly_flag) && !(tree_code_type
[(int) (((enum tree_code) (arg0)->base.code))] == tcc_constant
)) (void) (read_only = 0); if (!((non_type_check ((arg0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 5020, __FUNCTION__))->base.constant_flag)) (void) (constant
= 0); } } while (0)
;
5021 PROCESS_ARG (1)do { (*((const_cast<tree*> (tree_operand_check ((t), (1
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 5021, __FUNCTION__))))) = arg1; if (arg1 &&!(tree_code_type
[(int) (((enum tree_code) (arg1)->base.code))] == tcc_type
)) { if (((non_type_check ((arg1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 5021, __FUNCTION__))->base.side_effects_flag)) side_effects
= 1; if (!((non_type_check ((arg1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 5021, __FUNCTION__))->base.readonly_flag) && !(tree_code_type
[(int) (((enum tree_code) (arg1)->base.code))] == tcc_constant
)) (void) (read_only = 0); if (!((non_type_check ((arg1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 5021, __FUNCTION__))->base.constant_flag)) (void) (constant
= 0); } } while (0)
;
5022
5023 TREE_SIDE_EFFECTS (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 5023, __FUNCTION__))->base.side_effects_flag)
= side_effects;
5024 if (code == MEM_REF)
5025 {
5026 if (arg0 && TREE_CODE (arg0)((enum tree_code) (arg0)->base.code) == ADDR_EXPR)
5027 {
5028 tree o = TREE_OPERAND (arg0, 0)(*((const_cast<tree*> (tree_operand_check ((arg0), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 5028, __FUNCTION__)))))
;
5029 TREE_READONLY (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 5029, __FUNCTION__))->base.readonly_flag)
= TREE_READONLY (o)((non_type_check ((o), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 5029, __FUNCTION__))->base.readonly_flag)
;
5030 TREE_THIS_VOLATILE (t)((t)->base.volatile_flag) = TREE_THIS_VOLATILE (o)((o)->base.volatile_flag);
5031 }
5032 }
5033 else
5034 {
5035 TREE_READONLY (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 5035, __FUNCTION__))->base.readonly_flag)
= read_only;
5036 /* Don't mark X / 0 as constant. */
5037 TREE_CONSTANT (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/tree.c"
, 5037, __FUNCTION__))->base.constant_flag)
= constant && !div_by_zero;
5038 TREE_THIS_VOLATILE (t)((t)->base.volatile_flag)
5039 = (TREE_CODE_CLASS (code)tree_code_type[(int) (code)] == tcc_reference
5040 && arg0 && TREE_THIS_VOLATILE (arg0)((arg0)->base.volatile_flag));