Bug Summary

File:build/gcc/vec.h
Warning:line 814, column 10
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 cp-gimplify.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_FRONTEND -D IN_GCC -D HAVE_CONFIG_H -I . -I cp -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/cp -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-uw6Enm.plist -x c++ /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c

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

1/* C++-specific tree lowering bits; see also c-gimplify.c and gimple.c.
2
3 Copyright (C) 2002-2021 Free Software Foundation, Inc.
4 Contributed by Jason Merrill <jason@redhat.com>
5
6This file is part of GCC.
7
8GCC is free software; you can redistribute it and/or modify it under
9the terms of the GNU General Public License as published by the Free
10Software Foundation; either version 3, or (at your option) any later
11version.
12
13GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14WARRANTY; without even the implied warranty of MERCHANTABILITY or
15FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16for more details.
17
18You should have received a copy of the GNU General Public License
19along with GCC; see the file COPYING3. If not see
20<http://www.gnu.org/licenses/>. */
21
22#include "config.h"
23#include "system.h"
24#include "coretypes.h"
25#include "target.h"
26#include "basic-block.h"
27#include "cp-tree.h"
28#include "gimple.h"
29#include "predict.h"
30#include "stor-layout.h"
31#include "tree-iterator.h"
32#include "gimplify.h"
33#include "c-family/c-ubsan.h"
34#include "stringpool.h"
35#include "attribs.h"
36#include "asan.h"
37#include "gcc-rich-location.h"
38#include "memmodel.h"
39#include "tm_p.h"
40#include "output.h"
41#include "file-prefix-map.h"
42#include "cgraph.h"
43#include "omp-general.h"
44
45/* Forward declarations. */
46
47static tree cp_genericize_r (tree *, int *, void *);
48static tree cp_fold_r (tree *, int *, void *);
49static void cp_genericize_tree (tree*, bool);
50static tree cp_fold (tree);
51
52/* Genericize a TRY_BLOCK. */
53
54static void
55genericize_try_block (tree *stmt_p)
56{
57 tree body = TRY_STMTS (*stmt_p)(*((const_cast<tree*> (tree_operand_check (((tree_check
((*stmt_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 57, __FUNCTION__, (TRY_BLOCK)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 57, __FUNCTION__)))))
;
58 tree cleanup = TRY_HANDLERS (*stmt_p)(*((const_cast<tree*> (tree_operand_check (((tree_check
((*stmt_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 58, __FUNCTION__, (TRY_BLOCK)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 58, __FUNCTION__)))))
;
59
60 *stmt_p = build2 (TRY_CATCH_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE], body, cleanup);
61}
62
63/* Genericize a HANDLER by converting to a CATCH_EXPR. */
64
65static void
66genericize_catch_block (tree *stmt_p)
67{
68 tree type = HANDLER_TYPE (*stmt_p)((contains_struct_check (((tree_check ((*stmt_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 68, __FUNCTION__, (HANDLER)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 68, __FUNCTION__))->typed.type)
;
69 tree body = HANDLER_BODY (*stmt_p)(*((const_cast<tree*> (tree_operand_check (((tree_check
((*stmt_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 69, __FUNCTION__, (HANDLER)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 69, __FUNCTION__)))))
;
70
71 /* FIXME should the caught type go in TREE_TYPE? */
72 *stmt_p = build2 (CATCH_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE], type, body);
73}
74
75/* A terser interface for building a representation of an exception
76 specification. */
77
78static tree
79build_gimple_eh_filter_tree (tree body, tree allowed, tree failure)
80{
81 tree t;
82
83 /* FIXME should the allowed types go in TREE_TYPE? */
84 t = build2 (EH_FILTER_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE], allowed, NULL_TREE(tree) nullptr);
85 append_to_statement_list (failure, &EH_FILTER_FAILURE (t)(*((const_cast<tree*> (tree_operand_check (((tree_check
((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 85, __FUNCTION__, (EH_FILTER_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 85, __FUNCTION__)))))
);
86
87 t = build2 (TRY_CATCH_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE], NULL_TREE(tree) nullptr, t);
88 append_to_statement_list (body, &TREE_OPERAND (t, 0)(*((const_cast<tree*> (tree_operand_check ((t), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 88, __FUNCTION__)))))
);
89
90 return t;
91}
92
93/* Genericize an EH_SPEC_BLOCK by converting it to a
94 TRY_CATCH_EXPR/EH_FILTER_EXPR pair. */
95
96static void
97genericize_eh_spec_block (tree *stmt_p)
98{
99 tree body = EH_SPEC_STMTS (*stmt_p)(*((const_cast<tree*> (tree_operand_check (((tree_check
((*stmt_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 99, __FUNCTION__, (EH_SPEC_BLOCK)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 99, __FUNCTION__)))))
;
100 tree allowed = EH_SPEC_RAISES (*stmt_p)(*((const_cast<tree*> (tree_operand_check (((tree_check
((*stmt_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 100, __FUNCTION__, (EH_SPEC_BLOCK)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 100, __FUNCTION__)))))
;
101 tree failure = build_call_n (call_unexpected_fncp_global_trees[CPTI_CALL_UNEXPECTED_FN], 1, build_exc_ptr ());
102
103 *stmt_p = build_gimple_eh_filter_tree (body, allowed, failure);
104 suppress_warning (*stmt_p);
105 suppress_warning (TREE_OPERAND (*stmt_p, 1)(*((const_cast<tree*> (tree_operand_check ((*stmt_p), (
1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 105, __FUNCTION__)))))
);
106}
107
108/* Return the first non-compound statement in STMT. */
109
110tree
111first_stmt (tree stmt)
112{
113 switch (TREE_CODE (stmt)((enum tree_code) (stmt)->base.code))
114 {
115 case STATEMENT_LIST:
116 if (tree_statement_list_node *p = STATEMENT_LIST_HEAD (stmt)((tree_check ((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 116, __FUNCTION__, (STATEMENT_LIST)))->stmt_list.head)
)
117 return first_stmt (p->stmt);
118 return void_nodeglobal_trees[TI_VOID];
119
120 case BIND_EXPR:
121 return first_stmt (BIND_EXPR_BODY (stmt)((*((const_cast<tree*> (tree_operand_check (((tree_check
((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 121, __FUNCTION__, (BIND_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 121, __FUNCTION__))))))
);
122
123 default:
124 return stmt;
125 }
126}
127
128/* Genericize an IF_STMT by turning it into a COND_EXPR. */
129
130static void
131genericize_if_stmt (tree *stmt_p)
132{
133 tree stmt, cond, then_, else_;
134 location_t locus = EXPR_LOCATION (*stmt_p)((((*stmt_p)) && ((tree_code_type[(int) (((enum tree_code
) ((*stmt_p))->base.code))]) >= tcc_reference &&
(tree_code_type[(int) (((enum tree_code) ((*stmt_p))->base
.code))]) <= tcc_expression)) ? (*stmt_p)->exp.locus : (
(location_t) 0))
;
135
136 stmt = *stmt_p;
137 cond = IF_COND (stmt)(*((const_cast<tree*> (tree_operand_check (((tree_check
((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 137, __FUNCTION__, (IF_STMT)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 137, __FUNCTION__)))))
;
138 then_ = THEN_CLAUSE (stmt)(*((const_cast<tree*> (tree_operand_check (((tree_check
((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 138, __FUNCTION__, (IF_STMT)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 138, __FUNCTION__)))))
;
139 else_ = ELSE_CLAUSE (stmt)(*((const_cast<tree*> (tree_operand_check (((tree_check
((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 139, __FUNCTION__, (IF_STMT)))), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 139, __FUNCTION__)))))
;
140
141 if (then_ && else_)
142 {
143 tree ft = first_stmt (then_);
144 tree fe = first_stmt (else_);
145 br_predictor pr;
146 if (TREE_CODE (ft)((enum tree_code) (ft)->base.code) == PREDICT_EXPR
147 && TREE_CODE (fe)((enum tree_code) (fe)->base.code) == PREDICT_EXPR
148 && (pr = PREDICT_EXPR_PREDICTOR (ft)((enum br_predictor)tree_to_shwi ((*((const_cast<tree*>
(tree_operand_check (((tree_check ((ft), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 148, __FUNCTION__, (PREDICT_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 148, __FUNCTION__)))))))
) == PREDICT_EXPR_PREDICTOR (fe)((enum br_predictor)tree_to_shwi ((*((const_cast<tree*>
(tree_operand_check (((tree_check ((fe), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 148, __FUNCTION__, (PREDICT_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 148, __FUNCTION__)))))))
149 && (pr == PRED_HOT_LABEL || pr == PRED_COLD_LABEL))
150 {
151 gcc_rich_location richloc (EXPR_LOC_OR_LOC (ft, locus)((((IS_ADHOC_LOC (((((ft)) && ((tree_code_type[(int) (
((enum tree_code) ((ft))->base.code))]) >= tcc_reference
&& (tree_code_type[(int) (((enum tree_code) ((ft))->
base.code))]) <= tcc_expression)) ? (ft)->exp.locus : (
(location_t) 0)))) ? get_location_from_adhoc_loc (line_table,
((((ft)) && ((tree_code_type[(int) (((enum tree_code
) ((ft))->base.code))]) >= tcc_reference && (tree_code_type
[(int) (((enum tree_code) ((ft))->base.code))]) <= tcc_expression
)) ? (ft)->exp.locus : ((location_t) 0))) : (((((ft)) &&
((tree_code_type[(int) (((enum tree_code) ((ft))->base.code
))]) >= tcc_reference && (tree_code_type[(int) (((
enum tree_code) ((ft))->base.code))]) <= tcc_expression
)) ? (ft)->exp.locus : ((location_t) 0)))) != ((location_t
) 0)) ? (ft)->exp.locus : (locus))
);
152 richloc.add_range (EXPR_LOC_OR_LOC (fe, locus)((((IS_ADHOC_LOC (((((fe)) && ((tree_code_type[(int) (
((enum tree_code) ((fe))->base.code))]) >= tcc_reference
&& (tree_code_type[(int) (((enum tree_code) ((fe))->
base.code))]) <= tcc_expression)) ? (fe)->exp.locus : (
(location_t) 0)))) ? get_location_from_adhoc_loc (line_table,
((((fe)) && ((tree_code_type[(int) (((enum tree_code
) ((fe))->base.code))]) >= tcc_reference && (tree_code_type
[(int) (((enum tree_code) ((fe))->base.code))]) <= tcc_expression
)) ? (fe)->exp.locus : ((location_t) 0))) : (((((fe)) &&
((tree_code_type[(int) (((enum tree_code) ((fe))->base.code
))]) >= tcc_reference && (tree_code_type[(int) (((
enum tree_code) ((fe))->base.code))]) <= tcc_expression
)) ? (fe)->exp.locus : ((location_t) 0)))) != ((location_t
) 0)) ? (fe)->exp.locus : (locus))
);
153 warning_at (&richloc, OPT_Wattributes,
154 "both branches of %<if%> statement marked as %qs",
155 pr == PRED_HOT_LABEL ? "likely" : "unlikely");
156 }
157 }
158
159 if (!then_)
160 then_ = build_empty_stmt (locus);
161 if (!else_)
162 else_ = build_empty_stmt (locus);
163
164 /* consteval if has been verified not to have the then_/else_ blocks
165 entered by gotos/case labels from elsewhere, and as then_ block
166 can contain unfolded immediate function calls, we have to discard
167 the then_ block regardless of whether else_ has side-effects or not. */
168 if (IF_STMT_CONSTEVAL_P (stmt)((tree_not_check2 (((tree_check ((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 168, __FUNCTION__, (IF_STMT)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 168, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
)
169 stmt = else_;
170 else if (integer_nonzerop (cond) && !TREE_SIDE_EFFECTS (else_)((non_type_check ((else_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 170, __FUNCTION__))->base.side_effects_flag)
)
171 stmt = then_;
172 else if (integer_zerop (cond) && !TREE_SIDE_EFFECTS (then_)((non_type_check ((then_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 172, __FUNCTION__))->base.side_effects_flag)
)
173 stmt = else_;
174 else
175 stmt = build3 (COND_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE], cond, then_, else_);
176 protected_set_expr_location_if_unset (stmt, locus);
177 *stmt_p = stmt;
178}
179
180/* Hook into the middle of gimplifying an OMP_FOR node. */
181
182static enum gimplify_status
183cp_gimplify_omp_for (tree *expr_p, gimple_seq *pre_p)
184{
185 tree for_stmt = *expr_p;
186 gimple_seq seq = NULLnullptr;
187
188 /* Protect ourselves from recursion. */
189 if (OMP_FOR_GIMPLIFYING_P (for_stmt)(((tree_not_check2 (((tree_range_check ((for_stmt), (OMP_FOR)
, (OACC_LOOP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 189, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 189, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0))
)
190 return GS_UNHANDLED;
191 OMP_FOR_GIMPLIFYING_P (for_stmt)(((tree_not_check2 (((tree_range_check ((for_stmt), (OMP_FOR)
, (OACC_LOOP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 191, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 191, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0))
= 1;
192
193 gimplify_and_add (for_stmt, &seq);
194 gimple_seq_add_seq (pre_p, seq);
195
196 OMP_FOR_GIMPLIFYING_P (for_stmt)(((tree_not_check2 (((tree_range_check ((for_stmt), (OMP_FOR)
, (OACC_LOOP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 196, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 196, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0))
= 0;
197
198 return GS_ALL_DONE;
199}
200
201/* Gimplify an EXPR_STMT node. */
202
203static void
204gimplify_expr_stmt (tree *stmt_p)
205{
206 tree stmt = EXPR_STMT_EXPR (*stmt_p)(*((const_cast<tree*> (tree_operand_check (((tree_check
((*stmt_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 206, __FUNCTION__, (EXPR_STMT)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 206, __FUNCTION__)))))
;
207
208 if (stmt == error_mark_nodeglobal_trees[TI_ERROR_MARK])
209 stmt = NULLnullptr;
210
211 /* Gimplification of a statement expression will nullify the
212 statement if all its side effects are moved to *PRE_P and *POST_P.
213
214 In this case we will not want to emit the gimplified statement.
215 However, we may still want to emit a warning, so we do that before
216 gimplification. */
217 if (stmt && warn_unused_valueglobal_options.x_warn_unused_value)
218 {
219 if (!TREE_SIDE_EFFECTS (stmt)((non_type_check ((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 219, __FUNCTION__))->base.side_effects_flag)
)
220 {
221 if (!IS_EMPTY_STMT (stmt)(((enum tree_code) (stmt)->base.code) == NOP_EXPR &&
(((enum tree_code) (((contains_struct_check ((stmt), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 221, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
) && integer_zerop ((*((const_cast<tree*> (tree_operand_check
((stmt), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 221, __FUNCTION__)))))))
222 && !VOID_TYPE_P (TREE_TYPE (stmt))(((enum tree_code) (((contains_struct_check ((stmt), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 222, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
)
223 && !warning_suppressed_p (stmt, OPT_Wunused_value))
224 warning (OPT_Wunused_value, "statement with no effect");
225 }
226 else
227 warn_if_unused_value (stmt, input_location);
228 }
229
230 if (stmt == NULL_TREE(tree) nullptr)
231 stmt = alloc_stmt_list ();
232
233 *stmt_p = stmt;
234}
235
236/* Gimplify initialization from an AGGR_INIT_EXPR. */
237
238static void
239cp_gimplify_init_expr (tree *expr_p)
240{
241 tree from = TREE_OPERAND (*expr_p, 1)(*((const_cast<tree*> (tree_operand_check ((*expr_p), (
1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 241, __FUNCTION__)))))
;
242 tree to = TREE_OPERAND (*expr_p, 0)(*((const_cast<tree*> (tree_operand_check ((*expr_p), (
0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 242, __FUNCTION__)))))
;
243 tree t;
244
245 /* What about code that pulls out the temp and uses it elsewhere? I
246 think that such code never uses the TARGET_EXPR as an initializer. If
247 I'm wrong, we'll abort because the temp won't have any RTL. In that
248 case, I guess we'll need to replace references somehow. */
249 if (TREE_CODE (from)((enum tree_code) (from)->base.code) == TARGET_EXPR && TARGET_EXPR_INITIAL (from)(*(tree_operand_check_code ((from), (TARGET_EXPR), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 249, __FUNCTION__)))
)
250 from = TARGET_EXPR_INITIAL (from)(*(tree_operand_check_code ((from), (TARGET_EXPR), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 250, __FUNCTION__)))
;
251
252 /* Look through any COMPOUND_EXPRs, since build_compound_expr pushes them
253 inside the TARGET_EXPR. */
254 for (t = from; t; )
255 {
256 tree sub = TREE_CODE (t)((enum tree_code) (t)->base.code) == COMPOUND_EXPR ? TREE_OPERAND (t, 0)(*((const_cast<tree*> (tree_operand_check ((t), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 256, __FUNCTION__)))))
: t;
257
258 /* If we are initializing from an AGGR_INIT_EXPR, drop the INIT_EXPR and
259 replace the slot operand with our target.
260
261 Should we add a target parm to gimplify_expr instead? No, as in this
262 case we want to replace the INIT_EXPR. */
263 if (TREE_CODE (sub)((enum tree_code) (sub)->base.code) == AGGR_INIT_EXPR
264 || TREE_CODE (sub)((enum tree_code) (sub)->base.code) == VEC_INIT_EXPR)
265 {
266 if (TREE_CODE (sub)((enum tree_code) (sub)->base.code) == AGGR_INIT_EXPR)
267 AGGR_INIT_EXPR_SLOT (sub)(*((const_cast<tree*> (tree_operand_check (((tree_check
((sub), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 267, __FUNCTION__, (AGGR_INIT_EXPR)))), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 267, __FUNCTION__)))))
= to;
268 else
269 VEC_INIT_EXPR_SLOT (sub)(*((const_cast<tree*> (tree_operand_check (((tree_check
((sub), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 269, __FUNCTION__, (VEC_INIT_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 269, __FUNCTION__)))))
= to;
270 *expr_p = from;
271
272 /* The initialization is now a side-effect, so the container can
273 become void. */
274 if (from != sub)
275 TREE_TYPE (from)((contains_struct_check ((from), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 275, __FUNCTION__))->typed.type)
= void_type_nodeglobal_trees[TI_VOID_TYPE];
276 }
277
278 /* Handle aggregate NSDMI. */
279 replace_placeholders (sub, to);
280
281 if (t == sub)
282 break;
283 else
284 t = TREE_OPERAND (t, 1)(*((const_cast<tree*> (tree_operand_check ((t), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 284, __FUNCTION__)))))
;
285 }
286
287}
288
289/* Gimplify a MUST_NOT_THROW_EXPR. */
290
291static enum gimplify_status
292gimplify_must_not_throw_expr (tree *expr_p, gimple_seq *pre_p)
293{
294 tree stmt = *expr_p;
295 tree temp = voidify_wrapper_expr (stmt, NULLnullptr);
296 tree body = TREE_OPERAND (stmt, 0)(*((const_cast<tree*> (tree_operand_check ((stmt), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 296, __FUNCTION__)))))
;
297 gimple_seq try_ = NULLnullptr;
298 gimple_seq catch_ = NULLnullptr;
299 gimple *mnt;
300
301 gimplify_and_add (body, &try_);
302 mnt = gimple_build_eh_must_not_throw (terminate_fncp_global_trees[CPTI_TERMINATE_FN]);
303 gimple_seq_add_stmt_without_update (&catch_, mnt);
304 mnt = gimple_build_try (try_, catch_, GIMPLE_TRY_CATCH);
305
306 gimple_seq_add_stmt_without_update (pre_p, mnt);
307 if (temp)
308 {
309 *expr_p = temp;
310 return GS_OK;
311 }
312
313 *expr_p = NULLnullptr;
314 return GS_ALL_DONE;
315}
316
317/* Return TRUE if an operand (OP) of a given TYPE being copied is
318 really just an empty class copy.
319
320 Check that the operand has a simple form so that TARGET_EXPRs and
321 non-empty CONSTRUCTORs get reduced properly, and we leave the
322 return slot optimization alone because it isn't a copy. */
323
324bool
325simple_empty_class_p (tree type, tree op, tree_code code)
326{
327 if (TREE_CODE (op)((enum tree_code) (op)->base.code) == COMPOUND_EXPR)
328 return simple_empty_class_p (type, TREE_OPERAND (op, 1)(*((const_cast<tree*> (tree_operand_check ((op), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 328, __FUNCTION__)))))
, code);
329 if (SIMPLE_TARGET_EXPR_P (op)(((enum tree_code) (op)->base.code) == TARGET_EXPR &&
(*(tree_operand_check_code ((op), (TARGET_EXPR), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 329, __FUNCTION__))) && !(((enum tree_code) (((contains_struct_check
(((*(tree_operand_check_code ((op), (TARGET_EXPR), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 329, __FUNCTION__)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 329, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
))
330 && TYPE_HAS_TRIVIAL_DESTRUCTOR (type)(!(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 330, __FUNCTION__))->type_common.lang_flag_4)))
)
331 /* The TARGET_EXPR is itself a simple copy, look through it. */
332 return simple_empty_class_p (type, TARGET_EXPR_INITIAL (op)(*(tree_operand_check_code ((op), (TARGET_EXPR), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 332, __FUNCTION__)))
, code);
333
334 if (TREE_CODE (op)((enum tree_code) (op)->base.code) == PARM_DECL
335 && TREE_ADDRESSABLE (TREE_TYPE (op))((((contains_struct_check ((op), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 335, __FUNCTION__))->typed.type))->base.addressable_flag
)
)
336 {
337 tree fn = DECL_CONTEXT (op)((contains_struct_check ((op), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 337, __FUNCTION__))->decl_minimal.context)
;
338 if (DECL_THUNK_P (fn)(((enum tree_code) (fn)->base.code) == FUNCTION_DECL &&
((contains_struct_check ((fn), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 338, __FUNCTION__))->decl_common.lang_specific) &&
__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? (
(struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 338, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn))
, (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 338, __FUNCTION__))->decl_common.lang_specific); if (!((
(enum tree_code) (fn)->base.code) == FUNCTION_DECL || (((enum
tree_code) (fn)->base.code) == TEMPLATE_DECL && (
(struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 338, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fn),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 338, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 338, __FUNCTION__); &lt->u.fn; })->thunk_p)
339 || lambda_static_thunk_p (fn))
340 /* In a thunk, we pass through invisible reference parms, so this isn't
341 actually a copy. */
342 return false;
343 }
344
345 return
346 (TREE_CODE (op)((enum tree_code) (op)->base.code) == EMPTY_CLASS_EXPR
347 || code == MODIFY_EXPR
348 || is_gimple_lvalue (op)
349 || INDIRECT_REF_P (op)(((enum tree_code) (op)->base.code) == INDIRECT_REF)
350 || (TREE_CODE (op)((enum tree_code) (op)->base.code) == CONSTRUCTOR
351 && CONSTRUCTOR_NELTS (op)(vec_safe_length (((tree_check ((op), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 351, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)))
== 0)
352 || (TREE_CODE (op)((enum tree_code) (op)->base.code) == CALL_EXPR
353 && !CALL_EXPR_RETURN_SLOT_OPT (op)((tree_check ((op), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 353, __FUNCTION__, (CALL_EXPR)))->base.private_flag)
))
354 && !TREE_CLOBBER_P (op)(((enum tree_code) (op)->base.code) == CONSTRUCTOR &&
((op)->base.volatile_flag))
355 && is_really_empty_class (type, /*ignore_vptr*/true);
356}
357
358/* Returns true if evaluating E as an lvalue has side-effects;
359 specifically, a volatile lvalue has TREE_SIDE_EFFECTS, but it doesn't really
360 have side-effects until there is a read or write through it. */
361
362static bool
363lvalue_has_side_effects (tree e)
364{
365 if (!TREE_SIDE_EFFECTS (e)((non_type_check ((e), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 365, __FUNCTION__))->base.side_effects_flag)
)
366 return false;
367 while (handled_component_p (e))
368 {
369 if (TREE_CODE (e)((enum tree_code) (e)->base.code) == ARRAY_REF
370 && TREE_SIDE_EFFECTS (TREE_OPERAND (e, 1))((non_type_check (((*((const_cast<tree*> (tree_operand_check
((e), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 370, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 370, __FUNCTION__))->base.side_effects_flag)
)
371 return true;
372 e = TREE_OPERAND (e, 0)(*((const_cast<tree*> (tree_operand_check ((e), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 372, __FUNCTION__)))))
;
373 }
374 if (DECL_P (e)(tree_code_type[(int) (((enum tree_code) (e)->base.code))]
== tcc_declaration)
)
375 /* Just naming a variable has no side-effects. */
376 return false;
377 else if (INDIRECT_REF_P (e)(((enum tree_code) (e)->base.code) == INDIRECT_REF))
378 /* Similarly, indirection has no side-effects. */
379 return TREE_SIDE_EFFECTS (TREE_OPERAND (e, 0))((non_type_check (((*((const_cast<tree*> (tree_operand_check
((e), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 379, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 379, __FUNCTION__))->base.side_effects_flag)
;
380 else
381 /* For anything else, trust TREE_SIDE_EFFECTS. */
382 return TREE_SIDE_EFFECTS (e)((non_type_check ((e), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 382, __FUNCTION__))->base.side_effects_flag)
;
383}
384
385/* Gimplify *EXPR_P as rvalue into an expression that can't be modified
386 by expressions with side-effects in other operands. */
387
388static enum gimplify_status
389gimplify_to_rvalue (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
390 bool (*gimple_test_f) (tree))
391{
392 enum gimplify_status t
393 = gimplify_expr (expr_p, pre_p, post_p, gimple_test_f, fb_rvalue);
394 if (t == GS_ERROR)
395 return GS_ERROR;
396 else if (is_gimple_variable (*expr_p) && TREE_CODE (*expr_p)((enum tree_code) (*expr_p)->base.code) != SSA_NAME)
397 *expr_p = get_initialized_tmp_var (*expr_p, pre_p);
398 return t;
399}
400
401/* Like gimplify_arg, but if ORDERED is set (which should be set if
402 any of the arguments this argument is sequenced before has
403 TREE_SIDE_EFFECTS set, make sure expressions with is_gimple_reg_type type
404 are gimplified into SSA_NAME or a fresh temporary and for
405 non-is_gimple_reg_type we don't optimize away TARGET_EXPRs. */
406
407static enum gimplify_status
408cp_gimplify_arg (tree *arg_p, gimple_seq *pre_p, location_t call_location,
409 bool ordered)
410{
411 enum gimplify_status t;
412 if (ordered
413 && !is_gimple_reg_type (TREE_TYPE (*arg_p)((contains_struct_check ((*arg_p), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 413, __FUNCTION__))->typed.type)
)
414 && TREE_CODE (*arg_p)((enum tree_code) (*arg_p)->base.code) == TARGET_EXPR)
415 {
416 /* gimplify_arg would strip away the TARGET_EXPR, but
417 that can mean we don't copy the argument and some following
418 argument with side-effect could modify it. */
419 protected_set_expr_location (*arg_p, call_location);
420 return gimplify_expr (arg_p, pre_p, NULLnullptr, is_gimple_lvalue, fb_either);
421 }
422 else
423 {
424 t = gimplify_arg (arg_p, pre_p, call_location);
425 if (t == GS_ERROR)
426 return GS_ERROR;
427 else if (ordered
428 && is_gimple_reg_type (TREE_TYPE (*arg_p)((contains_struct_check ((*arg_p), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 428, __FUNCTION__))->typed.type)
)
429 && is_gimple_variable (*arg_p)
430 && TREE_CODE (*arg_p)((enum tree_code) (*arg_p)->base.code) != SSA_NAME
431 /* No need to force references into register, references
432 can't be modified. */
433 && !TYPE_REF_P (TREE_TYPE (*arg_p))(((enum tree_code) (((contains_struct_check ((*arg_p), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 433, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)
434 /* And this can't be modified either. */
435 && *arg_p != current_class_ptr(*((cfun + 0) && ((cfun + 0)->language) ? &((cfun
+ 0)->language)->x_current_class_ptr : &scope_chain
->x_current_class_ptr))
)
436 *arg_p = get_initialized_tmp_var (*arg_p, pre_p);
437 return t;
438 }
439
440}
441
442/* Do C++-specific gimplification. Args are as for gimplify_expr. */
443
444int
445cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
446{
447 int saved_stmts_are_full_exprs_p = 0;
448 location_t loc = cp_expr_loc_or_input_loc (*expr_p);
449 enum tree_code code = TREE_CODE (*expr_p)((enum tree_code) (*expr_p)->base.code);
450 enum gimplify_status ret;
451
452 if (STATEMENT_CODE_P (code)statement_code_p[(int) (code)])
1
Assuming the condition is true
2
Taking true branch
453 {
454 saved_stmts_are_full_exprs_p = stmts_are_full_exprs_p ();
455 current_stmt_tree ()->stmts_are_full_exprs_p
456 = STMT_IS_FULL_EXPR_P (*expr_p)((tree_not_check2 (((*expr_p)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 456, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)
;
457 }
458
459 switch (code)
3
Control jumps to 'case CALL_EXPR:' at line 629
460 {
461 case AGGR_INIT_EXPR:
462 simplify_aggr_init_expr (expr_p);
463 ret = GS_OK;
464 break;
465
466 case VEC_INIT_EXPR:
467 {
468 location_t loc = input_location;
469 tree init = VEC_INIT_EXPR_INIT (*expr_p)(*((const_cast<tree*> (tree_operand_check (((tree_check
((*expr_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 469, __FUNCTION__, (VEC_INIT_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 469, __FUNCTION__)))))
;
470 int from_array = (init && TREE_CODE (TREE_TYPE (init))((enum tree_code) (((contains_struct_check ((init), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 470, __FUNCTION__))->typed.type))->base.code)
== ARRAY_TYPE);
471 gcc_assert (EXPR_HAS_LOCATION (*expr_p))((void)(!((((IS_ADHOC_LOC (((((*expr_p)) && ((tree_code_type
[(int) (((enum tree_code) ((*expr_p))->base.code))]) >=
tcc_reference && (tree_code_type[(int) (((enum tree_code
) ((*expr_p))->base.code))]) <= tcc_expression)) ? (*expr_p
)->exp.locus : ((location_t) 0)))) ? get_location_from_adhoc_loc
(line_table, ((((*expr_p)) && ((tree_code_type[(int)
(((enum tree_code) ((*expr_p))->base.code))]) >= tcc_reference
&& (tree_code_type[(int) (((enum tree_code) ((*expr_p
))->base.code))]) <= tcc_expression)) ? (*expr_p)->exp
.locus : ((location_t) 0))) : (((((*expr_p)) && ((tree_code_type
[(int) (((enum tree_code) ((*expr_p))->base.code))]) >=
tcc_reference && (tree_code_type[(int) (((enum tree_code
) ((*expr_p))->base.code))]) <= tcc_expression)) ? (*expr_p
)->exp.locus : ((location_t) 0)))) != ((location_t) 0))) ?
fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 471, __FUNCTION__), 0 : 0))
;
472 input_location = EXPR_LOCATION (*expr_p)((((*expr_p)) && ((tree_code_type[(int) (((enum tree_code
) ((*expr_p))->base.code))]) >= tcc_reference &&
(tree_code_type[(int) (((enum tree_code) ((*expr_p))->base
.code))]) <= tcc_expression)) ? (*expr_p)->exp.locus : (
(location_t) 0))
;
473 *expr_p = build_vec_init (VEC_INIT_EXPR_SLOT (*expr_p)(*((const_cast<tree*> (tree_operand_check (((tree_check
((*expr_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 473, __FUNCTION__, (VEC_INIT_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 473, __FUNCTION__)))))
, NULL_TREE(tree) nullptr,
474 init, VEC_INIT_EXPR_VALUE_INIT (*expr_p)((tree_not_check2 (((tree_check ((*expr_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 474, __FUNCTION__, (VEC_INIT_EXPR)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 474, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)
,
475 from_array,
476 tf_warning_or_error);
477 hash_set<tree> pset;
478 cp_walk_tree (expr_p, cp_fold_r, &pset, NULL)walk_tree_1 (expr_p, cp_fold_r, &pset, nullptr, cp_walk_subtrees
)
;
479 cp_genericize_tree (expr_p, false);
480 copy_if_shared (expr_p);
481 ret = GS_OK;
482 input_location = loc;
483 }
484 break;
485
486 case THROW_EXPR:
487 /* FIXME communicate throw type to back end, probably by moving
488 THROW_EXPR into ../tree.def. */
489 *expr_p = TREE_OPERAND (*expr_p, 0)(*((const_cast<tree*> (tree_operand_check ((*expr_p), (
0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 489, __FUNCTION__)))))
;
490 ret = GS_OK;
491 break;
492
493 case MUST_NOT_THROW_EXPR:
494 ret = gimplify_must_not_throw_expr (expr_p, pre_p);
495 break;
496
497 /* We used to do this for MODIFY_EXPR as well, but that's unsafe; the
498 LHS of an assignment might also be involved in the RHS, as in bug
499 25979. */
500 case INIT_EXPR:
501 cp_gimplify_init_expr (expr_p);
502 if (TREE_CODE (*expr_p)((enum tree_code) (*expr_p)->base.code) != INIT_EXPR)
503 return GS_OK;
504 /* Fall through. */
505 case MODIFY_EXPR:
506 modify_expr_case:
507 {
508 /* If the back end isn't clever enough to know that the lhs and rhs
509 types are the same, add an explicit conversion. */
510 tree op0 = TREE_OPERAND (*expr_p, 0)(*((const_cast<tree*> (tree_operand_check ((*expr_p), (
0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 510, __FUNCTION__)))))
;
511 tree op1 = TREE_OPERAND (*expr_p, 1)(*((const_cast<tree*> (tree_operand_check ((*expr_p), (
1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 511, __FUNCTION__)))))
;
512
513 if (!error_operand_p (op0)
514 && !error_operand_p (op1)
515 && (TYPE_STRUCTURAL_EQUALITY_P (TREE_TYPE (op0))(((tree_class_check ((((contains_struct_check ((op0), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 515, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 515, __FUNCTION__))->type_common.canonical) == (tree) nullptr
)
516 || TYPE_STRUCTURAL_EQUALITY_P (TREE_TYPE (op1))(((tree_class_check ((((contains_struct_check ((op1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 516, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 516, __FUNCTION__))->type_common.canonical) == (tree) nullptr
)
)
517 && !useless_type_conversion_p (TREE_TYPE (op1)((contains_struct_check ((op1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 517, __FUNCTION__))->typed.type)
, TREE_TYPE (op0)((contains_struct_check ((op0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 517, __FUNCTION__))->typed.type)
))
518 TREE_OPERAND (*expr_p, 1)(*((const_cast<tree*> (tree_operand_check ((*expr_p), (
1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 518, __FUNCTION__)))))
= build1 (VIEW_CONVERT_EXPR,
519 TREE_TYPE (op0)((contains_struct_check ((op0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 519, __FUNCTION__))->typed.type)
, op1);
520
521 else if (simple_empty_class_p (TREE_TYPE (op0)((contains_struct_check ((op0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 521, __FUNCTION__))->typed.type)
, op1, code))
522 {
523 while (TREE_CODE (op1)((enum tree_code) (op1)->base.code) == TARGET_EXPR)
524 /* We're disconnecting the initializer from its target,
525 don't create a temporary. */
526 op1 = TARGET_EXPR_INITIAL (op1)(*(tree_operand_check_code ((op1), (TARGET_EXPR), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 526, __FUNCTION__)))
;
527
528 /* Remove any copies of empty classes. Also drop volatile
529 variables on the RHS to avoid infinite recursion from
530 gimplify_expr trying to load the value. */
531 if (TREE_SIDE_EFFECTS (op1)((non_type_check ((op1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 531, __FUNCTION__))->base.side_effects_flag)
)
532 {
533 if (TREE_THIS_VOLATILE (op1)((op1)->base.volatile_flag)
534 && (REFERENCE_CLASS_P (op1)(tree_code_type[(int) (((enum tree_code) (op1)->base.code)
)] == tcc_reference)
|| DECL_P (op1)(tree_code_type[(int) (((enum tree_code) (op1)->base.code)
)] == tcc_declaration)
))
535 op1 = build_fold_addr_expr (op1)build_fold_addr_expr_loc (((location_t) 0), (op1));
536
537 gimplify_and_add (op1, pre_p);
538 }
539 gimplify_expr (&TREE_OPERAND (*expr_p, 0)(*((const_cast<tree*> (tree_operand_check ((*expr_p), (
0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 539, __FUNCTION__)))))
, pre_p, post_p,
540 is_gimple_lvalue, fb_lvalue);
541 *expr_p = TREE_OPERAND (*expr_p, 0)(*((const_cast<tree*> (tree_operand_check ((*expr_p), (
0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 541, __FUNCTION__)))))
;
542 if (code == RETURN_EXPR && REFERENCE_CLASS_P (*expr_p)(tree_code_type[(int) (((enum tree_code) (*expr_p)->base.code
))] == tcc_reference)
)
543 /* Avoid 'return *<retval>;' */
544 *expr_p = TREE_OPERAND (*expr_p, 0)(*((const_cast<tree*> (tree_operand_check ((*expr_p), (
0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 544, __FUNCTION__)))))
;
545 }
546 /* P0145 says that the RHS is sequenced before the LHS.
547 gimplify_modify_expr gimplifies the RHS before the LHS, but that
548 isn't quite strong enough in two cases:
549
550 1) gimplify.c wants to leave a CALL_EXPR on the RHS, which would
551 mean it's evaluated after the LHS.
552
553 2) the value calculation of the RHS is also sequenced before the
554 LHS, so for scalar assignment we need to preevaluate if the
555 RHS could be affected by LHS side-effects even if it has no
556 side-effects of its own. We don't need this for classes because
557 class assignment takes its RHS by reference. */
558 else if (flag_strong_eval_orderglobal_options.x_flag_strong_eval_order > 1
559 && TREE_CODE (*expr_p)((enum tree_code) (*expr_p)->base.code) == MODIFY_EXPR
560 && lvalue_has_side_effects (op0)
561 && (TREE_CODE (op1)((enum tree_code) (op1)->base.code) == CALL_EXPR
562 || (SCALAR_TYPE_P (TREE_TYPE (op1))((((enum tree_code) (((contains_struct_check ((op1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 562, __FUNCTION__))->typed.type))->base.code) == OFFSET_TYPE
) || ((enum tree_code) (((contains_struct_check ((op1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 562, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE
|| ((((enum tree_code) (((contains_struct_check ((op1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 562, __FUNCTION__))->typed.type))->base.code) == BOOLEAN_TYPE
|| ((enum tree_code) (((contains_struct_check ((op1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 562, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE
) || ((enum tree_code) (((contains_struct_check ((op1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 562, __FUNCTION__))->typed.type))->base.code) == REAL_TYPE
|| ((enum tree_code) (((contains_struct_check ((op1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 562, __FUNCTION__))->typed.type))->base.code) == COMPLEX_TYPE
) || (((enum tree_code) (((contains_struct_check ((op1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 562, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
) || (((enum tree_code) (((contains_struct_check ((op1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 562, __FUNCTION__))->typed.type))->base.code) == RECORD_TYPE
&& (((tree_class_check (((tree_check ((((contains_struct_check
((op1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 562, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 562, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 562, __FUNCTION__))->type_common.lang_flag_2))) || (((enum
tree_code) (((contains_struct_check ((op1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 562, __FUNCTION__))->typed.type))->base.code) == NULLPTR_TYPE
))
563 && !TREE_CONSTANT (op1)((non_type_check ((op1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 563, __FUNCTION__))->base.constant_flag)
)))
564 TREE_OPERAND (*expr_p, 1)(*((const_cast<tree*> (tree_operand_check ((*expr_p), (
1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 564, __FUNCTION__)))))
= get_initialized_tmp_var (op1, pre_p);
565 }
566 ret = GS_OK;
567 break;
568
569 case EMPTY_CLASS_EXPR:
570 /* We create an empty CONSTRUCTOR with RECORD_TYPE. */
571 *expr_p = build_constructor (TREE_TYPE (*expr_p)((contains_struct_check ((*expr_p), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 571, __FUNCTION__))->typed.type)
, NULLnullptr);
572 ret = GS_OK;
573 break;
574
575 case BASELINK:
576 *expr_p = BASELINK_FUNCTIONS (*expr_p)(((struct tree_baselink*) (tree_check ((*expr_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 576, __FUNCTION__, (BASELINK))))->functions)
;
577 ret = GS_OK;
578 break;
579
580 case TRY_BLOCK:
581 genericize_try_block (expr_p);
582 ret = GS_OK;
583 break;
584
585 case HANDLER:
586 genericize_catch_block (expr_p);
587 ret = GS_OK;
588 break;
589
590 case EH_SPEC_BLOCK:
591 genericize_eh_spec_block (expr_p);
592 ret = GS_OK;
593 break;
594
595 case USING_STMT:
596 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 596, __FUNCTION__))
;
597
598 case FOR_STMT:
599 case WHILE_STMT:
600 case DO_STMT:
601 case SWITCH_STMT:
602 case CONTINUE_STMT:
603 case BREAK_STMT:
604 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 604, __FUNCTION__))
;
605
606 case OMP_FOR:
607 case OMP_SIMD:
608 case OMP_DISTRIBUTE:
609 case OMP_LOOP:
610 case OMP_TASKLOOP:
611 ret = cp_gimplify_omp_for (expr_p, pre_p);
612 break;
613
614 case EXPR_STMT:
615 gimplify_expr_stmt (expr_p);
616 ret = GS_OK;
617 break;
618
619 case UNARY_PLUS_EXPR:
620 {
621 tree arg = TREE_OPERAND (*expr_p, 0)(*((const_cast<tree*> (tree_operand_check ((*expr_p), (
0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 621, __FUNCTION__)))))
;
622 tree type = TREE_TYPE (*expr_p)((contains_struct_check ((*expr_p), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 622, __FUNCTION__))->typed.type)
;
623 *expr_p = (TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 623, __FUNCTION__))->typed.type)
!= type) ? fold_convert (type, arg)fold_convert_loc (((location_t) 0), type, arg)
624 : arg;
625 ret = GS_OK;
626 }
627 break;
628
629 case CALL_EXPR:
630 ret = GS_OK;
631 if (flag_strong_eval_orderglobal_options.x_flag_strong_eval_order == 2
4
Assuming field 'x_flag_strong_eval_order' is not equal to 2
632 && CALL_EXPR_FN (*expr_p)(*((const_cast<tree*> (tree_operand_check (((tree_check
((*expr_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 632, __FUNCTION__, (CALL_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 632, __FUNCTION__)))))
633 && !CALL_EXPR_OPERATOR_SYNTAX (*expr_p)((tree_not_check2 (((tree_check2 (((*expr_p)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 633, __FUNCTION__, (CALL_EXPR), (AGGR_INIT_EXPR)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 633, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_6)
634 && cp_get_callee_fndecl_nofold (*expr_p) == NULL_TREE(tree) nullptr)
635 {
636 tree fnptrtype = TREE_TYPE (CALL_EXPR_FN (*expr_p))((contains_struct_check (((*((const_cast<tree*> (tree_operand_check
(((tree_check ((*expr_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 636, __FUNCTION__, (CALL_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 636, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 636, __FUNCTION__))->typed.type)
;
637 enum gimplify_status t
638 = gimplify_to_rvalue (&CALL_EXPR_FN (*expr_p)(*((const_cast<tree*> (tree_operand_check (((tree_check
((*expr_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 638, __FUNCTION__, (CALL_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 638, __FUNCTION__)))))
, pre_p, NULLnullptr,
639 is_gimple_call_addr);
640 if (t == GS_ERROR)
641 ret = GS_ERROR;
642 /* GIMPLE considers most pointer conversion useless, but for
643 calls we actually care about the exact function pointer type. */
644 else if (TREE_TYPE (CALL_EXPR_FN (*expr_p))((contains_struct_check (((*((const_cast<tree*> (tree_operand_check
(((tree_check ((*expr_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 644, __FUNCTION__, (CALL_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 644, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 644, __FUNCTION__))->typed.type)
!= fnptrtype)
645 CALL_EXPR_FN (*expr_p)(*((const_cast<tree*> (tree_operand_check (((tree_check
((*expr_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 645, __FUNCTION__, (CALL_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 645, __FUNCTION__)))))
646 = build1 (NOP_EXPR, fnptrtype, CALL_EXPR_FN (*expr_p)(*((const_cast<tree*> (tree_operand_check (((tree_check
((*expr_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 646, __FUNCTION__, (CALL_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 646, __FUNCTION__)))))
);
647 }
648 if (!CALL_EXPR_FN (*expr_p)(*((const_cast<tree*> (tree_operand_check (((tree_check
((*expr_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 648, __FUNCTION__, (CALL_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 648, __FUNCTION__)))))
)
5
Assuming the condition is false
6
Taking false branch
649 /* Internal function call. */;
650 else if (CALL_EXPR_REVERSE_ARGS (*expr_p)((tree_not_check2 (((tree_check2 (((*expr_p)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 650, __FUNCTION__, (CALL_EXPR), (AGGR_INIT_EXPR)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 650, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_5)
)
7
Assuming field 'lang_flag_5' is 0
8
Taking false branch
651 {
652 /* This is a call to a (compound) assignment operator that used
653 the operator syntax; gimplify the RHS first. */
654 gcc_assert (call_expr_nargs (*expr_p) == 2)((void)(!((((int)((unsigned long) (*tree_int_cst_elt_check ((
(tree_class_check ((*expr_p), (tcc_vl_exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 654, __FUNCTION__))->exp.operands[0]), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 654, __FUNCTION__)))) - 3) == 2) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 654, __FUNCTION__), 0 : 0))
;
655 gcc_assert (!CALL_EXPR_ORDERED_ARGS (*expr_p))((void)(!(!((tree_not_check2 (((tree_check2 (((*expr_p)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 655, __FUNCTION__, (CALL_EXPR), (AGGR_INIT_EXPR)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 655, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_3)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 655, __FUNCTION__), 0 : 0))
;
656 enum gimplify_status t
657 = cp_gimplify_arg (&CALL_EXPR_ARG (*expr_p, 1)(*((const_cast<tree*> (tree_operand_check (((tree_check
((*expr_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 657, __FUNCTION__, (CALL_EXPR)))), ((1) + 3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 657, __FUNCTION__)))))
, pre_p, loc,
658 TREE_SIDE_EFFECTS (CALL_EXPR_ARG (*expr_p, 0))((non_type_check (((*((const_cast<tree*> (tree_operand_check
(((tree_check ((*expr_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 658, __FUNCTION__, (CALL_EXPR)))), ((0) + 3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 658, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 658, __FUNCTION__))->base.side_effects_flag)
);
659 if (t == GS_ERROR)
660 ret = GS_ERROR;
661 }
662 else if (CALL_EXPR_ORDERED_ARGS (*expr_p)((tree_not_check2 (((tree_check2 (((*expr_p)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 662, __FUNCTION__, (CALL_EXPR), (AGGR_INIT_EXPR)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 662, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_3)
)
9
Assuming field 'lang_flag_3' is 0
10
Taking false branch
663 {
664 /* Leave the last argument for gimplify_call_expr, to avoid problems
665 with __builtin_va_arg_pack(). */
666 int nargs = call_expr_nargs (*expr_p)(((int)((unsigned long) (*tree_int_cst_elt_check (((tree_class_check
((*expr_p), (tcc_vl_exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 666, __FUNCTION__))->exp.operands[0]), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 666, __FUNCTION__)))) - 3)
- 1;
667 int last_side_effects_arg = -1;
668 for (int i = nargs; i > 0; --i)
669 if (TREE_SIDE_EFFECTS (CALL_EXPR_ARG (*expr_p, i))((non_type_check (((*((const_cast<tree*> (tree_operand_check
(((tree_check ((*expr_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 669, __FUNCTION__, (CALL_EXPR)))), ((i) + 3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 669, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 669, __FUNCTION__))->base.side_effects_flag)
)
670 {
671 last_side_effects_arg = i;
672 break;
673 }
674 for (int i = 0; i < nargs; ++i)
675 {
676 enum gimplify_status t
677 = cp_gimplify_arg (&CALL_EXPR_ARG (*expr_p, i)(*((const_cast<tree*> (tree_operand_check (((tree_check
((*expr_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 677, __FUNCTION__, (CALL_EXPR)))), ((i) + 3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 677, __FUNCTION__)))))
, pre_p, loc,
678 i < last_side_effects_arg);
679 if (t == GS_ERROR)
680 ret = GS_ERROR;
681 }
682 }
683 else if (flag_strong_eval_orderglobal_options.x_flag_strong_eval_order
11
Assuming field 'x_flag_strong_eval_order' is 0
684 && !CALL_EXPR_OPERATOR_SYNTAX (*expr_p)((tree_not_check2 (((tree_check2 (((*expr_p)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 684, __FUNCTION__, (CALL_EXPR), (AGGR_INIT_EXPR)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 684, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_6)
)
685 {
686 /* If flag_strong_eval_order, evaluate the object argument first. */
687 tree fntype = TREE_TYPE (CALL_EXPR_FN (*expr_p))((contains_struct_check (((*((const_cast<tree*> (tree_operand_check
(((tree_check ((*expr_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 687, __FUNCTION__, (CALL_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 687, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 687, __FUNCTION__))->typed.type)
;
688 if (INDIRECT_TYPE_P (fntype)((((enum tree_code) (fntype)->base.code) == POINTER_TYPE) ||
(((enum tree_code) (fntype)->base.code) == REFERENCE_TYPE
))
)
689 fntype = TREE_TYPE (fntype)((contains_struct_check ((fntype), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 689, __FUNCTION__))->typed.type)
;
690 if (TREE_CODE (fntype)((enum tree_code) (fntype)->base.code) == METHOD_TYPE)
691 {
692 int nargs = call_expr_nargs (*expr_p)(((int)((unsigned long) (*tree_int_cst_elt_check (((tree_class_check
((*expr_p), (tcc_vl_exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 692, __FUNCTION__))->exp.operands[0]), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 692, __FUNCTION__)))) - 3)
;
693 bool side_effects = false;
694 for (int i = 1; i < nargs; ++i)
695 if (TREE_SIDE_EFFECTS (CALL_EXPR_ARG (*expr_p, i))((non_type_check (((*((const_cast<tree*> (tree_operand_check
(((tree_check ((*expr_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 695, __FUNCTION__, (CALL_EXPR)))), ((i) + 3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 695, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 695, __FUNCTION__))->base.side_effects_flag)
)
696 {
697 side_effects = true;
698 break;
699 }
700 enum gimplify_status t
701 = cp_gimplify_arg (&CALL_EXPR_ARG (*expr_p, 0)(*((const_cast<tree*> (tree_operand_check (((tree_check
((*expr_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 701, __FUNCTION__, (CALL_EXPR)))), ((0) + 3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 701, __FUNCTION__)))))
, pre_p, loc,
702 side_effects);
703 if (t == GS_ERROR)
704 ret = GS_ERROR;
705 }
706 }
707 if (ret
11.1
'ret' is not equal to GS_ERROR
11.1
'ret' is not equal to GS_ERROR
!= GS_ERROR)
12
Taking true branch
708 {
709 tree decl = cp_get_callee_fndecl_nofold (*expr_p);
710 if (decl && fndecl_built_in_p (decl, BUILT_IN_FRONTEND))
13
Assuming 'decl' is non-null
14
Taking true branch
711 switch (DECL_FE_FUNCTION_CODE (decl))
15
Control jumps to 'case CP_BUILT_IN_SOURCE_LOCATION:' at line 716
712 {
713 case CP_BUILT_IN_IS_CONSTANT_EVALUATED:
714 *expr_p = boolean_false_nodeglobal_trees[TI_BOOLEAN_FALSE];
715 break;
716 case CP_BUILT_IN_SOURCE_LOCATION:
717 *expr_p
718 = fold_builtin_source_location (EXPR_LOCATION (*expr_p)((((*expr_p)) && ((tree_code_type[(int) (((enum tree_code
) ((*expr_p))->base.code))]) >= tcc_reference &&
(tree_code_type[(int) (((enum tree_code) ((*expr_p))->base
.code))]) <= tcc_expression)) ? (*expr_p)->exp.locus : (
(location_t) 0))
)
;
16
Assuming the condition is false
17
Calling 'fold_builtin_source_location'
719 break;
720 case CP_BUILT_IN_IS_CORRESPONDING_MEMBER:
721 *expr_p
722 = fold_builtin_is_corresponding_member
723 (EXPR_LOCATION (*expr_p)((((*expr_p)) && ((tree_code_type[(int) (((enum tree_code
) ((*expr_p))->base.code))]) >= tcc_reference &&
(tree_code_type[(int) (((enum tree_code) ((*expr_p))->base
.code))]) <= tcc_expression)) ? (*expr_p)->exp.locus : (
(location_t) 0))
, call_expr_nargs (*expr_p)(((int)((unsigned long) (*tree_int_cst_elt_check (((tree_class_check
((*expr_p), (tcc_vl_exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 723, __FUNCTION__))->exp.operands[0]), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 723, __FUNCTION__)))) - 3)
,
724 &CALL_EXPR_ARG (*expr_p, 0)(*((const_cast<tree*> (tree_operand_check (((tree_check
((*expr_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 724, __FUNCTION__, (CALL_EXPR)))), ((0) + 3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 724, __FUNCTION__)))))
);
725 break;
726 case CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS:
727 *expr_p
728 = fold_builtin_is_pointer_inverconvertible_with_class
729 (EXPR_LOCATION (*expr_p)((((*expr_p)) && ((tree_code_type[(int) (((enum tree_code
) ((*expr_p))->base.code))]) >= tcc_reference &&
(tree_code_type[(int) (((enum tree_code) ((*expr_p))->base
.code))]) <= tcc_expression)) ? (*expr_p)->exp.locus : (
(location_t) 0))
, call_expr_nargs (*expr_p)(((int)((unsigned long) (*tree_int_cst_elt_check (((tree_class_check
((*expr_p), (tcc_vl_exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 729, __FUNCTION__))->exp.operands[0]), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 729, __FUNCTION__)))) - 3)
,
730 &CALL_EXPR_ARG (*expr_p, 0)(*((const_cast<tree*> (tree_operand_check (((tree_check
((*expr_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 730, __FUNCTION__, (CALL_EXPR)))), ((0) + 3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 730, __FUNCTION__)))))
);
731 break;
732 default:
733 break;
734 }
735 }
736 break;
737
738 case TARGET_EXPR:
739 /* A TARGET_EXPR that expresses direct-initialization should have been
740 elided by cp_gimplify_init_expr. */
741 gcc_checking_assert (!TARGET_EXPR_DIRECT_INIT_P (*expr_p))((void)(!(!((tree_not_check2 (((tree_check ((*expr_p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 741, __FUNCTION__, (TARGET_EXPR)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 741, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 741, __FUNCTION__), 0 : 0))
;
742 ret = GS_UNHANDLED;
743 break;
744
745 case PTRMEM_CST:
746 *expr_p = cplus_expand_constant (*expr_p);
747 if (TREE_CODE (*expr_p)((enum tree_code) (*expr_p)->base.code) == PTRMEM_CST)
748 ret = GS_ERROR;
749 else
750 ret = GS_OK;
751 break;
752
753 case RETURN_EXPR:
754 if (TREE_OPERAND (*expr_p, 0)(*((const_cast<tree*> (tree_operand_check ((*expr_p), (
0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 754, __FUNCTION__)))))
755 && (TREE_CODE (TREE_OPERAND (*expr_p, 0))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((*expr_p), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 755, __FUNCTION__))))))->base.code)
== INIT_EXPR
756 || TREE_CODE (TREE_OPERAND (*expr_p, 0))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((*expr_p), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 756, __FUNCTION__))))))->base.code)
== MODIFY_EXPR))
757 {
758 expr_p = &TREE_OPERAND (*expr_p, 0)(*((const_cast<tree*> (tree_operand_check ((*expr_p), (
0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 758, __FUNCTION__)))))
;
759 /* Avoid going through the INIT_EXPR case, which can
760 degrade INIT_EXPRs into AGGR_INIT_EXPRs. */
761 goto modify_expr_case;
762 }
763 /* Fall through. */
764
765 default:
766 ret = (enum gimplify_status) c_gimplify_expr (expr_p, pre_p, post_p);
767 break;
768 }
769
770 /* Restore saved state. */
771 if (STATEMENT_CODE_P (code)statement_code_p[(int) (code)])
772 current_stmt_tree ()->stmts_are_full_exprs_p
773 = saved_stmts_are_full_exprs_p;
774
775 return ret;
776}
777
778static inline bool
779is_invisiref_parm (const_tree t)
780{
781 return ((TREE_CODE (t)((enum tree_code) (t)->base.code) == PARM_DECL || TREE_CODE (t)((enum tree_code) (t)->base.code) == RESULT_DECL)
782 && DECL_BY_REFERENCE (t)((tree_check3 ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 782, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL)))
->decl_common.decl_by_reference_flag)
);
783}
784
785/* A stable comparison routine for use with splay trees and DECLs. */
786
787static int
788splay_tree_compare_decl_uid (splay_tree_key xa, splay_tree_key xb)
789{
790 tree a = (tree) xa;
791 tree b = (tree) xb;
792
793 return DECL_UID (a)((contains_struct_check ((a), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 793, __FUNCTION__))->decl_minimal.uid)
- DECL_UID (b)((contains_struct_check ((b), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 793, __FUNCTION__))->decl_minimal.uid)
;
794}
795
796/* OpenMP context during genericization. */
797
798struct cp_genericize_omp_taskreg
799{
800 bool is_parallel;
801 bool default_shared;
802 struct cp_genericize_omp_taskreg *outer;
803 splay_tree variables;
804};
805
806/* Return true if genericization should try to determine if
807 DECL is firstprivate or shared within task regions. */
808
809static bool
810omp_var_to_track (tree decl)
811{
812 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 812, __FUNCTION__))->typed.type)
;
813 if (is_invisiref_parm (decl))
814 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 814, __FUNCTION__))->typed.type)
;
815 else if (TYPE_REF_P (type)(((enum tree_code) (type)->base.code) == REFERENCE_TYPE))
816 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 816, __FUNCTION__))->typed.type)
;
817 while (TREE_CODE (type)((enum tree_code) (type)->base.code) == ARRAY_TYPE)
818 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 818, __FUNCTION__))->typed.type)
;
819 if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK] || !CLASS_TYPE_P (type)(((((enum tree_code) (type)->base.code)) == RECORD_TYPE ||
(((enum tree_code) (type)->base.code)) == UNION_TYPE) &&
((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 819, __FUNCTION__))->type_common.lang_flag_5))
)
820 return false;
821 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && CP_DECL_THREAD_LOCAL_P (decl)(((tree_not_check2 (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 821, __FUNCTION__, (VAR_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 821, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0))
)
822 return false;
823 if (cxx_omp_predetermined_sharing (decl) != OMP_CLAUSE_DEFAULT_UNSPECIFIED)
824 return false;
825 return true;
826}
827
828/* Note DECL use in OpenMP region OMP_CTX during genericization. */
829
830static void
831omp_cxx_notice_variable (struct cp_genericize_omp_taskreg *omp_ctx, tree decl)
832{
833 splay_tree_node n = splay_tree_lookup (omp_ctx->variables,
834 (splay_tree_key) decl);
835 if (n == NULLnullptr)
836 {
837 int flags = OMP_CLAUSE_DEFAULT_SHARED;
838 if (omp_ctx->outer)
839 omp_cxx_notice_variable (omp_ctx->outer, decl);
840 if (!omp_ctx->default_shared)
841 {
842 struct cp_genericize_omp_taskreg *octx;
843
844 for (octx = omp_ctx->outer; octx; octx = octx->outer)
845 {
846 n = splay_tree_lookup (octx->variables, (splay_tree_key) decl);
847 if (n && n->value != OMP_CLAUSE_DEFAULT_SHARED)
848 {
849 flags = OMP_CLAUSE_DEFAULT_FIRSTPRIVATE;
850 break;
851 }
852 if (octx->is_parallel)
853 break;
854 }
855 if (octx == NULLnullptr
856 && (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == PARM_DECL
857 || (!(TREE_STATIC (decl)((decl)->base.static_flag) || DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 857, __FUNCTION__))->decl_common.decl_flag_1)
)
858 && DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 858, __FUNCTION__))->decl_minimal.context)
== current_function_decl)))
859 flags = OMP_CLAUSE_DEFAULT_FIRSTPRIVATE;
860 if (flags == OMP_CLAUSE_DEFAULT_FIRSTPRIVATE)
861 {
862 /* DECL is implicitly determined firstprivate in
863 the current task construct. Ensure copy ctor and
864 dtor are instantiated, because during gimplification
865 it will be already too late. */
866 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 866, __FUNCTION__))->typed.type)
;
867 if (is_invisiref_parm (decl))
868 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 868, __FUNCTION__))->typed.type)
;
869 else if (TYPE_REF_P (type)(((enum tree_code) (type)->base.code) == REFERENCE_TYPE))
870 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 870, __FUNCTION__))->typed.type)
;
871 while (TREE_CODE (type)((enum tree_code) (type)->base.code) == ARRAY_TYPE)
872 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 872, __FUNCTION__))->typed.type)
;
873 get_copy_ctor (type, tf_none);
874 get_dtor (type, tf_none);
875 }
876 }
877 splay_tree_insert (omp_ctx->variables, (splay_tree_key) decl, flags);
878 }
879}
880
881/* Genericization context. */
882
883struct cp_genericize_data
884{
885 hash_set<tree> *p_set;
886 auto_vec<tree> bind_expr_stack;
887 struct cp_genericize_omp_taskreg *omp_ctx;
888 tree try_block;
889 bool no_sanitize_p;
890 bool handle_invisiref_parm_p;
891};
892
893/* Perform any pre-gimplification folding of C++ front end trees to
894 GENERIC.
895 Note: The folding of none-omp cases is something to move into
896 the middle-end. As for now we have most foldings only on GENERIC
897 in fold-const, we need to perform this before transformation to
898 GIMPLE-form. */
899
900static tree
901cp_fold_r (tree *stmt_p, int *walk_subtrees, void *data)
902{
903 tree stmt;
904 enum tree_code code;
905
906 *stmt_p = stmt = cp_fold (*stmt_p);
907
908 if (((hash_set<tree> *) data)->add (stmt))
909 {
910 /* Don't walk subtrees of stmts we've already walked once, otherwise
911 we can have exponential complexity with e.g. lots of nested
912 SAVE_EXPRs or TARGET_EXPRs. cp_fold uses a cache and will return
913 always the same tree, which the first time cp_fold_r has been
914 called on it had the subtrees walked. */
915 *walk_subtrees = 0;
916 return NULLnullptr;
917 }
918
919 code = TREE_CODE (stmt)((enum tree_code) (stmt)->base.code);
920 if (code == OMP_FOR || code == OMP_SIMD || code == OMP_DISTRIBUTE
921 || code == OMP_LOOP || code == OMP_TASKLOOP || code == OACC_LOOP)
922 {
923 tree x;
924 int i, n;
925
926 cp_walk_tree (&OMP_FOR_BODY (stmt), cp_fold_r, data, NULL)walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
(((tree_range_check ((stmt), (OMP_FOR), (OACC_LOOP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 926, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 926, __FUNCTION__))))), cp_fold_r, data, nullptr, cp_walk_subtrees
)
;
927 cp_walk_tree (&OMP_FOR_CLAUSES (stmt), cp_fold_r, data, NULL)walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
(((tree_range_check ((stmt), (OMP_FOR), (OACC_LOOP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 927, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 927, __FUNCTION__))))), cp_fold_r, data, nullptr, cp_walk_subtrees
)
;
928 cp_walk_tree (&OMP_FOR_INIT (stmt), cp_fold_r, data, NULL)walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
(((tree_range_check ((stmt), (OMP_FOR), (OACC_LOOP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 928, __FUNCTION__))), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 928, __FUNCTION__))))), cp_fold_r, data, nullptr, cp_walk_subtrees
)
;
929 x = OMP_FOR_COND (stmt)(*((const_cast<tree*> (tree_operand_check (((tree_range_check
((stmt), (OMP_FOR), (OACC_LOOP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 929, __FUNCTION__))), (3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 929, __FUNCTION__)))))
;
930 if (x && TREE_CODE_CLASS (TREE_CODE (x))tree_code_type[(int) (((enum tree_code) (x)->base.code))] == tcc_comparison)
931 {
932 cp_walk_tree (&TREE_OPERAND (x, 0), cp_fold_r, data, NULL)walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 932, __FUNCTION__))))), cp_fold_r, data, nullptr, cp_walk_subtrees
)
;
933 cp_walk_tree (&TREE_OPERAND (x, 1), cp_fold_r, data, NULL)walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
((x), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 933, __FUNCTION__))))), cp_fold_r, data, nullptr, cp_walk_subtrees
)
;
934 }
935 else if (x && TREE_CODE (x)((enum tree_code) (x)->base.code) == TREE_VEC)
936 {
937 n = TREE_VEC_LENGTH (x)((tree_check ((x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 937, __FUNCTION__, (TREE_VEC)))->base.u.length)
;
938 for (i = 0; i < n; i++)
939 {
940 tree o = TREE_VEC_ELT (x, i)(*((const_cast<tree *> (tree_vec_elt_check ((x), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 940, __FUNCTION__)))))
;
941 if (o && TREE_CODE_CLASS (TREE_CODE (o))tree_code_type[(int) (((enum tree_code) (o)->base.code))] == tcc_comparison)
942 cp_walk_tree (&TREE_OPERAND (o, 1), cp_fold_r, data, NULL)walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
((o), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 942, __FUNCTION__))))), cp_fold_r, data, nullptr, cp_walk_subtrees
)
;
943 }
944 }
945 x = OMP_FOR_INCR (stmt)(*((const_cast<tree*> (tree_operand_check (((tree_range_check
((stmt), (OMP_FOR), (OACC_LOOP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 945, __FUNCTION__))), (4), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 945, __FUNCTION__)))))
;
946 if (x && TREE_CODE (x)((enum tree_code) (x)->base.code) == TREE_VEC)
947 {
948 n = TREE_VEC_LENGTH (x)((tree_check ((x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 948, __FUNCTION__, (TREE_VEC)))->base.u.length)
;
949 for (i = 0; i < n; i++)
950 {
951 tree o = TREE_VEC_ELT (x, i)(*((const_cast<tree *> (tree_vec_elt_check ((x), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 951, __FUNCTION__)))))
;
952 if (o && TREE_CODE (o)((enum tree_code) (o)->base.code) == MODIFY_EXPR)
953 o = TREE_OPERAND (o, 1)(*((const_cast<tree*> (tree_operand_check ((o), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 953, __FUNCTION__)))))
;
954 if (o && (TREE_CODE (o)((enum tree_code) (o)->base.code) == PLUS_EXPR || TREE_CODE (o)((enum tree_code) (o)->base.code) == MINUS_EXPR
955 || TREE_CODE (o)((enum tree_code) (o)->base.code) == POINTER_PLUS_EXPR))
956 {
957 cp_walk_tree (&TREE_OPERAND (o, 0), cp_fold_r, data, NULL)walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
((o), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 957, __FUNCTION__))))), cp_fold_r, data, nullptr, cp_walk_subtrees
)
;
958 cp_walk_tree (&TREE_OPERAND (o, 1), cp_fold_r, data, NULL)walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
((o), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 958, __FUNCTION__))))), cp_fold_r, data, nullptr, cp_walk_subtrees
)
;
959 }
960 }
961 }
962 cp_walk_tree (&OMP_FOR_PRE_BODY (stmt), cp_fold_r, data, NULL)walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
(((tree_range_check ((stmt), (OMP_FOR), (OACC_LOOP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 962, __FUNCTION__))), (5), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 962, __FUNCTION__))))), cp_fold_r, data, nullptr, cp_walk_subtrees
)
;
963 *walk_subtrees = 0;
964 }
965
966 return NULLnullptr;
967}
968
969/* Fold ALL the trees! FIXME we should be able to remove this, but
970 apparently that still causes optimization regressions. */
971
972void
973cp_fold_function (tree fndecl)
974{
975 hash_set<tree> pset;
976 cp_walk_tree (&DECL_SAVED_TREE (fndecl), cp_fold_r, &pset, NULL)walk_tree_1 (&((tree_check ((fndecl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 976, __FUNCTION__, (FUNCTION_DECL)))->function_decl.saved_tree
), cp_fold_r, &pset, nullptr, cp_walk_subtrees)
;
977}
978
979/* Turn SPACESHIP_EXPR EXPR into GENERIC. */
980
981static tree genericize_spaceship (tree expr)
982{
983 iloc_sentinel s (cp_expr_location (expr));
984 tree type = TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 984, __FUNCTION__))->typed.type)
;
985 tree op0 = TREE_OPERAND (expr, 0)(*((const_cast<tree*> (tree_operand_check ((expr), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 985, __FUNCTION__)))))
;
986 tree op1 = TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 986, __FUNCTION__)))))
;
987 return genericize_spaceship (input_location, type, op0, op1);
988}
989
990/* If EXPR involves an anonymous VLA type, prepend a DECL_EXPR for that type
991 to trigger gimplify_type_sizes; otherwise a cast to pointer-to-VLA confuses
992 the middle-end (c++/88256). If EXPR is a DECL, use add_stmt and return
993 NULL_TREE; otherwise return a COMPOUND_STMT of the DECL_EXPR and EXPR. */
994
995tree
996predeclare_vla (tree expr)
997{
998 tree type = TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 998, __FUNCTION__))->typed.type)
;
999 if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK])
1000 return expr;
1001 if (is_typedef_decl (expr))
1002 type = DECL_ORIGINAL_TYPE (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1002, __FUNCTION__, (TYPE_DECL)))->decl_non_common.result
)
;
1003
1004 /* We need to strip pointers for gimplify_type_sizes. */
1005 tree vla = type;
1006 while (POINTER_TYPE_P (vla)(((enum tree_code) (vla)->base.code) == POINTER_TYPE || ((
enum tree_code) (vla)->base.code) == REFERENCE_TYPE)
)
1007 {
1008 if (TYPE_NAME (vla)((tree_class_check ((vla), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1008, __FUNCTION__))->type_common.name)
)
1009 return expr;
1010 vla = TREE_TYPE (vla)((contains_struct_check ((vla), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1010, __FUNCTION__))->typed.type)
;
1011 }
1012 if (vla == type || TYPE_NAME (vla)((tree_class_check ((vla), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1012, __FUNCTION__))->type_common.name)
1013 || !variably_modified_type_p (vla, NULL_TREE(tree) nullptr))
1014 return expr;
1015
1016 tree decl = build_decl (input_location, TYPE_DECL, NULL_TREE(tree) nullptr, vla);
1017 DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1017, __FUNCTION__))->decl_common.artificial_flag)
= 1;
1018 TYPE_NAME (vla)((tree_class_check ((vla), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1018, __FUNCTION__))->type_common.name)
= decl;
1019 tree dexp = build_stmt (input_location, DECL_EXPR, decl);
1020 if (DECL_P (expr)(tree_code_type[(int) (((enum tree_code) (expr)->base.code
))] == tcc_declaration)
)
1021 {
1022 add_stmt (dexp);
1023 return NULL_TREE(tree) nullptr;
1024 }
1025 else
1026 {
1027 expr = build2 (COMPOUND_EXPR, type, dexp, expr);
1028 return expr;
1029 }
1030}
1031
1032/* Perform any pre-gimplification lowering of C++ front end trees to
1033 GENERIC. */
1034
1035static tree
1036cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data)
1037{
1038 tree stmt = *stmt_p;
1039 struct cp_genericize_data *wtd = (struct cp_genericize_data *) data;
1040 hash_set<tree> *p_set = wtd->p_set;
1041
1042 /* If in an OpenMP context, note var uses. */
1043 if (__builtin_expect (wtd->omp_ctx != NULLnullptr, 0)
1044 && (VAR_P (stmt)(((enum tree_code) (stmt)->base.code) == VAR_DECL)
1045 || TREE_CODE (stmt)((enum tree_code) (stmt)->base.code) == PARM_DECL
1046 || TREE_CODE (stmt)((enum tree_code) (stmt)->base.code) == RESULT_DECL)
1047 && omp_var_to_track (stmt))
1048 omp_cxx_notice_variable (wtd->omp_ctx, stmt);
1049
1050 /* Don't dereference parms in a thunk, pass the references through. */
1051 if ((TREE_CODE (stmt)((enum tree_code) (stmt)->base.code) == CALL_EXPR && call_from_lambda_thunk_p (stmt))
1052 || (TREE_CODE (stmt)((enum tree_code) (stmt)->base.code) == AGGR_INIT_EXPR && AGGR_INIT_FROM_THUNK_P (stmt)((tree_check ((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1052, __FUNCTION__, (AGGR_INIT_EXPR)))->base.protected_flag
)
))
1053 {
1054 *walk_subtrees = 0;
1055 return NULLnullptr;
1056 }
1057
1058 /* Dereference invisible reference parms. */
1059 if (wtd->handle_invisiref_parm_p && is_invisiref_parm (stmt))
1060 {
1061 *stmt_p = convert_from_reference (stmt);
1062 p_set->add (*stmt_p);
1063 *walk_subtrees = 0;
1064 return NULLnullptr;
1065 }
1066
1067 /* Map block scope extern declarations to visible declarations with the
1068 same name and type in outer scopes if any. */
1069 if (VAR_OR_FUNCTION_DECL_P (stmt)(((enum tree_code) (stmt)->base.code) == VAR_DECL || ((enum
tree_code) (stmt)->base.code) == FUNCTION_DECL)
&& DECL_LOCAL_DECL_P (stmt)((contains_struct_check (((tree_check2 ((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1069, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1069, __FUNCTION__))->decl_common.lang_flag_0)
)
1070 if (tree alias = DECL_LOCAL_DECL_ALIAS (stmt)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((void)(!(((contains_struct_check (((tree_check2 ((stmt),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__), 0 : 0)), stmt)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__))->decl_common.lang_specific); if (!(
(((enum tree_code) ((((void)(!(((contains_struct_check (((tree_check2
((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__), 0 : 0)), stmt))->base.code) == VAR_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__), 0 : 0)), stmt))->base.code) == FUNCTION_DECL
) || ((enum tree_code) ((((void)(!(((contains_struct_check ((
(tree_check2 ((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__), 0 : 0)), stmt))->base.code) == FIELD_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__), 0 : 0)), stmt))->base.code) == CONST_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__), 0 : 0)), stmt))->base.code) == TYPE_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__), 0 : 0)), stmt))->base.code) == TEMPLATE_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__), 0 : 0)), stmt))->base.code) == USING_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__), 0 : 0)), stmt))->base.code) == CONCEPT_DECL
)) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1070, __FUNCTION__); &lt->u.min; })->access)
)
1071 {
1072 if (alias != error_mark_nodeglobal_trees[TI_ERROR_MARK])
1073 {
1074 *stmt_p = alias;
1075 TREE_USED (alias)((alias)->base.used_flag) |= TREE_USED (stmt)((stmt)->base.used_flag);
1076 }
1077 *walk_subtrees = 0;
1078 return NULLnullptr;
1079 }
1080
1081 if (TREE_CODE (stmt)((enum tree_code) (stmt)->base.code) == INTEGER_CST
1082 && TYPE_REF_P (TREE_TYPE (stmt))(((enum tree_code) (((contains_struct_check ((stmt), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1082, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)
1083 && (flag_sanitizeglobal_options.x_flag_sanitize & (SANITIZE_NULL | SANITIZE_ALIGNMENT))
1084 && !wtd->no_sanitize_p)
1085 {
1086 ubsan_maybe_instrument_reference (stmt_p);
1087 if (*stmt_p != stmt)
1088 {
1089 *walk_subtrees = 0;
1090 return NULL_TREE(tree) nullptr;
1091 }
1092 }
1093
1094 /* Other than invisiref parms, don't walk the same tree twice. */
1095 if (p_set->contains (stmt))
1096 {
1097 *walk_subtrees = 0;
1098 return NULL_TREE(tree) nullptr;
1099 }
1100
1101 switch (TREE_CODE (stmt)((enum tree_code) (stmt)->base.code))
1102 {
1103 case ADDR_EXPR:
1104 if (is_invisiref_parm (TREE_OPERAND (stmt, 0)(*((const_cast<tree*> (tree_operand_check ((stmt), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1104, __FUNCTION__)))))
))
1105 {
1106 /* If in an OpenMP context, note var uses. */
1107 if (__builtin_expect (wtd->omp_ctx != NULLnullptr, 0)
1108 && omp_var_to_track (TREE_OPERAND (stmt, 0)(*((const_cast<tree*> (tree_operand_check ((stmt), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1108, __FUNCTION__)))))
))
1109 omp_cxx_notice_variable (wtd->omp_ctx, TREE_OPERAND (stmt, 0)(*((const_cast<tree*> (tree_operand_check ((stmt), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1109, __FUNCTION__)))))
);
1110 *stmt_p = fold_convert (TREE_TYPE (stmt), TREE_OPERAND (stmt, 0))fold_convert_loc (((location_t) 0), ((contains_struct_check (
(stmt), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1110, __FUNCTION__))->typed.type), (*((const_cast<tree
*> (tree_operand_check ((stmt), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1110, __FUNCTION__))))))
;
1111 *walk_subtrees = 0;
1112 }
1113 break;
1114
1115 case RETURN_EXPR:
1116 if (TREE_OPERAND (stmt, 0)(*((const_cast<tree*> (tree_operand_check ((stmt), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1116, __FUNCTION__)))))
&& is_invisiref_parm (TREE_OPERAND (stmt, 0)(*((const_cast<tree*> (tree_operand_check ((stmt), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1116, __FUNCTION__)))))
))
1117 /* Don't dereference an invisiref RESULT_DECL inside a RETURN_EXPR. */
1118 *walk_subtrees = 0;
1119 break;
1120
1121 case OMP_CLAUSE:
1122 switch (OMP_CLAUSE_CODE (stmt)((tree_check ((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1122, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code
)
1123 {
1124 case OMP_CLAUSE_LASTPRIVATE:
1125 /* Don't dereference an invisiref in OpenMP clauses. */
1126 if (is_invisiref_parm (OMP_CLAUSE_DECL (stmt)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1126, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1126, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1126, __FUNCTION__)))
))
1127 {
1128 *walk_subtrees = 0;
1129 if (OMP_CLAUSE_LASTPRIVATE_STMT (stmt)(*(omp_clause_elt_check (((omp_clause_subcode_check ((stmt), (
OMP_CLAUSE_LASTPRIVATE), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1129, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1129, __FUNCTION__)))
)
1130 cp_walk_tree (&OMP_CLAUSE_LASTPRIVATE_STMT (stmt),walk_tree_1 (&(*(omp_clause_elt_check (((omp_clause_subcode_check
((stmt), (OMP_CLAUSE_LASTPRIVATE), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1130, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1130, __FUNCTION__))), cp_genericize_r, data, nullptr, cp_walk_subtrees
)
1131 cp_genericize_r, data, NULL)walk_tree_1 (&(*(omp_clause_elt_check (((omp_clause_subcode_check
((stmt), (OMP_CLAUSE_LASTPRIVATE), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1130, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1130, __FUNCTION__))), cp_genericize_r, data, nullptr, cp_walk_subtrees
)
;
1132 }
1133 break;
1134 case OMP_CLAUSE_PRIVATE:
1135 /* Don't dereference an invisiref in OpenMP clauses. */
1136 if (is_invisiref_parm (OMP_CLAUSE_DECL (stmt)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1136, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1136, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1136, __FUNCTION__)))
))
1137 *walk_subtrees = 0;
1138 else if (wtd->omp_ctx != NULLnullptr)
1139 {
1140 /* Private clause doesn't cause any references to the
1141 var in outer contexts, avoid calling
1142 omp_cxx_notice_variable for it. */
1143 struct cp_genericize_omp_taskreg *old = wtd->omp_ctx;
1144 wtd->omp_ctx = NULLnullptr;
1145 cp_walk_tree (&OMP_CLAUSE_DECL (stmt), cp_genericize_r,walk_tree_1 (&(*(omp_clause_elt_check (((omp_clause_range_check
(((tree_check ((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1145, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1145, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1145, __FUNCTION__))), cp_genericize_r, data, nullptr, cp_walk_subtrees
)
1146 data, NULL)walk_tree_1 (&(*(omp_clause_elt_check (((omp_clause_range_check
(((tree_check ((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1145, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1145, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1145, __FUNCTION__))), cp_genericize_r, data, nullptr, cp_walk_subtrees
)
;
1147 wtd->omp_ctx = old;
1148 *walk_subtrees = 0;
1149 }
1150 break;
1151 case OMP_CLAUSE_SHARED:
1152 case OMP_CLAUSE_FIRSTPRIVATE:
1153 case OMP_CLAUSE_COPYIN:
1154 case OMP_CLAUSE_COPYPRIVATE:
1155 case OMP_CLAUSE_INCLUSIVE:
1156 case OMP_CLAUSE_EXCLUSIVE:
1157 /* Don't dereference an invisiref in OpenMP clauses. */
1158 if (is_invisiref_parm (OMP_CLAUSE_DECL (stmt)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1158, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1158, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1158, __FUNCTION__)))
))
1159 *walk_subtrees = 0;
1160 break;
1161 case OMP_CLAUSE_REDUCTION:
1162 case OMP_CLAUSE_IN_REDUCTION:
1163 case OMP_CLAUSE_TASK_REDUCTION:
1164 /* Don't dereference an invisiref in reduction clause's
1165 OMP_CLAUSE_DECL either. OMP_CLAUSE_REDUCTION_{INIT,MERGE}
1166 still needs to be genericized. */
1167 if (is_invisiref_parm (OMP_CLAUSE_DECL (stmt)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1167, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1167, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1167, __FUNCTION__)))
))
1168 {
1169 *walk_subtrees = 0;
1170 if (OMP_CLAUSE_REDUCTION_INIT (stmt)(*(omp_clause_elt_check (((omp_clause_range_check ((stmt), (OMP_CLAUSE_REDUCTION
), (OMP_CLAUSE_IN_REDUCTION), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1170, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1170, __FUNCTION__)))
)
1171 cp_walk_tree (&OMP_CLAUSE_REDUCTION_INIT (stmt),walk_tree_1 (&(*(omp_clause_elt_check (((omp_clause_range_check
((stmt), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1171, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1171, __FUNCTION__))), cp_genericize_r, data, nullptr, cp_walk_subtrees
)
1172 cp_genericize_r, data, NULL)walk_tree_1 (&(*(omp_clause_elt_check (((omp_clause_range_check
((stmt), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1171, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1171, __FUNCTION__))), cp_genericize_r, data, nullptr, cp_walk_subtrees
)
;
1173 if (OMP_CLAUSE_REDUCTION_MERGE (stmt)(*(omp_clause_elt_check (((omp_clause_range_check ((stmt), (OMP_CLAUSE_REDUCTION
), (OMP_CLAUSE_IN_REDUCTION), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1173, __FUNCTION__))), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1173, __FUNCTION__)))
)
1174 cp_walk_tree (&OMP_CLAUSE_REDUCTION_MERGE (stmt),walk_tree_1 (&(*(omp_clause_elt_check (((omp_clause_range_check
((stmt), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1174, __FUNCTION__))), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1174, __FUNCTION__))), cp_genericize_r, data, nullptr, cp_walk_subtrees
)
1175 cp_genericize_r, data, NULL)walk_tree_1 (&(*(omp_clause_elt_check (((omp_clause_range_check
((stmt), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1174, __FUNCTION__))), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1174, __FUNCTION__))), cp_genericize_r, data, nullptr, cp_walk_subtrees
)
;
1176 }
1177 break;
1178 default:
1179 break;
1180 }
1181 break;
1182
1183 /* Due to the way voidify_wrapper_expr is written, we don't get a chance
1184 to lower this construct before scanning it, so we need to lower these
1185 before doing anything else. */
1186 case CLEANUP_STMT:
1187 *stmt_p = build2_loc (EXPR_LOCATION (stmt)((((stmt)) && ((tree_code_type[(int) (((enum tree_code
) ((stmt))->base.code))]) >= tcc_reference && (
tree_code_type[(int) (((enum tree_code) ((stmt))->base.code
))]) <= tcc_expression)) ? (stmt)->exp.locus : ((location_t
) 0))
,
1188 CLEANUP_EH_ONLY (stmt)((stmt)->base.static_flag) ? TRY_CATCH_EXPR
1189 : TRY_FINALLY_EXPR,
1190 void_type_nodeglobal_trees[TI_VOID_TYPE],
1191 CLEANUP_BODY (stmt)(*((const_cast<tree*> (tree_operand_check (((tree_check
((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1191, __FUNCTION__, (CLEANUP_STMT)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1191, __FUNCTION__)))))
,
1192 CLEANUP_EXPR (stmt)(*((const_cast<tree*> (tree_operand_check (((tree_check
((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1192, __FUNCTION__, (CLEANUP_STMT)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1192, __FUNCTION__)))))
);
1193 break;
1194
1195 case IF_STMT:
1196 genericize_if_stmt (stmt_p);
1197 /* *stmt_p has changed, tail recurse to handle it again. */
1198 return cp_genericize_r (stmt_p, walk_subtrees, data);
1199
1200 /* COND_EXPR might have incompatible types in branches if one or both
1201 arms are bitfields. Fix it up now. */
1202 case COND_EXPR:
1203 {
1204 tree type_left
1205 = (TREE_OPERAND (stmt, 1)(*((const_cast<tree*> (tree_operand_check ((stmt), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1205, __FUNCTION__)))))
1206 ? is_bitfield_expr_with_lowered_type (TREE_OPERAND (stmt, 1)(*((const_cast<tree*> (tree_operand_check ((stmt), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1206, __FUNCTION__)))))
)
1207 : NULL_TREE(tree) nullptr);
1208 tree type_right
1209 = (TREE_OPERAND (stmt, 2)(*((const_cast<tree*> (tree_operand_check ((stmt), (2),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1209, __FUNCTION__)))))
1210 ? is_bitfield_expr_with_lowered_type (TREE_OPERAND (stmt, 2)(*((const_cast<tree*> (tree_operand_check ((stmt), (2),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1210, __FUNCTION__)))))
)
1211 : NULL_TREE(tree) nullptr);
1212 if (type_left
1213 && !useless_type_conversion_p (TREE_TYPE (stmt)((contains_struct_check ((stmt), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1213, __FUNCTION__))->typed.type)
,
1214 TREE_TYPE (TREE_OPERAND (stmt, 1))((contains_struct_check (((*((const_cast<tree*> (tree_operand_check
((stmt), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1214, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1214, __FUNCTION__))->typed.type)
))
1215 {
1216 TREE_OPERAND (stmt, 1)(*((const_cast<tree*> (tree_operand_check ((stmt), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1216, __FUNCTION__)))))
1217 = fold_convert (type_left, TREE_OPERAND (stmt, 1))fold_convert_loc (((location_t) 0), type_left, (*((const_cast
<tree*> (tree_operand_check ((stmt), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1217, __FUNCTION__))))))
;
1218 gcc_assert (useless_type_conversion_p (TREE_TYPE (stmt),((void)(!(useless_type_conversion_p (((contains_struct_check (
(stmt), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1218, __FUNCTION__))->typed.type), type_left)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1219, __FUNCTION__), 0 : 0))
1219 type_left))((void)(!(useless_type_conversion_p (((contains_struct_check (
(stmt), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1218, __FUNCTION__))->typed.type), type_left)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1219, __FUNCTION__), 0 : 0))
;
1220 }
1221 if (type_right
1222 && !useless_type_conversion_p (TREE_TYPE (stmt)((contains_struct_check ((stmt), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1222, __FUNCTION__))->typed.type)
,
1223 TREE_TYPE (TREE_OPERAND (stmt, 2))((contains_struct_check (((*((const_cast<tree*> (tree_operand_check
((stmt), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1223, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1223, __FUNCTION__))->typed.type)
))
1224 {
1225 TREE_OPERAND (stmt, 2)(*((const_cast<tree*> (tree_operand_check ((stmt), (2),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1225, __FUNCTION__)))))
1226 = fold_convert (type_right, TREE_OPERAND (stmt, 2))fold_convert_loc (((location_t) 0), type_right, (*((const_cast
<tree*> (tree_operand_check ((stmt), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1226, __FUNCTION__))))))
;
1227 gcc_assert (useless_type_conversion_p (TREE_TYPE (stmt),((void)(!(useless_type_conversion_p (((contains_struct_check (
(stmt), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1227, __FUNCTION__))->typed.type), type_right)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1228, __FUNCTION__), 0 : 0))
1228 type_right))((void)(!(useless_type_conversion_p (((contains_struct_check (
(stmt), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1227, __FUNCTION__))->typed.type), type_right)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1228, __FUNCTION__), 0 : 0))
;
1229 }
1230 }
1231 break;
1232
1233 case BIND_EXPR:
1234 if (__builtin_expect (wtd->omp_ctx != NULLnullptr, 0))
1235 {
1236 tree decl;
1237 for (decl = BIND_EXPR_VARS (stmt)((*((const_cast<tree*> (tree_operand_check (((tree_check
((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1237, __FUNCTION__, (BIND_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1237, __FUNCTION__))))))
; decl; decl = DECL_CHAIN (decl)(((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1237, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1237, __FUNCTION__))->common.chain))
)
1238 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)
1239 && !DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1239, __FUNCTION__))->decl_common.decl_flag_1)
1240 && omp_var_to_track (decl))
1241 {
1242 splay_tree_node n
1243 = splay_tree_lookup (wtd->omp_ctx->variables,
1244 (splay_tree_key) decl);
1245 if (n == NULLnullptr)
1246 splay_tree_insert (wtd->omp_ctx->variables,
1247 (splay_tree_key) decl,
1248 TREE_STATIC (decl)((decl)->base.static_flag)
1249 ? OMP_CLAUSE_DEFAULT_SHARED
1250 : OMP_CLAUSE_DEFAULT_PRIVATE);
1251 }
1252 }
1253 if (sanitize_flags_p (SANITIZE_NULL | SANITIZE_ALIGNMENT | SANITIZE_VPTR))
1254 {
1255 /* The point here is to not sanitize static initializers. */
1256 bool no_sanitize_p = wtd->no_sanitize_p;
1257 wtd->no_sanitize_p = true;
1258 for (tree decl = BIND_EXPR_VARS (stmt)((*((const_cast<tree*> (tree_operand_check (((tree_check
((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1258, __FUNCTION__, (BIND_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1258, __FUNCTION__))))))
;
1259 decl;
1260 decl = DECL_CHAIN (decl)(((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1260, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1260, __FUNCTION__))->common.chain))
)
1261 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)
1262 && TREE_STATIC (decl)((decl)->base.static_flag)
1263 && DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1263, __FUNCTION__))->decl_common.initial)
)
1264 cp_walk_tree (&DECL_INITIAL (decl), cp_genericize_r, data, NULL)walk_tree_1 (&((contains_struct_check ((decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1264, __FUNCTION__))->decl_common.initial), cp_genericize_r
, data, nullptr, cp_walk_subtrees)
;
1265 wtd->no_sanitize_p = no_sanitize_p;
1266 }
1267 wtd->bind_expr_stack.safe_push (stmt);
1268 cp_walk_tree (&BIND_EXPR_BODY (stmt),walk_tree_1 (&((*((const_cast<tree*> (tree_operand_check
(((tree_check ((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1268, __FUNCTION__, (BIND_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1268, __FUNCTION__)))))), cp_genericize_r, data, nullptr, cp_walk_subtrees
)
1269 cp_genericize_r, data, NULL)walk_tree_1 (&((*((const_cast<tree*> (tree_operand_check
(((tree_check ((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1268, __FUNCTION__, (BIND_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1268, __FUNCTION__)))))), cp_genericize_r, data, nullptr, cp_walk_subtrees
)
;
1270 wtd->bind_expr_stack.pop ();
1271 break;
1272
1273 case USING_STMT:
1274 {
1275 tree block = NULL_TREE(tree) nullptr;
1276
1277 /* Get the innermost inclosing GIMPLE_BIND that has a non NULL
1278 BLOCK, and append an IMPORTED_DECL to its
1279 BLOCK_VARS chained list. */
1280 if (wtd->bind_expr_stack.exists ())
1281 {
1282 int i;
1283 for (i = wtd->bind_expr_stack.length () - 1; i >= 0; i--)
1284 if ((block = BIND_EXPR_BLOCK (wtd->bind_expr_stack[i])((*((const_cast<tree*> (tree_operand_check (((tree_check
((wtd->bind_expr_stack[i]), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1284, __FUNCTION__, (BIND_EXPR)))), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1284, __FUNCTION__))))))
))
1285 break;
1286 }
1287 if (block)
1288 {
1289 tree decl = TREE_OPERAND (stmt, 0)(*((const_cast<tree*> (tree_operand_check ((stmt), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1289, __FUNCTION__)))))
;
1290 gcc_assert (decl)((void)(!(decl) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1290, __FUNCTION__), 0 : 0))
;
1291
1292 if (undeduced_auto_decl (decl))
1293 /* Omit from the GENERIC, the back-end can't handle it. */;
1294 else
1295 {
1296 tree using_directive = make_node (IMPORTED_DECL);
1297 TREE_TYPE (using_directive)((contains_struct_check ((using_directive), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1297, __FUNCTION__))->typed.type)
= void_type_nodeglobal_trees[TI_VOID_TYPE];
1298 DECL_CONTEXT (using_directive)((contains_struct_check ((using_directive), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1298, __FUNCTION__))->decl_minimal.context)
= current_function_decl;
1299
1300 IMPORTED_DECL_ASSOCIATED_DECL (using_directive)(((contains_struct_check (((tree_check ((using_directive), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1300, __FUNCTION__, (IMPORTED_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1300, __FUNCTION__))->decl_common.initial))
= decl;
1301 DECL_CHAIN (using_directive)(((contains_struct_check (((contains_struct_check ((using_directive
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1301, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1301, __FUNCTION__))->common.chain))
= BLOCK_VARS (block)((tree_check ((block), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1301, __FUNCTION__, (BLOCK)))->block.vars)
;
1302 BLOCK_VARS (block)((tree_check ((block), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1302, __FUNCTION__, (BLOCK)))->block.vars)
= using_directive;
1303 }
1304 }
1305 /* The USING_STMT won't appear in GENERIC. */
1306 *stmt_p = build1 (NOP_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE], integer_zero_nodeglobal_trees[TI_INTEGER_ZERO]);
1307 *walk_subtrees = 0;
1308 }
1309 break;
1310
1311 case DECL_EXPR:
1312 if (TREE_CODE (DECL_EXPR_DECL (stmt))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
(((tree_check ((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1312, __FUNCTION__, (DECL_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1312, __FUNCTION__))))))->base.code)
== USING_DECL)
1313 {
1314 /* Using decls inside DECL_EXPRs are just dropped on the floor. */
1315 *stmt_p = build1 (NOP_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE], integer_zero_nodeglobal_trees[TI_INTEGER_ZERO]);
1316 *walk_subtrees = 0;
1317 }
1318 else
1319 {
1320 tree d = DECL_EXPR_DECL (stmt)(*((const_cast<tree*> (tree_operand_check (((tree_check
((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1320, __FUNCTION__, (DECL_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1320, __FUNCTION__)))))
;
1321 if (VAR_P (d)(((enum tree_code) (d)->base.code) == VAR_DECL))
1322 gcc_assert (CP_DECL_THREAD_LOCAL_P (d) == DECL_THREAD_LOCAL_P (d))((void)(!((((tree_not_check2 (((tree_check ((d), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1322, __FUNCTION__, (VAR_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1322, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)) == ((((d)->base.static_flag) || ((contains_struct_check
((d), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1322, __FUNCTION__))->decl_common.decl_flag_1)) &&
decl_tls_model (d) >= TLS_MODEL_REAL)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1322, __FUNCTION__), 0 : 0))
;
1323 }
1324 break;
1325
1326 case OMP_PARALLEL:
1327 case OMP_TASK:
1328 case OMP_TASKLOOP:
1329 {
1330 struct cp_genericize_omp_taskreg omp_ctx;
1331 tree c, decl;
1332 splay_tree_node n;
1333
1334 *walk_subtrees = 0;
1335 cp_walk_tree (&OMP_CLAUSES (stmt), cp_genericize_r, data, NULL)walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
(((tree_range_check ((stmt), (OACC_PARALLEL), (OMP_SCAN), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1335, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1335, __FUNCTION__))))), cp_genericize_r, data, nullptr, cp_walk_subtrees
)
;
1336 omp_ctx.is_parallel = TREE_CODE (stmt)((enum tree_code) (stmt)->base.code) == OMP_PARALLEL;
1337 omp_ctx.default_shared = omp_ctx.is_parallel;
1338 omp_ctx.outer = wtd->omp_ctx;
1339 omp_ctx.variables = splay_tree_new (splay_tree_compare_decl_uid, 0, 0);
1340 wtd->omp_ctx = &omp_ctx;
1341 for (c = OMP_CLAUSES (stmt)(*((const_cast<tree*> (tree_operand_check (((tree_range_check
((stmt), (OACC_PARALLEL), (OMP_SCAN), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1341, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1341, __FUNCTION__)))))
; c; c = OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1341, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1341, __FUNCTION__))->common.chain)
)
1342 switch (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1342, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code
)
1343 {
1344 case OMP_CLAUSE_SHARED:
1345 case OMP_CLAUSE_PRIVATE:
1346 case OMP_CLAUSE_FIRSTPRIVATE:
1347 case OMP_CLAUSE_LASTPRIVATE:
1348 decl = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1348, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1348, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1348, __FUNCTION__)))
;
1349 if (decl == error_mark_nodeglobal_trees[TI_ERROR_MARK] || !omp_var_to_track (decl))
1350 break;
1351 n = splay_tree_lookup (omp_ctx.variables, (splay_tree_key) decl);
1352 if (n != NULLnullptr)
1353 break;
1354 splay_tree_insert (omp_ctx.variables, (splay_tree_key) decl,
1355 OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1355, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code
== OMP_CLAUSE_SHARED
1356 ? OMP_CLAUSE_DEFAULT_SHARED
1357 : OMP_CLAUSE_DEFAULT_PRIVATE);
1358 if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1358, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code
!= OMP_CLAUSE_PRIVATE && omp_ctx.outer)
1359 omp_cxx_notice_variable (omp_ctx.outer, decl);
1360 break;
1361 case OMP_CLAUSE_DEFAULT:
1362 if (OMP_CLAUSE_DEFAULT_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_DEFAULT), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1362, __FUNCTION__))->omp_clause.subcode.default_kind)
== OMP_CLAUSE_DEFAULT_SHARED)
1363 omp_ctx.default_shared = true;
1364 default:
1365 break;
1366 }
1367 if (TREE_CODE (stmt)((enum tree_code) (stmt)->base.code) == OMP_TASKLOOP)
1368 c_genericize_control_stmt (stmt_p, walk_subtrees, data,
1369 cp_genericize_r, cp_walk_subtrees);
1370 else
1371 cp_walk_tree (&OMP_BODY (stmt), cp_genericize_r, data, NULL)walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
(((tree_range_check ((stmt), (OACC_PARALLEL), (OMP_MASTER), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1371, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1371, __FUNCTION__))))), cp_genericize_r, data, nullptr, cp_walk_subtrees
)
;
1372 wtd->omp_ctx = omp_ctx.outer;
1373 splay_tree_delete (omp_ctx.variables);
1374 }
1375 break;
1376
1377 case OMP_TARGET:
1378 cfun(cfun + 0)->has_omp_target = true;
1379 break;
1380
1381 case TRY_BLOCK:
1382 {
1383 *walk_subtrees = 0;
1384 tree try_block = wtd->try_block;
1385 wtd->try_block = stmt;
1386 cp_walk_tree (&TRY_STMTS (stmt), cp_genericize_r, data, NULL)walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
(((tree_check ((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1386, __FUNCTION__, (TRY_BLOCK)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1386, __FUNCTION__))))), cp_genericize_r, data, nullptr, cp_walk_subtrees
)
;
1387 wtd->try_block = try_block;
1388 cp_walk_tree (&TRY_HANDLERS (stmt), cp_genericize_r, data, NULL)walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
(((tree_check ((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1388, __FUNCTION__, (TRY_BLOCK)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1388, __FUNCTION__))))), cp_genericize_r, data, nullptr, cp_walk_subtrees
)
;
1389 }
1390 break;
1391
1392 case MUST_NOT_THROW_EXPR:
1393 /* MUST_NOT_THROW_COND might be something else with TM. */
1394 if (MUST_NOT_THROW_COND (stmt)(*((const_cast<tree*> (tree_operand_check (((tree_check
((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1394, __FUNCTION__, (MUST_NOT_THROW_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1394, __FUNCTION__)))))
== NULL_TREE(tree) nullptr)
1395 {
1396 *walk_subtrees = 0;
1397 tree try_block = wtd->try_block;
1398 wtd->try_block = stmt;
1399 cp_walk_tree (&TREE_OPERAND (stmt, 0), cp_genericize_r, data, NULL)walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
((stmt), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1399, __FUNCTION__))))), cp_genericize_r, data, nullptr, cp_walk_subtrees
)
;
1400 wtd->try_block = try_block;
1401 }
1402 break;
1403
1404 case THROW_EXPR:
1405 {
1406 location_t loc = location_of (stmt);
1407 if (warning_suppressed_p (stmt /* What warning? */))
1408 /* Never mind. */;
1409 else if (wtd->try_block)
1410 {
1411 if (TREE_CODE (wtd->try_block)((enum tree_code) (wtd->try_block)->base.code) == MUST_NOT_THROW_EXPR)
1412 {
1413 auto_diagnostic_group d;
1414 if (warning_at (loc, OPT_Wterminate,
1415 "%<throw%> will always call %<terminate%>")
1416 && cxx_dialect >= cxx11
1417 && DECL_DESTRUCTOR_P (current_function_decl)((tree_check (((((enum tree_code) (current_function_decl)->
base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(
const_cast<union tree_node *> ((((tree_check ((current_function_decl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1417, __FUNCTION__, (TEMPLATE_DECL))))))))->result : current_function_decl
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1417, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor
)
)
1418 inform (loc, "in C++11 destructors default to %<noexcept%>");
1419 }
1420 }
1421 else
1422 {
1423 if (warn_cxx11_compatglobal_options.x_warn_cxx11_compat && cxx_dialect < cxx11
1424 && DECL_DESTRUCTOR_P (current_function_decl)((tree_check (((((enum tree_code) (current_function_decl)->
base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(
const_cast<union tree_node *> ((((tree_check ((current_function_decl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1424, __FUNCTION__, (TEMPLATE_DECL))))))))->result : current_function_decl
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1424, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor
)
1425 && (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (current_function_decl))((tree_class_check (((tree_check2 ((((contains_struct_check (
(current_function_decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1425, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1425, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1425, __FUNCTION__))->type_non_common.lang_1)
1426 == NULL_TREE(tree) nullptr)
1427 && (get_defaulted_eh_spec (current_function_decl)
1428 == empty_except_speccp_global_trees[CPTI_EMPTY_EXCEPT_SPEC]))
1429 warning_at (loc, OPT_Wc__11_compat,
1430 "in C++11 this %<throw%> will call %<terminate%> "
1431 "because destructors default to %<noexcept%>");
1432 }
1433 }
1434 break;
1435
1436 case CONVERT_EXPR:
1437 gcc_assert (!CONVERT_EXPR_VBASE_PATH (stmt))((void)(!(!((tree_not_check2 (((tree_check ((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1437, __FUNCTION__, (CONVERT_EXPR)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1437, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1437, __FUNCTION__), 0 : 0))
;
1438 break;
1439
1440 case SPACESHIP_EXPR:
1441 *stmt_p = genericize_spaceship (*stmt_p);
1442 break;
1443
1444 case PTRMEM_CST:
1445 /* By the time we get here we're handing off to the back end, so we don't
1446 need or want to preserve PTRMEM_CST anymore. */
1447 *stmt_p = cplus_expand_constant (stmt);
1448 *walk_subtrees = 0;
1449 break;
1450
1451 case MEM_REF:
1452 /* For MEM_REF, make sure not to sanitize the second operand even
1453 if it has reference type. It is just an offset with a type
1454 holding other information. There is no other processing we
1455 need to do for INTEGER_CSTs, so just ignore the second argument
1456 unconditionally. */
1457 cp_walk_tree (&TREE_OPERAND (stmt, 0), cp_genericize_r, data, NULL)walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
((stmt), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1457, __FUNCTION__))))), cp_genericize_r, data, nullptr, cp_walk_subtrees
)
;
1458 *walk_subtrees = 0;
1459 break;
1460
1461 case NOP_EXPR:
1462 *stmt_p = predeclare_vla (*stmt_p);
1463 if (!wtd->no_sanitize_p
1464 && sanitize_flags_p (SANITIZE_NULL | SANITIZE_ALIGNMENT)
1465 && TYPE_REF_P (TREE_TYPE (stmt))(((enum tree_code) (((contains_struct_check ((stmt), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1465, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)
)
1466 ubsan_maybe_instrument_reference (stmt_p);
1467 break;
1468
1469 case CALL_EXPR:
1470 /* Evaluate function concept checks instead of treating them as
1471 normal functions. */
1472 if (concept_check_p (stmt))
1473 {
1474 *stmt_p = evaluate_concept_check (stmt);
1475 * walk_subtrees = 0;
1476 break;
1477 }
1478
1479 if (tree fndecl = cp_get_callee_fndecl_nofold (stmt))
1480 if (DECL_IMMEDIATE_FUNCTION_P (fndecl)(((contains_struct_check (((tree_check (((((enum tree_code) (
fndecl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fndecl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1480, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1480, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1480, __FUNCTION__))->decl_common.lang_specific) ? __extension__
({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code
) (fndecl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fndecl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1480, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl
)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1480, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (fndecl)->base.code) == FUNCTION_DECL ||
(((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((fndecl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1480, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fndecl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1480, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1480, __FUNCTION__); &lt->u.fn; })->immediate_fn_p
: false)
)
1481 {
1482 gcc_assert (source_location_current_p (fndecl))((void)(!(source_location_current_p (fndecl)) ? fancy_abort (
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1482, __FUNCTION__), 0 : 0))
;
1483 *stmt_p = cxx_constant_value (stmt);
1484 break;
1485 }
1486
1487 if (!wtd->no_sanitize_p
1488 && sanitize_flags_p ((SANITIZE_NULL
1489 | SANITIZE_ALIGNMENT | SANITIZE_VPTR)))
1490 {
1491 tree fn = CALL_EXPR_FN (stmt)(*((const_cast<tree*> (tree_operand_check (((tree_check
((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1491, __FUNCTION__, (CALL_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1491, __FUNCTION__)))))
;
1492 if (fn != NULL_TREE(tree) nullptr
1493 && !error_operand_p (fn)
1494 && INDIRECT_TYPE_P (TREE_TYPE (fn))((((enum tree_code) (((contains_struct_check ((fn), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1494, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
) || (((enum tree_code) (((contains_struct_check ((fn), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1494, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
))
1495 && TREE_CODE (TREE_TYPE (TREE_TYPE (fn)))((enum tree_code) (((contains_struct_check ((((contains_struct_check
((fn), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1495, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1495, __FUNCTION__))->typed.type))->base.code)
== METHOD_TYPE)
1496 {
1497 bool is_ctor
1498 = TREE_CODE (fn)((enum tree_code) (fn)->base.code) == ADDR_EXPR
1499 && TREE_CODE (TREE_OPERAND (fn, 0))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((fn), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1499, __FUNCTION__))))))->base.code)
== FUNCTION_DECL
1500 && DECL_CONSTRUCTOR_P (TREE_OPERAND (fn, 0))((tree_check (((((enum tree_code) ((*((const_cast<tree*>
(tree_operand_check ((fn), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1500, __FUNCTION__))))))->base.code) == TEMPLATE_DECL ? (
(struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check (((*((const_cast<tree*> (tree_operand_check
((fn), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1500, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1500, __FUNCTION__, (TEMPLATE_DECL))))))))->result : (*(
(const_cast<tree*> (tree_operand_check ((fn), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1500, __FUNCTION__))))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1500, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor
)
;
1501 if (sanitize_flags_p (SANITIZE_NULL | SANITIZE_ALIGNMENT))
1502 ubsan_maybe_instrument_member_call (stmt, is_ctor);
1503 if (sanitize_flags_p (SANITIZE_VPTR) && !is_ctor)
1504 cp_ubsan_maybe_instrument_member_call (stmt);
1505 }
1506 else if (fn == NULL_TREE(tree) nullptr
1507 && CALL_EXPR_IFN (stmt)((tree_check ((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1507, __FUNCTION__, (CALL_EXPR)))->base.u.ifn)
== IFN_UBSAN_NULL
1508 && TREE_CODE (CALL_EXPR_ARG (stmt, 0))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
(((tree_check ((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1508, __FUNCTION__, (CALL_EXPR)))), ((0) + 3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1508, __FUNCTION__))))))->base.code)
== INTEGER_CST
1509 && TYPE_REF_P (TREE_TYPE (CALL_EXPR_ARG (stmt, 0)))(((enum tree_code) (((contains_struct_check (((*((const_cast<
tree*> (tree_operand_check (((tree_check ((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1509, __FUNCTION__, (CALL_EXPR)))), ((0) + 3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1509, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1509, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)
)
1510 *walk_subtrees = 0;
1511 }
1512 /* Fall through. */
1513 case AGGR_INIT_EXPR:
1514 /* For calls to a multi-versioned function, overload resolution
1515 returns the function with the highest target priority, that is,
1516 the version that will checked for dispatching first. If this
1517 version is inlinable, a direct call to this version can be made
1518 otherwise the call should go through the dispatcher. */
1519 {
1520 tree fn = cp_get_callee_fndecl_nofold (stmt);
1521 if (fn && DECL_FUNCTION_VERSIONED (fn)((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1521, __FUNCTION__, (FUNCTION_DECL)))->function_decl.versioned_function
)
1522 && (current_function_decl == NULLnullptr
1523 || !targetm.target_option.can_inline_p (current_function_decl,
1524 fn)))
1525 if (tree dis = get_function_version_dispatcher (fn))
1526 {
1527 mark_versions_used (dis);
1528 dis = build_address (dis);
1529 if (TREE_CODE (stmt)((enum tree_code) (stmt)->base.code) == CALL_EXPR)
1530 CALL_EXPR_FN (stmt)(*((const_cast<tree*> (tree_operand_check (((tree_check
((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1530, __FUNCTION__, (CALL_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1530, __FUNCTION__)))))
= dis;
1531 else
1532 AGGR_INIT_EXPR_FN (stmt)(*((const_cast<tree*> (tree_operand_check (((tree_check
((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1532, __FUNCTION__, (AGGR_INIT_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1532, __FUNCTION__)))))
= dis;
1533 }
1534 }
1535 break;
1536
1537 case TARGET_EXPR:
1538 if (TARGET_EXPR_INITIAL (stmt)(*(tree_operand_check_code ((stmt), (TARGET_EXPR), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1538, __FUNCTION__)))
1539 && TREE_CODE (TARGET_EXPR_INITIAL (stmt))((enum tree_code) ((*(tree_operand_check_code ((stmt), (TARGET_EXPR
), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1539, __FUNCTION__))))->base.code)
== CONSTRUCTOR
1540 && CONSTRUCTOR_PLACEHOLDER_BOUNDARY (TARGET_EXPR_INITIAL (stmt))(((tree_not_check2 (((tree_check (((*(tree_operand_check_code
((stmt), (TARGET_EXPR), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1540, __FUNCTION__)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1540, __FUNCTION__, (CONSTRUCTOR)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1540, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_5))
)
1541 TARGET_EXPR_NO_ELIDE (stmt)((tree_check ((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1541, __FUNCTION__, (TARGET_EXPR)))->base.private_flag)
= 1;
1542 break;
1543
1544 case TEMPLATE_ID_EXPR:
1545 gcc_assert (concept_check_p (stmt))((void)(!(concept_check_p (stmt)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1545, __FUNCTION__), 0 : 0))
;
1546 /* Emit the value of the concept check. */
1547 *stmt_p = evaluate_concept_check (stmt);
1548 walk_subtrees = 0;
1549 break;
1550
1551 case OMP_DISTRIBUTE:
1552 /* Need to explicitly instantiate copy ctors on class iterators of
1553 composite distribute parallel for. */
1554 if (OMP_FOR_INIT (*stmt_p)(*((const_cast<tree*> (tree_operand_check (((tree_range_check
((*stmt_p), (OMP_FOR), (OACC_LOOP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1554, __FUNCTION__))), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1554, __FUNCTION__)))))
== NULL_TREE(tree) nullptr)
1555 {
1556 tree *data[4] = { NULLnullptr, NULLnullptr, NULLnullptr, NULLnullptr };
1557 tree inner = walk_tree (&OMP_FOR_BODY (*stmt_p),walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
(((tree_range_check ((*stmt_p), (OMP_FOR), (OACC_LOOP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1557, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1557, __FUNCTION__))))), find_combined_omp_for, data, nullptr
, nullptr)
1558 find_combined_omp_for, data, NULL)walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
(((tree_range_check ((*stmt_p), (OMP_FOR), (OACC_LOOP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1557, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1557, __FUNCTION__))))), find_combined_omp_for, data, nullptr
, nullptr)
;
1559 if (inner != NULL_TREE(tree) nullptr
1560 && TREE_CODE (inner)((enum tree_code) (inner)->base.code) == OMP_FOR)
1561 {
1562 for (int i = 0; i < TREE_VEC_LENGTH (OMP_FOR_INIT (inner))((tree_check (((*((const_cast<tree*> (tree_operand_check
(((tree_range_check ((inner), (OMP_FOR), (OACC_LOOP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1562, __FUNCTION__))), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1562, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1562, __FUNCTION__, (TREE_VEC)))->base.u.length)
; i++)
1563 if (OMP_FOR_ORIG_DECLS (inner)(*((const_cast<tree*> (tree_operand_check (((tree_range_check
((inner), (OMP_FOR), (OACC_LOOP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1563, __FUNCTION__))), (6), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1563, __FUNCTION__)))))
1564 && TREE_CODE (TREE_VEC_ELT (OMP_FOR_ORIG_DECLS (inner),((enum tree_code) ((*((const_cast<tree *> (tree_vec_elt_check
(((*((const_cast<tree*> (tree_operand_check (((tree_range_check
((inner), (OMP_FOR), (OACC_LOOP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1564, __FUNCTION__))), (6), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1564, __FUNCTION__)))))), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1565, __FUNCTION__))))))->base.code)
1565 i))((enum tree_code) ((*((const_cast<tree *> (tree_vec_elt_check
(((*((const_cast<tree*> (tree_operand_check (((tree_range_check
((inner), (OMP_FOR), (OACC_LOOP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1564, __FUNCTION__))), (6), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1564, __FUNCTION__)))))), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1565, __FUNCTION__))))))->base.code)
== TREE_LIST
1566 && TREE_PURPOSE (TREE_VEC_ELT (OMP_FOR_ORIG_DECLS (inner),((tree_check (((*((const_cast<tree *> (tree_vec_elt_check
(((*((const_cast<tree*> (tree_operand_check (((tree_range_check
((inner), (OMP_FOR), (OACC_LOOP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1566, __FUNCTION__))), (6), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1566, __FUNCTION__)))))), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1567, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1567, __FUNCTION__, (TREE_LIST)))->list.purpose)
1567 i))((tree_check (((*((const_cast<tree *> (tree_vec_elt_check
(((*((const_cast<tree*> (tree_operand_check (((tree_range_check
((inner), (OMP_FOR), (OACC_LOOP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1566, __FUNCTION__))), (6), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1566, __FUNCTION__)))))), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1567, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1567, __FUNCTION__, (TREE_LIST)))->list.purpose)
)
1568 {
1569 tree orig = TREE_VEC_ELT (OMP_FOR_ORIG_DECLS (inner), i)(*((const_cast<tree *> (tree_vec_elt_check (((*((const_cast
<tree*> (tree_operand_check (((tree_range_check ((inner
), (OMP_FOR), (OACC_LOOP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1569, __FUNCTION__))), (6), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1569, __FUNCTION__)))))), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1569, __FUNCTION__)))))
;
1570 /* Class iterators aren't allowed on OMP_SIMD, so the only
1571 case we need to solve is distribute parallel for. */
1572 gcc_assert (TREE_CODE (inner) == OMP_FOR((void)(!(((enum tree_code) (inner)->base.code) == OMP_FOR
&& data[1]) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1573, __FUNCTION__), 0 : 0))
1573 && data[1])((void)(!(((enum tree_code) (inner)->base.code) == OMP_FOR
&& data[1]) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1573, __FUNCTION__), 0 : 0))
;
1574 tree orig_decl = TREE_PURPOSE (orig)((tree_check ((orig), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1574, __FUNCTION__, (TREE_LIST)))->list.purpose)
;
1575 tree c, cl = NULL_TREE(tree) nullptr;
1576 for (c = OMP_FOR_CLAUSES (inner)(*((const_cast<tree*> (tree_operand_check (((tree_range_check
((inner), (OMP_FOR), (OACC_LOOP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1576, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1576, __FUNCTION__)))))
;
1577 c; c = OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1577, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1577, __FUNCTION__))->common.chain)
)
1578 if ((OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1578, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code
== OMP_CLAUSE_PRIVATE
1579 || OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1579, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code
== OMP_CLAUSE_LASTPRIVATE)
1580 && OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1580, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1580, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1580, __FUNCTION__)))
== orig_decl)
1581 {
1582 cl = c;
1583 break;
1584 }
1585 if (cl == NULL_TREE(tree) nullptr)
1586 {
1587 for (c = OMP_PARALLEL_CLAUSES (*data[1])(*((const_cast<tree*> (tree_operand_check (((tree_check
((*data[1]), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1587, __FUNCTION__, (OMP_PARALLEL)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1587, __FUNCTION__)))))
;
1588 c; c = OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1588, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1588, __FUNCTION__))->common.chain)
)
1589 if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1589, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code
== OMP_CLAUSE_PRIVATE
1590 && OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1590, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1590, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1590, __FUNCTION__)))
== orig_decl)
1591 {
1592 cl = c;
1593 break;
1594 }
1595 }
1596 if (cl)
1597 {
1598 orig_decl = require_complete_type (orig_decl);
1599 tree inner_type = TREE_TYPE (orig_decl)((contains_struct_check ((orig_decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1599, __FUNCTION__))->typed.type)
;
1600 if (orig_decl == error_mark_nodeglobal_trees[TI_ERROR_MARK])
1601 continue;
1602 if (TYPE_REF_P (TREE_TYPE (orig_decl))(((enum tree_code) (((contains_struct_check ((orig_decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1602, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)
)
1603 inner_type = TREE_TYPE (inner_type)((contains_struct_check ((inner_type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1603, __FUNCTION__))->typed.type)
;
1604
1605 while (TREE_CODE (inner_type)((enum tree_code) (inner_type)->base.code) == ARRAY_TYPE)
1606 inner_type = TREE_TYPE (inner_type)((contains_struct_check ((inner_type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1606, __FUNCTION__))->typed.type)
;
1607 get_copy_ctor (inner_type, tf_warning_or_error);
1608 }
1609 }
1610 }
1611 }
1612 /* FALLTHRU */
1613
1614 case FOR_STMT:
1615 case WHILE_STMT:
1616 case DO_STMT:
1617 case SWITCH_STMT:
1618 case CONTINUE_STMT:
1619 case BREAK_STMT:
1620 case OMP_FOR:
1621 case OMP_SIMD:
1622 case OMP_LOOP:
1623 case OACC_LOOP:
1624 case STATEMENT_LIST:
1625 /* These cases are handled by shared code. */
1626 c_genericize_control_stmt (stmt_p, walk_subtrees, data,
1627 cp_genericize_r, cp_walk_subtrees);
1628 break;
1629
1630 case BIT_CAST_EXPR:
1631 *stmt_p = build1_loc (EXPR_LOCATION (stmt)((((stmt)) && ((tree_code_type[(int) (((enum tree_code
) ((stmt))->base.code))]) >= tcc_reference && (
tree_code_type[(int) (((enum tree_code) ((stmt))->base.code
))]) <= tcc_expression)) ? (stmt)->exp.locus : ((location_t
) 0))
, VIEW_CONVERT_EXPR,
1632 TREE_TYPE (stmt)((contains_struct_check ((stmt), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1632, __FUNCTION__))->typed.type)
, TREE_OPERAND (stmt, 0)(*((const_cast<tree*> (tree_operand_check ((stmt), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1632, __FUNCTION__)))))
);
1633 break;
1634
1635 default:
1636 if (IS_TYPE_OR_DECL_P (stmt)((tree_code_type[(int) (((enum tree_code) (stmt)->base.code
))] == tcc_type) || (tree_code_type[(int) (((enum tree_code) (
stmt)->base.code))] == tcc_declaration))
)
1637 *walk_subtrees = 0;
1638 break;
1639 }
1640
1641 p_set->add (*stmt_p);
1642
1643 return NULLnullptr;
1644}
1645
1646/* Lower C++ front end trees to GENERIC in T_P. */
1647
1648static void
1649cp_genericize_tree (tree* t_p, bool handle_invisiref_parm_p)
1650{
1651 struct cp_genericize_data wtd;
1652
1653 wtd.p_set = new hash_set<tree>;
1654 wtd.bind_expr_stack.create (0);
1655 wtd.omp_ctx = NULLnullptr;
1656 wtd.try_block = NULL_TREE(tree) nullptr;
1657 wtd.no_sanitize_p = false;
1658 wtd.handle_invisiref_parm_p = handle_invisiref_parm_p;
1659 cp_walk_tree (t_p, cp_genericize_r, &wtd, NULL)walk_tree_1 (t_p, cp_genericize_r, &wtd, nullptr, cp_walk_subtrees
)
;
1660 delete wtd.p_set;
1661 if (sanitize_flags_p (SANITIZE_VPTR))
1662 cp_ubsan_instrument_member_accesses (t_p);
1663}
1664
1665/* If a function that should end with a return in non-void
1666 function doesn't obviously end with return, add ubsan
1667 instrumentation code to verify it at runtime. If -fsanitize=return
1668 is not enabled, instrument __builtin_unreachable. */
1669
1670static void
1671cp_maybe_instrument_return (tree fndecl)
1672{
1673 if (VOID_TYPE_P (TREE_TYPE (TREE_TYPE (fndecl)))(((enum tree_code) (((contains_struct_check ((((contains_struct_check
((fndecl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1673, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1673, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
)
1674 || DECL_CONSTRUCTOR_P (fndecl)((tree_check (((((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL
? ((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((fndecl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1674, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1674, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor
)
1675 || DECL_DESTRUCTOR_P (fndecl)((tree_check (((((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL
? ((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((fndecl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1675, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1675, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor
)
1676 || !targetm.warn_func_return (fndecl))
1677 return;
1678
1679 if (!sanitize_flags_p (SANITIZE_RETURN, fndecl)
1680 /* Don't add __builtin_unreachable () if not optimizing, it will not
1681 improve any optimizations in that case, just break UB code.
1682 Don't add it if -fsanitize=unreachable -fno-sanitize=return either,
1683 UBSan covers this with ubsan_instrument_return above where sufficient
1684 information is provided, while the __builtin_unreachable () below
1685 if return sanitization is disabled will just result in hard to
1686 understand runtime error without location. */
1687 && (!optimizeglobal_options.x_optimize
1688 || sanitize_flags_p (SANITIZE_UNREACHABLE, fndecl)))
1689 return;
1690
1691 tree t = DECL_SAVED_TREE (fndecl)((tree_check ((fndecl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1691, __FUNCTION__, (FUNCTION_DECL)))->function_decl.saved_tree
)
;
1692 while (t)
1693 {
1694 switch (TREE_CODE (t)((enum tree_code) (t)->base.code))
1695 {
1696 case BIND_EXPR:
1697 t = BIND_EXPR_BODY (t)((*((const_cast<tree*> (tree_operand_check (((tree_check
((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1697, __FUNCTION__, (BIND_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1697, __FUNCTION__))))))
;
1698 continue;
1699 case TRY_FINALLY_EXPR:
1700 case CLEANUP_POINT_EXPR:
1701 t = TREE_OPERAND (t, 0)(*((const_cast<tree*> (tree_operand_check ((t), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1701, __FUNCTION__)))))
;
1702 continue;
1703 case STATEMENT_LIST:
1704 {
1705 tree_stmt_iterator i = tsi_last (t);
1706 while (!tsi_end_p (i))
1707 {
1708 tree p = tsi_stmt (i);
1709 if (TREE_CODE (p)((enum tree_code) (p)->base.code) != DEBUG_BEGIN_STMT)
1710 break;
1711 tsi_prev (&i);
1712 }
1713 if (!tsi_end_p (i))
1714 {
1715 t = tsi_stmt (i);
1716 continue;
1717 }
1718 }
1719 break;
1720 case RETURN_EXPR:
1721 return;
1722 default:
1723 break;
1724 }
1725 break;
1726 }
1727 if (t == NULL_TREE(tree) nullptr)
1728 return;
1729 tree *p = &DECL_SAVED_TREE (fndecl)((tree_check ((fndecl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1729, __FUNCTION__, (FUNCTION_DECL)))->function_decl.saved_tree
)
;
1730 if (TREE_CODE (*p)((enum tree_code) (*p)->base.code) == BIND_EXPR)
1731 p = &BIND_EXPR_BODY (*p)((*((const_cast<tree*> (tree_operand_check (((tree_check
((*p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1731, __FUNCTION__, (BIND_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1731, __FUNCTION__))))))
;
1732
1733 location_t loc = DECL_SOURCE_LOCATION (fndecl)((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1733, __FUNCTION__))->decl_minimal.locus)
;
1734 if (sanitize_flags_p (SANITIZE_RETURN, fndecl))
1735 t = ubsan_instrument_return (loc);
1736 else
1737 {
1738 tree fndecl = builtin_decl_explicit (BUILT_IN_UNREACHABLE);
1739 t = build_call_expr_loc (BUILTINS_LOCATION((location_t) 1), fndecl, 0);
1740 }
1741
1742 append_to_statement_list (t, p);
1743}
1744
1745void
1746cp_genericize (tree fndecl)
1747{
1748 tree t;
1749
1750 /* Fix up the types of parms passed by invisible reference. */
1751 for (t = DECL_ARGUMENTS (fndecl)((tree_check ((fndecl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1751, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments
)
; t; t = DECL_CHAIN (t)(((contains_struct_check (((contains_struct_check ((t), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1751, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1751, __FUNCTION__))->common.chain))
)
1752 if (TREE_ADDRESSABLE (TREE_TYPE (t))((((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1752, __FUNCTION__))->typed.type))->base.addressable_flag
)
)
1753 {
1754 /* If a function's arguments are copied to create a thunk,
1755 then DECL_BY_REFERENCE will be set -- but the type of the
1756 argument will be a pointer type, so we will never get
1757 here. */
1758 gcc_assert (!DECL_BY_REFERENCE (t))((void)(!(!((tree_check3 ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1758, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL))
)->decl_common.decl_by_reference_flag)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1758, __FUNCTION__), 0 : 0))
;
1759 gcc_assert (DECL_ARG_TYPE (t) != TREE_TYPE (t))((void)(!(((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1759, __FUNCTION__, (PARM_DECL)))->decl_common.initial) !=
((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1759, __FUNCTION__))->typed.type)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1759, __FUNCTION__), 0 : 0))
;
1760 TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1760, __FUNCTION__))->typed.type)
= DECL_ARG_TYPE (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1760, __FUNCTION__, (PARM_DECL)))->decl_common.initial)
;
1761 DECL_BY_REFERENCE (t)((tree_check3 ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1761, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL))
)->decl_common.decl_by_reference_flag)
= 1;
1762 TREE_ADDRESSABLE (t)((t)->base.addressable_flag) = 0;
1763 relayout_decl (t);
1764 }
1765
1766 /* Do the same for the return value. */
1767 if (TREE_ADDRESSABLE (TREE_TYPE (DECL_RESULT (fndecl)))((((contains_struct_check ((((tree_check ((fndecl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1767, __FUNCTION__, (FUNCTION_DECL)))->decl_non_common.result
)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1767, __FUNCTION__))->typed.type))->base.addressable_flag
)
)
1768 {
1769 t = DECL_RESULT (fndecl)((tree_check ((fndecl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1769, __FUNCTION__, (FUNCTION_DECL)))->decl_non_common.result
)
;
1770 TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1770, __FUNCTION__))->typed.type)
= build_reference_type (TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1770, __FUNCTION__))->typed.type)
);
1771 DECL_BY_REFERENCE (t)((tree_check3 ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1771, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL))
)->decl_common.decl_by_reference_flag)
= 1;
1772 TREE_ADDRESSABLE (t)((t)->base.addressable_flag) = 0;
1773 relayout_decl (t);
1774 if (DECL_NAME (t)((contains_struct_check ((t), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1774, __FUNCTION__))->decl_minimal.name)
)
1775 {
1776 /* Adjust DECL_VALUE_EXPR of the original var. */
1777 tree outer = outer_curly_brace_block (current_function_decl);
1778 tree var;
1779
1780 if (outer)
1781 for (var = BLOCK_VARS (outer)((tree_check ((outer), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1781, __FUNCTION__, (BLOCK)))->block.vars)
; var; var = DECL_CHAIN (var)(((contains_struct_check (((contains_struct_check ((var), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1781, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1781, __FUNCTION__))->common.chain))
)
1782 if (VAR_P (var)(((enum tree_code) (var)->base.code) == VAR_DECL)
1783 && DECL_NAME (t)((contains_struct_check ((t), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1783, __FUNCTION__))->decl_minimal.name)
== DECL_NAME (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1783, __FUNCTION__))->decl_minimal.name)
1784 && DECL_HAS_VALUE_EXPR_P (var)((tree_check3 ((var), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1784, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL))
) ->decl_common.decl_flag_2)
1785 && DECL_VALUE_EXPR (var)(decl_value_expr_lookup ((contains_struct_check ((var), (TS_DECL_WRTL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1785, __FUNCTION__))))
== t)
1786 {
1787 tree val = convert_from_reference (t);
1788 SET_DECL_VALUE_EXPR (var, val)(decl_value_expr_insert ((contains_struct_check ((var), (TS_DECL_WRTL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1788, __FUNCTION__)), val))
;
1789 break;
1790 }
1791 }
1792 }
1793
1794 /* If we're a clone, the body is already GIMPLE. */
1795 if (DECL_CLONED_FUNCTION_P (fndecl)(((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1795, __FUNCTION__))->decl_minimal.name) && ((!(
(tree_not_check2 (((tree_check ((((contains_struct_check ((fndecl
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1795, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1795, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1795, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check
((fndecl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1795, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1795, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1795, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)) && !((((contains_struct_check ((fndecl
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1795, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check ((fndecl)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1795, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_DTOR_IDENTIFIER])))
)
1796 return;
1797
1798 /* Allow cp_genericize calls to be nested. */
1799 bc_state_t save_state;
1800 save_bc_state (&save_state);
1801
1802 /* We do want to see every occurrence of the parms, so we can't just use
1803 walk_tree's hash functionality. */
1804 cp_genericize_tree (&DECL_SAVED_TREE (fndecl)((tree_check ((fndecl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1804, __FUNCTION__, (FUNCTION_DECL)))->function_decl.saved_tree
)
, true);
1805
1806 cp_maybe_instrument_return (fndecl);
1807
1808 /* Do everything else. */
1809 c_genericize (fndecl);
1810 restore_bc_state (&save_state);
1811}
1812
1813/* Build code to apply FN to each member of ARG1 and ARG2. FN may be
1814 NULL if there is in fact nothing to do. ARG2 may be null if FN
1815 actually only takes one argument. */
1816
1817static tree
1818cxx_omp_clause_apply_fn (tree fn, tree arg1, tree arg2)
1819{
1820 tree defparm, parm, t;
1821 int i = 0;
1822 int nargs;
1823 tree *argarray;
1824
1825 if (fn == NULLnullptr)
1826 return NULLnullptr;
1827
1828 nargs = list_length (DECL_ARGUMENTS (fn)((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1828, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments
)
);
1829 argarray = XALLOCAVEC (tree, nargs)((tree *) __builtin_alloca(sizeof (tree) * (nargs)));
1830
1831 defparm = TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (fn)))((contains_struct_check ((((tree_check2 ((((contains_struct_check
((fn), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1831, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1831, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1831, __FUNCTION__))->common.chain)
;
1832 if (arg2)
1833 defparm = TREE_CHAIN (defparm)((contains_struct_check ((defparm), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1833, __FUNCTION__))->common.chain)
;
1834
1835 bool is_method = TREE_CODE (TREE_TYPE (fn))((enum tree_code) (((contains_struct_check ((fn), (TS_TYPED),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1835, __FUNCTION__))->typed.type))->base.code)
== METHOD_TYPE;
1836 if (TREE_CODE (TREE_TYPE (arg1))((enum tree_code) (((contains_struct_check ((arg1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1836, __FUNCTION__))->typed.type))->base.code)
== ARRAY_TYPE)
1837 {
1838 tree inner_type = TREE_TYPE (arg1)((contains_struct_check ((arg1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1838, __FUNCTION__))->typed.type)
;
1839 tree start1, end1, p1;
1840 tree start2 = NULLnullptr, p2 = NULLnullptr;
1841 tree ret = NULLnullptr, lab;
1842
1843 start1 = arg1;
1844 start2 = arg2;
1845 do
1846 {
1847 inner_type = TREE_TYPE (inner_type)((contains_struct_check ((inner_type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1847, __FUNCTION__))->typed.type)
;
1848 start1 = build4 (ARRAY_REF, inner_type, start1,
1849 size_zero_nodeglobal_trees[TI_SIZE_ZERO], NULLnullptr, NULLnullptr);
1850 if (arg2)
1851 start2 = build4 (ARRAY_REF, inner_type, start2,
1852 size_zero_nodeglobal_trees[TI_SIZE_ZERO], NULLnullptr, NULLnullptr);
1853 }
1854 while (TREE_CODE (inner_type)((enum tree_code) (inner_type)->base.code) == ARRAY_TYPE);
1855 start1 = build_fold_addr_expr_loc (input_location, start1);
1856 if (arg2)
1857 start2 = build_fold_addr_expr_loc (input_location, start2);
1858
1859 end1 = TYPE_SIZE_UNIT (TREE_TYPE (arg1))((tree_class_check ((((contains_struct_check ((arg1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1859, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1859, __FUNCTION__))->type_common.size_unit)
;
1860 end1 = fold_build_pointer_plus (start1, end1)fold_build_pointer_plus_loc (((location_t) 0), start1, end1);
1861
1862 p1 = create_tmp_var (TREE_TYPE (start1)((contains_struct_check ((start1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1862, __FUNCTION__))->typed.type)
);
1863 t = build2 (MODIFY_EXPR, TREE_TYPE (p1)((contains_struct_check ((p1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1863, __FUNCTION__))->typed.type)
, p1, start1);
1864 append_to_statement_list (t, &ret);
1865
1866 if (arg2)
1867 {
1868 p2 = create_tmp_var (TREE_TYPE (start2)((contains_struct_check ((start2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1868, __FUNCTION__))->typed.type)
);
1869 t = build2 (MODIFY_EXPR, TREE_TYPE (p2)((contains_struct_check ((p2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1869, __FUNCTION__))->typed.type)
, p2, start2);
1870 append_to_statement_list (t, &ret);
1871 }
1872
1873 lab = create_artificial_label (input_location);
1874 t = build1 (LABEL_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE], lab);
1875 append_to_statement_list (t, &ret);
1876
1877 argarray[i++] = p1;
1878 if (arg2)
1879 argarray[i++] = p2;
1880 /* Handle default arguments. */
1881 for (parm = defparm; parm && parm != void_list_nodeglobal_trees[TI_VOID_LIST_NODE];
1882 parm = TREE_CHAIN (parm)((contains_struct_check ((parm), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1882, __FUNCTION__))->common.chain)
, i++)
1883 argarray[i] = convert_default_arg (TREE_VALUE (parm)((tree_check ((parm), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1883, __FUNCTION__, (TREE_LIST)))->list.value)
,
1884 TREE_PURPOSE (parm)((tree_check ((parm), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1884, __FUNCTION__, (TREE_LIST)))->list.purpose)
, fn,
1885 i - is_method, tf_warning_or_error);
1886 t = build_call_a (fn, i, argarray);
1887 t = fold_convert (void_type_node, t)fold_convert_loc (((location_t) 0), global_trees[TI_VOID_TYPE
], t)
;
1888 t = fold_build_cleanup_point_expr (TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1888, __FUNCTION__))->typed.type)
, t);
1889 append_to_statement_list (t, &ret);
1890
1891 t = fold_build_pointer_plus (p1, TYPE_SIZE_UNIT (inner_type))fold_build_pointer_plus_loc (((location_t) 0), p1, ((tree_class_check
((inner_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1891, __FUNCTION__))->type_common.size_unit))
;
1892 t = build2 (MODIFY_EXPR, TREE_TYPE (p1)((contains_struct_check ((p1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1892, __FUNCTION__))->typed.type)
, p1, t);
1893 append_to_statement_list (t, &ret);
1894
1895 if (arg2)
1896 {
1897 t = fold_build_pointer_plus (p2, TYPE_SIZE_UNIT (inner_type))fold_build_pointer_plus_loc (((location_t) 0), p2, ((tree_class_check
((inner_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1897, __FUNCTION__))->type_common.size_unit))
;
1898 t = build2 (MODIFY_EXPR, TREE_TYPE (p2)((contains_struct_check ((p2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1898, __FUNCTION__))->typed.type)
, p2, t);
1899 append_to_statement_list (t, &ret);
1900 }
1901
1902 t = build2 (NE_EXPR, boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE], p1, end1);
1903 t = build3 (COND_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE], t, build_and_jump (&lab), NULLnullptr);
1904 append_to_statement_list (t, &ret);
1905
1906 return ret;
1907 }
1908 else
1909 {
1910 argarray[i++] = build_fold_addr_expr_loc (input_location, arg1);
1911 if (arg2)
1912 argarray[i++] = build_fold_addr_expr_loc (input_location, arg2);
1913 /* Handle default arguments. */
1914 for (parm = defparm; parm && parm != void_list_nodeglobal_trees[TI_VOID_LIST_NODE];
1915 parm = TREE_CHAIN (parm)((contains_struct_check ((parm), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1915, __FUNCTION__))->common.chain)
, i++)
1916 argarray[i] = convert_default_arg (TREE_VALUE (parm)((tree_check ((parm), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1916, __FUNCTION__, (TREE_LIST)))->list.value)
,
1917 TREE_PURPOSE (parm)((tree_check ((parm), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1917, __FUNCTION__, (TREE_LIST)))->list.purpose)
, fn,
1918 i - is_method, tf_warning_or_error);
1919 t = build_call_a (fn, i, argarray);
1920 t = fold_convert (void_type_node, t)fold_convert_loc (((location_t) 0), global_trees[TI_VOID_TYPE
], t)
;
1921 return fold_build_cleanup_point_expr (TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1921, __FUNCTION__))->typed.type)
, t);
1922 }
1923}
1924
1925/* Return code to initialize DECL with its default constructor, or
1926 NULL if there's nothing to do. */
1927
1928tree
1929cxx_omp_clause_default_ctor (tree clause, tree decl, tree /*outer*/)
1930{
1931 tree info = CP_OMP_CLAUSE_INFO (clause)((contains_struct_check (((omp_clause_range_check ((clause), (
OMP_CLAUSE_PRIVATE), (OMP_CLAUSE__CONDTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1931, __FUNCTION__))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1931, __FUNCTION__))->typed.type)
;
1932 tree ret = NULLnullptr;
1933
1934 if (info)
1935 ret = cxx_omp_clause_apply_fn (TREE_VEC_ELT (info, 0)(*((const_cast<tree *> (tree_vec_elt_check ((info), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1935, __FUNCTION__)))))
, decl, NULLnullptr);
1936
1937 return ret;
1938}
1939
1940/* Return code to initialize DST with a copy constructor from SRC. */
1941
1942tree
1943cxx_omp_clause_copy_ctor (tree clause, tree dst, tree src)
1944{
1945 tree info = CP_OMP_CLAUSE_INFO (clause)((contains_struct_check (((omp_clause_range_check ((clause), (
OMP_CLAUSE_PRIVATE), (OMP_CLAUSE__CONDTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1945, __FUNCTION__))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1945, __FUNCTION__))->typed.type)
;
1946 tree ret = NULLnullptr;
1947
1948 if (info)
1949 ret = cxx_omp_clause_apply_fn (TREE_VEC_ELT (info, 0)(*((const_cast<tree *> (tree_vec_elt_check ((info), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1949, __FUNCTION__)))))
, dst, src);
1950 if (ret == NULLnullptr)
1951 ret = build2 (MODIFY_EXPR, TREE_TYPE (dst)((contains_struct_check ((dst), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1951, __FUNCTION__))->typed.type)
, dst, src);
1952
1953 return ret;
1954}
1955
1956/* Similarly, except use an assignment operator instead. */
1957
1958tree
1959cxx_omp_clause_assign_op (tree clause, tree dst, tree src)
1960{
1961 tree info = CP_OMP_CLAUSE_INFO (clause)((contains_struct_check (((omp_clause_range_check ((clause), (
OMP_CLAUSE_PRIVATE), (OMP_CLAUSE__CONDTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1961, __FUNCTION__))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1961, __FUNCTION__))->typed.type)
;
1962 tree ret = NULLnullptr;
1963
1964 if (info)
1965 ret = cxx_omp_clause_apply_fn (TREE_VEC_ELT (info, 2)(*((const_cast<tree *> (tree_vec_elt_check ((info), (2)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1965, __FUNCTION__)))))
, dst, src);
1966 if (ret == NULLnullptr)
1967 ret = build2 (MODIFY_EXPR, TREE_TYPE (dst)((contains_struct_check ((dst), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1967, __FUNCTION__))->typed.type)
, dst, src);
1968
1969 return ret;
1970}
1971
1972/* Return code to destroy DECL. */
1973
1974tree
1975cxx_omp_clause_dtor (tree clause, tree decl)
1976{
1977 tree info = CP_OMP_CLAUSE_INFO (clause)((contains_struct_check (((omp_clause_range_check ((clause), (
OMP_CLAUSE_PRIVATE), (OMP_CLAUSE__CONDTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1977, __FUNCTION__))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1977, __FUNCTION__))->typed.type)
;
1978 tree ret = NULLnullptr;
1979
1980 if (info)
1981 ret = cxx_omp_clause_apply_fn (TREE_VEC_ELT (info, 1)(*((const_cast<tree *> (tree_vec_elt_check ((info), (1)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1981, __FUNCTION__)))))
, decl, NULLnullptr);
1982
1983 return ret;
1984}
1985
1986/* True if OpenMP should privatize what this DECL points to rather
1987 than the DECL itself. */
1988
1989bool
1990cxx_omp_privatize_by_reference (const_tree decl)
1991{
1992 return (TYPE_REF_P (TREE_TYPE (decl))(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 1992, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)
1993 || is_invisiref_parm (decl));
1994}
1995
1996/* Return true if DECL is const qualified var having no mutable member. */
1997bool
1998cxx_omp_const_qual_no_mutable (tree decl)
1999{
2000 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2000, __FUNCTION__))->typed.type)
;
2001 if (TYPE_REF_P (type)(((enum tree_code) (type)->base.code) == REFERENCE_TYPE))
2002 {
2003 if (!is_invisiref_parm (decl))
2004 return false;
2005 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2005, __FUNCTION__))->typed.type)
;
2006
2007 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == RESULT_DECL && DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2007, __FUNCTION__))->decl_minimal.name)
)
2008 {
2009 /* NVR doesn't preserve const qualification of the
2010 variable's type. */
2011 tree outer = outer_curly_brace_block (current_function_decl);
2012 tree var;
2013
2014 if (outer)
2015 for (var = BLOCK_VARS (outer)((tree_check ((outer), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2015, __FUNCTION__, (BLOCK)))->block.vars)
; var; var = DECL_CHAIN (var)(((contains_struct_check (((contains_struct_check ((var), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2015, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2015, __FUNCTION__))->common.chain))
)
2016 if (VAR_P (var)(((enum tree_code) (var)->base.code) == VAR_DECL)
2017 && DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2017, __FUNCTION__))->decl_minimal.name)
== DECL_NAME (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2017, __FUNCTION__))->decl_minimal.name)
2018 && (TYPE_MAIN_VARIANT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2018, __FUNCTION__))->type_common.main_variant)
2019 == TYPE_MAIN_VARIANT (TREE_TYPE (var))((tree_class_check ((((contains_struct_check ((var), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2019, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2019, __FUNCTION__))->type_common.main_variant)
))
2020 {
2021 if (TYPE_READONLY (TREE_TYPE (var))((tree_class_check ((((contains_struct_check ((var), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2021, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2021, __FUNCTION__))->base.readonly_flag)
)
2022 type = TREE_TYPE (var)((contains_struct_check ((var), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2022, __FUNCTION__))->typed.type)
;
2023 break;
2024 }
2025 }
2026 }
2027
2028 if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2029 return false;
2030
2031 /* Variables with const-qualified type having no mutable member
2032 are predetermined shared. */
2033 if (TYPE_READONLY (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2033, __FUNCTION__))->base.readonly_flag)
&& !cp_has_mutable_p (type))
2034 return true;
2035
2036 return false;
2037}
2038
2039/* OMP_CLAUSE_DEFAULT_UNSPECIFIED unless OpenMP sharing attribute
2040 of DECL is predetermined. */
2041
2042enum omp_clause_default_kind
2043cxx_omp_predetermined_sharing_1 (tree decl)
2044{
2045 /* Static data members are predetermined shared. */
2046 if (TREE_STATIC (decl)((decl)->base.static_flag))
2047 {
2048 tree ctx = CP_DECL_CONTEXT (decl)(!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2048, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2048, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2048, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
;
2049 if (TYPE_P (ctx)(tree_code_type[(int) (((enum tree_code) (ctx)->base.code)
)] == tcc_type)
&& MAYBE_CLASS_TYPE_P (ctx)((((enum tree_code) (ctx)->base.code) == TEMPLATE_TYPE_PARM
|| ((enum tree_code) (ctx)->base.code) == TYPENAME_TYPE ||
((enum tree_code) (ctx)->base.code) == TYPEOF_TYPE || ((enum
tree_code) (ctx)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM
|| ((enum tree_code) (ctx)->base.code) == DECLTYPE_TYPE) ||
(((((enum tree_code) (ctx)->base.code)) == RECORD_TYPE ||
(((enum tree_code) (ctx)->base.code)) == UNION_TYPE) &&
((tree_class_check ((ctx), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2049, __FUNCTION__))->type_common.lang_flag_5)))
)
2050 return OMP_CLAUSE_DEFAULT_SHARED;
2051
2052 if (c_omp_predefined_variable (decl))
2053 return OMP_CLAUSE_DEFAULT_SHARED;
2054 }
2055
2056 /* this may not be specified in data-sharing clauses, still we need
2057 to predetermined it firstprivate. */
2058 if (decl == current_class_ptr(*((cfun + 0) && ((cfun + 0)->language) ? &((cfun
+ 0)->language)->x_current_class_ptr : &scope_chain
->x_current_class_ptr))
)
2059 return OMP_CLAUSE_DEFAULT_FIRSTPRIVATE;
2060
2061 return OMP_CLAUSE_DEFAULT_UNSPECIFIED;
2062}
2063
2064/* Likewise, but also include the artificial vars. We don't want to
2065 disallow the artificial vars being mentioned in explicit clauses,
2066 as we use artificial vars e.g. for loop constructs with random
2067 access iterators other than pointers, but during gimplification
2068 we want to treat them as predetermined. */
2069
2070enum omp_clause_default_kind
2071cxx_omp_predetermined_sharing (tree decl)
2072{
2073 enum omp_clause_default_kind ret = cxx_omp_predetermined_sharing_1 (decl);
2074 if (ret != OMP_CLAUSE_DEFAULT_UNSPECIFIED)
2075 return ret;
2076
2077 /* Predetermine artificial variables holding integral values, those
2078 are usually result of gimplify_one_sizepos or SAVE_EXPR
2079 gimplification. */
2080 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)
2081 && DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2081, __FUNCTION__))->decl_common.artificial_flag)
2082 && INTEGRAL_TYPE_P (TREE_TYPE (decl))(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2082, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2082, __FUNCTION__))->typed.type))->base.code) == BOOLEAN_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2082, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE
)
2083 && !(DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2083, __FUNCTION__))->decl_common.lang_specific)
2084 && DECL_OMP_PRIVATIZED_MEMBER (decl)(((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2084, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2084, __FUNCTION__))->decl_common.lang_specific)->u.base
.anticipated_p)
))
2085 return OMP_CLAUSE_DEFAULT_SHARED;
2086
2087 /* Similarly for typeinfo symbols. */
2088 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2088, __FUNCTION__))->decl_common.artificial_flag)
&& DECL_TINFO_P (decl)((tree_not_check2 (((tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2088, __FUNCTION__, (VAR_DECL), (TYPE_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2088, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
)
2089 return OMP_CLAUSE_DEFAULT_SHARED;
2090
2091 return OMP_CLAUSE_DEFAULT_UNSPECIFIED;
2092}
2093
2094enum omp_clause_defaultmap_kind
2095cxx_omp_predetermined_mapping (tree decl)
2096{
2097 /* Predetermine artificial variables holding integral values, those
2098 are usually result of gimplify_one_sizepos or SAVE_EXPR
2099 gimplification. */
2100 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)
2101 && DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2101, __FUNCTION__))->decl_common.artificial_flag)
2102 && INTEGRAL_TYPE_P (TREE_TYPE (decl))(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2102, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2102, __FUNCTION__))->typed.type))->base.code) == BOOLEAN_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2102, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE
)
2103 && !(DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2103, __FUNCTION__))->decl_common.lang_specific)
2104 && DECL_OMP_PRIVATIZED_MEMBER (decl)(((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2104, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2104, __FUNCTION__))->decl_common.lang_specific)->u.base
.anticipated_p)
))
2105 return OMP_CLAUSE_DEFAULTMAP_FIRSTPRIVATE;
2106
2107 if (c_omp_predefined_variable (decl))
2108 return OMP_CLAUSE_DEFAULTMAP_TO;
2109
2110 return OMP_CLAUSE_DEFAULTMAP_CATEGORY_UNSPECIFIED;
2111}
2112
2113/* Finalize an implicitly determined clause. */
2114
2115void
2116cxx_omp_finish_clause (tree c, gimple_seq *, bool /* openacc */)
2117{
2118 tree decl, inner_type;
2119 bool make_shared = false;
2120
2121 if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2121, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code
!= OMP_CLAUSE_FIRSTPRIVATE
2122 && OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2122, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code
!= OMP_CLAUSE_PRIVATE
2123 && (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2123, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code
!= OMP_CLAUSE_LASTPRIVATE
2124 || !OMP_CLAUSE_LASTPRIVATE_LOOP_IV (c)(((omp_clause_subcode_check ((c), (OMP_CLAUSE_LASTPRIVATE), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2124, __FUNCTION__)))->base.protected_flag)
))
2125 return;
2126
2127 decl = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2127, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2127, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2127, __FUNCTION__)))
;
2128 decl = require_complete_type (decl);
2129 inner_type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2129, __FUNCTION__))->typed.type)
;
2130 if (decl == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2131 make_shared = true;
2132 else if (TYPE_REF_P (TREE_TYPE (decl))(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2132, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)
)
2133 inner_type = TREE_TYPE (inner_type)((contains_struct_check ((inner_type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2133, __FUNCTION__))->typed.type)
;
2134
2135 /* We're interested in the base element, not arrays. */
2136 while (TREE_CODE (inner_type)((enum tree_code) (inner_type)->base.code) == ARRAY_TYPE)
2137 inner_type = TREE_TYPE (inner_type)((contains_struct_check ((inner_type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2137, __FUNCTION__))->typed.type)
;
2138
2139 /* Check for special function availability by building a call to one.
2140 Save the results, because later we won't be in the right context
2141 for making these queries. */
2142 bool first = OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2142, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code
== OMP_CLAUSE_FIRSTPRIVATE;
2143 bool last = OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2143, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code
== OMP_CLAUSE_LASTPRIVATE;
2144 if (!make_shared
2145 && CLASS_TYPE_P (inner_type)(((((enum tree_code) (inner_type)->base.code)) == RECORD_TYPE
|| (((enum tree_code) (inner_type)->base.code)) == UNION_TYPE
) && ((tree_class_check ((inner_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2145, __FUNCTION__))->type_common.lang_flag_5))
2146 && cxx_omp_create_clause_info (c, inner_type, !first, first, last,
2147 true))
2148 make_shared = true;
2149
2150 if (make_shared)
2151 {
2152 OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2152, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code
= OMP_CLAUSE_SHARED;
2153 OMP_CLAUSE_SHARED_FIRSTPRIVATE (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_SHARED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2153, __FUNCTION__))->base.public_flag)
= 0;
2154 OMP_CLAUSE_SHARED_READONLY (c)(((omp_clause_subcode_check ((c), (OMP_CLAUSE_SHARED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2154, __FUNCTION__)))->base.private_flag)
= 0;
2155 }
2156}
2157
2158/* Return true if DECL's DECL_VALUE_EXPR (if any) should be
2159 disregarded in OpenMP construct, because it is going to be
2160 remapped during OpenMP lowering. SHARED is true if DECL
2161 is going to be shared, false if it is going to be privatized. */
2162
2163bool
2164cxx_omp_disregard_value_expr (tree decl, bool shared)
2165{
2166 if (shared)
2167 return false;
2168 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)
2169 && DECL_HAS_VALUE_EXPR_P (decl)((tree_check3 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2169, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL))
) ->decl_common.decl_flag_2)
2170 && DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2170, __FUNCTION__))->decl_common.artificial_flag)
2171 && DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2171, __FUNCTION__))->decl_common.lang_specific)
2172 && DECL_OMP_PRIVATIZED_MEMBER (decl)(((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2172, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2172, __FUNCTION__))->decl_common.lang_specific)->u.base
.anticipated_p)
)
2173 return true;
2174 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2174, __FUNCTION__))->decl_minimal.context)
&& is_capture_proxy (decl))
2175 return true;
2176 return false;
2177}
2178
2179/* Fold expression X which is used as an rvalue if RVAL is true. */
2180
2181tree
2182cp_fold_maybe_rvalue (tree x, bool rval)
2183{
2184 while (true)
2185 {
2186 x = cp_fold (x);
2187 if (rval)
2188 x = mark_rvalue_use (x);
2189 if (rval && DECL_P (x)(tree_code_type[(int) (((enum tree_code) (x)->base.code))]
== tcc_declaration)
2190 && !TYPE_REF_P (TREE_TYPE (x))(((enum tree_code) (((contains_struct_check ((x), (TS_TYPED),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2190, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)
)
2191 {
2192 tree v = decl_constant_value (x);
2193 if (v != x && v != error_mark_nodeglobal_trees[TI_ERROR_MARK])
2194 {
2195 x = v;
2196 continue;
2197 }
2198 }
2199 break;
2200 }
2201 return x;
2202}
2203
2204/* Fold expression X which is used as an rvalue. */
2205
2206tree
2207cp_fold_rvalue (tree x)
2208{
2209 return cp_fold_maybe_rvalue (x, true);
2210}
2211
2212/* Perform folding on expression X. */
2213
2214tree
2215cp_fully_fold (tree x)
2216{
2217 if (processing_template_declscope_chain->x_processing_template_decl)
2218 return x;
2219 /* FIXME cp_fold ought to be a superset of maybe_constant_value so we don't
2220 have to call both. */
2221 if (cxx_dialect >= cxx11)
2222 {
2223 x = maybe_constant_value (x);
2224 /* Sometimes we are given a CONSTRUCTOR but the call above wraps it into
2225 a TARGET_EXPR; undo that here. */
2226 if (TREE_CODE (x)((enum tree_code) (x)->base.code) == TARGET_EXPR)
2227 x = TARGET_EXPR_INITIAL (x)(*(tree_operand_check_code ((x), (TARGET_EXPR), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2227, __FUNCTION__)))
;
2228 else if (TREE_CODE (x)((enum tree_code) (x)->base.code) == VIEW_CONVERT_EXPR
2229 && TREE_CODE (TREE_OPERAND (x, 0))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2229, __FUNCTION__))))))->base.code)
== CONSTRUCTOR
2230 && TREE_TYPE (TREE_OPERAND (x, 0))((contains_struct_check (((*((const_cast<tree*> (tree_operand_check
((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2230, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2230, __FUNCTION__))->typed.type)
== TREE_TYPE (x)((contains_struct_check ((x), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2230, __FUNCTION__))->typed.type)
)
2231 x = TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2231, __FUNCTION__)))))
;
2232 }
2233 return cp_fold_rvalue (x);
2234}
2235
2236/* Likewise, but also fold recursively, which cp_fully_fold doesn't perform
2237 in some cases. */
2238
2239tree
2240cp_fully_fold_init (tree x)
2241{
2242 if (processing_template_declscope_chain->x_processing_template_decl)
2243 return x;
2244 x = cp_fully_fold (x);
2245 hash_set<tree> pset;
2246 cp_walk_tree (&x, cp_fold_r, &pset, NULL)walk_tree_1 (&x, cp_fold_r, &pset, nullptr, cp_walk_subtrees
)
;
2247 return x;
2248}
2249
2250/* c-common interface to cp_fold. If IN_INIT, this is in a static initializer
2251 and certain changes are made to the folding done. Or should be (FIXME). We
2252 never touch maybe_const, as it is only used for the C front-end
2253 C_MAYBE_CONST_EXPR. */
2254
2255tree
2256c_fully_fold (tree x, bool /*in_init*/, bool */*maybe_const*/, bool lval)
2257{
2258 return cp_fold_maybe_rvalue (x, !lval);
2259}
2260
2261static GTY((deletable)) hash_map<tree, tree> *fold_cache;
2262
2263/* Dispose of the whole FOLD_CACHE. */
2264
2265void
2266clear_fold_cache (void)
2267{
2268 if (fold_cache != NULLnullptr)
2269 fold_cache->empty ();
2270}
2271
2272/* This function tries to fold an expression X.
2273 To avoid combinatorial explosion, folding results are kept in fold_cache.
2274 If X is invalid, we don't fold at all.
2275 For performance reasons we don't cache expressions representing a
2276 declaration or constant.
2277 Function returns X or its folded variant. */
2278
2279static tree
2280cp_fold (tree x)
2281{
2282 tree op0, op1, op2, op3;
2283 tree org_x = x, r = NULL_TREE(tree) nullptr;
2284 enum tree_code code;
2285 location_t loc;
2286 bool rval_ops = true;
2287
2288 if (!x || x == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2289 return x;
2290
2291 if (EXPR_P (x)((tree_code_type[(int) (((enum tree_code) (x)->base.code))
]) >= tcc_reference && (tree_code_type[(int) (((enum
tree_code) (x)->base.code))]) <= tcc_expression)
&& (!TREE_TYPE (x)((contains_struct_check ((x), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2291, __FUNCTION__))->typed.type)
|| TREE_TYPE (x)((contains_struct_check ((x), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2291, __FUNCTION__))->typed.type)
== error_mark_nodeglobal_trees[TI_ERROR_MARK]))
2292 return x;
2293
2294 /* Don't bother to cache DECLs or constants. */
2295 if (DECL_P (x)(tree_code_type[(int) (((enum tree_code) (x)->base.code))]
== tcc_declaration)
|| CONSTANT_CLASS_P (x)(tree_code_type[(int) (((enum tree_code) (x)->base.code))]
== tcc_constant)
)
2296 return x;
2297
2298 if (fold_cache == NULLnullptr)
2299 fold_cache = hash_map<tree, tree>::create_ggc (101);
2300
2301 if (tree *cached = fold_cache->get (x))
2302 return *cached;
2303
2304 uid_sensitive_constexpr_evaluation_checker c;
2305
2306 code = TREE_CODE (x)((enum tree_code) (x)->base.code);
2307 switch (code)
2308 {
2309 case CLEANUP_POINT_EXPR:
2310 /* Strip CLEANUP_POINT_EXPR if the expression doesn't have side
2311 effects. */
2312 r = cp_fold_rvalue (TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2312, __FUNCTION__)))))
);
2313 if (!TREE_SIDE_EFFECTS (r)((non_type_check ((r), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2313, __FUNCTION__))->base.side_effects_flag)
)
2314 x = r;
2315 break;
2316
2317 case SIZEOF_EXPR:
2318 x = fold_sizeof_expr (x);
2319 break;
2320
2321 case VIEW_CONVERT_EXPR:
2322 rval_ops = false;
2323 /* FALLTHRU */
2324 case CONVERT_EXPR:
2325 case NOP_EXPR:
2326 case NON_LVALUE_EXPR:
2327
2328 if (VOID_TYPE_P (TREE_TYPE (x))(((enum tree_code) (((contains_struct_check ((x), (TS_TYPED),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2328, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
)
)
2329 {
2330 /* This is just to make sure we don't end up with casts to
2331 void from error_mark_node. If we just return x, then
2332 cp_fold_r might fold the operand into error_mark_node and
2333 leave the conversion in the IR. STRIP_USELESS_TYPE_CONVERSION
2334 during gimplification doesn't like such casts.
2335 Don't create a new tree if op0 != TREE_OPERAND (x, 0), the
2336 folding of the operand should be in the caches and if in cp_fold_r
2337 it will modify it in place. */
2338 op0 = cp_fold (TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2338, __FUNCTION__)))))
);
2339 if (op0 == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2340 x = error_mark_nodeglobal_trees[TI_ERROR_MARK];
2341 break;
2342 }
2343
2344 loc = EXPR_LOCATION (x)((((x)) && ((tree_code_type[(int) (((enum tree_code) (
(x))->base.code))]) >= tcc_reference && (tree_code_type
[(int) (((enum tree_code) ((x))->base.code))]) <= tcc_expression
)) ? (x)->exp.locus : ((location_t) 0))
;
2345 op0 = cp_fold_maybe_rvalue (TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2345, __FUNCTION__)))))
, rval_ops);
2346
2347 if (code == CONVERT_EXPR
2348 && SCALAR_TYPE_P (TREE_TYPE (x))((((enum tree_code) (((contains_struct_check ((x), (TS_TYPED)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2348, __FUNCTION__))->typed.type))->base.code) == OFFSET_TYPE
) || ((enum tree_code) (((contains_struct_check ((x), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2348, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE
|| ((((enum tree_code) (((contains_struct_check ((x), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2348, __FUNCTION__))->typed.type))->base.code) == BOOLEAN_TYPE
|| ((enum tree_code) (((contains_struct_check ((x), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2348, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE
) || ((enum tree_code) (((contains_struct_check ((x), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2348, __FUNCTION__))->typed.type))->base.code) == REAL_TYPE
|| ((enum tree_code) (((contains_struct_check ((x), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2348, __FUNCTION__))->typed.type))->base.code) == COMPLEX_TYPE
) || (((enum tree_code) (((contains_struct_check ((x), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2348, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
) || (((enum tree_code) (((contains_struct_check ((x), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2348, __FUNCTION__))->typed.type))->base.code) == RECORD_TYPE
&& (((tree_class_check (((tree_check ((((contains_struct_check
((x), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2348, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2348, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2348, __FUNCTION__))->type_common.lang_flag_2))) || (((enum
tree_code) (((contains_struct_check ((x), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2348, __FUNCTION__))->typed.type))->base.code) == NULLPTR_TYPE
))
2349 && op0 != void_nodeglobal_trees[TI_VOID])
2350 /* During parsing we used convert_to_*_nofold; re-convert now using the
2351 folding variants, since fold() doesn't do those transformations. */
2352 x = fold (convert (TREE_TYPE (x)((contains_struct_check ((x), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2352, __FUNCTION__))->typed.type)
, op0));
2353 else if (op0 != TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2353, __FUNCTION__)))))
)
2354 {
2355 if (op0 == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2356 x = error_mark_nodeglobal_trees[TI_ERROR_MARK];
2357 else
2358 x = fold_build1_loc (loc, code, TREE_TYPE (x)((contains_struct_check ((x), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2358, __FUNCTION__))->typed.type)
, op0);
2359 }
2360 else
2361 x = fold (x);
2362
2363 /* Conversion of an out-of-range value has implementation-defined
2364 behavior; the language considers it different from arithmetic
2365 overflow, which is undefined. */
2366 if (TREE_CODE (op0)((enum tree_code) (op0)->base.code) == INTEGER_CST
2367 && TREE_OVERFLOW_P (x)((tree_code_type[(int) (((enum tree_code) (x)->base.code))
] == tcc_constant) && ((tree_class_check ((x), (tcc_constant
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2367, __FUNCTION__))->base.public_flag))
&& !TREE_OVERFLOW_P (op0)((tree_code_type[(int) (((enum tree_code) (op0)->base.code
))] == tcc_constant) && ((tree_class_check ((op0), (tcc_constant
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2367, __FUNCTION__))->base.public_flag))
)
2368 TREE_OVERFLOW (x)((tree_class_check ((x), (tcc_constant), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2368, __FUNCTION__))->base.public_flag)
= false;
2369
2370 break;
2371
2372 case INDIRECT_REF:
2373 /* We don't need the decltype(auto) obfuscation anymore. */
2374 if (REF_PARENTHESIZED_P (x)((tree_not_check2 (((tree_check5 (((x)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2374, __FUNCTION__, (COMPONENT_REF), (INDIRECT_REF), (SCOPE_REF
), (VIEW_CONVERT_EXPR), (PAREN_EXPR)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2374, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
)
2375 {
2376 tree p = maybe_undo_parenthesized_ref (x);
2377 return cp_fold (p);
2378 }
2379 goto unary;
2380
2381 case ADDR_EXPR:
2382 loc = EXPR_LOCATION (x)((((x)) && ((tree_code_type[(int) (((enum tree_code) (
(x))->base.code))]) >= tcc_reference && (tree_code_type
[(int) (((enum tree_code) ((x))->base.code))]) <= tcc_expression
)) ? (x)->exp.locus : ((location_t) 0))
;
2383 op0 = cp_fold_maybe_rvalue (TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2383, __FUNCTION__)))))
, false);
2384
2385 /* Cope with user tricks that amount to offsetof. */
2386 if (op0 != error_mark_nodeglobal_trees[TI_ERROR_MARK]
2387 && !FUNC_OR_METHOD_TYPE_P (TREE_TYPE (op0))(((enum tree_code) (((contains_struct_check ((op0), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2387, __FUNCTION__))->typed.type))->base.code) == FUNCTION_TYPE
|| ((enum tree_code) (((contains_struct_check ((op0), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2387, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE
)
)
2388 {
2389 tree val = get_base_address (op0);
2390 if (val
2391 && INDIRECT_REF_P (val)(((enum tree_code) (val)->base.code) == INDIRECT_REF)
2392 && COMPLETE_TYPE_P (TREE_TYPE (val))(((tree_class_check ((((contains_struct_check ((val), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2392, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2392, __FUNCTION__))->type_common.size) != (tree) nullptr
)
2393 && TREE_CONSTANT (TREE_OPERAND (val, 0))((non_type_check (((*((const_cast<tree*> (tree_operand_check
((val), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2393, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2393, __FUNCTION__))->base.constant_flag)
)
2394 {
2395 val = TREE_OPERAND (val, 0)(*((const_cast<tree*> (tree_operand_check ((val), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2395, __FUNCTION__)))))
;
2396 STRIP_NOPS (val)(val) = tree_strip_nop_conversions ((const_cast<union tree_node
*> (((val)))))
;
2397 val = maybe_constant_value (val);
2398 if (TREE_CODE (val)((enum tree_code) (val)->base.code) == INTEGER_CST)
2399 return fold_offsetof (op0, TREE_TYPE (x)((contains_struct_check ((x), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2399, __FUNCTION__))->typed.type)
);
2400 }
2401 }
2402 goto finish_unary;
2403
2404 case REALPART_EXPR:
2405 case IMAGPART_EXPR:
2406 rval_ops = false;
2407 /* FALLTHRU */
2408 case CONJ_EXPR:
2409 case FIX_TRUNC_EXPR:
2410 case FLOAT_EXPR:
2411 case NEGATE_EXPR:
2412 case ABS_EXPR:
2413 case ABSU_EXPR:
2414 case BIT_NOT_EXPR:
2415 case TRUTH_NOT_EXPR:
2416 case FIXED_CONVERT_EXPR:
2417 unary:
2418
2419 loc = EXPR_LOCATION (x)((((x)) && ((tree_code_type[(int) (((enum tree_code) (
(x))->base.code))]) >= tcc_reference && (tree_code_type
[(int) (((enum tree_code) ((x))->base.code))]) <= tcc_expression
)) ? (x)->exp.locus : ((location_t) 0))
;
2420 op0 = cp_fold_maybe_rvalue (TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2420, __FUNCTION__)))))
, rval_ops);
2421
2422 finish_unary:
2423 if (op0 != TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2423, __FUNCTION__)))))
)
2424 {
2425 if (op0 == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2426 x = error_mark_nodeglobal_trees[TI_ERROR_MARK];
2427 else
2428 {
2429 x = fold_build1_loc (loc, code, TREE_TYPE (x)((contains_struct_check ((x), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2429, __FUNCTION__))->typed.type)
, op0);
2430 if (code == INDIRECT_REF
2431 && (INDIRECT_REF_P (x)(((enum tree_code) (x)->base.code) == INDIRECT_REF) || TREE_CODE (x)((enum tree_code) (x)->base.code) == MEM_REF))
2432 {
2433 TREE_READONLY (x)((non_type_check ((x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2433, __FUNCTION__))->base.readonly_flag)
= TREE_READONLY (org_x)((non_type_check ((org_x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2433, __FUNCTION__))->base.readonly_flag)
;
2434 TREE_SIDE_EFFECTS (x)((non_type_check ((x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2434, __FUNCTION__))->base.side_effects_flag)
= TREE_SIDE_EFFECTS (org_x)((non_type_check ((org_x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2434, __FUNCTION__))->base.side_effects_flag)
;
2435 TREE_THIS_VOLATILE (x)((x)->base.volatile_flag) = TREE_THIS_VOLATILE (org_x)((org_x)->base.volatile_flag);
2436 }
2437 }
2438 }
2439 else
2440 x = fold (x);
2441
2442 gcc_assert (TREE_CODE (x) != COND_EXPR((void)(!(((enum tree_code) (x)->base.code) != COND_EXPR ||
!(((enum tree_code) (((contains_struct_check (((*((const_cast
<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2443, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2443, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2443, __FUNCTION__), 0 : 0))
2443 || !VOID_TYPE_P (TREE_TYPE (TREE_OPERAND (x, 0))))((void)(!(((enum tree_code) (x)->base.code) != COND_EXPR ||
!(((enum tree_code) (((contains_struct_check (((*((const_cast
<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2443, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2443, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2443, __FUNCTION__), 0 : 0))
;
2444 break;
2445
2446 case UNARY_PLUS_EXPR:
2447 op0 = cp_fold_rvalue (TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2447, __FUNCTION__)))))
);
2448 if (op0 == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2449 x = error_mark_nodeglobal_trees[TI_ERROR_MARK];
2450 else
2451 x = fold_convert (TREE_TYPE (x), op0)fold_convert_loc (((location_t) 0), ((contains_struct_check (
(x), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2451, __FUNCTION__))->typed.type), op0)
;
2452 break;
2453
2454 case POSTDECREMENT_EXPR:
2455 case POSTINCREMENT_EXPR:
2456 case INIT_EXPR:
2457 case PREDECREMENT_EXPR:
2458 case PREINCREMENT_EXPR:
2459 case COMPOUND_EXPR:
2460 case MODIFY_EXPR:
2461 rval_ops = false;
2462 /* FALLTHRU */
2463 case POINTER_PLUS_EXPR:
2464 case PLUS_EXPR:
2465 case POINTER_DIFF_EXPR:
2466 case MINUS_EXPR:
2467 case MULT_EXPR:
2468 case TRUNC_DIV_EXPR:
2469 case CEIL_DIV_EXPR:
2470 case FLOOR_DIV_EXPR:
2471 case ROUND_DIV_EXPR:
2472 case TRUNC_MOD_EXPR:
2473 case CEIL_MOD_EXPR:
2474 case ROUND_MOD_EXPR:
2475 case RDIV_EXPR:
2476 case EXACT_DIV_EXPR:
2477 case MIN_EXPR:
2478 case MAX_EXPR:
2479 case LSHIFT_EXPR:
2480 case RSHIFT_EXPR:
2481 case LROTATE_EXPR:
2482 case RROTATE_EXPR:
2483 case BIT_AND_EXPR:
2484 case BIT_IOR_EXPR:
2485 case BIT_XOR_EXPR:
2486 case TRUTH_AND_EXPR:
2487 case TRUTH_ANDIF_EXPR:
2488 case TRUTH_OR_EXPR:
2489 case TRUTH_ORIF_EXPR:
2490 case TRUTH_XOR_EXPR:
2491 case LT_EXPR: case LE_EXPR:
2492 case GT_EXPR: case GE_EXPR:
2493 case EQ_EXPR: case NE_EXPR:
2494 case UNORDERED_EXPR: case ORDERED_EXPR:
2495 case UNLT_EXPR: case UNLE_EXPR:
2496 case UNGT_EXPR: case UNGE_EXPR:
2497 case UNEQ_EXPR: case LTGT_EXPR:
2498 case RANGE_EXPR: case COMPLEX_EXPR:
2499
2500 loc = EXPR_LOCATION (x)((((x)) && ((tree_code_type[(int) (((enum tree_code) (
(x))->base.code))]) >= tcc_reference && (tree_code_type
[(int) (((enum tree_code) ((x))->base.code))]) <= tcc_expression
)) ? (x)->exp.locus : ((location_t) 0))
;
2501 op0 = cp_fold_maybe_rvalue (TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2501, __FUNCTION__)))))
, rval_ops);
2502 op1 = cp_fold_rvalue (TREE_OPERAND (x, 1)(*((const_cast<tree*> (tree_operand_check ((x), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2502, __FUNCTION__)))))
);
2503
2504 /* decltype(nullptr) has only one value, so optimize away all comparisons
2505 with that type right away, keeping them in the IL causes troubles for
2506 various optimizations. */
2507 if (COMPARISON_CLASS_P (org_x)(tree_code_type[(int) (((enum tree_code) (org_x)->base.code
))] == tcc_comparison)
2508 && TREE_CODE (TREE_TYPE (op0))((enum tree_code) (((contains_struct_check ((op0), (TS_TYPED)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2508, __FUNCTION__))->typed.type))->base.code)
== NULLPTR_TYPE
2509 && TREE_CODE (TREE_TYPE (op1))((enum tree_code) (((contains_struct_check ((op1), (TS_TYPED)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2509, __FUNCTION__))->typed.type))->base.code)
== NULLPTR_TYPE)
2510 {
2511 switch (code)
2512 {
2513 case EQ_EXPR:
2514 x = constant_boolean_node (true, TREE_TYPE (x)((contains_struct_check ((x), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2514, __FUNCTION__))->typed.type)
);
2515 break;
2516 case NE_EXPR:
2517 x = constant_boolean_node (false, TREE_TYPE (x)((contains_struct_check ((x), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2517, __FUNCTION__))->typed.type)
);
2518 break;
2519 default:
2520 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2520, __FUNCTION__))
;
2521 }
2522 return omit_two_operands_loc (loc, TREE_TYPE (x)((contains_struct_check ((x), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2522, __FUNCTION__))->typed.type)
, x,
2523 op0, op1);
2524 }
2525
2526 if (op0 != TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2526, __FUNCTION__)))))
|| op1 != TREE_OPERAND (x, 1)(*((const_cast<tree*> (tree_operand_check ((x), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2526, __FUNCTION__)))))
)
2527 {
2528 if (op0 == error_mark_nodeglobal_trees[TI_ERROR_MARK] || op1 == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2529 x = error_mark_nodeglobal_trees[TI_ERROR_MARK];
2530 else
2531 x = fold_build2_loc (loc, code, TREE_TYPE (x)((contains_struct_check ((x), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2531, __FUNCTION__))->typed.type)
, op0, op1);
2532 }
2533 else
2534 x = fold (x);
2535
2536 /* This is only needed for -Wnonnull-compare and only if
2537 TREE_NO_WARNING (org_x), but to avoid that option affecting code
2538 generation, we do it always. */
2539 if (COMPARISON_CLASS_P (org_x)(tree_code_type[(int) (((enum tree_code) (org_x)->base.code
))] == tcc_comparison)
)
2540 {
2541 if (x == error_mark_nodeglobal_trees[TI_ERROR_MARK] || TREE_CODE (x)((enum tree_code) (x)->base.code) == INTEGER_CST)
2542 ;
2543 else if (COMPARISON_CLASS_P (x)(tree_code_type[(int) (((enum tree_code) (x)->base.code))]
== tcc_comparison)
)
2544 {
2545 if (warn_nonnull_compareglobal_options.x_warn_nonnull_compare
2546 && warning_suppressed_p (org_x, OPT_Wnonnull_compare))
2547 suppress_warning (x, OPT_Wnonnull_compare);
2548 }
2549 /* Otherwise give up on optimizing these, let GIMPLE folders
2550 optimize those later on. */
2551 else if (op0 != TREE_OPERAND (org_x, 0)(*((const_cast<tree*> (tree_operand_check ((org_x), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2551, __FUNCTION__)))))
2552 || op1 != TREE_OPERAND (org_x, 1)(*((const_cast<tree*> (tree_operand_check ((org_x), (1)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2552, __FUNCTION__)))))
)
2553 {
2554 x = build2_loc (loc, code, TREE_TYPE (org_x)((contains_struct_check ((org_x), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2554, __FUNCTION__))->typed.type)
, op0, op1);
2555 if (warn_nonnull_compareglobal_options.x_warn_nonnull_compare
2556 && warning_suppressed_p (org_x, OPT_Wnonnull_compare))
2557 suppress_warning (x, OPT_Wnonnull_compare);
2558 }
2559 else
2560 x = org_x;
2561 }
2562
2563 break;
2564
2565 case VEC_COND_EXPR:
2566 case COND_EXPR:
2567 loc = EXPR_LOCATION (x)((((x)) && ((tree_code_type[(int) (((enum tree_code) (
(x))->base.code))]) >= tcc_reference && (tree_code_type
[(int) (((enum tree_code) ((x))->base.code))]) <= tcc_expression
)) ? (x)->exp.locus : ((location_t) 0))
;
2568 op0 = cp_fold_rvalue (TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2568, __FUNCTION__)))))
);
2569 op1 = cp_fold (TREE_OPERAND (x, 1)(*((const_cast<tree*> (tree_operand_check ((x), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2569, __FUNCTION__)))))
);
2570 op2 = cp_fold (TREE_OPERAND (x, 2)(*((const_cast<tree*> (tree_operand_check ((x), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2570, __FUNCTION__)))))
);
2571
2572 if (TREE_CODE (TREE_TYPE (x))((enum tree_code) (((contains_struct_check ((x), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2572, __FUNCTION__))->typed.type))->base.code)
== BOOLEAN_TYPE)
2573 {
2574 warning_sentinel s (warn_int_in_bool_contextglobal_options.x_warn_int_in_bool_context);
2575 if (!VOID_TYPE_P (TREE_TYPE (op1))(((enum tree_code) (((contains_struct_check ((op1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2575, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
)
)
2576 op1 = cp_truthvalue_conversion (op1, tf_warning_or_error);
2577 if (!VOID_TYPE_P (TREE_TYPE (op2))(((enum tree_code) (((contains_struct_check ((op2), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2577, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
)
)
2578 op2 = cp_truthvalue_conversion (op2, tf_warning_or_error);
2579 }
2580 else if (VOID_TYPE_P (TREE_TYPE (x))(((enum tree_code) (((contains_struct_check ((x), (TS_TYPED),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2580, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
)
)
2581 {
2582 if (TREE_CODE (op0)((enum tree_code) (op0)->base.code) == INTEGER_CST)
2583 {
2584 /* If the condition is constant, fold can fold away
2585 the COND_EXPR. If some statement-level uses of COND_EXPR
2586 have one of the branches NULL, avoid folding crash. */
2587 if (!op1)
2588 op1 = build_empty_stmt (loc);
2589 if (!op2)
2590 op2 = build_empty_stmt (loc);
2591 }
2592 else
2593 {
2594 /* Otherwise, don't bother folding a void condition, since
2595 it can't produce a constant value. */
2596 if (op0 != TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2596, __FUNCTION__)))))
2597 || op1 != TREE_OPERAND (x, 1)(*((const_cast<tree*> (tree_operand_check ((x), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2597, __FUNCTION__)))))
2598 || op2 != TREE_OPERAND (x, 2)(*((const_cast<tree*> (tree_operand_check ((x), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2598, __FUNCTION__)))))
)
2599 x = build3_loc (loc, code, TREE_TYPE (x)((contains_struct_check ((x), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2599, __FUNCTION__))->typed.type)
, op0, op1, op2);
2600 break;
2601 }
2602 }
2603
2604 if (op0 != TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2604, __FUNCTION__)))))
2605 || op1 != TREE_OPERAND (x, 1)(*((const_cast<tree*> (tree_operand_check ((x), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2605, __FUNCTION__)))))
2606 || op2 != TREE_OPERAND (x, 2)(*((const_cast<tree*> (tree_operand_check ((x), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2606, __FUNCTION__)))))
)
2607 {
2608 if (op0 == error_mark_nodeglobal_trees[TI_ERROR_MARK]
2609 || op1 == error_mark_nodeglobal_trees[TI_ERROR_MARK]
2610 || op2 == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2611 x = error_mark_nodeglobal_trees[TI_ERROR_MARK];
2612 else
2613 x = fold_build3_loc (loc, code, TREE_TYPE (x)((contains_struct_check ((x), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2613, __FUNCTION__))->typed.type)
, op0, op1, op2);
2614 }
2615 else
2616 x = fold (x);
2617
2618 /* A COND_EXPR might have incompatible types in branches if one or both
2619 arms are bitfields. If folding exposed such a branch, fix it up. */
2620 if (TREE_CODE (x)((enum tree_code) (x)->base.code) != code
2621 && x != error_mark_nodeglobal_trees[TI_ERROR_MARK]
2622 && !useless_type_conversion_p (TREE_TYPE (org_x)((contains_struct_check ((org_x), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2622, __FUNCTION__))->typed.type)
, TREE_TYPE (x)((contains_struct_check ((x), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2622, __FUNCTION__))->typed.type)
))
2623 x = fold_convert (TREE_TYPE (org_x), x)fold_convert_loc (((location_t) 0), ((contains_struct_check (
(org_x), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2623, __FUNCTION__))->typed.type), x)
;
2624
2625 break;
2626
2627 case CALL_EXPR:
2628 {
2629 int sv = optimizeglobal_options.x_optimize, nw = sv;
2630 tree callee = get_callee_fndecl (x);
2631
2632 /* Some built-in function calls will be evaluated at compile-time in
2633 fold (). Set optimize to 1 when folding __builtin_constant_p inside
2634 a constexpr function so that fold_builtin_1 doesn't fold it to 0. */
2635 if (callee && fndecl_built_in_p (callee) && !optimizeglobal_options.x_optimize
2636 && DECL_IS_BUILTIN_CONSTANT_P (callee)(((enum tree_code) (callee)->base.code) == FUNCTION_DECL &&
((built_in_class) (tree_check ((callee), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2636, __FUNCTION__, (FUNCTION_DECL)))->function_decl.built_in_class
) == BUILT_IN_NORMAL && DECL_FUNCTION_CODE (callee) ==
BUILT_IN_CONSTANT_P)
2637 && current_function_decl
2638 && DECL_DECLARED_CONSTEXPR_P (current_function_decl)((contains_struct_check (((tree_check2 (((((enum tree_code) (
current_function_decl)->base.code) == TEMPLATE_DECL ? ((struct
tree_template_decl *)(const_cast<union tree_node *> ((
((tree_check ((current_function_decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2638, __FUNCTION__, (TEMPLATE_DECL))))))))->result : current_function_decl
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2638, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2638, __FUNCTION__))->decl_common.lang_flag_8)
)
2639 nw = 1;
2640
2641 if (callee && fndecl_built_in_p (callee, BUILT_IN_FRONTEND))
2642 {
2643 switch (DECL_FE_FUNCTION_CODE (callee))
2644 {
2645 /* Defer folding __builtin_is_constant_evaluated. */
2646 case CP_BUILT_IN_IS_CONSTANT_EVALUATED:
2647 break;
2648 case CP_BUILT_IN_SOURCE_LOCATION:
2649 x = fold_builtin_source_location (EXPR_LOCATION (x)((((x)) && ((tree_code_type[(int) (((enum tree_code) (
(x))->base.code))]) >= tcc_reference && (tree_code_type
[(int) (((enum tree_code) ((x))->base.code))]) <= tcc_expression
)) ? (x)->exp.locus : ((location_t) 0))
);
2650 break;
2651 case CP_BUILT_IN_IS_CORRESPONDING_MEMBER:
2652 x = fold_builtin_is_corresponding_member
2653 (EXPR_LOCATION (x)((((x)) && ((tree_code_type[(int) (((enum tree_code) (
(x))->base.code))]) >= tcc_reference && (tree_code_type
[(int) (((enum tree_code) ((x))->base.code))]) <= tcc_expression
)) ? (x)->exp.locus : ((location_t) 0))
, call_expr_nargs (x)(((int)((unsigned long) (*tree_int_cst_elt_check (((tree_class_check
((x), (tcc_vl_exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2653, __FUNCTION__))->exp.operands[0]), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2653, __FUNCTION__)))) - 3)
,
2654 &CALL_EXPR_ARG (x, 0)(*((const_cast<tree*> (tree_operand_check (((tree_check
((x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2654, __FUNCTION__, (CALL_EXPR)))), ((0) + 3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2654, __FUNCTION__)))))
);
2655 break;
2656 case CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS:
2657 x = fold_builtin_is_pointer_inverconvertible_with_class
2658 (EXPR_LOCATION (x)((((x)) && ((tree_code_type[(int) (((enum tree_code) (
(x))->base.code))]) >= tcc_reference && (tree_code_type
[(int) (((enum tree_code) ((x))->base.code))]) <= tcc_expression
)) ? (x)->exp.locus : ((location_t) 0))
, call_expr_nargs (x)(((int)((unsigned long) (*tree_int_cst_elt_check (((tree_class_check
((x), (tcc_vl_exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2658, __FUNCTION__))->exp.operands[0]), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2658, __FUNCTION__)))) - 3)
,
2659 &CALL_EXPR_ARG (x, 0)(*((const_cast<tree*> (tree_operand_check (((tree_check
((x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2659, __FUNCTION__, (CALL_EXPR)))), ((0) + 3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2659, __FUNCTION__)))))
);
2660 break;
2661 default:
2662 break;
2663 }
2664 break;
2665 }
2666
2667 if (callee
2668 && fndecl_built_in_p (callee, CP_BUILT_IN_SOURCE_LOCATION,
2669 BUILT_IN_FRONTEND))
2670 {
2671 x = fold_builtin_source_location (EXPR_LOCATION (x)((((x)) && ((tree_code_type[(int) (((enum tree_code) (
(x))->base.code))]) >= tcc_reference && (tree_code_type
[(int) (((enum tree_code) ((x))->base.code))]) <= tcc_expression
)) ? (x)->exp.locus : ((location_t) 0))
);
2672 break;
2673 }
2674
2675 bool changed = false;
2676 int m = call_expr_nargs (x)(((int)((unsigned long) (*tree_int_cst_elt_check (((tree_class_check
((x), (tcc_vl_exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2676, __FUNCTION__))->exp.operands[0]), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2676, __FUNCTION__)))) - 3)
;
2677 for (int i = 0; i < m; i++)
2678 {
2679 r = cp_fold (CALL_EXPR_ARG (x, i)(*((const_cast<tree*> (tree_operand_check (((tree_check
((x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2679, __FUNCTION__, (CALL_EXPR)))), ((i) + 3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2679, __FUNCTION__)))))
);
2680 if (r != CALL_EXPR_ARG (x, i)(*((const_cast<tree*> (tree_operand_check (((tree_check
((x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2680, __FUNCTION__, (CALL_EXPR)))), ((i) + 3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2680, __FUNCTION__)))))
)
2681 {
2682 if (r == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2683 {
2684 x = error_mark_nodeglobal_trees[TI_ERROR_MARK];
2685 break;
2686 }
2687 if (!changed)
2688 x = copy_node (x);
2689 CALL_EXPR_ARG (x, i)(*((const_cast<tree*> (tree_operand_check (((tree_check
((x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2689, __FUNCTION__, (CALL_EXPR)))), ((i) + 3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2689, __FUNCTION__)))))
= r;
2690 changed = true;
2691 }
2692 }
2693 if (x == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2694 break;
2695
2696 optimizeglobal_options.x_optimize = nw;
2697 r = fold (x);
2698 optimizeglobal_options.x_optimize = sv;
2699
2700 if (TREE_CODE (r)((enum tree_code) (r)->base.code) != CALL_EXPR)
2701 {
2702 x = cp_fold (r);
2703 break;
2704 }
2705
2706 optimizeglobal_options.x_optimize = nw;
2707
2708 /* Invoke maybe_constant_value for functions declared
2709 constexpr and not called with AGGR_INIT_EXPRs.
2710 TODO:
2711 Do constexpr expansion of expressions where the call itself is not
2712 constant, but the call followed by an INDIRECT_REF is. */
2713 if (callee && DECL_DECLARED_CONSTEXPR_P (callee)((contains_struct_check (((tree_check2 (((((enum tree_code) (
callee)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((callee
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2713, __FUNCTION__, (TEMPLATE_DECL))))))))->result : callee
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2713, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2713, __FUNCTION__))->decl_common.lang_flag_8)
2714 && !flag_no_inlineglobal_options.x_flag_no_inline)
2715 r = maybe_constant_value (x);
2716 optimizeglobal_options.x_optimize = sv;
2717
2718 if (TREE_CODE (r)((enum tree_code) (r)->base.code) != CALL_EXPR)
2719 {
2720 if (DECL_CONSTRUCTOR_P (callee)((tree_check (((((enum tree_code) (callee)->base.code) == TEMPLATE_DECL
? ((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((callee), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2720, __FUNCTION__, (TEMPLATE_DECL))))))))->result : callee
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2720, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor
)
)
2721 {
2722 loc = EXPR_LOCATION (x)((((x)) && ((tree_code_type[(int) (((enum tree_code) (
(x))->base.code))]) >= tcc_reference && (tree_code_type
[(int) (((enum tree_code) ((x))->base.code))]) <= tcc_expression
)) ? (x)->exp.locus : ((location_t) 0))
;
2723 tree s = build_fold_indirect_ref_loc (loc,
2724 CALL_EXPR_ARG (x, 0)(*((const_cast<tree*> (tree_operand_check (((tree_check
((x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2724, __FUNCTION__, (CALL_EXPR)))), ((0) + 3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2724, __FUNCTION__)))))
);
2725 r = build2_loc (loc, INIT_EXPR, TREE_TYPE (s)((contains_struct_check ((s), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2725, __FUNCTION__))->typed.type)
, s, r);
2726 }
2727 x = r;
2728 break;
2729 }
2730
2731 break;
2732 }
2733
2734 case CONSTRUCTOR:
2735 {
2736 unsigned i;
2737 constructor_elt *p;
2738 vec<constructor_elt, va_gc> *elts = CONSTRUCTOR_ELTS (x)((tree_check ((x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2738, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)
;
2739 vec<constructor_elt, va_gc> *nelts = NULLnullptr;
2740 FOR_EACH_VEC_SAFE_ELT (elts, i, p)for (i = 0; vec_safe_iterate ((elts), (i), &(p)); ++(i))
2741 {
2742 tree op = cp_fold (p->value);
2743 if (op != p->value)
2744 {
2745 if (op == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2746 {
2747 x = error_mark_nodeglobal_trees[TI_ERROR_MARK];
2748 vec_free (nelts);
2749 break;
2750 }
2751 if (nelts == NULLnullptr)
2752 nelts = elts->copy ();
2753 (*nelts)[i].value = op;
2754 }
2755 }
2756 if (nelts)
2757 {
2758 x = build_constructor (TREE_TYPE (x)((contains_struct_check ((x), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2758, __FUNCTION__))->typed.type)
, nelts);
2759 CONSTRUCTOR_PLACEHOLDER_BOUNDARY (x)(((tree_not_check2 (((tree_check ((x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2759, __FUNCTION__, (CONSTRUCTOR)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2759, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_5))
2760 = CONSTRUCTOR_PLACEHOLDER_BOUNDARY (org_x)(((tree_not_check2 (((tree_check ((org_x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2760, __FUNCTION__, (CONSTRUCTOR)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2760, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_5))
;
2761 }
2762 if (VECTOR_TYPE_P (TREE_TYPE (x))(((enum tree_code) (((contains_struct_check ((x), (TS_TYPED),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2762, __FUNCTION__))->typed.type))->base.code) == VECTOR_TYPE
)
)
2763 x = fold (x);
2764 break;
2765 }
2766 case TREE_VEC:
2767 {
2768 bool changed = false;
2769 int n = TREE_VEC_LENGTH (x)((tree_check ((x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2769, __FUNCTION__, (TREE_VEC)))->base.u.length)
;
2770
2771 for (int i = 0; i < n; i++)
2772 {
2773 tree op = cp_fold (TREE_VEC_ELT (x, i)(*((const_cast<tree *> (tree_vec_elt_check ((x), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2773, __FUNCTION__)))))
);
2774 if (op != TREE_VEC_ELT (x, i)(*((const_cast<tree *> (tree_vec_elt_check ((x), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2774, __FUNCTION__)))))
)
2775 {
2776 if (!changed)
2777 x = copy_node (x);
2778 TREE_VEC_ELT (x, i)(*((const_cast<tree *> (tree_vec_elt_check ((x), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2778, __FUNCTION__)))))
= op;
2779 changed = true;
2780 }
2781 }
2782 }
2783
2784 break;
2785
2786 case ARRAY_REF:
2787 case ARRAY_RANGE_REF:
2788
2789 loc = EXPR_LOCATION (x)((((x)) && ((tree_code_type[(int) (((enum tree_code) (
(x))->base.code))]) >= tcc_reference && (tree_code_type
[(int) (((enum tree_code) ((x))->base.code))]) <= tcc_expression
)) ? (x)->exp.locus : ((location_t) 0))
;
2790 op0 = cp_fold (TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2790, __FUNCTION__)))))
);
2791 op1 = cp_fold (TREE_OPERAND (x, 1)(*((const_cast<tree*> (tree_operand_check ((x), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2791, __FUNCTION__)))))
);
2792 op2 = cp_fold (TREE_OPERAND (x, 2)(*((const_cast<tree*> (tree_operand_check ((x), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2792, __FUNCTION__)))))
);
2793 op3 = cp_fold (TREE_OPERAND (x, 3)(*((const_cast<tree*> (tree_operand_check ((x), (3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2793, __FUNCTION__)))))
);
2794
2795 if (op0 != TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2795, __FUNCTION__)))))
2796 || op1 != TREE_OPERAND (x, 1)(*((const_cast<tree*> (tree_operand_check ((x), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2796, __FUNCTION__)))))
2797 || op2 != TREE_OPERAND (x, 2)(*((const_cast<tree*> (tree_operand_check ((x), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2797, __FUNCTION__)))))
2798 || op3 != TREE_OPERAND (x, 3)(*((const_cast<tree*> (tree_operand_check ((x), (3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2798, __FUNCTION__)))))
)
2799 {
2800 if (op0 == error_mark_nodeglobal_trees[TI_ERROR_MARK]
2801 || op1 == error_mark_nodeglobal_trees[TI_ERROR_MARK]
2802 || op2 == error_mark_nodeglobal_trees[TI_ERROR_MARK]
2803 || op3 == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2804 x = error_mark_nodeglobal_trees[TI_ERROR_MARK];
2805 else
2806 {
2807 x = build4_loc (loc, code, TREE_TYPE (x)((contains_struct_check ((x), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2807, __FUNCTION__))->typed.type)
, op0, op1, op2, op3);
2808 TREE_READONLY (x)((non_type_check ((x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2808, __FUNCTION__))->base.readonly_flag)
= TREE_READONLY (org_x)((non_type_check ((org_x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2808, __FUNCTION__))->base.readonly_flag)
;
2809 TREE_SIDE_EFFECTS (x)((non_type_check ((x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2809, __FUNCTION__))->base.side_effects_flag)
= TREE_SIDE_EFFECTS (org_x)((non_type_check ((org_x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2809, __FUNCTION__))->base.side_effects_flag)
;
2810 TREE_THIS_VOLATILE (x)((x)->base.volatile_flag) = TREE_THIS_VOLATILE (org_x)((org_x)->base.volatile_flag);
2811 }
2812 }
2813
2814 x = fold (x);
2815 break;
2816
2817 case SAVE_EXPR:
2818 /* A SAVE_EXPR might contain e.g. (0 * i) + (0 * j), which, after
2819 folding, evaluates to an invariant. In that case no need to wrap
2820 this folded tree with a SAVE_EXPR. */
2821 r = cp_fold (TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2821, __FUNCTION__)))))
);
2822 if (tree_invariant_p (r))
2823 x = r;
2824 break;
2825
2826 case REQUIRES_EXPR:
2827 x = evaluate_requires_expr (x);
2828 break;
2829
2830 default:
2831 return org_x;
2832 }
2833
2834 if (EXPR_P (x)((tree_code_type[(int) (((enum tree_code) (x)->base.code))
]) >= tcc_reference && (tree_code_type[(int) (((enum
tree_code) (x)->base.code))]) <= tcc_expression)
&& TREE_CODE (x)((enum tree_code) (x)->base.code) == code)
2835 {
2836 TREE_THIS_VOLATILE (x)((x)->base.volatile_flag) = TREE_THIS_VOLATILE (org_x)((org_x)->base.volatile_flag);
2837 copy_warning (x, org_x);
2838 }
2839
2840 if (!c.evaluation_restricted_p ())
2841 {
2842 fold_cache->put (org_x, x);
2843 /* Prevent that we try to fold an already folded result again. */
2844 if (x != org_x)
2845 fold_cache->put (x, x);
2846 }
2847
2848 return x;
2849}
2850
2851/* Look up either "hot" or "cold" in attribute list LIST. */
2852
2853tree
2854lookup_hotness_attribute (tree list)
2855{
2856 for (; list; list = TREE_CHAIN (list)((contains_struct_check ((list), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2856, __FUNCTION__))->common.chain)
)
2857 {
2858 tree name = get_attribute_name (list);
2859 if (is_attribute_p ("hot", name)
2860 || is_attribute_p ("cold", name)
2861 || is_attribute_p ("likely", name)
2862 || is_attribute_p ("unlikely", name))
2863 break;
2864 }
2865 return list;
2866}
2867
2868/* Remove both "hot" and "cold" attributes from LIST. */
2869
2870static tree
2871remove_hotness_attribute (tree list)
2872{
2873 list = remove_attribute ("hot", list);
2874 list = remove_attribute ("cold", list);
2875 list = remove_attribute ("likely", list);
2876 list = remove_attribute ("unlikely", list);
2877 return list;
2878}
2879
2880/* If [[likely]] or [[unlikely]] appear on this statement, turn it into a
2881 PREDICT_EXPR. */
2882
2883tree
2884process_stmt_hotness_attribute (tree std_attrs, location_t attrs_loc)
2885{
2886 if (std_attrs == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2887 return std_attrs;
2888 if (tree attr = lookup_hotness_attribute (std_attrs))
2889 {
2890 tree name = get_attribute_name (attr);
2891 bool hot = (is_attribute_p ("hot", name)
2892 || is_attribute_p ("likely", name));
2893 tree pred = build_predict_expr (hot ? PRED_HOT_LABEL : PRED_COLD_LABEL,
2894 hot ? TAKEN : NOT_TAKEN);
2895 SET_EXPR_LOCATION (pred, attrs_loc)(expr_check (((pred)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2895, __FUNCTION__))->exp.locus = (attrs_loc)
;
2896 add_stmt (pred);
2897 if (tree other = lookup_hotness_attribute (TREE_CHAIN (attr)((contains_struct_check ((attr), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2897, __FUNCTION__))->common.chain)
))
2898 warning (OPT_Wattributes, "ignoring attribute %qE after earlier %qE",
2899 get_attribute_name (other), name);
2900 std_attrs = remove_hotness_attribute (std_attrs);
2901 }
2902 return std_attrs;
2903}
2904
2905/* Helper of fold_builtin_source_location, return the
2906 std::source_location::__impl type after performing verification
2907 on it. LOC is used for reporting any errors. */
2908
2909static tree
2910get_source_location_impl_type (location_t loc)
2911{
2912 tree name = get_identifier ("source_location")(__builtin_constant_p ("source_location") ? get_identifier_with_length
(("source_location"), strlen ("source_location")) : get_identifier
("source_location"))
;
2913 tree decl = lookup_qualified_name (std_nodecp_global_trees[CPTI_STD], name);
2914 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != TYPE_DECL)
2915 {
2916 auto_diagnostic_group d;
2917 if (decl == error_mark_nodeglobal_trees[TI_ERROR_MARK] || TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TREE_LIST)
2918 qualified_name_lookup_error (std_nodecp_global_trees[CPTI_STD], name, decl, loc);
2919 else
2920 error_at (loc, "%qD is not a type", decl);
2921 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2922 }
2923 name = get_identifier ("__impl")(__builtin_constant_p ("__impl") ? get_identifier_with_length
(("__impl"), strlen ("__impl")) : get_identifier ("__impl"))
;
2924 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2924, __FUNCTION__))->typed.type)
;
2925 decl = lookup_qualified_name (type, name);
2926 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != TYPE_DECL)
2927 {
2928 auto_diagnostic_group d;
2929 if (decl == error_mark_nodeglobal_trees[TI_ERROR_MARK] || TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TREE_LIST)
2930 qualified_name_lookup_error (type, name, decl, loc);
2931 else
2932 error_at (loc, "%qD is not a type", decl);
2933 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2934 }
2935 type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2935, __FUNCTION__))->typed.type)
;
2936 if (TREE_CODE (type)((enum tree_code) (type)->base.code) != RECORD_TYPE)
2937 {
2938 error_at (loc, "%qD is not a class type", decl);
2939 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2940 }
2941
2942 int cnt = 0;
2943 for (tree field = TYPE_FIELDS (type)((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2943, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
;
2944 (field = next_initializable_field (field)) != NULL_TREE(tree) nullptr;
2945 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/cp/cp-gimplify.c"
, 2945, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2945, __FUNCTION__))->common.chain))
)
2946 {
2947 if (DECL_NAME (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2947, __FUNCTION__))->decl_minimal.name)
!= NULL_TREE(tree) nullptr)
2948 {
2949 const char *n = IDENTIFIER_POINTER (DECL_NAME (field))((const char *) (tree_check ((((contains_struct_check ((field
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2949, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2949, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str
)
;
2950 if (strcmp (n, "_M_file_name") == 0
2951 || strcmp (n, "_M_function_name") == 0)
2952 {
2953 if (TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2953, __FUNCTION__))->typed.type)
!= const_string_type_nodec_global_trees[CTI_CONST_STRING_TYPE])
2954 {
2955 error_at (loc, "%qD does not have %<const char *%> type",
2956 field);
2957 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2958 }
2959 cnt++;
2960 continue;
2961 }
2962 else if (strcmp (n, "_M_line") == 0 || strcmp (n, "_M_column") == 0)
2963 {
2964 if (TREE_CODE (TREE_TYPE (field))((enum tree_code) (((contains_struct_check ((field), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 2964, __FUNCTION__))->typed.type))->base.code)
!= INTEGER_TYPE)
2965 {
2966 error_at (loc, "%qD does not have integral type", field);
2967 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2968 }
2969 cnt++;
2970 continue;
2971 }
2972 }
2973 cnt = 0;
2974 break;
2975 }
2976 if (cnt != 4)
2977 {
2978 error_at (loc, "%<std::source_location::__impl%> does not contain only "
2979 "non-static data members %<_M_file_name%>, "
2980 "%<_M_function_name%>, %<_M_line%> and %<_M_column%>");
2981 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2982 }
2983 return build_qualified_type (type, TYPE_QUAL_CONST);
2984}
2985
2986/* Type for source_location_table hash_set. */
2987struct GTY((for_user)) source_location_table_entry {
2988 location_t loc;
2989 unsigned uid;
2990 tree var;
2991};
2992
2993/* Traits class for function start hash maps below. */
2994
2995struct source_location_table_entry_hash
2996 : ggc_remove <source_location_table_entry>
2997{
2998 typedef source_location_table_entry value_type;
2999 typedef source_location_table_entry compare_type;
3000
3001 static hashval_t
3002 hash (const source_location_table_entry &ref)
3003 {
3004 inchash::hash hstate (0);
3005 hstate.add_int (ref.loc);
3006 hstate.add_int (ref.uid);
3007 return hstate.end ();
3008 }
3009
3010 static bool
3011 equal (const source_location_table_entry &ref1,
3012 const source_location_table_entry &ref2)
3013 {
3014 return ref1.loc == ref2.loc && ref1.uid == ref2.uid;
3015 }
3016
3017 static void
3018 mark_deleted (source_location_table_entry &ref)
3019 {
3020 ref.loc = UNKNOWN_LOCATION((location_t) 0);
3021 ref.uid = -1U;
3022 ref.var = NULL_TREE(tree) nullptr;
3023 }
3024
3025 static const bool empty_zero_p = true;
3026
3027 static void
3028 mark_empty (source_location_table_entry &ref)
3029 {
3030 ref.loc = UNKNOWN_LOCATION((location_t) 0);
3031 ref.uid = 0;
3032 ref.var = NULL_TREE(tree) nullptr;
3033 }
3034
3035 static bool
3036 is_deleted (const source_location_table_entry &ref)
3037 {
3038 return (ref.loc == UNKNOWN_LOCATION((location_t) 0)
3039 && ref.uid == -1U
3040 && ref.var == NULL_TREE(tree) nullptr);
3041 }
3042
3043 static bool
3044 is_empty (const source_location_table_entry &ref)
3045 {
3046 return (ref.loc == UNKNOWN_LOCATION((location_t) 0)
3047 && ref.uid == 0
3048 && ref.var == NULL_TREE(tree) nullptr);
3049 }
3050
3051 static void
3052 pch_nx (source_location_table_entry &p)
3053 {
3054 extern void gt_pch_nx (source_location_table_entry &);
3055 gt_pch_nx (p);
3056 }
3057
3058 static void
3059 pch_nx (source_location_table_entry &p, gt_pointer_operator op, void *cookie)
3060 {
3061 extern void gt_pch_nx (source_location_table_entry *, gt_pointer_operator,
3062 void *);
3063 gt_pch_nx (&p, op, cookie);
3064 }
3065};
3066
3067static GTY(()) hash_table <source_location_table_entry_hash>
3068 *source_location_table;
3069static GTY(()) unsigned int source_location_id;
3070
3071/* Fold __builtin_source_location () call. LOC is the location
3072 of the call. */
3073
3074tree
3075fold_builtin_source_location (location_t loc)
3076{
3077 if (source_location_implcp_global_trees[CPTI_SOURCE_LOCATION_IMPL] == NULL_TREE(tree) nullptr)
18
Assuming the condition is false
19
Taking false branch
3078 {
3079 auto_diagnostic_group d;
3080 source_location_implcp_global_trees[CPTI_SOURCE_LOCATION_IMPL] = get_source_location_impl_type (loc);
3081 if (source_location_implcp_global_trees[CPTI_SOURCE_LOCATION_IMPL] == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3082 inform (loc, "evaluating %qs", "__builtin_source_location");
3083 }
3084 if (source_location_implcp_global_trees[CPTI_SOURCE_LOCATION_IMPL] == error_mark_nodeglobal_trees[TI_ERROR_MARK])
20
Assuming the condition is false
21
Taking false branch
3085 return build_zero_cst (const_ptr_type_nodeglobal_trees[TI_CONST_PTR_TYPE]);
3086 if (source_location_table == NULLnullptr)
22
Assuming the condition is false
23
Taking false branch
3087 source_location_table
3088 = hash_table <source_location_table_entry_hash>::create_ggc (64);
3089 const line_map_ordinary *map;
3090 source_location_table_entry entry;
3091 entry.loc
3092 = linemap_resolve_location (line_table, loc, LRK_MACRO_EXPANSION_POINT,
3093 &map);
3094 entry.uid = current_function_decl ? DECL_UID (current_function_decl)((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 3094, __FUNCTION__))->decl_minimal.uid)
: -1;
24
Assuming 'current_function_decl' is null
25
'?' condition is false
3095 entry.var = error_mark_nodeglobal_trees[TI_ERROR_MARK];
3096 source_location_table_entry *entryp
3097 = source_location_table->find_slot (entry, INSERT);
3098 tree var;
3099 if (entryp->var)
26
Assuming field 'var' is null
27
Taking false branch
3100 var = entryp->var;
3101 else
3102 {
3103 char tmp_name[32];
3104 ASM_GENERATE_INTERNAL_LABEL (tmp_name, "Lsrc_loc", source_location_id++)do { char *__p; (tmp_name)[0] = '*'; (tmp_name)[1] = '.'; __p
= stpcpy (&(tmp_name)[2], "Lsrc_loc"); sprint_ul (__p, (
unsigned long) (source_location_id++)); } while (0)
;
28
Loop condition is false. Exiting loop
3105 var = build_decl (loc, VAR_DECL, get_identifier (tmp_name)(__builtin_constant_p (tmp_name) ? get_identifier_with_length
((tmp_name), strlen (tmp_name)) : get_identifier (tmp_name))
,
29
'?' condition is false
3106 source_location_implcp_global_trees[CPTI_SOURCE_LOCATION_IMPL]);
3107 TREE_STATIC (var)((var)->base.static_flag) = 1;
3108 TREE_PUBLIC (var)((var)->base.public_flag) = 0;
3109 DECL_ARTIFICIAL (var)((contains_struct_check ((var), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 3109, __FUNCTION__))->decl_common.artificial_flag)
= 1;
3110 DECL_IGNORED_P (var)((contains_struct_check ((var), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 3110, __FUNCTION__))->decl_common.ignored_flag)
= 1;
3111 DECL_EXTERNAL (var)((contains_struct_check ((var), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 3111, __FUNCTION__))->decl_common.decl_flag_1)
= 0;
3112 DECL_DECLARED_CONSTEXPR_P (var)((contains_struct_check (((tree_check2 (((((enum tree_code) (
var)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((var)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 3112, __FUNCTION__, (TEMPLATE_DECL))))))))->result : var
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 3112, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 3112, __FUNCTION__))->decl_common.lang_flag_8)
= 1;
30
Assuming field 'code' is not equal to TEMPLATE_DECL
31
'?' condition is false
3113 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (var)(((tree_not_check2 (((tree_check ((var), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 3113, __FUNCTION__, (VAR_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 3113, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2))
= 1;
3114 layout_decl (var, 0);
3115
3116 vec<constructor_elt, va_gc> *v = NULLnullptr;
3117 vec_alloc (v, 4);
32
Calling 'vec_alloc<constructor_elt, va_gc>'
53
Returning from 'vec_alloc<constructor_elt, va_gc>'
3118 for (tree field = TYPE_FIELDS (source_location_impl)((tree_check3 ((cp_global_trees[CPTI_SOURCE_LOCATION_IMPL]), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 3118, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
;
55
Loop condition is true. Entering loop body
3119 (field = next_initializable_field (field)) != NULL_TREE(tree) nullptr;
54
Assuming the condition is true
3120 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/cp/cp-gimplify.c"
, 3120, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 3120, __FUNCTION__))->common.chain))
)
3121 {
3122 const char *n = IDENTIFIER_POINTER (DECL_NAME (field))((const char *) (tree_check ((((contains_struct_check ((field
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 3122, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 3122, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str
)
;
3123 tree val = NULL_TREE(tree) nullptr;
3124 if (strcmp (n, "_M_file_name") == 0)
56
Taking true branch
3125 {
3126 if (const char *fname = LOCATION_FILE (loc)((expand_location (loc)).file))
57
Assuming 'fname' is null
58
Taking false branch
3127 {
3128 fname = remap_macro_filename (fname);
3129 val = build_string_literal (strlen (fname) + 1, fname);
3130 }
3131 else
3132 val = build_string_literal (1, "");
3133 }
3134 else if (strcmp (n, "_M_function_name") == 0)
3135 {
3136 const char *name = "";
3137
3138 if (current_function_decl)
3139 name = cxx_printable_name (current_function_decl, 2);
3140
3141 val = build_string_literal (strlen (name) + 1, name);
3142 }
3143 else if (strcmp (n, "_M_line") == 0)
3144 val = build_int_cst (TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 3144, __FUNCTION__))->typed.type)
, LOCATION_LINE (loc)((expand_location (loc)).line));
3145 else if (strcmp (n, "_M_column") == 0)
3146 val = build_int_cst (TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 3146, __FUNCTION__))->typed.type)
, LOCATION_COLUMN (loc)((expand_location (loc)).column));
3147 else
3148 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 3148, __FUNCTION__))
;
3149 CONSTRUCTOR_APPEND_ELT (v, field, val)do { constructor_elt _ce___ = {field, val}; vec_safe_push ((v
), _ce___); } while (0)
;
59
Passing value via 1st parameter 'v'
60
Calling 'vec_safe_push<constructor_elt, va_gc>'
3150 }
3151
3152 tree ctor = build_constructor (source_location_implcp_global_trees[CPTI_SOURCE_LOCATION_IMPL], v);
3153 TREE_CONSTANT (ctor)((non_type_check ((ctor), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 3153, __FUNCTION__))->base.constant_flag)
= 1;
3154 TREE_STATIC (ctor)((ctor)->base.static_flag) = 1;
3155 DECL_INITIAL (var)((contains_struct_check ((var), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/cp-gimplify.c"
, 3155, __FUNCTION__))->decl_common.initial)
= ctor;
3156 varpool_node::finalize_decl (var);
3157 *entryp = entry;
3158 entryp->var = var;
3159 }
3160
3161 return build_fold_addr_expr_with_type_loc (loc, var, const_ptr_type_nodeglobal_trees[TI_CONST_PTR_TYPE]);
3162}
3163
3164#include "gt-cp-cp-gimplify.h"

/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/vec.h

1/* Vector API for GNU compiler.
2 Copyright (C) 2004-2021 Free Software Foundation, Inc.
3 Contributed by Nathan Sidwell <nathan@codesourcery.com>
4 Re-implemented in C++ by Diego Novillo <dnovillo@google.com>
5
6This file is part of GCC.
7
8GCC is free software; you can redistribute it and/or modify it under
9the terms of the GNU General Public License as published by the Free
10Software Foundation; either version 3, or (at your option) any later
11version.
12
13GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14WARRANTY; without even the implied warranty of MERCHANTABILITY or
15FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16for more details.
17
18You should have received a copy of the GNU General Public License
19along with GCC; see the file COPYING3. If not see
20<http://www.gnu.org/licenses/>. */
21
22#ifndef GCC_VEC_H
23#define GCC_VEC_H
24
25/* Some gen* file have no ggc support as the header file gtype-desc.h is
26 missing. Provide these definitions in case ggc.h has not been included.
27 This is not a problem because any code that runs before gengtype is built
28 will never need to use GC vectors.*/
29
30extern void ggc_free (void *);
31extern size_t ggc_round_alloc_size (size_t requested_size);
32extern void *ggc_realloc (void *, size_t MEM_STAT_DECL);
33
34/* Templated vector type and associated interfaces.
35
36 The interface functions are typesafe and use inline functions,
37 sometimes backed by out-of-line generic functions. The vectors are
38 designed to interoperate with the GTY machinery.
39
40 There are both 'index' and 'iterate' accessors. The index accessor
41 is implemented by operator[]. The iterator returns a boolean
42 iteration condition and updates the iteration variable passed by
43 reference. Because the iterator will be inlined, the address-of
44 can be optimized away.
45
46 Each operation that increases the number of active elements is
47 available in 'quick' and 'safe' variants. The former presumes that
48 there is sufficient allocated space for the operation to succeed
49 (it dies if there is not). The latter will reallocate the
50 vector, if needed. Reallocation causes an exponential increase in
51 vector size. If you know you will be adding N elements, it would
52 be more efficient to use the reserve operation before adding the
53 elements with the 'quick' operation. This will ensure there are at
54 least as many elements as you ask for, it will exponentially
55 increase if there are too few spare slots. If you want reserve a
56 specific number of slots, but do not want the exponential increase
57 (for instance, you know this is the last allocation), use the
58 reserve_exact operation. You can also create a vector of a
59 specific size from the get go.
60
61 You should prefer the push and pop operations, as they append and
62 remove from the end of the vector. If you need to remove several
63 items in one go, use the truncate operation. The insert and remove
64 operations allow you to change elements in the middle of the
65 vector. There are two remove operations, one which preserves the
66 element ordering 'ordered_remove', and one which does not
67 'unordered_remove'. The latter function copies the end element
68 into the removed slot, rather than invoke a memmove operation. The
69 'lower_bound' function will determine where to place an item in the
70 array using insert that will maintain sorted order.
71
72 Vectors are template types with three arguments: the type of the
73 elements in the vector, the allocation strategy, and the physical
74 layout to use
75
76 Four allocation strategies are supported:
77
78 - Heap: allocation is done using malloc/free. This is the
79 default allocation strategy.
80
81 - GC: allocation is done using ggc_alloc/ggc_free.
82
83 - GC atomic: same as GC with the exception that the elements
84 themselves are assumed to be of an atomic type that does
85 not need to be garbage collected. This means that marking
86 routines do not need to traverse the array marking the
87 individual elements. This increases the performance of
88 GC activities.
89
90 Two physical layouts are supported:
91
92 - Embedded: The vector is structured using the trailing array
93 idiom. The last member of the structure is an array of size
94 1. When the vector is initially allocated, a single memory
95 block is created to hold the vector's control data and the
96 array of elements. These vectors cannot grow without
97 reallocation (see discussion on embeddable vectors below).
98
99 - Space efficient: The vector is structured as a pointer to an
100 embedded vector. This is the default layout. It means that
101 vectors occupy a single word of storage before initial
102 allocation. Vectors are allowed to grow (the internal
103 pointer is reallocated but the main vector instance does not
104 need to relocate).
105
106 The type, allocation and layout are specified when the vector is
107 declared.
108
109 If you need to directly manipulate a vector, then the 'address'
110 accessor will return the address of the start of the vector. Also
111 the 'space' predicate will tell you whether there is spare capacity
112 in the vector. You will not normally need to use these two functions.
113
114 Notes on the different layout strategies
115
116 * Embeddable vectors (vec<T, A, vl_embed>)
117
118 These vectors are suitable to be embedded in other data
119 structures so that they can be pre-allocated in a contiguous
120 memory block.
121
122 Embeddable vectors are implemented using the trailing array
123 idiom, thus they are not resizeable without changing the address
124 of the vector object itself. This means you cannot have
125 variables or fields of embeddable vector type -- always use a
126 pointer to a vector. The one exception is the final field of a
127 structure, which could be a vector type.
128
129 You will have to use the embedded_size & embedded_init calls to
130 create such objects, and they will not be resizeable (so the
131 'safe' allocation variants are not available).
132
133 Properties of embeddable vectors:
134
135 - The whole vector and control data are allocated in a single
136 contiguous block. It uses the trailing-vector idiom, so
137 allocation must reserve enough space for all the elements
138 in the vector plus its control data.
139 - The vector cannot be re-allocated.
140 - The vector cannot grow nor shrink.
141 - No indirections needed for access/manipulation.
142 - It requires 2 words of storage (prior to vector allocation).
143
144
145 * Space efficient vector (vec<T, A, vl_ptr>)
146
147 These vectors can grow dynamically and are allocated together
148 with their control data. They are suited to be included in data
149 structures. Prior to initial allocation, they only take a single
150 word of storage.
151
152 These vectors are implemented as a pointer to embeddable vectors.
153 The semantics allow for this pointer to be NULL to represent
154 empty vectors. This way, empty vectors occupy minimal space in
155 the structure containing them.
156
157 Properties:
158
159 - The whole vector and control data are allocated in a single
160 contiguous block.
161 - The whole vector may be re-allocated.
162 - Vector data may grow and shrink.
163 - Access and manipulation requires a pointer test and
164 indirection.
165 - It requires 1 word of storage (prior to vector allocation).
166
167 An example of their use would be,
168
169 struct my_struct {
170 // A space-efficient vector of tree pointers in GC memory.
171 vec<tree, va_gc, vl_ptr> v;
172 };
173
174 struct my_struct *s;
175
176 if (s->v.length ()) { we have some contents }
177 s->v.safe_push (decl); // append some decl onto the end
178 for (ix = 0; s->v.iterate (ix, &elt); ix++)
179 { do something with elt }
180*/
181
182/* Support function for statistics. */
183extern void dump_vec_loc_statistics (void);
184
185/* Hashtable mapping vec addresses to descriptors. */
186extern htab_t vec_mem_usage_hash;
187
188/* Control data for vectors. This contains the number of allocated
189 and used slots inside a vector. */
190
191struct vec_prefix
192{
193 /* FIXME - These fields should be private, but we need to cater to
194 compilers that have stricter notions of PODness for types. */
195
196 /* Memory allocation support routines in vec.c. */
197 void register_overhead (void *, size_t, size_t CXX_MEM_STAT_INFO);
198 void release_overhead (void *, size_t, size_t, bool CXX_MEM_STAT_INFO);
199 static unsigned calculate_allocation (vec_prefix *, unsigned, bool);
200 static unsigned calculate_allocation_1 (unsigned, unsigned);
201
202 /* Note that vec_prefix should be a base class for vec, but we use
203 offsetof() on vector fields of tree structures (e.g.,
204 tree_binfo::base_binfos), and offsetof only supports base types.
205
206 To compensate, we make vec_prefix a field inside vec and make
207 vec a friend class of vec_prefix so it can access its fields. */
208 template <typename, typename, typename> friend struct vec;
209
210 /* The allocator types also need access to our internals. */
211 friend struct va_gc;
212 friend struct va_gc_atomic;
213 friend struct va_heap;
214
215 unsigned m_alloc : 31;
216 unsigned m_using_auto_storage : 1;
217 unsigned m_num;
218};
219
220/* Calculate the number of slots to reserve a vector, making sure that
221 RESERVE slots are free. If EXACT grow exactly, otherwise grow
222 exponentially. PFX is the control data for the vector. */
223
224inline unsigned
225vec_prefix::calculate_allocation (vec_prefix *pfx, unsigned reserve,
226 bool exact)
227{
228 if (exact
42.1
'exact' is false
42.1
'exact' is false
)
43
Taking false branch
229 return (pfx ? pfx->m_num : 0) + reserve;
230 else if (!pfx
43.1
'pfx' is null
43.1
'pfx' is null
)
44
Taking true branch
231 return MAX (4, reserve)((4) > (reserve) ? (4) : (reserve));
45
'?' condition is false
46
Returning the value 4, which participates in a condition later
232 return calculate_allocation_1 (pfx->m_alloc, pfx->m_num + reserve);
233}
234
235template<typename, typename, typename> struct vec;
236
237/* Valid vector layouts
238
239 vl_embed - Embeddable vector that uses the trailing array idiom.
240 vl_ptr - Space efficient vector that uses a pointer to an
241 embeddable vector. */
242struct vl_embed { };
243struct vl_ptr { };
244
245
246/* Types of supported allocations
247
248 va_heap - Allocation uses malloc/free.
249 va_gc - Allocation uses ggc_alloc.
250 va_gc_atomic - Same as GC, but individual elements of the array
251 do not need to be marked during collection. */
252
253/* Allocator type for heap vectors. */
254struct va_heap
255{
256 /* Heap vectors are frequently regular instances, so use the vl_ptr
257 layout for them. */
258 typedef vl_ptr default_layout;
259
260 template<typename T>
261 static void reserve (vec<T, va_heap, vl_embed> *&, unsigned, bool
262 CXX_MEM_STAT_INFO);
263
264 template<typename T>
265 static void release (vec<T, va_heap, vl_embed> *&);
266};
267
268
269/* Allocator for heap memory. Ensure there are at least RESERVE free
270 slots in V. If EXACT is true, grow exactly, else grow
271 exponentially. As a special case, if the vector had not been
272 allocated and RESERVE is 0, no vector will be created. */
273
274template<typename T>
275inline void
276va_heap::reserve (vec<T, va_heap, vl_embed> *&v, unsigned reserve, bool exact
277 MEM_STAT_DECL)
278{
279 size_t elt_size = sizeof (T);
280 unsigned alloc
281 = vec_prefix::calculate_allocation (v ? &v->m_vecpfx : 0, reserve, exact);
282 gcc_checking_assert (alloc)((void)(!(alloc) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/vec.h"
, 282, __FUNCTION__), 0 : 0))
;
283
284 if (GATHER_STATISTICS0 && v)
285 v->m_vecpfx.release_overhead (v, elt_size * v->allocated (),
286 v->allocated (), false);
287
288 size_t size = vec<T, va_heap, vl_embed>::embedded_size (alloc);
289 unsigned nelem = v ? v->length () : 0;
290 v = static_cast <vec<T, va_heap, vl_embed> *> (xrealloc (v, size));
291 v->embedded_init (alloc, nelem);
292
293 if (GATHER_STATISTICS0)
294 v->m_vecpfx.register_overhead (v, alloc, elt_size PASS_MEM_STAT);
295}
296
297
298#if GCC_VERSION(4 * 1000 + 2) >= 4007
299#pragma GCC diagnostic push
300#pragma GCC diagnostic ignored "-Wfree-nonheap-object"
301#endif
302
303/* Free the heap space allocated for vector V. */
304
305template<typename T>
306void
307va_heap::release (vec<T, va_heap, vl_embed> *&v)
308{
309 size_t elt_size = sizeof (T);
310 if (v == NULLnullptr)
311 return;
312
313 if (GATHER_STATISTICS0)
314 v->m_vecpfx.release_overhead (v, elt_size * v->allocated (),
315 v->allocated (), true);
316 ::free (v);
317 v = NULLnullptr;
318}
319
320#if GCC_VERSION(4 * 1000 + 2) >= 4007
321#pragma GCC diagnostic pop
322#endif
323
324/* Allocator type for GC vectors. Notice that we need the structure
325 declaration even if GC is not enabled. */
326
327struct va_gc
328{
329 /* Use vl_embed as the default layout for GC vectors. Due to GTY
330 limitations, GC vectors must always be pointers, so it is more
331 efficient to use a pointer to the vl_embed layout, rather than
332 using a pointer to a pointer as would be the case with vl_ptr. */
333 typedef vl_embed default_layout;
334
335 template<typename T, typename A>
336 static void reserve (vec<T, A, vl_embed> *&, unsigned, bool
337 CXX_MEM_STAT_INFO);
338
339 template<typename T, typename A>
340 static void release (vec<T, A, vl_embed> *&v);
341};
342
343
344/* Free GC memory used by V and reset V to NULL. */
345
346template<typename T, typename A>
347inline void
348va_gc::release (vec<T, A, vl_embed> *&v)
349{
350 if (v)
351 ::ggc_free (v);
352 v = NULLnullptr;
353}
354
355
356/* Allocator for GC memory. Ensure there are at least RESERVE free
357 slots in V. If EXACT is true, grow exactly, else grow
358 exponentially. As a special case, if the vector had not been
359 allocated and RESERVE is 0, no vector will be created. */
360
361template<typename T, typename A>
362void
363va_gc::reserve (vec<T, A, vl_embed> *&v, unsigned reserve, bool exact
364 MEM_STAT_DECL)
365{
366 unsigned alloc
367 = vec_prefix::calculate_allocation (v
40.1
'v' is null
65.1
'v' is non-null
40.1
'v' is null
65.1
'v' is non-null
? &v->m_vecpfx : 0, reserve, exact)
;
41
'?' condition is false
42
Calling 'vec_prefix::calculate_allocation'
47
Returning from 'vec_prefix::calculate_allocation'
66
'?' condition is true
368 if (!alloc
47.1
'alloc' is 4
47.1
'alloc' is 4
)
48
Taking false branch
67
Assuming 'alloc' is 0
68
Taking true branch
369 {
370 ::ggc_free (v);
371 v = NULLnullptr;
69
Null pointer value stored to 'v'
372 return;
373 }
374
375 /* Calculate the amount of space we want. */
376 size_t size = vec<T, A, vl_embed>::embedded_size (alloc);
377
378 /* Ask the allocator how much space it will really give us. */
379 size = ::ggc_round_alloc_size (size);
380
381 /* Adjust the number of slots accordingly. */
382 size_t vec_offset = sizeof (vec_prefix);
383 size_t elt_size = sizeof (T);
384 alloc = (size - vec_offset) / elt_size;
385
386 /* And finally, recalculate the amount of space we ask for. */
387 size = vec_offset + alloc * elt_size;
388
389 unsigned nelem = v
48.1
'v' is null
48.1
'v' is null
? v->length () : 0;
49
'?' condition is false
390 v = static_cast <vec<T, A, vl_embed> *> (::ggc_realloc (v, size
50
Value assigned to 'v'
391 PASS_MEM_STAT));
392 v->embedded_init (alloc, nelem);
393}
394
395
396/* Allocator type for GC vectors. This is for vectors of types
397 atomics w.r.t. collection, so allocation and deallocation is
398 completely inherited from va_gc. */
399struct va_gc_atomic : va_gc
400{
401};
402
403
404/* Generic vector template. Default values for A and L indicate the
405 most commonly used strategies.
406
407 FIXME - Ideally, they would all be vl_ptr to encourage using regular
408 instances for vectors, but the existing GTY machinery is limited
409 in that it can only deal with GC objects that are pointers
410 themselves.
411
412 This means that vector operations that need to deal with
413 potentially NULL pointers, must be provided as free
414 functions (see the vec_safe_* functions above). */
415template<typename T,
416 typename A = va_heap,
417 typename L = typename A::default_layout>
418struct GTY((user)) vec
419{
420};
421
422/* Allow C++11 range-based 'for' to work directly on vec<T>*. */
423template<typename T, typename A, typename L>
424T* begin (vec<T,A,L> *v) { return v ? v->begin () : nullptr; }
425template<typename T, typename A, typename L>
426T* end (vec<T,A,L> *v) { return v ? v->end () : nullptr; }
427template<typename T, typename A, typename L>
428const T* begin (const vec<T,A,L> *v) { return v ? v->begin () : nullptr; }
429template<typename T, typename A, typename L>
430const T* end (const vec<T,A,L> *v) { return v ? v->end () : nullptr; }
431
432/* Generic vec<> debug helpers.
433
434 These need to be instantiated for each vec<TYPE> used throughout
435 the compiler like this:
436
437 DEFINE_DEBUG_VEC (TYPE)
438
439 The reason we have a debug_helper() is because GDB can't
440 disambiguate a plain call to debug(some_vec), and it must be called
441 like debug<TYPE>(some_vec). */
442
443template<typename T>
444void
445debug_helper (vec<T> &ref)
446{
447 unsigned i;
448 for (i = 0; i < ref.length (); ++i)
449 {
450 fprintf (stderrstderr, "[%d] = ", i);
451 debug_slim (ref[i]);
452 fputc ('\n', stderrstderr);
453 }
454}
455
456/* We need a separate va_gc variant here because default template
457 argument for functions cannot be used in c++-98. Once this
458 restriction is removed, those variant should be folded with the
459 above debug_helper. */
460
461template<typename T>
462void
463debug_helper (vec<T, va_gc> &ref)
464{
465 unsigned i;
466 for (i = 0; i < ref.length (); ++i)
467 {
468 fprintf (stderrstderr, "[%d] = ", i);
469 debug_slim (ref[i]);
470 fputc ('\n', stderrstderr);
471 }
472}
473
474/* Macro to define debug(vec<T>) and debug(vec<T, va_gc>) helper
475 functions for a type T. */
476
477#define DEFINE_DEBUG_VEC(T)template void debug_helper (vec<T> &); template void
debug_helper (vec<T, va_gc> &); __attribute__ ((__used__
)) void debug (vec<T> &ref) { debug_helper <T>
(ref); } __attribute__ ((__used__)) void debug (vec<T>
*ptr) { if (ptr) debug (*ptr); else fprintf (stderr, "<nil>\n"
); } __attribute__ ((__used__)) void debug (vec<T, va_gc>
&ref) { debug_helper <T> (ref); } __attribute__ ((
__used__)) void debug (vec<T, va_gc> *ptr) { if (ptr) debug
(*ptr); else fprintf (stderr, "<nil>\n"); }
\
478 template void debug_helper (vec<T> &); \
479 template void debug_helper (vec<T, va_gc> &); \
480 /* Define the vec<T> debug functions. */ \
481 DEBUG_FUNCTION__attribute__ ((__used__)) void \
482 debug (vec<T> &ref) \
483 { \
484 debug_helper <T> (ref); \
485 } \
486 DEBUG_FUNCTION__attribute__ ((__used__)) void \
487 debug (vec<T> *ptr) \
488 { \
489 if (ptr) \
490 debug (*ptr); \
491 else \
492 fprintf (stderrstderr, "<nil>\n"); \
493 } \
494 /* Define the vec<T, va_gc> debug functions. */ \
495 DEBUG_FUNCTION__attribute__ ((__used__)) void \
496 debug (vec<T, va_gc> &ref) \
497 { \
498 debug_helper <T> (ref); \
499 } \
500 DEBUG_FUNCTION__attribute__ ((__used__)) void \
501 debug (vec<T, va_gc> *ptr) \
502 { \
503 if (ptr) \
504 debug (*ptr); \
505 else \
506 fprintf (stderrstderr, "<nil>\n"); \
507 }
508
509/* Default-construct N elements in DST. */
510
511template <typename T>
512inline void
513vec_default_construct (T *dst, unsigned n)
514{
515#ifdef BROKEN_VALUE_INITIALIZATION
516 /* Versions of GCC before 4.4 sometimes leave certain objects
517 uninitialized when value initialized, though if the type has
518 user defined default ctor, that ctor is invoked. As a workaround
519 perform clearing first and then the value initialization, which
520 fixes the case when value initialization doesn't initialize due to
521 the bugs and should initialize to all zeros, but still allows
522 vectors for types with user defined default ctor that initializes
523 some or all elements to non-zero. If T has no user defined
524 default ctor and some non-static data members have user defined
525 default ctors that initialize to non-zero the workaround will
526 still not work properly; in that case we just need to provide
527 user defined default ctor. */
528 memset (dst, '\0', sizeof (T) * n);
529#endif
530 for ( ; n; ++dst, --n)
531 ::new (static_cast<void*>(dst)) T ();
532}
533
534/* Copy-construct N elements in DST from *SRC. */
535
536template <typename T>
537inline void
538vec_copy_construct (T *dst, const T *src, unsigned n)
539{
540 for ( ; n; ++dst, ++src, --n)
541 ::new (static_cast<void*>(dst)) T (*src);
542}
543
544/* Type to provide zero-initialized values for vec<T, A, L>. This is
545 used to provide nil initializers for vec instances. Since vec must
546 be a trivially copyable type that can be copied by memcpy and zeroed
547 out by memset, it must have defaulted default and copy ctor and copy
548 assignment. To initialize a vec either use value initialization
549 (e.g., vec() or vec v{ };) or assign it the value vNULL. This isn't
550 needed for file-scope and function-local static vectors, which are
551 zero-initialized by default. */
552struct vnull { };
553constexpr vnull vNULL{ };
554
555
556/* Embeddable vector. These vectors are suitable to be embedded
557 in other data structures so that they can be pre-allocated in a
558 contiguous memory block.
559
560 Embeddable vectors are implemented using the trailing array idiom,
561 thus they are not resizeable without changing the address of the
562 vector object itself. This means you cannot have variables or
563 fields of embeddable vector type -- always use a pointer to a
564 vector. The one exception is the final field of a structure, which
565 could be a vector type.
566
567 You will have to use the embedded_size & embedded_init calls to
568 create such objects, and they will not be resizeable (so the 'safe'
569 allocation variants are not available).
570
571 Properties:
572
573 - The whole vector and control data are allocated in a single
574 contiguous block. It uses the trailing-vector idiom, so
575 allocation must reserve enough space for all the elements
576 in the vector plus its control data.
577 - The vector cannot be re-allocated.
578 - The vector cannot grow nor shrink.
579 - No indirections needed for access/manipulation.
580 - It requires 2 words of storage (prior to vector allocation). */
581
582template<typename T, typename A>
583struct GTY((user)) vec<T, A, vl_embed>
584{
585public:
586 unsigned allocated (void) const { return m_vecpfx.m_alloc; }
587 unsigned length (void) const { return m_vecpfx.m_num; }
588 bool is_empty (void) const { return m_vecpfx.m_num == 0; }
589 T *address (void) { return m_vecdata; }
590 const T *address (void) const { return m_vecdata; }
591 T *begin () { return address (); }
592 const T *begin () const { return address (); }
593 T *end () { return address () + length (); }
594 const T *end () const { return address () + length (); }
595 const T &operator[] (unsigned) const;
596 T &operator[] (unsigned);
597 T &last (void);
598 bool space (unsigned) const;
599 bool iterate (unsigned, T *) const;
600 bool iterate (unsigned, T **) const;
601 vec *copy (ALONE_CXX_MEM_STAT_INFO) const;
602 void splice (const vec &);
603 void splice (const vec *src);
604 T *quick_push (const T &);
605 T &pop (void);
606 void truncate (unsigned);
607 void quick_insert (unsigned, const T &);
608 void ordered_remove (unsigned);
609 void unordered_remove (unsigned);
610 void block_remove (unsigned, unsigned);
611 void qsort (int (*) (const void *, const void *))qsort (int (*) (const void *, const void *));
612 void sort (int (*) (const void *, const void *, void *), void *);
613 void stablesort (int (*) (const void *, const void *, void *), void *);
614 T *bsearch (const void *key, int (*compar)(const void *, const void *));
615 T *bsearch (const void *key,
616 int (*compar)(const void *, const void *, void *), void *);
617 unsigned lower_bound (T, bool (*)(const T &, const T &)) const;
618 bool contains (const T &search) const;
619 static size_t embedded_size (unsigned);
620 void embedded_init (unsigned, unsigned = 0, unsigned = 0);
621 void quick_grow (unsigned len);
622 void quick_grow_cleared (unsigned len);
623
624 /* vec class can access our internal data and functions. */
625 template <typename, typename, typename> friend struct vec;
626
627 /* The allocator types also need access to our internals. */
628 friend struct va_gc;
629 friend struct va_gc_atomic;
630 friend struct va_heap;
631
632 /* FIXME - These fields should be private, but we need to cater to
633 compilers that have stricter notions of PODness for types. */
634 vec_prefix m_vecpfx;
635 T m_vecdata[1];
636};
637
638
639/* Convenience wrapper functions to use when dealing with pointers to
640 embedded vectors. Some functionality for these vectors must be
641 provided via free functions for these reasons:
642
643 1- The pointer may be NULL (e.g., before initial allocation).
644
645 2- When the vector needs to grow, it must be reallocated, so
646 the pointer will change its value.
647
648 Because of limitations with the current GC machinery, all vectors
649 in GC memory *must* be pointers. */
650
651
652/* If V contains no room for NELEMS elements, return false. Otherwise,
653 return true. */
654template<typename T, typename A>
655inline bool
656vec_safe_space (const vec<T, A, vl_embed> *v, unsigned nelems)
657{
658 return v
35.1
'v' is null
35.1
'v' is null
? v->space (nelems) : nelems == 0
;
36
'?' condition is false
37
Returning zero, which participates in a condition later
659}
660
661
662/* If V is NULL, return 0. Otherwise, return V->length(). */
663template<typename T, typename A>
664inline unsigned
665vec_safe_length (const vec<T, A, vl_embed> *v)
666{
667 return v ? v->length () : 0;
668}
669
670
671/* If V is NULL, return NULL. Otherwise, return V->address(). */
672template<typename T, typename A>
673inline T *
674vec_safe_address (vec<T, A, vl_embed> *v)
675{
676 return v ? v->address () : NULLnullptr;
677}
678
679
680/* If V is NULL, return true. Otherwise, return V->is_empty(). */
681template<typename T, typename A>
682inline bool
683vec_safe_is_empty (vec<T, A, vl_embed> *v)
684{
685 return v ? v->is_empty () : true;
686}
687
688/* If V does not have space for NELEMS elements, call
689 V->reserve(NELEMS, EXACT). */
690template<typename T, typename A>
691inline bool
692vec_safe_reserve (vec<T, A, vl_embed> *&v, unsigned nelems, bool exact = false
693 CXX_MEM_STAT_INFO)
694{
695 bool extend = nelems
33.1
'nelems' is 4
61.1
'nelems' is 1
33.1
'nelems' is 4
61.1
'nelems' is 1
? !vec_safe_space (v, nelems) : false;
34
'?' condition is true
35
Calling 'vec_safe_space<constructor_elt, va_gc>'
38
Returning from 'vec_safe_space<constructor_elt, va_gc>'
62
'?' condition is true
63
Assuming the condition is true
696 if (extend
38.1
'extend' is true
63.1
'extend' is true
38.1
'extend' is true
63.1
'extend' is true
)
39
Taking true branch
64
Taking true branch
697 A::reserve (v, nelems, exact PASS_MEM_STAT);
40
Calling 'va_gc::reserve'
51
Returning from 'va_gc::reserve'
65
Calling 'va_gc::reserve'
70
Returning from 'va_gc::reserve'
698 return extend;
699}
700
701template<typename T, typename A>
702inline bool
703vec_safe_reserve_exact (vec<T, A, vl_embed> *&v, unsigned nelems
704 CXX_MEM_STAT_INFO)
705{
706 return vec_safe_reserve (v, nelems, true PASS_MEM_STAT);
707}
708
709
710/* Allocate GC memory for V with space for NELEMS slots. If NELEMS
711 is 0, V is initialized to NULL. */
712
713template<typename T, typename A>
714inline void
715vec_alloc (vec<T, A, vl_embed> *&v, unsigned nelems CXX_MEM_STAT_INFO)
716{
717 v = NULLnullptr;
718 vec_safe_reserve (v, nelems, false PASS_MEM_STAT);
33
Calling 'vec_safe_reserve<constructor_elt, va_gc>'
52
Returning from 'vec_safe_reserve<constructor_elt, va_gc>'
719}
720
721
722/* Free the GC memory allocated by vector V and set it to NULL. */
723
724template<typename T, typename A>
725inline void
726vec_free (vec<T, A, vl_embed> *&v)
727{
728 A::release (v);
729}
730
731
732/* Grow V to length LEN. Allocate it, if necessary. */
733template<typename T, typename A>
734inline void
735vec_safe_grow (vec<T, A, vl_embed> *&v, unsigned len,
736 bool exact = false CXX_MEM_STAT_INFO)
737{
738 unsigned oldlen = vec_safe_length (v);
739 gcc_checking_assert (len >= oldlen)((void)(!(len >= oldlen) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/vec.h"
, 739, __FUNCTION__), 0 : 0))
;
740 vec_safe_reserve (v, len - oldlen, exact PASS_MEM_STAT);
741 v->quick_grow (len);
742}
743
744
745/* If V is NULL, allocate it. Call V->safe_grow_cleared(LEN). */
746template<typename T, typename A>
747inline void
748vec_safe_grow_cleared (vec<T, A, vl_embed> *&v, unsigned len,
749 bool exact = false CXX_MEM_STAT_INFO)
750{
751 unsigned oldlen = vec_safe_length (v);
752 vec_safe_grow (v, len, exact PASS_MEM_STAT);
753 vec_default_construct (v->address () + oldlen, len - oldlen);
754}
755
756
757/* Assume V is not NULL. */
758
759template<typename T>
760inline void
761vec_safe_grow_cleared (vec<T, va_heap, vl_ptr> *&v,
762 unsigned len, bool exact = false CXX_MEM_STAT_INFO)
763{
764 v->safe_grow_cleared (len, exact PASS_MEM_STAT);
765}
766
767/* If V does not have space for NELEMS elements, call
768 V->reserve(NELEMS, EXACT). */
769
770template<typename T>
771inline bool
772vec_safe_reserve (vec<T, va_heap, vl_ptr> *&v, unsigned nelems, bool exact = false
773 CXX_MEM_STAT_INFO)
774{
775 return v->reserve (nelems, exact);
776}
777
778
779/* If V is NULL return false, otherwise return V->iterate(IX, PTR). */
780template<typename T, typename A>
781inline bool
782vec_safe_iterate (const vec<T, A, vl_embed> *v, unsigned ix, T **ptr)
783{
784 if (v)
785 return v->iterate (ix, ptr);
786 else
787 {
788 *ptr = 0;
789 return false;
790 }
791}
792
793template<typename T, typename A>
794inline bool
795vec_safe_iterate (const vec<T, A, vl_embed> *v, unsigned ix, T *ptr)
796{
797 if (v)
798 return v->iterate (ix, ptr);
799 else
800 {
801 *ptr = 0;
802 return false;
803 }
804}
805
806
807/* If V has no room for one more element, reallocate it. Then call
808 V->quick_push(OBJ). */
809template<typename T, typename A>
810inline T *
811vec_safe_push (vec<T, A, vl_embed> *&v, const T &obj CXX_MEM_STAT_INFO)
812{
813 vec_safe_reserve (v, 1, false PASS_MEM_STAT);
61
Calling 'vec_safe_reserve<constructor_elt, va_gc>'
71
Returning from 'vec_safe_reserve<constructor_elt, va_gc>'
814 return v->quick_push (obj);
72
Called C++ object pointer is null
815}
816
817
818/* if V has no room for one more element, reallocate it. Then call
819 V->quick_insert(IX, OBJ). */
820template<typename T, typename A>
821inline void
822vec_safe_insert (vec<T, A, vl_embed> *&v, unsigned ix, const T &obj
823 CXX_MEM_STAT_INFO)
824{
825 vec_safe_reserve (v, 1, false PASS_MEM_STAT);
826 v->quick_insert (ix, obj);
827}
828
829
830/* If V is NULL, do nothing. Otherwise, call V->truncate(SIZE). */
831template<typename T, typename A>
832inline void
833vec_safe_truncate (vec<T, A, vl_embed> *v, unsigned size)
834{
835 if (v)
836 v->truncate (size);
837}
838
839
840/* If SRC is not NULL, return a pointer to a copy of it. */
841template<typename T, typename A>
842inline vec<T, A, vl_embed> *
843vec_safe_copy (vec<T, A, vl_embed> *src CXX_MEM_STAT_INFO)
844{
845 return src ? src->copy (ALONE_PASS_MEM_STAT) : NULLnullptr;
846}
847
848/* Copy the elements from SRC to the end of DST as if by memcpy.
849 Reallocate DST, if necessary. */
850template<typename T, typename A>
851inline void
852vec_safe_splice (vec<T, A, vl_embed> *&dst, const vec<T, A, vl_embed> *src
853 CXX_MEM_STAT_INFO)
854{
855 unsigned src_len = vec_safe_length (src);
856 if (src_len)
857 {
858 vec_safe_reserve_exact (dst, vec_safe_length (dst) + src_len
859 PASS_MEM_STAT);
860 dst->splice (*src);
861 }
862}
863
864/* Return true if SEARCH is an element of V. Note that this is O(N) in the
865 size of the vector and so should be used with care. */
866
867template<typename T, typename A>
868inline bool
869vec_safe_contains (vec<T, A, vl_embed> *v, const T &search)
870{
871 return v ? v->contains (search) : false;
872}
873
874/* Index into vector. Return the IX'th element. IX must be in the
875 domain of the vector. */
876
877template<typename T, typename A>
878inline const T &
879vec<T, A, vl_embed>::operator[] (unsigned ix) const
880{
881 gcc_checking_assert (ix < m_vecpfx.m_num)((void)(!(ix < m_vecpfx.m_num) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/vec.h"
, 881, __FUNCTION__), 0 : 0))
;
882 return m_vecdata[ix];
883}
884
885template<typename T, typename A>
886inline T &
887vec<T, A, vl_embed>::operator[] (unsigned ix)
888{
889 gcc_checking_assert (ix < m_vecpfx.m_num)((void)(!(ix < m_vecpfx.m_num) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/vec.h"
, 889, __FUNCTION__), 0 : 0))
;
890 return m_vecdata[ix];
891}
892
893
894/* Get the final element of the vector, which must not be empty. */
895
896template<typename T, typename A>
897inline T &
898vec<T, A, vl_embed>::last (void)
899{
900 gcc_checking_assert (m_vecpfx.m_num > 0)((void)(!(m_vecpfx.m_num > 0) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/vec.h"
, 900, __FUNCTION__), 0 : 0))
;
901 return (*this)[m_vecpfx.m_num - 1];
902}
903
904
905/* If this vector has space for NELEMS additional entries, return
906 true. You usually only need to use this if you are doing your
907 own vector reallocation, for instance on an embedded vector. This
908 returns true in exactly the same circumstances that vec::reserve
909 will. */
910
911template<typename T, typename A>
912inline bool
913vec<T, A, vl_embed>::space (unsigned nelems) const
914{
915 return m_vecpfx.m_alloc - m_vecpfx.m_num >= nelems;
916}
917
918
919/* Return iteration condition and update PTR to point to the IX'th
920 element of this vector. Use this to iterate over the elements of a
921 vector as follows,
922
923 for (ix = 0; vec<T, A>::iterate (v, ix, &ptr); ix++)
924 continue; */
925
926template<typename T, typename A>
927inline bool
928vec<T, A, vl_embed>::iterate (unsigned ix, T *ptr) const
929{
930 if (ix < m_vecpfx.m_num)
931 {
932 *ptr = m_vecdata[ix];
933 return true;
934 }
935 else
936 {
937 *ptr = 0;
938 return false;
939 }
940}
941
942
943/* Return iteration condition and update *PTR to point to the
944 IX'th element of this vector. Use this to iterate over the
945 elements of a vector as follows,
946
947 for (ix = 0; v->iterate (ix, &ptr); ix++)
948 continue;
949
950 This variant is for vectors of objects. */
951
952template<typename T, typename A>
953inline bool
954vec<T, A, vl_embed>::iterate (unsigned ix, T **ptr) const
955{
956 if (ix < m_vecpfx.m_num)
957 {
958 *ptr = CONST_CAST (T *, &m_vecdata[ix])(const_cast<T *> ((&m_vecdata[ix])));
959 return true;
960 }
961 else
962 {
963 *ptr = 0;
964 return false;
965 }
966}
967
968
969/* Return a pointer to a copy of this vector. */
970
971template<typename T, typename A>
972inline vec<T, A, vl_embed> *
973vec<T, A, vl_embed>::copy (ALONE_MEM_STAT_DECLvoid) const
974{
975 vec<T, A, vl_embed> *new_vec = NULLnullptr;
976 unsigned len = length ();
977 if (len)
978 {
979 vec_alloc (new_vec, len PASS_MEM_STAT);
980 new_vec->embedded_init (len, len);
981 vec_copy_construct (new_vec->address (), m_vecdata, len);
982 }
983 return new_vec;
984}
985
986
987/* Copy the elements from SRC to the end of this vector as if by memcpy.
988 The vector must have sufficient headroom available. */
989
990template<typename T, typename A>
991inline void
992vec<T, A, vl_embed>::splice (const vec<T, A, vl_embed> &src)
993{
994 unsigned len = src.length ();
995 if (len)
996 {
997 gcc_checking_assert (space (len))((void)(!(space (len)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/vec.h"
, 997, __FUNCTION__), 0 : 0))
;
998 vec_copy_construct (end (), src.address (), len);
999 m_vecpfx.m_num += len;
1000 }
1001}
1002
1003template<typename T, typename A>
1004inline void
1005vec<T, A, vl_embed>::splice (const vec<T, A, vl_embed> *src)
1006{
1007 if (src)
1008 splice (*src);
1009}
1010
1011
1012/* Push OBJ (a new element) onto the end of the vector. There must be
1013 sufficient space in the vector. Return a pointer to the slot
1014 where OBJ was inserted. */
1015
1016template<typename T, typename A>
1017inline T *
1018vec<T, A, vl_embed>::quick_push (const T &obj)
1019{
1020 gcc_checking_assert (space (1))((void)(!(space (1)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/vec.h"
, 1020, __FUNCTION__), 0 : 0))
;
1021 T *slot = &m_vecdata[m_vecpfx.m_num++];
1022 *slot = obj;
1023 return slot;
1024}
1025
1026
1027/* Pop and return the last element off the end of the vector. */
1028
1029template<typename T, typename A>
1030inline T &
1031vec<T, A, vl_embed>::pop (void)
1032{
1033 gcc_checking_assert (length () > 0)((void)(!(length () > 0) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/vec.h"
, 1033, __FUNCTION__), 0 : 0))
;
1034 return m_vecdata[--m_vecpfx.m_num];
1035}
1036
1037
1038/* Set the length of the vector to SIZE. The new length must be less
1039 than or equal to the current length. This is an O(1) operation. */
1040
1041template<typename T, typename A>
1042inline void
1043vec<T, A, vl_embed>::truncate (unsigned size)
1044{
1045 gcc_checking_assert (length () >= size)((void)(!(length () >= size) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/vec.h"
, 1045, __FUNCTION__), 0 : 0))
;
1046 m_vecpfx.m_num = size;
1047}
1048
1049
1050/* Insert an element, OBJ, at the IXth position of this vector. There
1051 must be sufficient space. */
1052
1053template<typename T, typename A>
1054inline void
1055vec<T, A, vl_embed>::quick_insert (unsigned ix, const T &obj)
1056{
1057 gcc_checking_assert (length () < allocated ())((void)(!(length () < allocated ()) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/vec.h"
, 1057, __FUNCTION__), 0 : 0))
;
1058 gcc_checking_assert (ix <= length ())((void)(!(ix <= length ()) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/vec.h"
, 1058, __FUNCTION__), 0 : 0))
;
1059 T *slot = &m_vecdata[ix];
1060 memmove (slot + 1, slot, (m_vecpfx.m_num++ - ix) * sizeof (T));
1061 *slot = obj;
1062}
1063
1064
1065/* Remove an element from the IXth position of this vector. Ordering of
1066 remaining elements is preserved. This is an O(N) operation due to
1067 memmove. */
1068
1069template<typename T, typename A>
1070inline void
1071vec<T, A, vl_embed>::ordered_remove (unsigned ix)
1072{
1073 gcc_checking_assert (ix < length ())((void)(!(ix < length ()) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/vec.h"
, 1073, __FUNCTION__), 0 : 0))
;
1074 T *slot = &m_vecdata[ix];
1075 memmove (slot, slot + 1, (--m_vecpfx.m_num - ix) * sizeof (T));
1076}
1077
1078
1079/* Remove elements in [START, END) from VEC for which COND holds. Ordering of
1080 remaining elements is preserved. This is an O(N) operation. */
1081
1082#define VEC_ORDERED_REMOVE_IF_FROM_TO(vec, read_index, write_index, \{ ((void)(!((end) <= (vec).length ()) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/vec.h"
, 1083, __FUNCTION__), 0 : 0)); for (read_index = write_index
= (start); read_index < (end); ++read_index) { elem_ptr =
&(vec)[read_index]; bool remove_p = (cond); if (remove_p
) continue; if (read_index != write_index) (vec)[write_index]
= (vec)[read_index]; write_index++; } if (read_index - write_index
> 0) (vec).block_remove (write_index, read_index - write_index
); }
1083 elem_ptr, start, end, cond){ ((void)(!((end) <= (vec).length ()) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/vec.h"
, 1083, __FUNCTION__), 0 : 0)); for (read_index = write_index
= (start); read_index < (end); ++read_index) { elem_ptr =
&(vec)[read_index]; bool remove_p = (cond); if (remove_p
) continue; if (read_index != write_index) (vec)[write_index]
= (vec)[read_index]; write_index++; } if (read_index - write_index
> 0) (vec).block_remove (write_index, read_index - write_index
); }
\
1084 { \
1085 gcc_assert ((end) <= (vec).length ())((void)(!((end) <= (vec).length ()) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/vec.h"
, 1085, __FUNCTION__), 0 : 0))
; \
1086 for (read_index = write_index = (start); read_index < (end); \
1087 ++read_index) \
1088 { \
1089 elem_ptr = &(vec)[read_index]; \
1090 bool remove_p = (cond); \
1091 if (remove_p) \
1092 continue; \
1093 \
1094 if (read_index != write_index) \
1095 (vec)[write_index] = (vec)[read_index]; \
1096 \
1097 write_index++; \
1098 } \
1099 \
1100 if (read_index - write_index > 0) \
1101 (vec).block_remove (write_index, read_index - write_index); \
1102 }
1103
1104
1105/* Remove elements from VEC for which COND holds. Ordering of remaining
1106 elements is preserved. This is an O(N) operation. */
1107
1108#define VEC_ORDERED_REMOVE_IF(vec, read_index, write_index, elem_ptr, \{ ((void)(!(((vec).length ()) <= ((vec)).length ()) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/vec.h"
, 1109, __FUNCTION__), 0 : 0)); for (read_index = write_index
= (0); read_index < ((vec).length ()); ++read_index) { elem_ptr
= &((vec))[read_index]; bool remove_p = ((cond)); if (remove_p
) continue; if (read_index != write_index) ((vec))[write_index
] = ((vec))[read_index]; write_index++; } if (read_index - write_index
> 0) ((vec)).block_remove (write_index, read_index - write_index
); }
1109 cond){ ((void)(!(((vec).length ()) <= ((vec)).length ()) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/vec.h"
, 1109, __FUNCTION__), 0 : 0)); for (read_index = write_index
= (0); read_index < ((vec).length ()); ++read_index) { elem_ptr
= &((vec))[read_index]; bool remove_p = ((cond)); if (remove_p
) continue; if (read_index != write_index) ((vec))[write_index
] = ((vec))[read_index]; write_index++; } if (read_index - write_index
> 0) ((vec)).block_remove (write_index, read_index - write_index
); }
\
1110 VEC_ORDERED_REMOVE_IF_FROM_TO ((vec), read_index, write_index, \{ ((void)(!(((vec).length ()) <= ((vec)).length ()) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/vec.h"
, 1111, __FUNCTION__), 0 : 0)); for (read_index = write_index
= (0); read_index < ((vec).length ()); ++read_index) { elem_ptr
= &((vec))[read_index]; bool remove_p = ((cond)); if (remove_p
) continue; if (read_index != write_index) ((vec))[write_index
] = ((vec))[read_index]; write_index++; } if (read_index - write_index
> 0) ((vec)).block_remove (write_index, read_index - write_index
); }
1111 elem_ptr, 0, (vec).length (), (cond)){ ((void)(!(((vec).length ()) <= ((vec)).length ()) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/vec.h"
, 1111, __FUNCTION__), 0 : 0)); for (read_index = write_index
= (0); read_index < ((vec).length ()); ++read_index) { elem_ptr
= &((vec))[read_index]; bool remove_p = ((cond)); if (remove_p
) continue; if (read_index != write_index) ((vec))[write_index
] = ((vec))[read_index]; write_index++; } if (read_index - write_index
> 0) ((vec)).block_remove (write_index, read_index - write_index
); }
1112
1113/* Remove an element from the IXth position of this vector. Ordering of
1114 remaining elements is destroyed. This is an O(1) operation. */
1115
1116template<typename T, typename A>
1117inline void
1118vec<T, A, vl_embed>::unordered_remove (unsigned ix)
1119{
1120 gcc_checking_assert (ix < length ())((void)(!(ix < length ()) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/vec.h"
, 1120, __FUNCTION__), 0 : 0))
;
1121 m_vecdata[ix] = m_vecdata[--m_vecpfx.m_num];
1122}
1123
1124
1125/* Remove LEN elements starting at the IXth. Ordering is retained.
1126 This is an O(N) operation due to memmove. */
1127
1128template<typename T, typename A>
1129inline void
1130vec<T, A, vl_embed>::block_remove (unsigned ix, unsigned len)
1131{
1132 gcc_checking_assert (ix + len <= length ())((void)(!(ix + len <= length ()) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/vec.h"
, 1132, __FUNCTION__), 0 : 0))
;
1133 T *slot = &m_vecdata[ix];
1134 m_vecpfx.m_num -= len;
1135 memmove (slot, slot + len, (m_vecpfx.m_num - ix) * sizeof (T));
1136}
1137
1138
1139/* Sort the contents of this vector with qsort. CMP is the comparison
1140 function to pass to qsort. */
1141
1142template<typename T, typename A>
1143inline void
1144vec<T, A, vl_embed>::qsort (int (*cmp) (const void *, const void *))qsort (int (*cmp) (const void *, const void *))
1145{
1146 if (length () > 1)
1147 gcc_qsort (address (), length (), sizeof (T), cmp);
1148}
1149
1150/* Sort the contents of this vector with qsort. CMP is the comparison
1151 function to pass to qsort. */
1152
1153template<typename T, typename A>
1154inline void
1155vec<T, A, vl_embed>::sort (int (*cmp) (const void *, const void *, void *),
1156 void *data)
1157{
1158 if (length () > 1)
1159 gcc_sort_r (address (), length (), sizeof (T), cmp, data);
1160}
1161
1162/* Sort the contents of this vector with gcc_stablesort_r. CMP is the
1163 comparison function to pass to qsort. */
1164
1165template<typename T, typename A>
1166inline void
1167vec<T, A, vl_embed>::stablesort (int (*cmp) (const void *, const void *,
1168 void *), void *data)
1169{
1170 if (length () > 1)
1171 gcc_stablesort_r (address (), length (), sizeof (T), cmp, data);
1172}
1173
1174/* Search the contents of the sorted vector with a binary search.
1175 CMP is the comparison function to pass to bsearch. */
1176
1177template<typename T, typename A>
1178inline T *
1179vec<T, A, vl_embed>::bsearch (const void *key,
1180 int (*compar) (const void *, const void *))
1181{
1182 const void *base = this->address ();
1183 size_t nmemb = this->length ();
1184 size_t size = sizeof (T);
1185 /* The following is a copy of glibc stdlib-bsearch.h. */
1186 size_t l, u, idx;
1187 const void *p;
1188 int comparison;
1189
1190 l = 0;
1191 u = nmemb;
1192 while (l < u)
1193 {
1194 idx = (l + u) / 2;
1195 p = (const void *) (((const char *) base) + (idx * size));
1196 comparison = (*compar) (key, p);
1197 if (comparison < 0)
1198 u = idx;
1199 else if (comparison > 0)
1200 l = idx + 1;
1201 else
1202 return (T *)const_cast<void *>(p);
1203 }
1204
1205 return NULLnullptr;
1206}
1207
1208/* Search the contents of the sorted vector with a binary search.
1209 CMP is the comparison function to pass to bsearch. */
1210
1211template<typename T, typename A>
1212inline T *
1213vec<T, A, vl_embed>::bsearch (const void *key,
1214 int (*compar) (const void *, const void *,
1215 void *), void *data)
1216{
1217 const void *base = this->address ();
1218 size_t nmemb = this->length ();
1219 size_t size = sizeof (T);
1220 /* The following is a copy of glibc stdlib-bsearch.h. */
1221 size_t l, u, idx;
1222 const void *p;
1223 int comparison;
1224
1225 l = 0;
1226 u = nmemb;
1227 while (l < u)
1228 {
1229 idx = (l + u) / 2;
1230 p = (const void *) (((const char *) base) + (idx * size));
1231 comparison = (*compar) (key, p, data);
1232 if (comparison < 0)
1233 u = idx;
1234 else if (comparison > 0)
1235 l = idx + 1;
1236 else
1237 return (T *)const_cast<void *>(p);
1238 }
1239
1240 return NULLnullptr;
1241}
1242
1243/* Return true if SEARCH is an element of V. Note that this is O(N) in the
1244 size of the vector and so should be used with care. */
1245
1246template<typename T, typename A>
1247inline bool
1248vec<T, A, vl_embed>::contains (const T &search) const
1249{
1250 unsigned int len = length ();
1251 for (unsigned int i = 0; i < len; i++)
1252 if ((*this)[i] == search)
1253 return true;
1254
1255 return false;
1256}
1257
1258/* Find and return the first position in which OBJ could be inserted
1259 without changing the ordering of this vector. LESSTHAN is a
1260 function that returns true if the first argument is strictly less
1261 than the second. */
1262
1263template<typename T, typename A>
1264unsigned
1265vec<T, A, vl_embed>::lower_bound (T obj, bool (*lessthan)(const T &, const T &))
1266 const
1267{
1268 unsigned int len = length ();
1269 unsigned int half, middle;
1270 unsigned int first = 0;
1271 while (len > 0)
1272 {
1273 half = len / 2;
1274 middle = first;
1275 middle += half;
1276 T middle_elem = (*this)[middle];
1277 if (lessthan (middle_elem, obj))
1278 {
1279 first = middle;
1280 ++first;
1281 len = len - half - 1;
1282 }
1283 else
1284 len = half;
1285 }
1286 return first;
1287}
1288
1289
1290/* Return the number of bytes needed to embed an instance of an
1291 embeddable vec inside another data structure.
1292
1293 Use these methods to determine the required size and initialization
1294 of a vector V of type T embedded within another structure (as the
1295 final member):
1296
1297 size_t vec<T, A, vl_embed>::embedded_size (unsigned alloc);
1298 void v->embedded_init (unsigned alloc, unsigned num);
1299
1300 These allow the caller to perform the memory allocation. */
1301
1302template<typename T, typename A>
1303inline size_t
1304vec<T, A, vl_embed>::embedded_size (unsigned alloc)
1305{
1306 struct alignas (T) U { char data[sizeof (T)]; };
1307 typedef vec<U, A, vl_embed> vec_embedded;
1308 typedef typename std::conditional<std::is_standard_layout<T>::value,
1309 vec, vec_embedded>::type vec_stdlayout;
1310 static_assert (sizeof (vec_stdlayout) == sizeof (vec), "");
1311 static_assert (alignof (vec_stdlayout) == alignof (vec), "");
1312 return offsetof (vec_stdlayout, m_vecdata)__builtin_offsetof(vec_stdlayout, m_vecdata) + alloc * sizeof (T);
1313}
1314
1315
1316/* Initialize the vector to contain room for ALLOC elements and
1317 NUM active elements. */
1318
1319template<typename T, typename A>
1320inline void
1321vec<T, A, vl_embed>::embedded_init (unsigned alloc, unsigned num, unsigned aut)
1322{
1323 m_vecpfx.m_alloc = alloc;
1324 m_vecpfx.m_using_auto_storage = aut;
1325 m_vecpfx.m_num = num;
1326}
1327
1328
1329/* Grow the vector to a specific length. LEN must be as long or longer than
1330 the current length. The new elements are uninitialized. */
1331
1332template<typename T, typename A>
1333inline void
1334vec<T, A, vl_embed>::quick_grow (unsigned len)
1335{
1336 gcc_checking_assert (length () <= len && len <= m_vecpfx.m_alloc)((void)(!(length () <= len && len <= m_vecpfx.m_alloc
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/vec.h"
, 1336, __FUNCTION__), 0 : 0))
;
1337 m_vecpfx.m_num = len;
1338}
1339
1340
1341/* Grow the vector to a specific length. LEN must be as long or longer than
1342 the current length. The new elements are initialized to zero. */
1343
1344template<typename T, typename A>
1345inline void
1346vec<T, A, vl_embed>::quick_grow_cleared (unsigned len)
1347{
1348 unsigned oldlen = length ();
1349 size_t growby = len - oldlen;
1350 quick_grow (len);
1351 if (growby != 0)
1352 vec_default_construct (address () + oldlen, growby);
1353}
1354
1355/* Garbage collection support for vec<T, A, vl_embed>. */
1356
1357template<typename T>
1358void
1359gt_ggc_mx (vec<T, va_gc> *v)
1360{
1361 extern void gt_ggc_mx (T &);
1362 for (unsigned i = 0; i < v->length (); i++)
1363 gt_ggc_mx ((*v)[i]);
1364}
1365
1366template<typename T>
1367void
1368gt_ggc_mx (vec<T, va_gc_atomic, vl_embed> *v ATTRIBUTE_UNUSED__attribute__ ((__unused__)))
1369{
1370 /* Nothing to do. Vectors of atomic types wrt GC do not need to
1371 be traversed. */
1372}
1373
1374
1375/* PCH support for vec<T, A, vl_embed>. */
1376
1377template<typename T, typename A>
1378void
1379gt_pch_nx (vec<T, A, vl_embed> *v)
1380{
1381 extern void gt_pch_nx (T &);
1382 for (unsigned i = 0; i < v->length (); i++)
1383 gt_pch_nx ((*v)[i]);
1384}
1385
1386template<typename T, typename A>
1387void
1388gt_pch_nx (vec<T *, A, vl_embed> *v, gt_pointer_operator op, void *cookie)
1389{
1390 for (unsigned i = 0; i < v->length (); i++)
1391 op (&((*v)[i]), cookie);
1392}
1393
1394template<typename T, typename A>
1395void
1396gt_pch_nx (vec<T, A, vl_embed> *v, gt_pointer_operator op, void *cookie)
1397{
1398 extern void gt_pch_nx (T *, gt_pointer_operator, void *);
1399 for (unsigned i = 0; i < v->length (); i++)
1400 gt_pch_nx (&((*v)[i]), op, cookie);
1401}
1402
1403
1404/* Space efficient vector. These vectors can grow dynamically and are
1405 allocated together with their control data. They are suited to be
1406 included in data structures. Prior to initial allocation, they
1407 only take a single word of storage.
1408
1409 These vectors are implemented as a pointer to an embeddable vector.
1410 The semantics allow for this pointer to be NULL to represent empty
1411 vectors. This way, empty vectors occupy minimal space in the
1412 structure containing them.
1413
1414 Properties:
1415
1416 - The whole vector and control data are allocated in a single
1417 contiguous block.
1418 - The whole vector may be re-allocated.
1419 - Vector data may grow and shrink.
1420 - Access and manipulation requires a pointer test and
1421 indirection.
1422 - It requires 1 word of storage (prior to vector allocation).
1423
1424
1425 Limitations:
1426
1427 These vectors must be PODs because they are stored in unions.
1428 (http://en.wikipedia.org/wiki/Plain_old_data_structures).
1429 As long as we use C++03, we cannot have constructors nor
1430 destructors in classes that are stored in unions. */
1431
1432template<typename T, size_t N = 0>
1433class auto_vec;
1434
1435template<typename T>
1436struct vec<T, va_heap, vl_ptr>
1437{
1438public:
1439 /* Default ctors to ensure triviality. Use value-initialization
1440 (e.g., vec() or vec v{ };) or vNULL to create a zero-initialized
1441 instance. */
1442 vec () = default;
1443 vec (const vec &) = default;
1444 /* Initialization from the generic vNULL. */
1445 vec (vnull): m_vec () { }
1446 /* Same as default ctor: vec storage must be released manually. */
1447 ~vec () = default;
1448
1449 /* Defaulted same as copy ctor. */
1450 vec& operator= (const vec &) = default;
1451
1452 /* Prevent implicit conversion from auto_vec. Use auto_vec::to_vec()
1453 instead. */
1454 template <size_t N>
1455 vec (auto_vec<T, N> &) = delete;
1456
1457 template <size_t N>
1458 void operator= (auto_vec<T, N> &) = delete;
1459
1460 /* Memory allocation and deallocation for the embedded vector.
1461 Needed because we cannot have proper ctors/dtors defined. */
1462 void create (unsigned nelems CXX_MEM_STAT_INFO);
1463 void release (void);
1464
1465 /* Vector operations. */
1466 bool exists (void) const
1467 { return m_vec != NULLnullptr; }
1468
1469 bool is_empty (void) const
1470 { return m_vec ? m_vec->is_empty () : true; }
1471
1472 unsigned length (void) const
1473 { return m_vec ? m_vec->length () : 0; }
1474
1475 T *address (void)
1476 { return m_vec ? m_vec->m_vecdata : NULLnullptr; }
1477
1478 const T *address (void) const
1479 { return m_vec ? m_vec->m_vecdata : NULLnullptr; }
1480
1481 T *begin () { return address (); }
1482 const T *begin () const { return address (); }
1483 T *end () { return begin () + length (); }
1484 const T *end () const { return begin () + length (); }
1485 const T &operator[] (unsigned ix) const
1486 { return (*m_vec)[ix]; }
1487
1488 bool operator!=(const vec &other) const
1489 { return !(*this == other); }
1490
1491 bool operator==(const vec &other) const
1492 { return address () == other.address (); }
1493
1494 T &operator[] (unsigned ix)
1495 { return (*m_vec)[ix]; }
1496
1497 T &last (void)
1498 { return m_vec->last (); }
1499
1500 bool space (int nelems) const
1501 { return m_vec ? m_vec->space (nelems) : nelems == 0; }
1502
1503 bool iterate (unsigned ix, T *p) const;
1504 bool iterate (unsigned ix, T **p) const;
1505 vec copy (ALONE_CXX_MEM_STAT_INFO) const;
1506 bool reserve (unsigned, bool = false CXX_MEM_STAT_INFO);
1507 bool reserve_exact (unsigned CXX_MEM_STAT_INFO);
1508 void splice (const vec &);
1509 void safe_splice (const vec & CXX_MEM_STAT_INFO);
1510 T *quick_push (const T &);
1511 T *safe_push (const T &CXX_MEM_STAT_INFO);
1512 T &pop (void);
1513 void truncate (unsigned);
1514 void safe_grow (unsigned, bool = false CXX_MEM_STAT_INFO);
1515 void safe_grow_cleared (unsigned, bool = false CXX_MEM_STAT_INFO);
1516 void quick_grow (unsigned);
1517 void quick_grow_cleared (unsigned);
1518 void quick_insert (unsigned, const T &);
1519 void safe_insert (unsigned, const T & CXX_MEM_STAT_INFO);
1520 void ordered_remove (unsigned);
1521 void unordered_remove (unsigned);
1522 void block_remove (unsigned, unsigned);
1523 void qsort (int (*) (const void *, const void *))qsort (int (*) (const void *, const void *));
1524 void sort (int (*) (const void *, const void *, void *), void *);
1525 void stablesort (int (*) (const void *, const void *, void *), void *);
1526 T *bsearch (const void *key, int (*compar)(const void *, const void *));
1527 T *bsearch (const void *key,
1528 int (*compar)(const void *, const void *, void *), void *);
1529 unsigned lower_bound (T, bool (*)(const T &, const T &)) const;
1530 bool contains (const T &search) const;
1531 void reverse (void);
1532
1533 bool using_auto_storage () const;
1534
1535 /* FIXME - This field should be private, but we need to cater to
1536 compilers that have stricter notions of PODness for types. */
1537 vec<T, va_heap, vl_embed> *m_vec;
1538};
1539
1540
1541/* auto_vec is a subclass of vec that automatically manages creating and
1542 releasing the internal vector. If N is non zero then it has N elements of
1543 internal storage. The default is no internal storage, and you probably only
1544 want to ask for internal storage for vectors on the stack because if the
1545 size of the vector is larger than the internal storage that space is wasted.
1546 */
1547template<typename T, size_t N /* = 0 */>
1548class auto_vec : public vec<T, va_heap>
1549{
1550public:
1551 auto_vec ()
1552 {
1553 m_auto.embedded_init (MAX (N, 2)((N) > (2) ? (N) : (2)), 0, 1);
1554 this->m_vec = &m_auto;
1555 }
1556
1557 auto_vec (size_t s CXX_MEM_STAT_INFO)
1558 {
1559 if (s > N)
1560 {
1561 this->create (s PASS_MEM_STAT);
1562 return;
1563 }
1564
1565 m_auto.embedded_init (MAX (N, 2)((N) > (2) ? (N) : (2)), 0, 1);
1566 this->m_vec = &m_auto;
1567 }
1568
1569 ~auto_vec ()
1570 {
1571 this->release ();
1572 }
1573
1574 /* Explicitly convert to the base class. There is no conversion
1575 from a const auto_vec because a copy of the returned vec can
1576 be used to modify *THIS.
1577 This is a legacy function not to be used in new code. */
1578 vec<T, va_heap> to_vec_legacy () {
1579 return *static_cast<vec<T, va_heap> *>(this);
1580 }
1581
1582private:
1583 vec<T, va_heap, vl_embed> m_auto;
1584 T m_data[MAX (N - 1, 1)((N - 1) > (1) ? (N - 1) : (1))];
1585};
1586
1587/* auto_vec is a sub class of vec whose storage is released when it is
1588 destroyed. */
1589template<typename T>
1590class auto_vec<T, 0> : public vec<T, va_heap>
1591{
1592public:
1593 auto_vec () { this->m_vec = NULLnullptr; }
1594 auto_vec (size_t n CXX_MEM_STAT_INFO) { this->create (n PASS_MEM_STAT); }
1595 ~auto_vec () { this->release (); }
1596
1597 auto_vec (vec<T, va_heap>&& r)
1598 {
1599 gcc_assert (!r.using_auto_storage ())((void)(!(!r.using_auto_storage ()) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/vec.h"
, 1599, __FUNCTION__), 0 : 0))
;
1600 this->m_vec = r.m_vec;
1601 r.m_vec = NULLnullptr;
1602 }
1603
1604 auto_vec (auto_vec<T> &&r)
1605 {
1606 gcc_assert (!r.using_auto_storage ())((void)(!(!r.using_auto_storage ()) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/vec.h"
, 1606, __FUNCTION__), 0 : 0))
</