Bug Summary

File:build/gcc/c/c-typeck.c
Warning:line 3071, column 5
Called C++ object pointer is null

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-unknown-linux-gnu -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name c-typeck.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 c -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/c -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-WS_C7G.plist -x c++ /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c

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

1/* Build expressions with type checking for C compiler.
2 Copyright (C) 1987-2021 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14for more details.
15
16You should have received a copy of the GNU General Public License
17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
19
20
21/* This file is part of the C front end.
22 It contains routines to build C expressions given their operands,
23 including computing the types of the result, C-specific error checks,
24 and some optimization. */
25
26#include "config.h"
27#include "system.h"
28#include "coretypes.h"
29#include "memmodel.h"
30#include "target.h"
31#include "function.h"
32#include "bitmap.h"
33#include "c-tree.h"
34#include "gimple-expr.h"
35#include "predict.h"
36#include "stor-layout.h"
37#include "trans-mem.h"
38#include "varasm.h"
39#include "stmt.h"
40#include "langhooks.h"
41#include "c-lang.h"
42#include "intl.h"
43#include "tree-iterator.h"
44#include "gimplify.h"
45#include "tree-inline.h"
46#include "omp-general.h"
47#include "c-family/c-objc.h"
48#include "c-family/c-ubsan.h"
49#include "gomp-constants.h"
50#include "spellcheck-tree.h"
51#include "gcc-rich-location.h"
52#include "stringpool.h"
53#include "attribs.h"
54#include "asan.h"
55
56/* Possible cases of implicit conversions. Used to select diagnostic messages
57 and control folding initializers in convert_for_assignment. */
58enum impl_conv {
59 ic_argpass,
60 ic_assign,
61 ic_init,
62 ic_init_const,
63 ic_return
64};
65
66/* The level of nesting inside "__alignof__". */
67int in_alignof;
68
69/* The level of nesting inside "sizeof". */
70int in_sizeof;
71
72/* The level of nesting inside "typeof". */
73int in_typeof;
74
75/* True when parsing OpenMP loop expressions. */
76bool c_in_omp_for;
77
78/* The argument of last parsed sizeof expression, only to be tested
79 if expr.original_code == SIZEOF_EXPR. */
80tree c_last_sizeof_arg;
81location_t c_last_sizeof_loc;
82
83/* Nonzero if we might need to print a "missing braces around
84 initializer" message within this initializer. */
85static int found_missing_braces;
86
87static int require_constant_value;
88static int require_constant_elements;
89
90static bool null_pointer_constant_p (const_tree);
91static tree qualify_type (tree, tree);
92static int tagged_types_tu_compatible_p (const_tree, const_tree, bool *,
93 bool *);
94static int comp_target_types (location_t, tree, tree);
95static int function_types_compatible_p (const_tree, const_tree, bool *,
96 bool *);
97static int type_lists_compatible_p (const_tree, const_tree, bool *, bool *);
98static tree lookup_field (tree, tree);
99static int convert_arguments (location_t, vec<location_t>, tree,
100 vec<tree, va_gc> *, vec<tree, va_gc> *, tree,
101 tree);
102static tree pointer_diff (location_t, tree, tree, tree *);
103static tree convert_for_assignment (location_t, location_t, tree, tree, tree,
104 enum impl_conv, bool, tree, tree, int,
105 int = 0);
106static tree valid_compound_expr_initializer (tree, tree);
107static void push_string (const char *);
108static void push_member_name (tree);
109static int spelling_length (void);
110static char *print_spelling (char *);
111static void warning_init (location_t, int, const char *);
112static tree digest_init (location_t, tree, tree, tree, bool, bool, int);
113static void output_init_element (location_t, tree, tree, bool, tree, tree, bool,
114 bool, struct obstack *);
115static void output_pending_init_elements (int, struct obstack *);
116static bool set_designator (location_t, bool, struct obstack *);
117static void push_range_stack (tree, struct obstack *);
118static void add_pending_init (location_t, tree, tree, tree, bool,
119 struct obstack *);
120static void set_nonincremental_init (struct obstack *);
121static void set_nonincremental_init_from_string (tree, struct obstack *);
122static tree find_init_member (tree, struct obstack *);
123static void readonly_warning (tree, enum lvalue_use);
124static int lvalue_or_else (location_t, const_tree, enum lvalue_use);
125static void record_maybe_used_decl (tree);
126static int comptypes_internal (const_tree, const_tree, bool *, bool *);
127
128/* Return true if EXP is a null pointer constant, false otherwise. */
129
130static bool
131null_pointer_constant_p (const_tree expr)
132{
133 /* This should really operate on c_expr structures, but they aren't
134 yet available everywhere required. */
135 tree type = TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 135, __FUNCTION__))->typed.type)
;
136 return (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == INTEGER_CST
137 && !TREE_OVERFLOW (expr)((tree_class_check ((expr), (tcc_constant), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 137, __FUNCTION__))->base.public_flag)
138 && integer_zerop (expr)
139 && (INTEGRAL_TYPE_P (type)(((enum tree_code) (type)->base.code) == ENUMERAL_TYPE || (
(enum tree_code) (type)->base.code) == BOOLEAN_TYPE || ((enum
tree_code) (type)->base.code) == INTEGER_TYPE)
140 || (TREE_CODE (type)((enum tree_code) (type)->base.code) == POINTER_TYPE
141 && VOID_TYPE_P (TREE_TYPE (type))(((enum tree_code) (((contains_struct_check ((type), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 141, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
)
142 && TYPE_QUALS (TREE_TYPE (type))((int) ((((tree_class_check ((((contains_struct_check ((type)
, (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 142, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 142, __FUNCTION__))->base.readonly_flag) * TYPE_QUAL_CONST
) | (((tree_class_check ((((contains_struct_check ((type), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 142, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 142, __FUNCTION__))->base.volatile_flag) * TYPE_QUAL_VOLATILE
) | (((tree_class_check ((((contains_struct_check ((type), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 142, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 142, __FUNCTION__))->base.u.bits.atomic_flag) * TYPE_QUAL_ATOMIC
) | (((tree_class_check ((((contains_struct_check ((type), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 142, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 142, __FUNCTION__))->type_common.restrict_flag) * TYPE_QUAL_RESTRICT
) | (((((tree_class_check ((((contains_struct_check ((type), (
TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 142, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 142, __FUNCTION__))->base.u.bits.address_space) & 0xFF
) << 8))))
== TYPE_UNQUALIFIED)));
143}
144
145/* EXPR may appear in an unevaluated part of an integer constant
146 expression, but not in an evaluated part. Wrap it in a
147 C_MAYBE_CONST_EXPR, or mark it with TREE_OVERFLOW if it is just an
148 INTEGER_CST and we cannot create a C_MAYBE_CONST_EXPR. */
149
150static tree
151note_integer_operands (tree expr)
152{
153 tree ret;
154 if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == INTEGER_CST && in_late_binary_op)
155 {
156 ret = copy_node (expr);
157 TREE_OVERFLOW (ret)((tree_class_check ((ret), (tcc_constant), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 157, __FUNCTION__))->base.public_flag)
= 1;
158 }
159 else
160 {
161 ret = build2 (C_MAYBE_CONST_EXPR, TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 161, __FUNCTION__))->typed.type)
, NULL_TREE(tree) __null, expr);
162 C_MAYBE_CONST_EXPR_INT_OPERANDS (ret)((tree_not_check2 (((tree_check ((ret), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 162, __FUNCTION__, (C_MAYBE_CONST_EXPR)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 162, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
= 1;
163 }
164 return ret;
165}
166
167/* Having checked whether EXPR may appear in an unevaluated part of an
168 integer constant expression and found that it may, remove any
169 C_MAYBE_CONST_EXPR noting this fact and return the resulting
170 expression. */
171
172static inline tree
173remove_c_maybe_const_expr (tree expr)
174{
175 if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == C_MAYBE_CONST_EXPR)
176 return C_MAYBE_CONST_EXPR_EXPR (expr)(*((const_cast<tree*> (tree_operand_check (((tree_check
((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 176, __FUNCTION__, (C_MAYBE_CONST_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 176, __FUNCTION__)))))
;
177 else
178 return expr;
179}
180
181
/* This is a cache to hold if two types are compatible or not. */
182
183struct tagged_tu_seen_cache {
184 const struct tagged_tu_seen_cache * next;
185 const_tree t1;
186 const_tree t2;
187 /* The return value of tagged_types_tu_compatible_p if we had seen
188 these two types already. */
189 int val;
190};
191
192static const struct tagged_tu_seen_cache * tagged_tu_seen_base;
193static void free_all_tagged_tu_seen_up_to (const struct tagged_tu_seen_cache *);
194
195/* Do `exp = require_complete_type (loc, exp);' to make sure exp
196 does not have an incomplete type. (That includes void types.)
197 LOC is the location of the use. */
198
199tree
200require_complete_type (location_t loc, tree value)
201{
202 tree type = TREE_TYPE (value)((contains_struct_check ((value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 202, __FUNCTION__))->typed.type)
;
203
204 if (error_operand_p (value))
205 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
206
207 /* First, detect a valid value with a complete type. */
208 if (COMPLETE_TYPE_P (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 208, __FUNCTION__))->type_common.size) != (tree) __null)
)
209 return value;
210
211 c_incomplete_type_error (loc, value, type);
212 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
213}
214
215/* Print an error message for invalid use of an incomplete type.
216 VALUE is the expression that was used (or 0 if that isn't known)
217 and TYPE is the type that was invalid. LOC is the location for
218 the error. */
219
220void
221c_incomplete_type_error (location_t loc, const_tree value, const_tree type)
222{
223 /* Avoid duplicate error message. */
224 if (TREE_CODE (type)((enum tree_code) (type)->base.code) == ERROR_MARK)
225 return;
226
227 if (value != NULL_TREE(tree) __null && (VAR_P (value)(((enum tree_code) (value)->base.code) == VAR_DECL) || TREE_CODE (value)((enum tree_code) (value)->base.code) == PARM_DECL))
228 error_at (loc, "%qD has an incomplete type %qT", value, type);
229 else
230 {
231 retry:
232 /* We must print an error message. Be clever about what it says. */
233
234 switch (TREE_CODE (type)((enum tree_code) (type)->base.code))
235 {
236 case RECORD_TYPE:
237 case UNION_TYPE:
238 case ENUMERAL_TYPE:
239 break;
240
241 case VOID_TYPE:
242 error_at (loc, "invalid use of void expression");
243 return;
244
245 case ARRAY_TYPE:
246 if (TYPE_DOMAIN (type)((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 246, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
)
247 {
248 if (TYPE_MAX_VALUE (TYPE_DOMAIN (type))((tree_check5 ((((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 248, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 248, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)
== NULL__null)
249 {
250 error_at (loc, "invalid use of flexible array member");
251 return;
252 }
253 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 253, __FUNCTION__))->typed.type)
;
254 goto retry;
255 }
256 error_at (loc, "invalid use of array with unspecified bounds");
257 return;
258
259 default:
260 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 260, __FUNCTION__))
;
261 }
262
263 if (TREE_CODE (TYPE_NAME (type))((enum tree_code) (((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 263, __FUNCTION__))->type_common.name))->base.code)
== IDENTIFIER_NODE)
264 error_at (loc, "invalid use of undefined type %qT", type);
265 else
266 /* If this type has a typedef-name, the TYPE_NAME is a TYPE_DECL. */
267 error_at (loc, "invalid use of incomplete typedef %qT", type);
268 }
269}
270
271/* Given a type, apply default promotions wrt unnamed function
272 arguments and return the new type. */
273
274tree
275c_type_promotes_to (tree type)
276{
277 tree ret = NULL_TREE(tree) __null;
278
279 if (TYPE_MAIN_VARIANT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 279, __FUNCTION__))->type_common.main_variant)
== float_type_nodeglobal_trees[TI_FLOAT_TYPE])
280 ret = double_type_nodeglobal_trees[TI_DOUBLE_TYPE];
281 else if (c_promoting_integer_type_p (type))
282 {
283 /* Preserve unsignedness if not really getting any wider. */
284 if (TYPE_UNSIGNED (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 284, __FUNCTION__))->base.u.bits.unsigned_flag)
285 && (TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 285, __FUNCTION__))->type_common.precision)
== TYPE_PRECISION (integer_type_node)((tree_class_check ((integer_types[itk_int]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 285, __FUNCTION__))->type_common.precision)
))
286 ret = unsigned_type_nodeinteger_types[itk_unsigned_int];
287 else
288 ret = integer_type_nodeinteger_types[itk_int];
289 }
290
291 if (ret != NULL_TREE(tree) __null)
292 return (TYPE_ATOMIC (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 292, __FUNCTION__))->base.u.bits.atomic_flag)
293 ? c_build_qualified_type (ret, TYPE_QUAL_ATOMIC)
294 : ret);
295
296 return type;
297}
298
299/* Return true if between two named address spaces, whether there is a superset
300 named address space that encompasses both address spaces. If there is a
301 superset, return which address space is the superset. */
302
303static bool
304addr_space_superset (addr_space_t as1, addr_space_t as2, addr_space_t *common)
305{
306 if (as1 == as2)
307 {
308 *common = as1;
309 return true;
310 }
311 else if (targetm.addr_space.subset_p (as1, as2))
312 {
313 *common = as2;
314 return true;
315 }
316 else if (targetm.addr_space.subset_p (as2, as1))
317 {
318 *common = as1;
319 return true;
320 }
321 else
322 return false;
323}
324
325/* Return a variant of TYPE which has all the type qualifiers of LIKE
326 as well as those of TYPE. */
327
328static tree
329qualify_type (tree type, tree like)
330{
331 addr_space_t as_type = TYPE_ADDR_SPACE (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 331, __FUNCTION__))->base.u.bits.address_space)
;
332 addr_space_t as_like = TYPE_ADDR_SPACE (like)((tree_class_check ((like), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 332, __FUNCTION__))->base.u.bits.address_space)
;
333 addr_space_t as_common;
334
335 /* If the two named address spaces are different, determine the common
336 superset address space. If there isn't one, raise an error. */
337 if (!addr_space_superset (as_type, as_like, &as_common))
338 {
339 as_common = as_type;
340 error ("%qT and %qT are in disjoint named address spaces",
341 type, like);
342 }
343
344 return c_build_qualified_type (type,
345 TYPE_QUALS_NO_ADDR_SPACE (type)((int) ((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 345, __FUNCTION__))->base.readonly_flag) * TYPE_QUAL_CONST
) | (((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 345, __FUNCTION__))->base.volatile_flag) * TYPE_QUAL_VOLATILE
) | (((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 345, __FUNCTION__))->base.u.bits.atomic_flag) * TYPE_QUAL_ATOMIC
) | (((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 345, __FUNCTION__))->type_common.restrict_flag) * TYPE_QUAL_RESTRICT
)))
346 | TYPE_QUALS_NO_ADDR_SPACE_NO_ATOMIC (like)((int) ((((tree_class_check ((like), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 346, __FUNCTION__))->base.readonly_flag) * TYPE_QUAL_CONST
) | (((tree_class_check ((like), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 346, __FUNCTION__))->base.volatile_flag) * TYPE_QUAL_VOLATILE
) | (((tree_class_check ((like), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 346, __FUNCTION__))->type_common.restrict_flag) * TYPE_QUAL_RESTRICT
)))
347 | ENCODE_QUAL_ADDR_SPACE (as_common)((as_common & 0xFF) << 8));
348}
349
350/* Return true iff the given tree T is a variable length array. */
351
352bool
353c_vla_type_p (const_tree t)
354{
355 if (TREE_CODE (t)((enum tree_code) (t)->base.code) == ARRAY_TYPE
356 && C_TYPE_VARIABLE_SIZE (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 356, __FUNCTION__))->type_common.lang_flag_1)
)
357 return true;
358 return false;
359}
360
361/* If NTYPE is a type of a non-variadic function with a prototype
362 and OTYPE is a type of a function without a prototype and ATTRS
363 contains attribute format, diagnosess and removes it from ATTRS.
364 Returns the result of build_type_attribute_variant of NTYPE and
365 the (possibly) modified ATTRS. */
366
367static tree
368build_functype_attribute_variant (tree ntype, tree otype, tree attrs)
369{
370 if (!prototype_p (otype)
371 && prototype_p (ntype)
372 && lookup_attribute ("format", attrs))
373 {
374 warning_at (input_location, OPT_Wattributes,
375 "%qs attribute cannot be applied to a function that "
376 "does not take variable arguments", "format");
377 attrs = remove_attribute ("format", attrs);
378 }
379 return build_type_attribute_variant (ntype, attrs);
380
381}
382/* Return the composite type of two compatible types.
383
384 We assume that comptypes has already been done and returned
385 nonzero; if that isn't so, this may crash. In particular, we
386 assume that qualifiers match. */
387
388tree
389composite_type (tree t1, tree t2)
390{
391 enum tree_code code1;
392 enum tree_code code2;
393 tree attributes;
394
395 /* Save time if the two types are the same. */
396
397 if (t1 == t2) return t1;
398
399 /* If one type is nonsense, use the other. */
400 if (t1 == error_mark_nodeglobal_trees[TI_ERROR_MARK])
401 return t2;
402 if (t2 == error_mark_nodeglobal_trees[TI_ERROR_MARK])
403 return t1;
404
405 code1 = TREE_CODE (t1)((enum tree_code) (t1)->base.code);
406 code2 = TREE_CODE (t2)((enum tree_code) (t2)->base.code);
407
408 /* Merge the attributes. */
409 attributes = targetm.merge_type_attributes (t1, t2);
410
411 /* If one is an enumerated type and the other is the compatible
412 integer type, the composite type might be either of the two
413 (DR#013 question 3). For consistency, use the enumerated type as
414 the composite type. */
415
416 if (code1 == ENUMERAL_TYPE && code2 == INTEGER_TYPE)
417 return t1;
418 if (code2 == ENUMERAL_TYPE && code1 == INTEGER_TYPE)
419 return t2;
420
421 gcc_assert (code1 == code2)((void)(!(code1 == code2) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 421, __FUNCTION__), 0 : 0))
;
422
423 switch (code1)
424 {
425 case POINTER_TYPE:
426 /* For two pointers, do this recursively on the target type. */
427 {
428 tree pointed_to_1 = TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 428, __FUNCTION__))->typed.type)
;
429 tree pointed_to_2 = TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 429, __FUNCTION__))->typed.type)
;
430 tree target = composite_type (pointed_to_1, pointed_to_2);
431 t1 = build_pointer_type_for_mode (target, TYPE_MODE (t1)((((enum tree_code) ((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 431, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(t1) : (t1)->type_common.mode)
, false);
432 t1 = build_type_attribute_variant (t1, attributes);
433 return qualify_type (t1, t2);
434 }
435
436 case ARRAY_TYPE:
437 {
438 tree elt = composite_type (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 438, __FUNCTION__))->typed.type)
, TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 438, __FUNCTION__))->typed.type)
);
439 int quals;
440 tree unqual_elt;
441 tree d1 = TYPE_DOMAIN (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 441, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
;
442 tree d2 = TYPE_DOMAIN (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 442, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
;
443 bool d1_variable, d2_variable;
444 bool d1_zero, d2_zero;
445 bool t1_complete, t2_complete;
446
447 /* We should not have any type quals on arrays at all. */
448 gcc_assert (!TYPE_QUALS_NO_ADDR_SPACE (t1)((void)(!(!((int) ((((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 448, __FUNCTION__))->base.readonly_flag) * TYPE_QUAL_CONST
) | (((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 448, __FUNCTION__))->base.volatile_flag) * TYPE_QUAL_VOLATILE
) | (((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 448, __FUNCTION__))->base.u.bits.atomic_flag) * TYPE_QUAL_ATOMIC
) | (((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 448, __FUNCTION__))->type_common.restrict_flag) * TYPE_QUAL_RESTRICT
))) && !((int) ((((tree_class_check ((t2), (tcc_type)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 449, __FUNCTION__))->base.readonly_flag) * TYPE_QUAL_CONST
) | (((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 449, __FUNCTION__))->base.volatile_flag) * TYPE_QUAL_VOLATILE
) | (((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 449, __FUNCTION__))->base.u.bits.atomic_flag) * TYPE_QUAL_ATOMIC
) | (((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 449, __FUNCTION__))->type_common.restrict_flag) * TYPE_QUAL_RESTRICT
)))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 449, __FUNCTION__), 0 : 0))
449 && !TYPE_QUALS_NO_ADDR_SPACE (t2))((void)(!(!((int) ((((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 448, __FUNCTION__))->base.readonly_flag) * TYPE_QUAL_CONST
) | (((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 448, __FUNCTION__))->base.volatile_flag) * TYPE_QUAL_VOLATILE
) | (((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 448, __FUNCTION__))->base.u.bits.atomic_flag) * TYPE_QUAL_ATOMIC
) | (((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 448, __FUNCTION__))->type_common.restrict_flag) * TYPE_QUAL_RESTRICT
))) && !((int) ((((tree_class_check ((t2), (tcc_type)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 449, __FUNCTION__))->base.readonly_flag) * TYPE_QUAL_CONST
) | (((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 449, __FUNCTION__))->base.volatile_flag) * TYPE_QUAL_VOLATILE
) | (((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 449, __FUNCTION__))->base.u.bits.atomic_flag) * TYPE_QUAL_ATOMIC
) | (((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 449, __FUNCTION__))->type_common.restrict_flag) * TYPE_QUAL_RESTRICT
)))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 449, __FUNCTION__), 0 : 0))
;
450
451 t1_complete = COMPLETE_TYPE_P (t1)(((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 451, __FUNCTION__))->type_common.size) != (tree) __null)
;
452 t2_complete = COMPLETE_TYPE_P (t2)(((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 452, __FUNCTION__))->type_common.size) != (tree) __null)
;
453
454 d1_zero = d1 == NULL_TREE(tree) __null || !TYPE_MAX_VALUE (d1)((tree_check5 ((d1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 454, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)
;
455 d2_zero = d2 == NULL_TREE(tree) __null || !TYPE_MAX_VALUE (d2)((tree_check5 ((d2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 455, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)
;
456
457 d1_variable = (!d1_zero
458 && (TREE_CODE (TYPE_MIN_VALUE (d1))((enum tree_code) (((tree_check5 ((d1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 458, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.minval
))->base.code)
!= INTEGER_CST
459 || TREE_CODE (TYPE_MAX_VALUE (d1))((enum tree_code) (((tree_check5 ((d1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 459, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
))->base.code)
!= INTEGER_CST));
460 d2_variable = (!d2_zero
461 && (TREE_CODE (TYPE_MIN_VALUE (d2))((enum tree_code) (((tree_check5 ((d2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 461, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.minval
))->base.code)
!= INTEGER_CST
462 || TREE_CODE (TYPE_MAX_VALUE (d2))((enum tree_code) (((tree_check5 ((d2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 462, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
))->base.code)
!= INTEGER_CST));
463 d1_variable = d1_variable || (d1_zero && c_vla_type_p (t1));
464 d2_variable = d2_variable || (d2_zero && c_vla_type_p (t2));
465
466 /* Save space: see if the result is identical to one of the args. */
467 if (elt == TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 467, __FUNCTION__))->typed.type)
&& TYPE_DOMAIN (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 467, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
468 && (d2_variable || d2_zero || !d1_variable))
469 return build_type_attribute_variant (t1, attributes);
470 if (elt == TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 470, __FUNCTION__))->typed.type)
&& TYPE_DOMAIN (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 470, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
471 && (d1_variable || d1_zero || !d2_variable))
472 return build_type_attribute_variant (t2, attributes);
473
474 if (elt == TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 474, __FUNCTION__))->typed.type)
&& !TYPE_DOMAIN (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 474, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
&& !TYPE_DOMAIN (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 474, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
)
475 return build_type_attribute_variant (t1, attributes);
476 if (elt == TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 476, __FUNCTION__))->typed.type)
&& !TYPE_DOMAIN (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 476, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
&& !TYPE_DOMAIN (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 476, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
)
477 return build_type_attribute_variant (t2, attributes);
478
479 /* Merge the element types, and have a size if either arg has
480 one. We may have qualifiers on the element types. To set
481 up TYPE_MAIN_VARIANT correctly, we need to form the
482 composite of the unqualified types and add the qualifiers
483 back at the end. */
484 quals = TYPE_QUALS (strip_array_types (elt))((int) ((((tree_class_check ((strip_array_types (elt)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 484, __FUNCTION__))->base.readonly_flag) * TYPE_QUAL_CONST
) | (((tree_class_check ((strip_array_types (elt)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 484, __FUNCTION__))->base.volatile_flag) * TYPE_QUAL_VOLATILE
) | (((tree_class_check ((strip_array_types (elt)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 484, __FUNCTION__))->base.u.bits.atomic_flag) * TYPE_QUAL_ATOMIC
) | (((tree_class_check ((strip_array_types (elt)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 484, __FUNCTION__))->type_common.restrict_flag) * TYPE_QUAL_RESTRICT
) | (((((tree_class_check ((strip_array_types (elt)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 484, __FUNCTION__))->base.u.bits.address_space) & 0xFF
) << 8))))
;
485 unqual_elt = c_build_qualified_type (elt, TYPE_UNQUALIFIED);
486 t1 = build_array_type (unqual_elt,
487 TYPE_DOMAIN ((TYPE_DOMAIN (t1)((tree_check (((((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 487, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
) && (d2_variable || d2_zero || !d1_variable)) ? t1 :
t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 492, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
488 && (d2_variable((tree_check (((((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 487, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
) && (d2_variable || d2_zero || !d1_variable)) ? t1 :
t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 492, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
489 || d2_zero((tree_check (((((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 487, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
) && (d2_variable || d2_zero || !d1_variable)) ? t1 :
t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 492, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
490 || !d1_variable))((tree_check (((((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 487, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
) && (d2_variable || d2_zero || !d1_variable)) ? t1 :
t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 492, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
491 ? t1((tree_check (((((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 487, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
) && (d2_variable || d2_zero || !d1_variable)) ? t1 :
t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 492, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
492 : t2)((tree_check (((((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 487, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
) && (d2_variable || d2_zero || !d1_variable)) ? t1 :
t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 492, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
);
493 /* Ensure a composite type involving a zero-length array type
494 is a zero-length type not an incomplete type. */
495 if (d1_zero && d2_zero
496 && (t1_complete || t2_complete)
497 && !COMPLETE_TYPE_P (t1)(((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 497, __FUNCTION__))->type_common.size) != (tree) __null)
)
498 {
499 TYPE_SIZE (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 499, __FUNCTION__))->type_common.size)
= bitsize_zero_nodeglobal_trees[TI_BITSIZE_ZERO];
500 TYPE_SIZE_UNIT (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 500, __FUNCTION__))->type_common.size_unit)
= size_zero_nodeglobal_trees[TI_SIZE_ZERO];
501 }
502 t1 = c_build_qualified_type (t1, quals);
503 return build_type_attribute_variant (t1, attributes);
504 }
505
506 case ENUMERAL_TYPE:
507 case RECORD_TYPE:
508 case UNION_TYPE:
509 if (attributes != NULL__null)
510 {
511 /* Try harder not to create a new aggregate type. */
512 if (attribute_list_equal (TYPE_ATTRIBUTES (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 512, __FUNCTION__))->type_common.attributes)
, attributes))
513 return t1;
514 if (attribute_list_equal (TYPE_ATTRIBUTES (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 514, __FUNCTION__))->type_common.attributes)
, attributes))
515 return t2;
516 }
517 return build_type_attribute_variant (t1, attributes);
518
519 case FUNCTION_TYPE:
520 /* Function types: prefer the one that specified arg types.
521 If both do, merge the arg types. Also merge the return types. */
522 {
523 tree valtype = composite_type (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 523, __FUNCTION__))->typed.type)
, TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 523, __FUNCTION__))->typed.type)
);
524 tree p1 = TYPE_ARG_TYPES (t1)((tree_check2 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 524, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
525 tree p2 = TYPE_ARG_TYPES (t2)((tree_check2 ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 525, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
526 int len;
527 tree newargs, n;
528 int i;
529
530 /* Save space: see if the result is identical to one of the args. */
531 if (valtype == TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 531, __FUNCTION__))->typed.type)
&& !TYPE_ARG_TYPES (t2)((tree_check2 ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 531, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
)
532 return build_functype_attribute_variant (t1, t2, attributes);
533 if (valtype == TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 533, __FUNCTION__))->typed.type)
&& !TYPE_ARG_TYPES (t1)((tree_check2 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 533, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
)
534 return build_functype_attribute_variant (t2, t1, attributes);
535
536 /* Simple way if one arg fails to specify argument types. */
537 if (TYPE_ARG_TYPES (t1)((tree_check2 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 537, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
== NULL_TREE(tree) __null)
538 {
539 t1 = build_function_type (valtype, TYPE_ARG_TYPES (t2)((tree_check2 ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 539, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
);
540 t1 = build_type_attribute_variant (t1, attributes);
541 return qualify_type (t1, t2);
542 }
543 if (TYPE_ARG_TYPES (t2)((tree_check2 ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 543, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
== NULL_TREE(tree) __null)
544 {
545 t1 = build_function_type (valtype, TYPE_ARG_TYPES (t1)((tree_check2 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 545, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
);
546 t1 = build_type_attribute_variant (t1, attributes);
547 return qualify_type (t1, t2);
548 }
549
550 /* If both args specify argument types, we must merge the two
551 lists, argument by argument. */
552
553 for (len = 0, newargs = p1;
554 newargs && newargs != void_list_nodeglobal_trees[TI_VOID_LIST_NODE];
555 len++, newargs = TREE_CHAIN (newargs)((contains_struct_check ((newargs), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 555, __FUNCTION__))->common.chain)
)
556 ;
557
558 for (i = 0; i < len; i++)
559 newargs = tree_cons (NULL_TREE(tree) __null, NULL_TREE(tree) __null, newargs);
560
561 n = newargs;
562
563 for (; p1 && p1 != void_list_nodeglobal_trees[TI_VOID_LIST_NODE];
564 p1 = TREE_CHAIN (p1)((contains_struct_check ((p1), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 564, __FUNCTION__))->common.chain)
, p2 = TREE_CHAIN (p2)((contains_struct_check ((p2), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 564, __FUNCTION__))->common.chain)
, n = TREE_CHAIN (n)((contains_struct_check ((n), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 564, __FUNCTION__))->common.chain)
)
565 {
566 /* A null type means arg type is not specified.
567 Take whatever the other function type has. */
568 if (TREE_VALUE (p1)((tree_check ((p1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 568, __FUNCTION__, (TREE_LIST)))->list.value)
== NULL_TREE(tree) __null)
569 {
570 TREE_VALUE (n)((tree_check ((n), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 570, __FUNCTION__, (TREE_LIST)))->list.value)
= TREE_VALUE (p2)((tree_check ((p2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 570, __FUNCTION__, (TREE_LIST)))->list.value)
;
571 goto parm_done;
572 }
573 if (TREE_VALUE (p2)((tree_check ((p2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 573, __FUNCTION__, (TREE_LIST)))->list.value)
== NULL_TREE(tree) __null)
574 {
575 TREE_VALUE (n)((tree_check ((n), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 575, __FUNCTION__, (TREE_LIST)))->list.value)
= TREE_VALUE (p1)((tree_check ((p1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 575, __FUNCTION__, (TREE_LIST)))->list.value)
;
576 goto parm_done;
577 }
578
579 /* Given wait (union {union wait *u; int *i} *)
580 and wait (union wait *),
581 prefer union wait * as type of parm. */
582 if (TREE_CODE (TREE_VALUE (p1))((enum tree_code) (((tree_check ((p1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 582, __FUNCTION__, (TREE_LIST)))->list.value))->base.
code)
== UNION_TYPE
583 && TREE_VALUE (p1)((tree_check ((p1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 583, __FUNCTION__, (TREE_LIST)))->list.value)
!= TREE_VALUE (p2)((tree_check ((p2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 583, __FUNCTION__, (TREE_LIST)))->list.value)
)
584 {
585 tree memb;
586 tree mv2 = TREE_VALUE (p2)((tree_check ((p2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 586, __FUNCTION__, (TREE_LIST)))->list.value)
;
587 if (mv2 && mv2 != error_mark_nodeglobal_trees[TI_ERROR_MARK]
588 && TREE_CODE (mv2)((enum tree_code) (mv2)->base.code) != ARRAY_TYPE)
589 mv2 = TYPE_MAIN_VARIANT (mv2)((tree_class_check ((mv2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 589, __FUNCTION__))->type_common.main_variant)
;
590 for (memb = TYPE_FIELDS (TREE_VALUE (p1))((tree_check3 ((((tree_check ((p1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 590, __FUNCTION__, (TREE_LIST)))->list.value)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 590, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
;
591 memb; memb = DECL_CHAIN (memb)(((contains_struct_check (((contains_struct_check ((memb), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 591, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 591, __FUNCTION__))->common.chain))
)
592 {
593 tree mv3 = TREE_TYPE (memb)((contains_struct_check ((memb), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 593, __FUNCTION__))->typed.type)
;
594 if (mv3 && mv3 != error_mark_nodeglobal_trees[TI_ERROR_MARK]
595 && TREE_CODE (mv3)((enum tree_code) (mv3)->base.code) != ARRAY_TYPE)
596 mv3 = TYPE_MAIN_VARIANT (mv3)((tree_class_check ((mv3), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 596, __FUNCTION__))->type_common.main_variant)
;
597 if (comptypes (mv3, mv2))
598 {
599 TREE_VALUE (n)((tree_check ((n), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 599, __FUNCTION__, (TREE_LIST)))->list.value)
= composite_type (TREE_TYPE (memb)((contains_struct_check ((memb), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 599, __FUNCTION__))->typed.type)
,
600 TREE_VALUE (p2)((tree_check ((p2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 600, __FUNCTION__, (TREE_LIST)))->list.value)
);
601 pedwarn (input_location, OPT_Wpedantic,
602 "function types not truly compatible in ISO C");
603 goto parm_done;
604 }
605 }
606 }
607 if (TREE_CODE (TREE_VALUE (p2))((enum tree_code) (((tree_check ((p2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 607, __FUNCTION__, (TREE_LIST)))->list.value))->base.
code)
== UNION_TYPE
608 && TREE_VALUE (p2)((tree_check ((p2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 608, __FUNCTION__, (TREE_LIST)))->list.value)
!= TREE_VALUE (p1)((tree_check ((p1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 608, __FUNCTION__, (TREE_LIST)))->list.value)
)
609 {
610 tree memb;
611 tree mv1 = TREE_VALUE (p1)((tree_check ((p1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 611, __FUNCTION__, (TREE_LIST)))->list.value)
;
612 if (mv1 && mv1 != error_mark_nodeglobal_trees[TI_ERROR_MARK]
613 && TREE_CODE (mv1)((enum tree_code) (mv1)->base.code) != ARRAY_TYPE)
614 mv1 = TYPE_MAIN_VARIANT (mv1)((tree_class_check ((mv1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 614, __FUNCTION__))->type_common.main_variant)
;
615 for (memb = TYPE_FIELDS (TREE_VALUE (p2))((tree_check3 ((((tree_check ((p2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 615, __FUNCTION__, (TREE_LIST)))->list.value)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 615, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
;
616 memb; memb = DECL_CHAIN (memb)(((contains_struct_check (((contains_struct_check ((memb), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 616, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 616, __FUNCTION__))->common.chain))
)
617 {
618 tree mv3 = TREE_TYPE (memb)((contains_struct_check ((memb), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 618, __FUNCTION__))->typed.type)
;
619 if (mv3 && mv3 != error_mark_nodeglobal_trees[TI_ERROR_MARK]
620 && TREE_CODE (mv3)((enum tree_code) (mv3)->base.code) != ARRAY_TYPE)
621 mv3 = TYPE_MAIN_VARIANT (mv3)((tree_class_check ((mv3), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 621, __FUNCTION__))->type_common.main_variant)
;
622 if (comptypes (mv3, mv1))
623 {
624 TREE_VALUE (n)((tree_check ((n), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 624, __FUNCTION__, (TREE_LIST)))->list.value)
= composite_type (TREE_TYPE (memb)((contains_struct_check ((memb), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 624, __FUNCTION__))->typed.type)
,
625 TREE_VALUE (p1)((tree_check ((p1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 625, __FUNCTION__, (TREE_LIST)))->list.value)
);
626 pedwarn (input_location, OPT_Wpedantic,
627 "function types not truly compatible in ISO C");
628 goto parm_done;
629 }
630 }
631 }
632 TREE_VALUE (n)((tree_check ((n), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 632, __FUNCTION__, (TREE_LIST)))->list.value)
= composite_type (TREE_VALUE (p1)((tree_check ((p1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 632, __FUNCTION__, (TREE_LIST)))->list.value)
, TREE_VALUE (p2)((tree_check ((p2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 632, __FUNCTION__, (TREE_LIST)))->list.value)
);
633 parm_done: ;
634 }
635
636 t1 = build_function_type (valtype, newargs);
637 t1 = qualify_type (t1, t2);
638 }
639 /* FALLTHRU */
640
641 default:
642 return build_type_attribute_variant (t1, attributes);
643 }
644
645}
646
647/* Return the type of a conditional expression between pointers to
648 possibly differently qualified versions of compatible types.
649
650 We assume that comp_target_types has already been done and returned
651 nonzero; if that isn't so, this may crash. */
652
653static tree
654common_pointer_type (tree t1, tree t2)
655{
656 tree attributes;
657 tree pointed_to_1, mv1;
658 tree pointed_to_2, mv2;
659 tree target;
660 unsigned target_quals;
661 addr_space_t as1, as2, as_common;
662 int quals1, quals2;
663
664 /* Save time if the two types are the same. */
665
666 if (t1 == t2) return t1;
667
668 /* If one type is nonsense, use the other. */
669 if (t1 == error_mark_nodeglobal_trees[TI_ERROR_MARK])
670 return t2;
671 if (t2 == error_mark_nodeglobal_trees[TI_ERROR_MARK])
672 return t1;
673
674 gcc_assert (TREE_CODE (t1) == POINTER_TYPE((void)(!(((enum tree_code) (t1)->base.code) == POINTER_TYPE
&& ((enum tree_code) (t2)->base.code) == POINTER_TYPE
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 675, __FUNCTION__), 0 : 0))
675 && TREE_CODE (t2) == POINTER_TYPE)((void)(!(((enum tree_code) (t1)->base.code) == POINTER_TYPE
&& ((enum tree_code) (t2)->base.code) == POINTER_TYPE
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 675, __FUNCTION__), 0 : 0))
;
676
677 /* Merge the attributes. */
678 attributes = targetm.merge_type_attributes (t1, t2);
679
680 /* Find the composite type of the target types, and combine the
681 qualifiers of the two types' targets. Do not lose qualifiers on
682 array element types by taking the TYPE_MAIN_VARIANT. */
683 mv1 = pointed_to_1 = TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 683, __FUNCTION__))->typed.type)
;
684 mv2 = pointed_to_2 = TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 684, __FUNCTION__))->typed.type)
;
685 if (TREE_CODE (mv1)((enum tree_code) (mv1)->base.code) != ARRAY_TYPE)
686 mv1 = TYPE_MAIN_VARIANT (pointed_to_1)((tree_class_check ((pointed_to_1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 686, __FUNCTION__))->type_common.main_variant)
;
687 if (TREE_CODE (mv2)((enum tree_code) (mv2)->base.code) != ARRAY_TYPE)
688 mv2 = TYPE_MAIN_VARIANT (pointed_to_2)((tree_class_check ((pointed_to_2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 688, __FUNCTION__))->type_common.main_variant)
;
689 target = composite_type (mv1, mv2);
690
691 /* Strip array types to get correct qualifier for pointers to arrays */
692 quals1 = TYPE_QUALS_NO_ADDR_SPACE (strip_array_types (pointed_to_1))((int) ((((tree_class_check ((strip_array_types (pointed_to_1
)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 692, __FUNCTION__))->base.readonly_flag) * TYPE_QUAL_CONST
) | (((tree_class_check ((strip_array_types (pointed_to_1)), (
tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 692, __FUNCTION__))->base.volatile_flag) * TYPE_QUAL_VOLATILE
) | (((tree_class_check ((strip_array_types (pointed_to_1)), (
tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 692, __FUNCTION__))->base.u.bits.atomic_flag) * TYPE_QUAL_ATOMIC
) | (((tree_class_check ((strip_array_types (pointed_to_1)), (
tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 692, __FUNCTION__))->type_common.restrict_flag) * TYPE_QUAL_RESTRICT
)))
;
693 quals2 = TYPE_QUALS_NO_ADDR_SPACE (strip_array_types (pointed_to_2))((int) ((((tree_class_check ((strip_array_types (pointed_to_2
)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 693, __FUNCTION__))->base.readonly_flag) * TYPE_QUAL_CONST
) | (((tree_class_check ((strip_array_types (pointed_to_2)), (
tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 693, __FUNCTION__))->base.volatile_flag) * TYPE_QUAL_VOLATILE
) | (((tree_class_check ((strip_array_types (pointed_to_2)), (
tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 693, __FUNCTION__))->base.u.bits.atomic_flag) * TYPE_QUAL_ATOMIC
) | (((tree_class_check ((strip_array_types (pointed_to_2)), (
tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 693, __FUNCTION__))->type_common.restrict_flag) * TYPE_QUAL_RESTRICT
)))
;
694
695 /* For function types do not merge const qualifiers, but drop them
696 if used inconsistently. The middle-end uses these to mark const
697 and noreturn functions. */
698 if (TREE_CODE (pointed_to_1)((enum tree_code) (pointed_to_1)->base.code) == FUNCTION_TYPE)
699 target_quals = (quals1 & quals2);
700 else
701 target_quals = (quals1 | quals2);
702
703 /* If the two named address spaces are different, determine the common
704 superset address space. This is guaranteed to exist due to the
705 assumption that comp_target_type returned non-zero. */
706 as1 = TYPE_ADDR_SPACE (pointed_to_1)((tree_class_check ((pointed_to_1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 706, __FUNCTION__))->base.u.bits.address_space)
;
707 as2 = TYPE_ADDR_SPACE (pointed_to_2)((tree_class_check ((pointed_to_2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 707, __FUNCTION__))->base.u.bits.address_space)
;
708 if (!addr_space_superset (as1, as2, &as_common))
709 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 709, __FUNCTION__))
;
710
711 target_quals |= ENCODE_QUAL_ADDR_SPACE (as_common)((as_common & 0xFF) << 8);
712
713 t1 = build_pointer_type (c_build_qualified_type (target, target_quals));
714 return build_type_attribute_variant (t1, attributes);
715}
716
717/* Return the common type for two arithmetic types under the usual
718 arithmetic conversions. The default conversions have already been
719 applied, and enumerated types converted to their compatible integer
720 types. The resulting type is unqualified and has no attributes.
721
722 This is the type for the result of most arithmetic operations
723 if the operands have the given two types. */
724
725static tree
726c_common_type (tree t1, tree t2)
727{
728 enum tree_code code1;
729 enum tree_code code2;
730
731 /* If one type is nonsense, use the other. */
732 if (t1 == error_mark_nodeglobal_trees[TI_ERROR_MARK])
733 return t2;
734 if (t2 == error_mark_nodeglobal_trees[TI_ERROR_MARK])
735 return t1;
736
737 if (TYPE_QUALS (t1)((int) ((((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 737, __FUNCTION__))->base.readonly_flag) * TYPE_QUAL_CONST
) | (((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 737, __FUNCTION__))->base.volatile_flag) * TYPE_QUAL_VOLATILE
) | (((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 737, __FUNCTION__))->base.u.bits.atomic_flag) * TYPE_QUAL_ATOMIC
) | (((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 737, __FUNCTION__))->type_common.restrict_flag) * TYPE_QUAL_RESTRICT
) | (((((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 737, __FUNCTION__))->base.u.bits.address_space) & 0xFF
) << 8))))
!= TYPE_UNQUALIFIED)
738 t1 = TYPE_MAIN_VARIANT (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 738, __FUNCTION__))->type_common.main_variant)
;
739
740 if (TYPE_QUALS (t2)((int) ((((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 740, __FUNCTION__))->base.readonly_flag) * TYPE_QUAL_CONST
) | (((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 740, __FUNCTION__))->base.volatile_flag) * TYPE_QUAL_VOLATILE
) | (((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 740, __FUNCTION__))->base.u.bits.atomic_flag) * TYPE_QUAL_ATOMIC
) | (((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 740, __FUNCTION__))->type_common.restrict_flag) * TYPE_QUAL_RESTRICT
) | (((((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 740, __FUNCTION__))->base.u.bits.address_space) & 0xFF
) << 8))))
!= TYPE_UNQUALIFIED)
741 t2 = TYPE_MAIN_VARIANT (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 741, __FUNCTION__))->type_common.main_variant)
;
742
743 if (TYPE_ATTRIBUTES (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 743, __FUNCTION__))->type_common.attributes)
!= NULL_TREE(tree) __null)
744 {
745 tree attrs = affects_type_identity_attributes (TYPE_ATTRIBUTES (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 745, __FUNCTION__))->type_common.attributes)
);
746 t1 = build_type_attribute_variant (t1, attrs);
747 }
748
749 if (TYPE_ATTRIBUTES (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 749, __FUNCTION__))->type_common.attributes)
!= NULL_TREE(tree) __null)
750 {
751 tree attrs = affects_type_identity_attributes (TYPE_ATTRIBUTES (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 751, __FUNCTION__))->type_common.attributes)
);
752 t2 = build_type_attribute_variant (t2, attrs);
753 }
754
755 /* Save time if the two types are the same. */
756
757 if (t1 == t2) return t1;
758
759 code1 = TREE_CODE (t1)((enum tree_code) (t1)->base.code);
760 code2 = TREE_CODE (t2)((enum tree_code) (t2)->base.code);
761
762 gcc_assert (code1 == VECTOR_TYPE || code1 == COMPLEX_TYPE((void)(!(code1 == VECTOR_TYPE || code1 == COMPLEX_TYPE || code1
== FIXED_POINT_TYPE || code1 == REAL_TYPE || code1 == INTEGER_TYPE
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 764, __FUNCTION__), 0 : 0))
763 || code1 == FIXED_POINT_TYPE || code1 == REAL_TYPE((void)(!(code1 == VECTOR_TYPE || code1 == COMPLEX_TYPE || code1
== FIXED_POINT_TYPE || code1 == REAL_TYPE || code1 == INTEGER_TYPE
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 764, __FUNCTION__), 0 : 0))
764 || code1 == INTEGER_TYPE)((void)(!(code1 == VECTOR_TYPE || code1 == COMPLEX_TYPE || code1
== FIXED_POINT_TYPE || code1 == REAL_TYPE || code1 == INTEGER_TYPE
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 764, __FUNCTION__), 0 : 0))
;
765 gcc_assert (code2 == VECTOR_TYPE || code2 == COMPLEX_TYPE((void)(!(code2 == VECTOR_TYPE || code2 == COMPLEX_TYPE || code2
== FIXED_POINT_TYPE || code2 == REAL_TYPE || code2 == INTEGER_TYPE
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 767, __FUNCTION__), 0 : 0))
766 || code2 == FIXED_POINT_TYPE || code2 == REAL_TYPE((void)(!(code2 == VECTOR_TYPE || code2 == COMPLEX_TYPE || code2
== FIXED_POINT_TYPE || code2 == REAL_TYPE || code2 == INTEGER_TYPE
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 767, __FUNCTION__), 0 : 0))
767 || code2 == INTEGER_TYPE)((void)(!(code2 == VECTOR_TYPE || code2 == COMPLEX_TYPE || code2
== FIXED_POINT_TYPE || code2 == REAL_TYPE || code2 == INTEGER_TYPE
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 767, __FUNCTION__), 0 : 0))
;
768
769 /* When one operand is a decimal float type, the other operand cannot be
770 a generic float type or a complex type. We also disallow vector types
771 here. */
772 if ((DECIMAL_FLOAT_TYPE_P (t1)((((enum tree_code) (t1)->base.code) == REAL_TYPE) &&
(((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check
((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 772, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(t1) : (t1)->type_common.mode)]) == MODE_DECIMAL_FLOAT))
|| DECIMAL_FLOAT_TYPE_P (t2)((((enum tree_code) (t2)->base.code) == REAL_TYPE) &&
(((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check
((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 772, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(t2) : (t2)->type_common.mode)]) == MODE_DECIMAL_FLOAT))
)
773 && !(DECIMAL_FLOAT_TYPE_P (t1)((((enum tree_code) (t1)->base.code) == REAL_TYPE) &&
(((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check
((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 773, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(t1) : (t1)->type_common.mode)]) == MODE_DECIMAL_FLOAT))
&& DECIMAL_FLOAT_TYPE_P (t2)((((enum tree_code) (t2)->base.code) == REAL_TYPE) &&
(((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check
((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 773, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(t2) : (t2)->type_common.mode)]) == MODE_DECIMAL_FLOAT))
))
774 {
775 if (code1 == VECTOR_TYPE || code2 == VECTOR_TYPE)
776 {
777 error ("cannot mix operands of decimal floating and vector types");
778 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
779 }
780 if (code1 == COMPLEX_TYPE || code2 == COMPLEX_TYPE)
781 {
782 error ("cannot mix operands of decimal floating and complex types");
783 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
784 }
785 if (code1 == REAL_TYPE && code2 == REAL_TYPE)
786 {
787 error ("cannot mix operands of decimal floating "
788 "and other floating types");
789 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
790 }
791 }
792
793 /* If one type is a vector type, return that type. (How the usual
794 arithmetic conversions apply to the vector types extension is not
795 precisely specified.) */
796 if (code1 == VECTOR_TYPE)
797 return t1;
798
799 if (code2 == VECTOR_TYPE)
800 return t2;
801
802 /* If one type is complex, form the common type of the non-complex
803 components, then make that complex. Use T1 or T2 if it is the
804 required type. */
805 if (code1 == COMPLEX_TYPE || code2 == COMPLEX_TYPE)
806 {
807 tree subtype1 = code1 == COMPLEX_TYPE ? TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 807, __FUNCTION__))->typed.type)
: t1;
808 tree subtype2 = code2 == COMPLEX_TYPE ? TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 808, __FUNCTION__))->typed.type)
: t2;
809 tree subtype = c_common_type (subtype1, subtype2);
810
811 if (code1 == COMPLEX_TYPE && TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 811, __FUNCTION__))->typed.type)
== subtype)
812 return t1;
813 else if (code2 == COMPLEX_TYPE && TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 813, __FUNCTION__))->typed.type)
== subtype)
814 return t2;
815 else
816 return build_complex_type (subtype);
817 }
818
819 /* If only one is real, use it as the result. */
820
821 if (code1 == REAL_TYPE && code2 != REAL_TYPE)
822 return t1;
823
824 if (code2 == REAL_TYPE && code1 != REAL_TYPE)
825 return t2;
826
827 /* If both are real and either are decimal floating point types, use
828 the decimal floating point type with the greater precision. */
829
830 if (code1 == REAL_TYPE && code2 == REAL_TYPE)
831 {
832 if (TYPE_MAIN_VARIANT (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 832, __FUNCTION__))->type_common.main_variant)
== dfloat128_type_nodeglobal_trees[TI_DFLOAT128_TYPE]
833 || TYPE_MAIN_VARIANT (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 833, __FUNCTION__))->type_common.main_variant)
== dfloat128_type_nodeglobal_trees[TI_DFLOAT128_TYPE])
834 return dfloat128_type_nodeglobal_trees[TI_DFLOAT128_TYPE];
835 else if (TYPE_MAIN_VARIANT (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 835, __FUNCTION__))->type_common.main_variant)
== dfloat64_type_nodeglobal_trees[TI_DFLOAT64_TYPE]
836 || TYPE_MAIN_VARIANT (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 836, __FUNCTION__))->type_common.main_variant)
== dfloat64_type_nodeglobal_trees[TI_DFLOAT64_TYPE])
837 return dfloat64_type_nodeglobal_trees[TI_DFLOAT64_TYPE];
838 else if (TYPE_MAIN_VARIANT (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 838, __FUNCTION__))->type_common.main_variant)
== dfloat32_type_nodeglobal_trees[TI_DFLOAT32_TYPE]
839 || TYPE_MAIN_VARIANT (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 839, __FUNCTION__))->type_common.main_variant)
== dfloat32_type_nodeglobal_trees[TI_DFLOAT32_TYPE])
840 return dfloat32_type_nodeglobal_trees[TI_DFLOAT32_TYPE];
841 }
842
843 /* Deal with fixed-point types. */
844 if (code1 == FIXED_POINT_TYPE || code2 == FIXED_POINT_TYPE)
845 {
846 unsigned int unsignedp = 0, satp = 0;
847 scalar_mode m1, m2;
848 unsigned int fbit1, ibit1, fbit2, ibit2, max_fbit, max_ibit;
849
850 m1 = SCALAR_TYPE_MODE (t1)(as_a <scalar_mode> ((tree_class_check ((t1), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 850, __FUNCTION__))->type_common.mode))
;
851 m2 = SCALAR_TYPE_MODE (t2)(as_a <scalar_mode> ((tree_class_check ((t2), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 851, __FUNCTION__))->type_common.mode))
;
852
853 /* If one input type is saturating, the result type is saturating. */
854 if (TYPE_SATURATING (t1)((tree_not_check4 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 854, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
), (ARRAY_TYPE)))->base.u.bits.saturating_flag)
|| TYPE_SATURATING (t2)((tree_not_check4 ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 854, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
), (ARRAY_TYPE)))->base.u.bits.saturating_flag)
)
855 satp = 1;
856
857 /* If both fixed-point types are unsigned, the result type is unsigned.
858 When mixing fixed-point and integer types, follow the sign of the
859 fixed-point type.
860 Otherwise, the result type is signed. */
861 if ((TYPE_UNSIGNED (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 861, __FUNCTION__))->base.u.bits.unsigned_flag)
&& TYPE_UNSIGNED (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 861, __FUNCTION__))->base.u.bits.unsigned_flag)
862 && code1 == FIXED_POINT_TYPE && code2 == FIXED_POINT_TYPE)
863 || (code1 == FIXED_POINT_TYPE && code2 != FIXED_POINT_TYPE
864 && TYPE_UNSIGNED (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 864, __FUNCTION__))->base.u.bits.unsigned_flag)
)
865 || (code1 != FIXED_POINT_TYPE && code2 == FIXED_POINT_TYPE
866 && TYPE_UNSIGNED (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 866, __FUNCTION__))->base.u.bits.unsigned_flag)
))
867 unsignedp = 1;
868
869 /* The result type is signed. */
870 if (unsignedp == 0)
871 {
872 /* If the input type is unsigned, we need to convert to the
873 signed type. */
874 if (code1 == FIXED_POINT_TYPE && TYPE_UNSIGNED (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 874, __FUNCTION__))->base.u.bits.unsigned_flag)
)
875 {
876 enum mode_class mclass = (enum mode_class) 0;
877 if (GET_MODE_CLASS (m1)((enum mode_class) mode_class[m1]) == MODE_UFRACT)
878 mclass = MODE_FRACT;
879 else if (GET_MODE_CLASS (m1)((enum mode_class) mode_class[m1]) == MODE_UACCUM)
880 mclass = MODE_ACCUM;
881 else
882 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 882, __FUNCTION__))
;
883 m1 = as_a <scalar_mode>
884 (mode_for_size (GET_MODE_PRECISION (m1), mclass, 0));
885 }
886 if (code2 == FIXED_POINT_TYPE && TYPE_UNSIGNED (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 886, __FUNCTION__))->base.u.bits.unsigned_flag)
)
887 {
888 enum mode_class mclass = (enum mode_class) 0;
889 if (GET_MODE_CLASS (m2)((enum mode_class) mode_class[m2]) == MODE_UFRACT)
890 mclass = MODE_FRACT;
891 else if (GET_MODE_CLASS (m2)((enum mode_class) mode_class[m2]) == MODE_UACCUM)
892 mclass = MODE_ACCUM;
893 else
894 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 894, __FUNCTION__))
;
895 m2 = as_a <scalar_mode>
896 (mode_for_size (GET_MODE_PRECISION (m2), mclass, 0));
897 }
898 }
899
900 if (code1 == FIXED_POINT_TYPE)
901 {
902 fbit1 = GET_MODE_FBIT (m1)mode_fbit[m1];
903 ibit1 = GET_MODE_IBIT (m1)mode_ibit[m1];
904 }
905 else
906 {
907 fbit1 = 0;
908 /* Signed integers need to subtract one sign bit. */
909 ibit1 = TYPE_PRECISION (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 909, __FUNCTION__))->type_common.precision)
- (!TYPE_UNSIGNED (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 909, __FUNCTION__))->base.u.bits.unsigned_flag)
);
910 }
911
912 if (code2 == FIXED_POINT_TYPE)
913 {
914 fbit2 = GET_MODE_FBIT (m2)mode_fbit[m2];
915 ibit2 = GET_MODE_IBIT (m2)mode_ibit[m2];
916 }
917 else
918 {
919 fbit2 = 0;
920 /* Signed integers need to subtract one sign bit. */
921 ibit2 = TYPE_PRECISION (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 921, __FUNCTION__))->type_common.precision)
- (!TYPE_UNSIGNED (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 921, __FUNCTION__))->base.u.bits.unsigned_flag)
);
922 }
923
924 max_ibit = ibit1 >= ibit2 ? ibit1 : ibit2;
925 max_fbit = fbit1 >= fbit2 ? fbit1 : fbit2;
926 return c_common_fixed_point_type_for_size (max_ibit, max_fbit, unsignedp,
927 satp);
928 }
929
930 /* Both real or both integers; use the one with greater precision. */
931
932 if (TYPE_PRECISION (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 932, __FUNCTION__))->type_common.precision)
> TYPE_PRECISION (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 932, __FUNCTION__))->type_common.precision)
)
933 return t1;
934 else if (TYPE_PRECISION (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 934, __FUNCTION__))->type_common.precision)
> TYPE_PRECISION (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 934, __FUNCTION__))->type_common.precision)
)
935 return t2;
936
937 /* Same precision. Prefer long longs to longs to ints when the
938 same precision, following the C99 rules on integer type rank
939 (which are equivalent to the C90 rules for C90 types). */
940
941 if (TYPE_MAIN_VARIANT (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 941, __FUNCTION__))->type_common.main_variant)
== long_long_unsigned_type_nodeinteger_types[itk_unsigned_long_long]
942 || TYPE_MAIN_VARIANT (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 942, __FUNCTION__))->type_common.main_variant)
== long_long_unsigned_type_nodeinteger_types[itk_unsigned_long_long])
943 return long_long_unsigned_type_nodeinteger_types[itk_unsigned_long_long];
944
945 if (TYPE_MAIN_VARIANT (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 945, __FUNCTION__))->type_common.main_variant)
== long_long_integer_type_nodeinteger_types[itk_long_long]
946 || TYPE_MAIN_VARIANT (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 946, __FUNCTION__))->type_common.main_variant)
== long_long_integer_type_nodeinteger_types[itk_long_long])
947 {
948 if (TYPE_UNSIGNED (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 948, __FUNCTION__))->base.u.bits.unsigned_flag)
|| TYPE_UNSIGNED (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 948, __FUNCTION__))->base.u.bits.unsigned_flag)
)
949 return long_long_unsigned_type_nodeinteger_types[itk_unsigned_long_long];
950 else
951 return long_long_integer_type_nodeinteger_types[itk_long_long];
952 }
953
954 if (TYPE_MAIN_VARIANT (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 954, __FUNCTION__))->type_common.main_variant)
== long_unsigned_type_nodeinteger_types[itk_unsigned_long]
955 || TYPE_MAIN_VARIANT (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 955, __FUNCTION__))->type_common.main_variant)
== long_unsigned_type_nodeinteger_types[itk_unsigned_long])
956 return long_unsigned_type_nodeinteger_types[itk_unsigned_long];
957
958 if (TYPE_MAIN_VARIANT (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 958, __FUNCTION__))->type_common.main_variant)
== long_integer_type_nodeinteger_types[itk_long]
959 || TYPE_MAIN_VARIANT (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 959, __FUNCTION__))->type_common.main_variant)
== long_integer_type_nodeinteger_types[itk_long])
960 {
961 /* But preserve unsignedness from the other type,
962 since long cannot hold all the values of an unsigned int. */
963 if (TYPE_UNSIGNED (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 963, __FUNCTION__))->base.u.bits.unsigned_flag)
|| TYPE_UNSIGNED (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 963, __FUNCTION__))->base.u.bits.unsigned_flag)
)
964 return long_unsigned_type_nodeinteger_types[itk_unsigned_long];
965 else
966 return long_integer_type_nodeinteger_types[itk_long];
967 }
968
969 /* For floating types of the same TYPE_PRECISION (which we here
970 assume means either the same set of values, or sets of values
971 neither a subset of the other, with behavior being undefined in
972 the latter case), follow the rules from TS 18661-3: prefer
973 interchange types _FloatN, then standard types long double,
974 double, float, then extended types _FloatNx. For extended types,
975 check them starting with _Float128x as that seems most consistent
976 in spirit with preferring long double to double; for interchange
977 types, also check in that order for consistency although it's not
978 possible for more than one of them to have the same
979 precision. */
980 tree mv1 = TYPE_MAIN_VARIANT (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 980, __FUNCTION__))->type_common.main_variant)
;
981 tree mv2 = TYPE_MAIN_VARIANT (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 981, __FUNCTION__))->type_common.main_variant)
;
982
983 for (int i = NUM_FLOATN_TYPES(TI_FLOATN_TYPE_LAST - TI_FLOATN_TYPE_FIRST + 1) - 1; i >= 0; i--)
984 if (mv1 == FLOATN_TYPE_NODE (i)global_trees[TI_FLOATN_TYPE_FIRST + (i)] || mv2 == FLOATN_TYPE_NODE (i)global_trees[TI_FLOATN_TYPE_FIRST + (i)])
985 return FLOATN_TYPE_NODE (i)global_trees[TI_FLOATN_TYPE_FIRST + (i)];
986
987 /* Likewise, prefer long double to double even if same size. */
988 if (mv1 == long_double_type_nodeglobal_trees[TI_LONG_DOUBLE_TYPE] || mv2 == long_double_type_nodeglobal_trees[TI_LONG_DOUBLE_TYPE])
989 return long_double_type_nodeglobal_trees[TI_LONG_DOUBLE_TYPE];
990
991 /* Likewise, prefer double to float even if same size.
992 We got a couple of embedded targets with 32 bit doubles, and the
993 pdp11 might have 64 bit floats. */
994 if (mv1 == double_type_nodeglobal_trees[TI_DOUBLE_TYPE] || mv2 == double_type_nodeglobal_trees[TI_DOUBLE_TYPE])
995 return double_type_nodeglobal_trees[TI_DOUBLE_TYPE];
996
997 if (mv1 == float_type_nodeglobal_trees[TI_FLOAT_TYPE] || mv2 == float_type_nodeglobal_trees[TI_FLOAT_TYPE])
998 return float_type_nodeglobal_trees[TI_FLOAT_TYPE];
999
1000 for (int i = NUM_FLOATNX_TYPES(TI_FLOATNX_TYPE_LAST - TI_FLOATNX_TYPE_FIRST + 1) - 1; i >= 0; i--)
1001 if (mv1 == FLOATNX_TYPE_NODE (i)global_trees[TI_FLOATNX_TYPE_FIRST + (i)] || mv2 == FLOATNX_TYPE_NODE (i)global_trees[TI_FLOATNX_TYPE_FIRST + (i)])
1002 return FLOATNX_TYPE_NODE (i)global_trees[TI_FLOATNX_TYPE_FIRST + (i)];
1003
1004 /* Otherwise prefer the unsigned one. */
1005
1006 if (TYPE_UNSIGNED (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1006, __FUNCTION__))->base.u.bits.unsigned_flag)
)
1007 return t1;
1008 else
1009 return t2;
1010}
1011
1012/* Wrapper around c_common_type that is used by c-common.c and other
1013 front end optimizations that remove promotions. ENUMERAL_TYPEs
1014 are allowed here and are converted to their compatible integer types.
1015 BOOLEAN_TYPEs are allowed here and return either boolean_type_node or
1016 preferably a non-Boolean type as the common type. */
1017tree
1018common_type (tree t1, tree t2)
1019{
1020 if (TREE_CODE (t1)((enum tree_code) (t1)->base.code) == ENUMERAL_TYPE)
1021 t1 = c_common_type_for_size (TYPE_PRECISION (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1021, __FUNCTION__))->type_common.precision)
, 1);
1022 if (TREE_CODE (t2)((enum tree_code) (t2)->base.code) == ENUMERAL_TYPE)
1023 t2 = c_common_type_for_size (TYPE_PRECISION (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1023, __FUNCTION__))->type_common.precision)
, 1);
1024
1025 /* If both types are BOOLEAN_TYPE, then return boolean_type_node. */
1026 if (TREE_CODE (t1)((enum tree_code) (t1)->base.code) == BOOLEAN_TYPE
1027 && TREE_CODE (t2)((enum tree_code) (t2)->base.code) == BOOLEAN_TYPE)
1028 return boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE];
1029
1030 /* If either type is BOOLEAN_TYPE, then return the other. */
1031 if (TREE_CODE (t1)((enum tree_code) (t1)->base.code) == BOOLEAN_TYPE)
1032 return t2;
1033 if (TREE_CODE (t2)((enum tree_code) (t2)->base.code) == BOOLEAN_TYPE)
1034 return t1;
1035
1036 return c_common_type (t1, t2);
1037}
1038
1039/* Return 1 if TYPE1 and TYPE2 are compatible types for assignment
1040 or various other operations. Return 2 if they are compatible
1041 but a warning may be needed if you use them together. */
1042
1043int
1044comptypes (tree type1, tree type2)
1045{
1046 const struct tagged_tu_seen_cache * tagged_tu_seen_base1 = tagged_tu_seen_base;
1047 int val;
1048
1049 val = comptypes_internal (type1, type2, NULL__null, NULL__null);
1050 free_all_tagged_tu_seen_up_to (tagged_tu_seen_base1);
1051
1052 return val;
1053}
1054
1055/* Like comptypes, but if it returns non-zero because enum and int are
1056 compatible, it sets *ENUM_AND_INT_P to true. */
1057
1058static int
1059comptypes_check_enum_int (tree type1, tree type2, bool *enum_and_int_p)
1060{
1061 const struct tagged_tu_seen_cache * tagged_tu_seen_base1 = tagged_tu_seen_base;
1062 int val;
1063
1064 val = comptypes_internal (type1, type2, enum_and_int_p, NULL__null);
1065 free_all_tagged_tu_seen_up_to (tagged_tu_seen_base1);
1066
1067 return val;
1068}
1069
1070/* Like comptypes, but if it returns nonzero for different types, it
1071 sets *DIFFERENT_TYPES_P to true. */
1072
1073int
1074comptypes_check_different_types (tree type1, tree type2,
1075 bool *different_types_p)
1076{
1077 const struct tagged_tu_seen_cache * tagged_tu_seen_base1 = tagged_tu_seen_base;
1078 int val;
1079
1080 val = comptypes_internal (type1, type2, NULL__null, different_types_p);
1081 free_all_tagged_tu_seen_up_to (tagged_tu_seen_base1);
1082
1083 return val;
1084}
1085
1086/* Return 1 if TYPE1 and TYPE2 are compatible types for assignment
1087 or various other operations. Return 2 if they are compatible
1088 but a warning may be needed if you use them together. If
1089 ENUM_AND_INT_P is not NULL, and one type is an enum and the other a
1090 compatible integer type, then this sets *ENUM_AND_INT_P to true;
1091 *ENUM_AND_INT_P is never set to false. If DIFFERENT_TYPES_P is not
1092 NULL, and the types are compatible but different enough not to be
1093 permitted in C11 typedef redeclarations, then this sets
1094 *DIFFERENT_TYPES_P to true; *DIFFERENT_TYPES_P is never set to
1095 false, but may or may not be set if the types are incompatible.
1096 This differs from comptypes, in that we don't free the seen
1097 types. */
1098
1099static int
1100comptypes_internal (const_tree type1, const_tree type2, bool *enum_and_int_p,
1101 bool *different_types_p)
1102{
1103 const_tree t1 = type1;
1104 const_tree t2 = type2;
1105 int attrval, val;
1106
1107 /* Suppress errors caused by previously reported errors. */
1108
1109 if (t1 == t2 || !t1 || !t2
1110 || TREE_CODE (t1)((enum tree_code) (t1)->base.code) == ERROR_MARK || TREE_CODE (t2)((enum tree_code) (t2)->base.code) == ERROR_MARK)
1111 return 1;
1112
1113 /* Enumerated types are compatible with integer types, but this is
1114 not transitive: two enumerated types in the same translation unit
1115 are compatible with each other only if they are the same type. */
1116
1117 if (TREE_CODE (t1)((enum tree_code) (t1)->base.code) == ENUMERAL_TYPE
1118 && COMPLETE_TYPE_P (t1)(((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1118, __FUNCTION__))->type_common.size) != (tree) __null
)
1119 && TREE_CODE (t2)((enum tree_code) (t2)->base.code) != ENUMERAL_TYPE)
1120 {
1121 t1 = c_common_type_for_size (TYPE_PRECISION (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1121, __FUNCTION__))->type_common.precision)
, TYPE_UNSIGNED (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1121, __FUNCTION__))->base.u.bits.unsigned_flag)
);
1122 if (TREE_CODE (t2)((enum tree_code) (t2)->base.code) != VOID_TYPE)
1123 {
1124 if (enum_and_int_p != NULL__null)
1125 *enum_and_int_p = true;
1126 if (different_types_p != NULL__null)
1127 *different_types_p = true;
1128 }
1129 }
1130 else if (TREE_CODE (t2)((enum tree_code) (t2)->base.code) == ENUMERAL_TYPE
1131 && COMPLETE_TYPE_P (t2)(((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1131, __FUNCTION__))->type_common.size) != (tree) __null
)
1132 && TREE_CODE (t1)((enum tree_code) (t1)->base.code) != ENUMERAL_TYPE)
1133 {
1134 t2 = c_common_type_for_size (TYPE_PRECISION (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1134, __FUNCTION__))->type_common.precision)
, TYPE_UNSIGNED (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1134, __FUNCTION__))->base.u.bits.unsigned_flag)
);
1135 if (TREE_CODE (t1)((enum tree_code) (t1)->base.code) != VOID_TYPE)
1136 {
1137 if (enum_and_int_p != NULL__null)
1138 *enum_and_int_p = true;
1139 if (different_types_p != NULL__null)
1140 *different_types_p = true;
1141 }
1142 }
1143
1144 if (t1 == t2)
1145 return 1;
1146
1147 /* Different classes of types can't be compatible. */
1148
1149 if (TREE_CODE (t1)((enum tree_code) (t1)->base.code) != TREE_CODE (t2)((enum tree_code) (t2)->base.code))
1150 return 0;
1151
1152 /* Qualifiers must match. C99 6.7.3p9 */
1153
1154 if (TYPE_QUALS (t1)((int) ((((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1154, __FUNCTION__))->base.readonly_flag) * TYPE_QUAL_CONST
) | (((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1154, __FUNCTION__))->base.volatile_flag) * TYPE_QUAL_VOLATILE
) | (((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1154, __FUNCTION__))->base.u.bits.atomic_flag) * TYPE_QUAL_ATOMIC
) | (((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1154, __FUNCTION__))->type_common.restrict_flag) * TYPE_QUAL_RESTRICT
) | (((((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1154, __FUNCTION__))->base.u.bits.address_space) & 0xFF
) << 8))))
!= TYPE_QUALS (t2)((int) ((((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1154, __FUNCTION__))->base.readonly_flag) * TYPE_QUAL_CONST
) | (((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1154, __FUNCTION__))->base.volatile_flag) * TYPE_QUAL_VOLATILE
) | (((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1154, __FUNCTION__))->base.u.bits.atomic_flag) * TYPE_QUAL_ATOMIC
) | (((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1154, __FUNCTION__))->type_common.restrict_flag) * TYPE_QUAL_RESTRICT
) | (((((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1154, __FUNCTION__))->base.u.bits.address_space) & 0xFF
) << 8))))
)
1155 return 0;
1156
1157 /* Allow for two different type nodes which have essentially the same
1158 definition. Note that we already checked for equality of the type
1159 qualifiers (just above). */
1160
1161 if (TREE_CODE (t1)((enum tree_code) (t1)->base.code) != ARRAY_TYPE
1162 && TYPE_MAIN_VARIANT (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1162, __FUNCTION__))->type_common.main_variant)
== TYPE_MAIN_VARIANT (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1162, __FUNCTION__))->type_common.main_variant)
)
1163 return 1;
1164
1165 /* 1 if no need for warning yet, 2 if warning cause has been seen. */
1166 if (!(attrval = comp_type_attributes (t1, t2)))
1167 return 0;
1168
1169 /* 1 if no need for warning yet, 2 if warning cause has been seen. */
1170 val = 0;
1171
1172 switch (TREE_CODE (t1)((enum tree_code) (t1)->base.code))
1173 {
1174 case INTEGER_TYPE:
1175 case FIXED_POINT_TYPE:
1176 case REAL_TYPE:
1177 /* With these nodes, we can't determine type equivalence by
1178 looking at what is stored in the nodes themselves, because
1179 two nodes might have different TYPE_MAIN_VARIANTs but still
1180 represent the same type. For example, wchar_t and int could
1181 have the same properties (TYPE_PRECISION, TYPE_MIN_VALUE,
1182 TYPE_MAX_VALUE, etc.), but have different TYPE_MAIN_VARIANTs
1183 and are distinct types. On the other hand, int and the
1184 following typedef
1185
1186 typedef int INT __attribute((may_alias));
1187
1188 have identical properties, different TYPE_MAIN_VARIANTs, but
1189 represent the same type. The canonical type system keeps
1190 track of equivalence in this case, so we fall back on it. */
1191 return TYPE_CANONICAL (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1191, __FUNCTION__))->type_common.canonical)
== TYPE_CANONICAL (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1191, __FUNCTION__))->type_common.canonical)
;
1192
1193 case POINTER_TYPE:
1194 /* Do not remove mode information. */
1195 if (TYPE_MODE (t1)((((enum tree_code) ((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1195, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(t1) : (t1)->type_common.mode)
!= TYPE_MODE (t2)((((enum tree_code) ((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1195, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(t2) : (t2)->type_common.mode)
)
1196 break;
1197 val = (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1197, __FUNCTION__))->typed.type)
== TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1197, __FUNCTION__))->typed.type)
1198 ? 1 : comptypes_internal (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1198, __FUNCTION__))->typed.type)
, TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1198, __FUNCTION__))->typed.type)
,
1199 enum_and_int_p, different_types_p));
1200 break;
1201
1202 case FUNCTION_TYPE:
1203 val = function_types_compatible_p (t1, t2, enum_and_int_p,
1204 different_types_p);
1205 break;
1206
1207 case ARRAY_TYPE:
1208 {
1209 tree d1 = TYPE_DOMAIN (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1209, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
;
1210 tree d2 = TYPE_DOMAIN (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1210, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
;
1211 bool d1_variable, d2_variable;
1212 bool d1_zero, d2_zero;
1213 val = 1;
1214
1215 /* Target types must match incl. qualifiers. */
1216 if (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1216, __FUNCTION__))->typed.type)
!= TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1216, __FUNCTION__))->typed.type)
1217 && (val = comptypes_internal (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1217, __FUNCTION__))->typed.type)
, TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1217, __FUNCTION__))->typed.type)
,
1218 enum_and_int_p,
1219 different_types_p)) == 0)
1220 return 0;
1221
1222 if (different_types_p != NULL__null
1223 && (d1 == NULL_TREE(tree) __null) != (d2 == NULL_TREE(tree) __null))
1224 *different_types_p = true;
1225 /* Sizes must match unless one is missing or variable. */
1226 if (d1 == NULL_TREE(tree) __null || d2 == NULL_TREE(tree) __null || d1 == d2)
1227 break;
1228
1229 d1_zero = !TYPE_MAX_VALUE (d1)((tree_check5 ((d1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1229, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)
;
1230 d2_zero = !TYPE_MAX_VALUE (d2)((tree_check5 ((d2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1230, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)
;
1231
1232 d1_variable = (!d1_zero
1233 && (TREE_CODE (TYPE_MIN_VALUE (d1))((enum tree_code) (((tree_check5 ((d1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1233, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.minval
))->base.code)
!= INTEGER_CST
1234 || TREE_CODE (TYPE_MAX_VALUE (d1))((enum tree_code) (((tree_check5 ((d1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1234, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
))->base.code)
!= INTEGER_CST));
1235 d2_variable = (!d2_zero
1236 && (TREE_CODE (TYPE_MIN_VALUE (d2))((enum tree_code) (((tree_check5 ((d2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1236, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.minval
))->base.code)
!= INTEGER_CST
1237 || TREE_CODE (TYPE_MAX_VALUE (d2))((enum tree_code) (((tree_check5 ((d2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1237, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
))->base.code)
!= INTEGER_CST));
1238 d1_variable = d1_variable || (d1_zero && c_vla_type_p (t1));
1239 d2_variable = d2_variable || (d2_zero && c_vla_type_p (t2));
1240
1241 if (different_types_p != NULL__null
1242 && d1_variable != d2_variable)
1243 *different_types_p = true;
1244 if (d1_variable || d2_variable)
1245 break;
1246 if (d1_zero && d2_zero)
1247 break;
1248 if (d1_zero || d2_zero
1249 || !tree_int_cst_equal (TYPE_MIN_VALUE (d1)((tree_check5 ((d1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1249, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.minval
)
, TYPE_MIN_VALUE (d2)((tree_check5 ((d2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1249, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.minval
)
)
1250 || !tree_int_cst_equal (TYPE_MAX_VALUE (d1)((tree_check5 ((d1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1250, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)
, TYPE_MAX_VALUE (d2)((tree_check5 ((d2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1250, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)
))
1251 val = 0;
1252
1253 break;
1254 }
1255
1256 case ENUMERAL_TYPE:
1257 case RECORD_TYPE:
1258 case UNION_TYPE:
1259 if (val != 1 && !same_translation_unit_p (t1, t2))
1260 {
1261 tree a1 = TYPE_ATTRIBUTES (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1261, __FUNCTION__))->type_common.attributes)
;
1262 tree a2 = TYPE_ATTRIBUTES (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1262, __FUNCTION__))->type_common.attributes)
;
1263
1264 if (! attribute_list_contained (a1, a2)
1265 && ! attribute_list_contained (a2, a1))
1266 break;
1267
1268 if (attrval != 2)
1269 return tagged_types_tu_compatible_p (t1, t2, enum_and_int_p,
1270 different_types_p);
1271 val = tagged_types_tu_compatible_p (t1, t2, enum_and_int_p,
1272 different_types_p);
1273 }
1274 break;
1275
1276 case VECTOR_TYPE:
1277 val = (known_eq (TYPE_VECTOR_SUBPARTS (t1), TYPE_VECTOR_SUBPARTS (t2))(!maybe_ne (TYPE_VECTOR_SUBPARTS (t1), TYPE_VECTOR_SUBPARTS (
t2)))
1278 && comptypes_internal (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1278, __FUNCTION__))->typed.type)
, TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1278, __FUNCTION__))->typed.type)
,
1279 enum_and_int_p, different_types_p));
1280 break;
1281
1282 default:
1283 break;
1284 }
1285 return attrval == 2 && val == 1 ? 2 : val;
1286}
1287
1288/* Return 1 if TTL and TTR are pointers to types that are equivalent, ignoring
1289 their qualifiers, except for named address spaces. If the pointers point to
1290 different named addresses, then we must determine if one address space is a
1291 subset of the other. */
1292
1293static int
1294comp_target_types (location_t location, tree ttl, tree ttr)
1295{
1296 int val;
1297 int val_ped;
1298 tree mvl = TREE_TYPE (ttl)((contains_struct_check ((ttl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1298, __FUNCTION__))->typed.type)
;
1299 tree mvr = TREE_TYPE (ttr)((contains_struct_check ((ttr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1299, __FUNCTION__))->typed.type)
;
1300 addr_space_t asl = TYPE_ADDR_SPACE (mvl)((tree_class_check ((mvl), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1300, __FUNCTION__))->base.u.bits.address_space)
;
1301 addr_space_t asr = TYPE_ADDR_SPACE (mvr)((tree_class_check ((mvr), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1301, __FUNCTION__))->base.u.bits.address_space)
;
1302 addr_space_t as_common;
1303 bool enum_and_int_p;
1304
1305 /* Fail if pointers point to incompatible address spaces. */
1306 if (!addr_space_superset (asl, asr, &as_common))
1307 return 0;
1308
1309 /* For pedantic record result of comptypes on arrays before losing
1310 qualifiers on the element type below. */
1311 val_ped = 1;
1312
1313 if (TREE_CODE (mvl)((enum tree_code) (mvl)->base.code) == ARRAY_TYPE
1314 && TREE_CODE (mvr)((enum tree_code) (mvr)->base.code) == ARRAY_TYPE)
1315 val_ped = comptypes (mvl, mvr);
1316
1317 /* Qualifiers on element types of array types that are
1318 pointer targets are lost by taking their TYPE_MAIN_VARIANT. */
1319
1320 mvl = (TYPE_ATOMIC (strip_array_types (mvl))((tree_class_check ((strip_array_types (mvl)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1320, __FUNCTION__))->base.u.bits.atomic_flag)
1321 ? c_build_qualified_type (TYPE_MAIN_VARIANT (mvl)((tree_class_check ((mvl), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1321, __FUNCTION__))->type_common.main_variant)
, TYPE_QUAL_ATOMIC)
1322 : TYPE_MAIN_VARIANT (mvl)((tree_class_check ((mvl), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1322, __FUNCTION__))->type_common.main_variant)
);
1323
1324 mvr = (TYPE_ATOMIC (strip_array_types (mvr))((tree_class_check ((strip_array_types (mvr)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1324, __FUNCTION__))->base.u.bits.atomic_flag)
1325 ? c_build_qualified_type (TYPE_MAIN_VARIANT (mvr)((tree_class_check ((mvr), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1325, __FUNCTION__))->type_common.main_variant)
, TYPE_QUAL_ATOMIC)
1326 : TYPE_MAIN_VARIANT (mvr)((tree_class_check ((mvr), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1326, __FUNCTION__))->type_common.main_variant)
);
1327
1328 enum_and_int_p = false;
1329 val = comptypes_check_enum_int (mvl, mvr, &enum_and_int_p);
1330
1331 if (val == 1 && val_ped != 1)
1332 pedwarn_c11 (location, OPT_Wpedantic, "invalid use of pointers to arrays with different qualifiers "
1333 "in ISO C before C2X");
1334
1335 if (val == 2)
1336 pedwarn (location, OPT_Wpedantic, "types are not quite compatible");
1337
1338 if (val == 1 && enum_and_int_p && warn_cxx_compatglobal_options.x_warn_cxx_compat)
1339 warning_at (location, OPT_Wc___compat,
1340 "pointer target types incompatible in C++");
1341
1342 return val;
1343}
1344
1345/* Subroutines of `comptypes'. */
1346
1347/* Determine whether two trees derive from the same translation unit.
1348 If the CONTEXT chain ends in a null, that tree's context is still
1349 being parsed, so if two trees have context chains ending in null,
1350 they're in the same translation unit. */
1351
1352bool
1353same_translation_unit_p (const_tree t1, const_tree t2)
1354{
1355 while (t1 && TREE_CODE (t1)((enum tree_code) (t1)->base.code) != TRANSLATION_UNIT_DECL)
1356 switch (TREE_CODE_CLASS (TREE_CODE (t1))tree_code_type[(int) (((enum tree_code) (t1)->base.code))])
1357 {
1358 case tcc_declaration:
1359 t1 = DECL_CONTEXT (t1)((contains_struct_check ((t1), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1359, __FUNCTION__))->decl_minimal.context)
; break;
1360 case tcc_type:
1361 t1 = TYPE_CONTEXT (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1361, __FUNCTION__))->type_common.context)
; break;
1362 case tcc_exceptional:
1363 t1 = BLOCK_SUPERCONTEXT (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1363, __FUNCTION__, (BLOCK)))->block.supercontext)
; break; /* assume block */
1364 default: gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1364, __FUNCTION__))
;
1365 }
1366
1367 while (t2 && TREE_CODE (t2)((enum tree_code) (t2)->base.code) != TRANSLATION_UNIT_DECL)
1368 switch (TREE_CODE_CLASS (TREE_CODE (t2))tree_code_type[(int) (((enum tree_code) (t2)->base.code))])
1369 {
1370 case tcc_declaration:
1371 t2 = DECL_CONTEXT (t2)((contains_struct_check ((t2), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1371, __FUNCTION__))->decl_minimal.context)
; break;
1372 case tcc_type:
1373 t2 = TYPE_CONTEXT (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1373, __FUNCTION__))->type_common.context)
; break;
1374 case tcc_exceptional:
1375 t2 = BLOCK_SUPERCONTEXT (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1375, __FUNCTION__, (BLOCK)))->block.supercontext)
; break; /* assume block */
1376 default: gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1376, __FUNCTION__))
;
1377 }
1378
1379 return t1 == t2;
1380}
1381
1382/* Allocate the seen two types, assuming that they are compatible. */
1383
1384static struct tagged_tu_seen_cache *
1385alloc_tagged_tu_seen_cache (const_tree t1, const_tree t2)
1386{
1387 struct tagged_tu_seen_cache *tu = XNEW (struct tagged_tu_seen_cache)((struct tagged_tu_seen_cache *) xmalloc (sizeof (struct tagged_tu_seen_cache
)))
;
1388 tu->next = tagged_tu_seen_base;
1389 tu->t1 = t1;
1390 tu->t2 = t2;
1391
1392 tagged_tu_seen_base = tu;
1393
1394 /* The C standard says that two structures in different translation
1395 units are compatible with each other only if the types of their
1396 fields are compatible (among other things). We assume that they
1397 are compatible until proven otherwise when building the cache.
1398 An example where this can occur is:
1399 struct a
1400 {
1401 struct a *next;
1402 };
1403 If we are comparing this against a similar struct in another TU,
1404 and did not assume they were compatible, we end up with an infinite
1405 loop. */
1406 tu->val = 1;
1407 return tu;
1408}
1409
1410/* Free the seen types until we get to TU_TIL. */
1411
1412static void
1413free_all_tagged_tu_seen_up_to (const struct tagged_tu_seen_cache *tu_til)
1414{
1415 const struct tagged_tu_seen_cache *tu = tagged_tu_seen_base;
1416 while (tu != tu_til)
1417 {
1418 const struct tagged_tu_seen_cache *const tu1
1419 = (const struct tagged_tu_seen_cache *) tu;
1420 tu = tu1->next;
1421 XDELETE (CONST_CAST (struct tagged_tu_seen_cache *, tu1))free ((void*) ((const_cast<struct tagged_tu_seen_cache *>
((tu1)))))
;
1422 }
1423 tagged_tu_seen_base = tu_til;
1424}
1425
1426/* Return 1 if two 'struct', 'union', or 'enum' types T1 and T2 are
1427 compatible. If the two types are not the same (which has been
1428 checked earlier), this can only happen when multiple translation
1429 units are being compiled. See C99 6.2.7 paragraph 1 for the exact
1430 rules. ENUM_AND_INT_P and DIFFERENT_TYPES_P are as in
1431 comptypes_internal. */
1432
1433static int
1434tagged_types_tu_compatible_p (const_tree t1, const_tree t2,
1435 bool *enum_and_int_p, bool *different_types_p)
1436{
1437 tree s1, s2;
1438 bool needs_warning = false;
1439
1440 /* We have to verify that the tags of the types are the same. This
1441 is harder than it looks because this may be a typedef, so we have
1442 to go look at the original type. It may even be a typedef of a
1443 typedef...
1444 In the case of compiler-created builtin structs the TYPE_DECL
1445 may be a dummy, with no DECL_ORIGINAL_TYPE. Don't fault. */
1446 while (TYPE_NAME (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1446, __FUNCTION__))->type_common.name)
1447 && TREE_CODE (TYPE_NAME (t1))((enum tree_code) (((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1447, __FUNCTION__))->type_common.name))->base.code)
== TYPE_DECL
1448 && DECL_ORIGINAL_TYPE (TYPE_NAME (t1))((tree_check ((((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1448, __FUNCTION__))->type_common.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1448, __FUNCTION__, (TYPE_DECL)))->decl_non_common.result
)
)
1449 t1 = DECL_ORIGINAL_TYPE (TYPE_NAME (t1))((tree_check ((((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1449, __FUNCTION__))->type_common.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1449, __FUNCTION__, (TYPE_DECL)))->decl_non_common.result
)
;
1450
1451 while (TYPE_NAME (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1451, __FUNCTION__))->type_common.name)
1452 && TREE_CODE (TYPE_NAME (t2))((enum tree_code) (((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1452, __FUNCTION__))->type_common.name))->base.code)
== TYPE_DECL
1453 && DECL_ORIGINAL_TYPE (TYPE_NAME (t2))((tree_check ((((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1453, __FUNCTION__))->type_common.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1453, __FUNCTION__, (TYPE_DECL)))->decl_non_common.result
)
)
1454 t2 = DECL_ORIGINAL_TYPE (TYPE_NAME (t2))((tree_check ((((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1454, __FUNCTION__))->type_common.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1454, __FUNCTION__, (TYPE_DECL)))->decl_non_common.result
)
;
1455
1456 /* C90 didn't have the requirement that the two tags be the same. */
1457 if (flag_isoc99 && TYPE_NAME (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1457, __FUNCTION__))->type_common.name)
!= TYPE_NAME (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1457, __FUNCTION__))->type_common.name)
)
1458 return 0;
1459
1460 /* C90 didn't say what happened if one or both of the types were
1461 incomplete; we choose to follow C99 rules here, which is that they
1462 are compatible. */
1463 if (TYPE_SIZE (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1463, __FUNCTION__))->type_common.size)
== NULL__null
1464 || TYPE_SIZE (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1464, __FUNCTION__))->type_common.size)
== NULL__null)
1465 return 1;
1466
1467 {
1468 const struct tagged_tu_seen_cache * tts_i;
1469 for (tts_i = tagged_tu_seen_base; tts_i != NULL__null; tts_i = tts_i->next)
1470 if (tts_i->t1 == t1 && tts_i->t2 == t2)
1471 return tts_i->val;
1472 }
1473
1474 switch (TREE_CODE (t1)((enum tree_code) (t1)->base.code))
1475 {
1476 case ENUMERAL_TYPE:
1477 {
1478 struct tagged_tu_seen_cache *tu = alloc_tagged_tu_seen_cache (t1, t2);
1479 /* Speed up the case where the type values are in the same order. */
1480 tree tv1 = TYPE_VALUES (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1480, __FUNCTION__, (ENUMERAL_TYPE)))->type_non_common.values
)
;
1481 tree tv2 = TYPE_VALUES (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1481, __FUNCTION__, (ENUMERAL_TYPE)))->type_non_common.values
)
;
1482
1483 if (tv1 == tv2)
1484 {
1485 return 1;
1486 }
1487
1488 for (;tv1 && tv2; tv1 = TREE_CHAIN (tv1)((contains_struct_check ((tv1), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1488, __FUNCTION__))->common.chain)
, tv2 = TREE_CHAIN (tv2)((contains_struct_check ((tv2), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1488, __FUNCTION__))->common.chain)
)
1489 {
1490 if (TREE_PURPOSE (tv1)((tree_check ((tv1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1490, __FUNCTION__, (TREE_LIST)))->list.purpose)
!= TREE_PURPOSE (tv2)((tree_check ((tv2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1490, __FUNCTION__, (TREE_LIST)))->list.purpose)
)
1491 break;
1492 if (simple_cst_equal (TREE_VALUE (tv1)((tree_check ((tv1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1492, __FUNCTION__, (TREE_LIST)))->list.value)
, TREE_VALUE (tv2)((tree_check ((tv2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1492, __FUNCTION__, (TREE_LIST)))->list.value)
) != 1)
1493 {
1494 tu->val = 0;
1495 return 0;
1496 }
1497 }
1498
1499 if (tv1 == NULL_TREE(tree) __null && tv2 == NULL_TREE(tree) __null)
1500 {
1501 return 1;
1502 }
1503 if (tv1 == NULL_TREE(tree) __null || tv2 == NULL_TREE(tree) __null)
1504 {
1505 tu->val = 0;
1506 return 0;
1507 }
1508
1509 if (list_length (TYPE_VALUES (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1509, __FUNCTION__, (ENUMERAL_TYPE)))->type_non_common.values
)
) != list_length (TYPE_VALUES (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1509, __FUNCTION__, (ENUMERAL_TYPE)))->type_non_common.values
)
))
1510 {
1511 tu->val = 0;
1512 return 0;
1513 }
1514
1515 for (s1 = TYPE_VALUES (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1515, __FUNCTION__, (ENUMERAL_TYPE)))->type_non_common.values
)
; s1; s1 = TREE_CHAIN (s1)((contains_struct_check ((s1), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1515, __FUNCTION__))->common.chain)
)
1516 {
1517 s2 = purpose_member (TREE_PURPOSE (s1)((tree_check ((s1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1517, __FUNCTION__, (TREE_LIST)))->list.purpose)
, TYPE_VALUES (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1517, __FUNCTION__, (ENUMERAL_TYPE)))->type_non_common.values
)
);
1518 if (s2 == NULL__null
1519 || simple_cst_equal (TREE_VALUE (s1)((tree_check ((s1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1519, __FUNCTION__, (TREE_LIST)))->list.value)
, TREE_VALUE (s2)((tree_check ((s2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1519, __FUNCTION__, (TREE_LIST)))->list.value)
) != 1)
1520 {
1521 tu->val = 0;
1522 return 0;
1523 }
1524 }
1525 return 1;
1526 }
1527
1528 case UNION_TYPE:
1529 {
1530 struct tagged_tu_seen_cache *tu = alloc_tagged_tu_seen_cache (t1, t2);
1531 if (list_length (TYPE_FIELDS (t1)((tree_check3 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1531, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
) != list_length (TYPE_FIELDS (t2)((tree_check3 ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1531, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
))
1532 {
1533 tu->val = 0;
1534 return 0;
1535 }
1536
1537 /* Speed up the common case where the fields are in the same order. */
1538 for (s1 = TYPE_FIELDS (t1)((tree_check3 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1538, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
, s2 = TYPE_FIELDS (t2)((tree_check3 ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1538, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
; s1 && s2;
1539 s1 = DECL_CHAIN (s1)(((contains_struct_check (((contains_struct_check ((s1), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1539, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1539, __FUNCTION__))->common.chain))
, s2 = DECL_CHAIN (s2)(((contains_struct_check (((contains_struct_check ((s2), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1539, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1539, __FUNCTION__))->common.chain))
)
1540 {
1541 int result;
1542
1543 if (DECL_NAME (s1)((contains_struct_check ((s1), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1543, __FUNCTION__))->decl_minimal.name)
!= DECL_NAME (s2)((contains_struct_check ((s2), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1543, __FUNCTION__))->decl_minimal.name)
)
1544 break;
1545 result = comptypes_internal (TREE_TYPE (s1)((contains_struct_check ((s1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1545, __FUNCTION__))->typed.type)
, TREE_TYPE (s2)((contains_struct_check ((s2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1545, __FUNCTION__))->typed.type)
,
1546 enum_and_int_p, different_types_p);
1547
1548 if (result != 1 && !DECL_NAME (s1)((contains_struct_check ((s1), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1548, __FUNCTION__))->decl_minimal.name)
)
1549 break;
1550 if (result == 0)
1551 {
1552 tu->val = 0;
1553 return 0;
1554 }
1555 if (result == 2)
1556 needs_warning = true;
1557
1558 if (TREE_CODE (s1)((enum tree_code) (s1)->base.code) == FIELD_DECL
1559 && simple_cst_equal (DECL_FIELD_BIT_OFFSET (s1)((tree_check ((s1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1559, __FUNCTION__, (FIELD_DECL)))->field_decl.bit_offset
)
,
1560 DECL_FIELD_BIT_OFFSET (s2)((tree_check ((s2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1560, __FUNCTION__, (FIELD_DECL)))->field_decl.bit_offset
)
) != 1)
1561 {
1562 tu->val = 0;
1563 return 0;
1564 }
1565 }
1566 if (!s1 && !s2)
1567 {
1568 tu->val = needs_warning ? 2 : 1;
1569 return tu->val;
1570 }
1571
1572 for (s1 = TYPE_FIELDS (t1)((tree_check3 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1572, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
; s1; s1 = DECL_CHAIN (s1)(((contains_struct_check (((contains_struct_check ((s1), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1572, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1572, __FUNCTION__))->common.chain))
)
1573 {
1574 bool ok = false;
1575
1576 for (s2 = TYPE_FIELDS (t2)((tree_check3 ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1576, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
; s2; s2 = DECL_CHAIN (s2)(((contains_struct_check (((contains_struct_check ((s2), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1576, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1576, __FUNCTION__))->common.chain))
)
1577 if (DECL_NAME (s1)((contains_struct_check ((s1), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1577, __FUNCTION__))->decl_minimal.name)
== DECL_NAME (s2)((contains_struct_check ((s2), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1577, __FUNCTION__))->decl_minimal.name)
)
1578 {
1579 int result;
1580
1581 result = comptypes_internal (TREE_TYPE (s1)((contains_struct_check ((s1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1581, __FUNCTION__))->typed.type)
, TREE_TYPE (s2)((contains_struct_check ((s2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1581, __FUNCTION__))->typed.type)
,
1582 enum_and_int_p,
1583 different_types_p);
1584
1585 if (result != 1 && !DECL_NAME (s1)((contains_struct_check ((s1), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1585, __FUNCTION__))->decl_minimal.name)
)
1586 continue;
1587 if (result == 0)
1588 {
1589 tu->val = 0;
1590 return 0;
1591 }
1592 if (result == 2)
1593 needs_warning = true;
1594
1595 if (TREE_CODE (s1)((enum tree_code) (s1)->base.code) == FIELD_DECL
1596 && simple_cst_equal (DECL_FIELD_BIT_OFFSET (s1)((tree_check ((s1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1596, __FUNCTION__, (FIELD_DECL)))->field_decl.bit_offset
)
,
1597 DECL_FIELD_BIT_OFFSET (s2)((tree_check ((s2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1597, __FUNCTION__, (FIELD_DECL)))->field_decl.bit_offset
)
) != 1)
1598 break;
1599
1600 ok = true;
1601 break;
1602 }
1603 if (!ok)
1604 {
1605 tu->val = 0;
1606 return 0;
1607 }
1608 }
1609 tu->val = needs_warning ? 2 : 10;
1610 return tu->val;
1611 }
1612
1613 case RECORD_TYPE:
1614 {
1615 struct tagged_tu_seen_cache *tu = alloc_tagged_tu_seen_cache (t1, t2);
1616
1617 for (s1 = TYPE_FIELDS (t1)((tree_check3 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1617, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
, s2 = TYPE_FIELDS (t2)((tree_check3 ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1617, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
;
1618 s1 && s2;
1619 s1 = DECL_CHAIN (s1)(((contains_struct_check (((contains_struct_check ((s1), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1619, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1619, __FUNCTION__))->common.chain))
, s2 = DECL_CHAIN (s2)(((contains_struct_check (((contains_struct_check ((s2), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1619, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1619, __FUNCTION__))->common.chain))
)
1620 {
1621 int result;
1622 if (TREE_CODE (s1)((enum tree_code) (s1)->base.code) != TREE_CODE (s2)((enum tree_code) (s2)->base.code)
1623 || DECL_NAME (s1)((contains_struct_check ((s1), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1623, __FUNCTION__))->decl_minimal.name)
!= DECL_NAME (s2)((contains_struct_check ((s2), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1623, __FUNCTION__))->decl_minimal.name)
)
1624 break;
1625 result = comptypes_internal (TREE_TYPE (s1)((contains_struct_check ((s1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1625, __FUNCTION__))->typed.type)
, TREE_TYPE (s2)((contains_struct_check ((s2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1625, __FUNCTION__))->typed.type)
,
1626 enum_and_int_p, different_types_p);
1627 if (result == 0)
1628 break;
1629 if (result == 2)
1630 needs_warning = true;
1631
1632 if (TREE_CODE (s1)((enum tree_code) (s1)->base.code) == FIELD_DECL
1633 && simple_cst_equal (DECL_FIELD_BIT_OFFSET (s1)((tree_check ((s1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1633, __FUNCTION__, (FIELD_DECL)))->field_decl.bit_offset
)
,
1634 DECL_FIELD_BIT_OFFSET (s2)((tree_check ((s2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1634, __FUNCTION__, (FIELD_DECL)))->field_decl.bit_offset
)
) != 1)
1635 break;
1636 }
1637 if (s1 && s2)
1638 tu->val = 0;
1639 else
1640 tu->val = needs_warning ? 2 : 1;
1641 return tu->val;
1642 }
1643
1644 default:
1645 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1645, __FUNCTION__))
;
1646 }
1647}
1648
1649/* Return 1 if two function types F1 and F2 are compatible.
1650 If either type specifies no argument types,
1651 the other must specify a fixed number of self-promoting arg types.
1652 Otherwise, if one type specifies only the number of arguments,
1653 the other must specify that number of self-promoting arg types.
1654 Otherwise, the argument types must match.
1655 ENUM_AND_INT_P and DIFFERENT_TYPES_P are as in comptypes_internal. */
1656
1657static int
1658function_types_compatible_p (const_tree f1, const_tree f2,
1659 bool *enum_and_int_p, bool *different_types_p)
1660{
1661 tree args1, args2;
1662 /* 1 if no need for warning yet, 2 if warning cause has been seen. */
1663 int val = 1;
1664 int val1;
1665 tree ret1, ret2;
1666
1667 ret1 = TREE_TYPE (f1)((contains_struct_check ((f1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1667, __FUNCTION__))->typed.type)
;
1668 ret2 = TREE_TYPE (f2)((contains_struct_check ((f2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1668, __FUNCTION__))->typed.type)
;
1669
1670 /* 'volatile' qualifiers on a function's return type used to mean
1671 the function is noreturn. */
1672 if (TYPE_VOLATILE (ret1)((tree_class_check ((ret1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1672, __FUNCTION__))->base.volatile_flag)
!= TYPE_VOLATILE (ret2)((tree_class_check ((ret2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1672, __FUNCTION__))->base.volatile_flag)
)
1673 pedwarn (input_location, 0, "function return types not compatible due to %<volatile%>");
1674 if (TYPE_VOLATILE (ret1)((tree_class_check ((ret1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1674, __FUNCTION__))->base.volatile_flag)
)
1675 ret1 = build_qualified_type (TYPE_MAIN_VARIANT (ret1)((tree_class_check ((ret1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1675, __FUNCTION__))->type_common.main_variant)
,
1676 TYPE_QUALS (ret1)((int) ((((tree_class_check ((ret1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1676, __FUNCTION__))->base.readonly_flag) * TYPE_QUAL_CONST
) | (((tree_class_check ((ret1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1676, __FUNCTION__))->base.volatile_flag) * TYPE_QUAL_VOLATILE
) | (((tree_class_check ((ret1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1676, __FUNCTION__))->base.u.bits.atomic_flag) * TYPE_QUAL_ATOMIC
) | (((tree_class_check ((ret1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1676, __FUNCTION__))->type_common.restrict_flag) * TYPE_QUAL_RESTRICT
) | (((((tree_class_check ((ret1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1676, __FUNCTION__))->base.u.bits.address_space) & 0xFF
) << 8))))
& ~TYPE_QUAL_VOLATILE);
1677 if (TYPE_VOLATILE (ret2)((tree_class_check ((ret2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1677, __FUNCTION__))->base.volatile_flag)
)
1678 ret2 = build_qualified_type (TYPE_MAIN_VARIANT (ret2)((tree_class_check ((ret2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1678, __FUNCTION__))->type_common.main_variant)
,
1679 TYPE_QUALS (ret2)((int) ((((tree_class_check ((ret2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1679, __FUNCTION__))->base.readonly_flag) * TYPE_QUAL_CONST
) | (((tree_class_check ((ret2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1679, __FUNCTION__))->base.volatile_flag) * TYPE_QUAL_VOLATILE
) | (((tree_class_check ((ret2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1679, __FUNCTION__))->base.u.bits.atomic_flag) * TYPE_QUAL_ATOMIC
) | (((tree_class_check ((ret2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1679, __FUNCTION__))->type_common.restrict_flag) * TYPE_QUAL_RESTRICT
) | (((((tree_class_check ((ret2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1679, __FUNCTION__))->base.u.bits.address_space) & 0xFF
) << 8))))
& ~TYPE_QUAL_VOLATILE);
1680 val = comptypes_internal (ret1, ret2, enum_and_int_p, different_types_p);
1681 if (val == 0)
1682 return 0;
1683
1684 args1 = TYPE_ARG_TYPES (f1)((tree_check2 ((f1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1684, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
1685 args2 = TYPE_ARG_TYPES (f2)((tree_check2 ((f2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1685, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
1686
1687 if (different_types_p != NULL__null
1688 && (args1 == NULL_TREE(tree) __null) != (args2 == NULL_TREE(tree) __null))
1689 *different_types_p = true;
1690
1691 /* An unspecified parmlist matches any specified parmlist
1692 whose argument types don't need default promotions. */
1693
1694 if (args1 == NULL_TREE(tree) __null)
1695 {
1696 if (flag_isoc2x ? stdarg_p (f2) : !self_promoting_args_p (args2))
1697 return 0;
1698 /* If one of these types comes from a non-prototype fn definition,
1699 compare that with the other type's arglist.
1700 If they don't match, ask for a warning (but no error). */
1701 if (TYPE_ACTUAL_ARG_TYPES (f1)((tree_class_check (((tree_check ((f1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1701, __FUNCTION__, (FUNCTION_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1701, __FUNCTION__))->type_non_common.lang_1)
1702 && type_lists_compatible_p (args2, TYPE_ACTUAL_ARG_TYPES (f1)((tree_class_check (((tree_check ((f1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1702, __FUNCTION__, (FUNCTION_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1702, __FUNCTION__))->type_non_common.lang_1)
,
1703 enum_and_int_p, different_types_p) != 1)
1704 val = 2;
1705 return val;
1706 }
1707 if (args2 == NULL_TREE(tree) __null)
1708 {
1709 if (flag_isoc2x ? stdarg_p (f1) : !self_promoting_args_p (args1))
1710 return 0;
1711 if (TYPE_ACTUAL_ARG_TYPES (f2)((tree_class_check (((tree_check ((f2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1711, __FUNCTION__, (FUNCTION_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1711, __FUNCTION__))->type_non_common.lang_1)
1712 && type_lists_compatible_p (args1, TYPE_ACTUAL_ARG_TYPES (f2)((tree_class_check (((tree_check ((f2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1712, __FUNCTION__, (FUNCTION_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1712, __FUNCTION__))->type_non_common.lang_1)
,
1713 enum_and_int_p, different_types_p) != 1)
1714 val = 2;
1715 return val;
1716 }
1717
1718 /* Both types have argument lists: compare them and propagate results. */
1719 val1 = type_lists_compatible_p (args1, args2, enum_and_int_p,
1720 different_types_p);
1721 return val1 != 1 ? val1 : val;
1722}
1723
1724/* Check two lists of types for compatibility, returning 0 for
1725 incompatible, 1 for compatible, or 2 for compatible with
1726 warning. ENUM_AND_INT_P and DIFFERENT_TYPES_P are as in
1727 comptypes_internal. */
1728
1729static int
1730type_lists_compatible_p (const_tree args1, const_tree args2,
1731 bool *enum_and_int_p, bool *different_types_p)
1732{
1733 /* 1 if no need for warning yet, 2 if warning cause has been seen. */
1734 int val = 1;
1735 int newval = 0;
1736
1737 while (1)
1738 {
1739 tree a1, mv1, a2, mv2;
1740 if (args1 == NULL_TREE(tree) __null && args2 == NULL_TREE(tree) __null)
1741 return val;
1742 /* If one list is shorter than the other,
1743 they fail to match. */
1744 if (args1 == NULL_TREE(tree) __null || args2 == NULL_TREE(tree) __null)
1745 return 0;
1746 mv1 = a1 = TREE_VALUE (args1)((tree_check ((args1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1746, __FUNCTION__, (TREE_LIST)))->list.value)
;
1747 mv2 = a2 = TREE_VALUE (args2)((tree_check ((args2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1747, __FUNCTION__, (TREE_LIST)))->list.value)
;
1748 if (mv1 && mv1 != error_mark_nodeglobal_trees[TI_ERROR_MARK] && TREE_CODE (mv1)((enum tree_code) (mv1)->base.code) != ARRAY_TYPE)
1749 mv1 = (TYPE_ATOMIC (mv1)((tree_class_check ((mv1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1749, __FUNCTION__))->base.u.bits.atomic_flag)
1750 ? c_build_qualified_type (TYPE_MAIN_VARIANT (mv1)((tree_class_check ((mv1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1750, __FUNCTION__))->type_common.main_variant)
,
1751 TYPE_QUAL_ATOMIC)
1752 : TYPE_MAIN_VARIANT (mv1)((tree_class_check ((mv1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1752, __FUNCTION__))->type_common.main_variant)
);
1753 if (mv2 && mv2 != error_mark_nodeglobal_trees[TI_ERROR_MARK] && TREE_CODE (mv2)((enum tree_code) (mv2)->base.code) != ARRAY_TYPE)
1754 mv2 = (TYPE_ATOMIC (mv2)((tree_class_check ((mv2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1754, __FUNCTION__))->base.u.bits.atomic_flag)
1755 ? c_build_qualified_type (TYPE_MAIN_VARIANT (mv2)((tree_class_check ((mv2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1755, __FUNCTION__))->type_common.main_variant)
,
1756 TYPE_QUAL_ATOMIC)
1757 : TYPE_MAIN_VARIANT (mv2)((tree_class_check ((mv2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1757, __FUNCTION__))->type_common.main_variant)
);
1758 /* A null pointer instead of a type
1759 means there is supposed to be an argument
1760 but nothing is specified about what type it has.
1761 So match anything that self-promotes. */
1762 if (different_types_p != NULL__null
1763 && (a1 == NULL_TREE(tree) __null) != (a2 == NULL_TREE(tree) __null))
1764 *different_types_p = true;
1765 if (a1 == NULL_TREE(tree) __null)
1766 {
1767 if (c_type_promotes_to (a2) != a2)
1768 return 0;
1769 }
1770 else if (a2 == NULL_TREE(tree) __null)
1771 {
1772 if (c_type_promotes_to (a1) != a1)
1773 return 0;
1774 }
1775 /* If one of the lists has an error marker, ignore this arg. */
1776 else if (TREE_CODE (a1)((enum tree_code) (a1)->base.code) == ERROR_MARK
1777 || TREE_CODE (a2)((enum tree_code) (a2)->base.code) == ERROR_MARK)
1778 ;
1779 else if (!(newval = comptypes_internal (mv1, mv2, enum_and_int_p,
1780 different_types_p)))
1781 {
1782 if (different_types_p != NULL__null)
1783 *different_types_p = true;
1784 /* Allow wait (union {union wait *u; int *i} *)
1785 and wait (union wait *) to be compatible. */
1786 if (TREE_CODE (a1)((enum tree_code) (a1)->base.code) == UNION_TYPE
1787 && (TYPE_NAME (a1)((tree_class_check ((a1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1787, __FUNCTION__))->type_common.name)
== NULL_TREE(tree) __null
1788 || TYPE_TRANSPARENT_AGGR (a1)((tree_check3 ((a1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1788, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_common.transparent_aggr_flag)
)
1789 && TREE_CODE (TYPE_SIZE (a1))((enum tree_code) (((tree_class_check ((a1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1789, __FUNCTION__))->type_common.size))->base.code)
== INTEGER_CST
1790 && tree_int_cst_equal (TYPE_SIZE (a1)((tree_class_check ((a1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1790, __FUNCTION__))->type_common.size)
,
1791 TYPE_SIZE (a2)((tree_class_check ((a2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1791, __FUNCTION__))->type_common.size)
))
1792 {
1793 tree memb;
1794 for (memb = TYPE_FIELDS (a1)((tree_check3 ((a1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1794, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
;
1795 memb; memb = DECL_CHAIN (memb)(((contains_struct_check (((contains_struct_check ((memb), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1795, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1795, __FUNCTION__))->common.chain))
)
1796 {
1797 tree mv3 = TREE_TYPE (memb)((contains_struct_check ((memb), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1797, __FUNCTION__))->typed.type)
;
1798 if (mv3 && mv3 != error_mark_nodeglobal_trees[TI_ERROR_MARK]
1799 && TREE_CODE (mv3)((enum tree_code) (mv3)->base.code) != ARRAY_TYPE)
1800 mv3 = (TYPE_ATOMIC (mv3)((tree_class_check ((mv3), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1800, __FUNCTION__))->base.u.bits.atomic_flag)
1801 ? c_build_qualified_type (TYPE_MAIN_VARIANT (mv3)((tree_class_check ((mv3), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1801, __FUNCTION__))->type_common.main_variant)
,
1802 TYPE_QUAL_ATOMIC)
1803 : TYPE_MAIN_VARIANT (mv3)((tree_class_check ((mv3), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1803, __FUNCTION__))->type_common.main_variant)
);
1804 if (comptypes_internal (mv3, mv2, enum_and_int_p,
1805 different_types_p))
1806 break;
1807 }
1808 if (memb == NULL_TREE(tree) __null)
1809 return 0;
1810 }
1811 else if (TREE_CODE (a2)((enum tree_code) (a2)->base.code) == UNION_TYPE
1812 && (TYPE_NAME (a2)((tree_class_check ((a2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1812, __FUNCTION__))->type_common.name)
== NULL_TREE(tree) __null
1813 || TYPE_TRANSPARENT_AGGR (a2)((tree_check3 ((a2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1813, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_common.transparent_aggr_flag)
)
1814 && TREE_CODE (TYPE_SIZE (a2))((enum tree_code) (((tree_class_check ((a2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1814, __FUNCTION__))->type_common.size))->base.code)
== INTEGER_CST
1815 && tree_int_cst_equal (TYPE_SIZE (a2)((tree_class_check ((a2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1815, __FUNCTION__))->type_common.size)
,
1816 TYPE_SIZE (a1)((tree_class_check ((a1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1816, __FUNCTION__))->type_common.size)
))
1817 {
1818 tree memb;
1819 for (memb = TYPE_FIELDS (a2)((tree_check3 ((a2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1819, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
;
1820 memb; memb = DECL_CHAIN (memb)(((contains_struct_check (((contains_struct_check ((memb), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1820, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1820, __FUNCTION__))->common.chain))
)
1821 {
1822 tree mv3 = TREE_TYPE (memb)((contains_struct_check ((memb), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1822, __FUNCTION__))->typed.type)
;
1823 if (mv3 && mv3 != error_mark_nodeglobal_trees[TI_ERROR_MARK]
1824 && TREE_CODE (mv3)((enum tree_code) (mv3)->base.code) != ARRAY_TYPE)
1825 mv3 = (TYPE_ATOMIC (mv3)((tree_class_check ((mv3), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1825, __FUNCTION__))->base.u.bits.atomic_flag)
1826 ? c_build_qualified_type (TYPE_MAIN_VARIANT (mv3)((tree_class_check ((mv3), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1826, __FUNCTION__))->type_common.main_variant)
,
1827 TYPE_QUAL_ATOMIC)
1828 : TYPE_MAIN_VARIANT (mv3)((tree_class_check ((mv3), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1828, __FUNCTION__))->type_common.main_variant)
);
1829 if (comptypes_internal (mv3, mv1, enum_and_int_p,
1830 different_types_p))
1831 break;
1832 }
1833 if (memb == NULL_TREE(tree) __null)
1834 return 0;
1835 }
1836 else
1837 return 0;
1838 }
1839
1840 /* comptypes said ok, but record if it said to warn. */
1841 if (newval > val)
1842 val = newval;
1843
1844 args1 = TREE_CHAIN (args1)((contains_struct_check ((args1), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1844, __FUNCTION__))->common.chain)
;
1845 args2 = TREE_CHAIN (args2)((contains_struct_check ((args2), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1845, __FUNCTION__))->common.chain)
;
1846 }
1847}
1848
1849/* Compute the size to increment a pointer by. When a function type or void
1850 type or incomplete type is passed, size_one_node is returned.
1851 This function does not emit any diagnostics; the caller is responsible
1852 for that. */
1853
1854static tree
1855c_size_in_bytes (const_tree type)
1856{
1857 enum tree_code code = TREE_CODE (type)((enum tree_code) (type)->base.code);
1858
1859 if (code == FUNCTION_TYPE || code == VOID_TYPE || code == ERROR_MARK
1860 || !COMPLETE_TYPE_P (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1860, __FUNCTION__))->type_common.size) != (tree) __null
)
)
1861 return size_one_nodeglobal_trees[TI_SIZE_ONE];
1862
1863 /* Convert in case a char is more than one unit. */
1864 return size_binop_loc (input_location, CEIL_DIV_EXPR, TYPE_SIZE_UNIT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1864, __FUNCTION__))->type_common.size_unit)
,
1865 size_int (TYPE_PRECISION (char_type_node)size_int_kind (((tree_class_check ((integer_types[itk_char]),
(tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1865, __FUNCTION__))->type_common.precision) / (8), stk_sizetype
)
1866 / BITS_PER_UNIT)size_int_kind (((tree_class_check ((integer_types[itk_char]),
(tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1865, __FUNCTION__))->type_common.precision) / (8), stk_sizetype
)
);
1867}
1868
1869/* Return either DECL or its known constant value (if it has one). */
1870
1871tree
1872decl_constant_value_1 (tree decl, bool in_init)
1873{
1874 if (/* Note that DECL_INITIAL isn't valid for a PARM_DECL. */
1875 TREE_CODE (decl)((enum tree_code) (decl)->base.code) != PARM_DECL
1876 && !TREE_THIS_VOLATILE (decl)((decl)->base.volatile_flag)
1877 && TREE_READONLY (decl)((non_type_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1877, __FUNCTION__))->base.readonly_flag)
1878 && DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1878, __FUNCTION__))->decl_common.initial)
!= NULL_TREE(tree) __null
1879 && !error_operand_p (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1879, __FUNCTION__))->decl_common.initial)
)
1880 /* This is invalid if initial value is not constant.
1881 If it has either a function call, a memory reference,
1882 or a variable, then re-evaluating it could give different results. */
1883 && TREE_CONSTANT (DECL_INITIAL (decl))((non_type_check ((((contains_struct_check ((decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1883, __FUNCTION__))->decl_common.initial)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1883, __FUNCTION__))->base.constant_flag)
1884 /* Check for cases where this is sub-optimal, even though valid. */
1885 && (in_init || TREE_CODE (DECL_INITIAL (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1885, __FUNCTION__))->decl_common.initial))->base.code
)
!= CONSTRUCTOR))
1886 return DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1886, __FUNCTION__))->decl_common.initial)
;
1887 return decl;
1888}
1889
1890/* Return either DECL or its known constant value (if it has one).
1891 Like the above, but always return decl outside of functions. */
1892
1893tree
1894decl_constant_value (tree decl)
1895{
1896 /* Don't change a variable array bound or initial value to a constant
1897 in a place where a variable is invalid. */
1898 return current_function_decl ? decl_constant_value_1 (decl, false) : decl;
1899}
1900
1901/* Convert the array expression EXP to a pointer. */
1902static tree
1903array_to_pointer_conversion (location_t loc, tree exp)
1904{
1905 tree orig_exp = exp;
1906 tree type = TREE_TYPE (exp)((contains_struct_check ((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1906, __FUNCTION__))->typed.type)
;
1907 tree adr;
1908 tree restype = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1908, __FUNCTION__))->typed.type)
;
1909 tree ptrtype;
1910
1911 gcc_assert (TREE_CODE (type) == ARRAY_TYPE)((void)(!(((enum tree_code) (type)->base.code) == ARRAY_TYPE
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1911, __FUNCTION__), 0 : 0))
;
1912
1913 STRIP_TYPE_NOPS (exp)while ((((((enum tree_code) (exp)->base.code)) == NOP_EXPR
|| (((enum tree_code) (exp)->base.code)) == CONVERT_EXPR)
|| ((enum tree_code) (exp)->base.code) == NON_LVALUE_EXPR
) && (*((const_cast<tree*> (tree_operand_check (
(exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1913, __FUNCTION__))))) != global_trees[TI_ERROR_MARK] &&
(((contains_struct_check ((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1913, __FUNCTION__))->typed.type) == ((contains_struct_check
(((*((const_cast<tree*> (tree_operand_check ((exp), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1913, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1913, __FUNCTION__))->typed.type))) (exp) = (*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1913, __FUNCTION__)))))
;
1914
1915 copy_warning (exp, orig_exp);
1916
1917 ptrtype = build_pointer_type (restype);
1918
1919 if (INDIRECT_REF_P (exp)(((enum tree_code) (exp)->base.code) == INDIRECT_REF))
1920 return convert (ptrtype, TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1920, __FUNCTION__)))))
);
1921
1922 /* In C++ array compound literals are temporary objects unless they are
1923 const or appear in namespace scope, so they are destroyed too soon
1924 to use them for much of anything (c++/53220). */
1925 if (warn_cxx_compatglobal_options.x_warn_cxx_compat && TREE_CODE (exp)((enum tree_code) (exp)->base.code) == COMPOUND_LITERAL_EXPR)
1926 {
1927 tree decl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0)(*((const_cast<tree*> (tree_operand_check (((*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1927, __FUNCTION__)))))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1927, __FUNCTION__)))))
;
1928 if (!TREE_READONLY (decl)((non_type_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1928, __FUNCTION__))->base.readonly_flag)
&& !TREE_STATIC (decl)((decl)->base.static_flag))
1929 warning_at (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1929, __FUNCTION__))->decl_minimal.locus)
, OPT_Wc___compat,
1930 "converting an array compound literal to a pointer "
1931 "is ill-formed in C++");
1932 }
1933
1934 adr = build_unary_op (loc, ADDR_EXPR, exp, true);
1935 return convert (ptrtype, adr);
1936}
1937
1938/* Convert the function expression EXP to a pointer. */
1939static tree
1940function_to_pointer_conversion (location_t loc, tree exp)
1941{
1942 tree orig_exp = exp;
1943
1944 gcc_assert (TREE_CODE (TREE_TYPE (exp)) == FUNCTION_TYPE)((void)(!(((enum tree_code) (((contains_struct_check ((exp), (
TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1944, __FUNCTION__))->typed.type))->base.code) == FUNCTION_TYPE
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1944, __FUNCTION__), 0 : 0))
;
1945
1946 STRIP_TYPE_NOPS (exp)while ((((((enum tree_code) (exp)->base.code)) == NOP_EXPR
|| (((enum tree_code) (exp)->base.code)) == CONVERT_EXPR)
|| ((enum tree_code) (exp)->base.code) == NON_LVALUE_EXPR
) && (*((const_cast<tree*> (tree_operand_check (
(exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1946, __FUNCTION__))))) != global_trees[TI_ERROR_MARK] &&
(((contains_struct_check ((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1946, __FUNCTION__))->typed.type) == ((contains_struct_check
(((*((const_cast<tree*> (tree_operand_check ((exp), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1946, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1946, __FUNCTION__))->typed.type))) (exp) = (*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1946, __FUNCTION__)))))
;
1947
1948 copy_warning (exp, orig_exp);
1949
1950 return build_unary_op (loc, ADDR_EXPR, exp, false);
1951}
1952
1953/* Mark EXP as read, not just set, for set but not used -Wunused
1954 warning purposes. */
1955
1956void
1957mark_exp_read (tree exp)
1958{
1959 switch (TREE_CODE (exp)((enum tree_code) (exp)->base.code))
1960 {
1961 case VAR_DECL:
1962 case PARM_DECL:
1963 DECL_READ_P (exp)((tree_check2 ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1963, __FUNCTION__, (VAR_DECL), (PARM_DECL)))->decl_common
.decl_read_flag)
= 1;
1964 break;
1965 case ARRAY_REF:
1966 case COMPONENT_REF:
1967 case MODIFY_EXPR:
1968 case REALPART_EXPR:
1969 case IMAGPART_EXPR:
1970 CASE_CONVERTcase NOP_EXPR: case CONVERT_EXPR:
1971 case ADDR_EXPR:
1972 case VIEW_CONVERT_EXPR:
1973 mark_exp_read (TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1973, __FUNCTION__)))))
);
1974 break;
1975 case COMPOUND_EXPR:
1976 /* Pattern match what build_atomic_assign produces with modifycode
1977 NOP_EXPR. */
1978 if (VAR_P (TREE_OPERAND (exp, 1))(((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1978, __FUNCTION__))))))->base.code) == VAR_DECL)
1979 && DECL_ARTIFICIAL (TREE_OPERAND (exp, 1))((contains_struct_check (((*((const_cast<tree*> (tree_operand_check
((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1979, __FUNCTION__)))))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1979, __FUNCTION__))->decl_common.artificial_flag)
1980 && TREE_CODE (TREE_OPERAND (exp, 0))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1980, __FUNCTION__))))))->base.code)
== COMPOUND_EXPR)
1981 {
1982 tree t1 = TREE_OPERAND (TREE_OPERAND (exp, 0), 0)(*((const_cast<tree*> (tree_operand_check (((*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1982, __FUNCTION__)))))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1982, __FUNCTION__)))))
;
1983 tree t2 = TREE_OPERAND (TREE_OPERAND (exp, 0), 1)(*((const_cast<tree*> (tree_operand_check (((*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1983, __FUNCTION__)))))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1983, __FUNCTION__)))))
;
1984 if (TREE_CODE (t1)((enum tree_code) (t1)->base.code) == TARGET_EXPR
1985 && TARGET_EXPR_SLOT (t1)(*(tree_operand_check_code ((t1), (TARGET_EXPR), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1985, __FUNCTION__)))
== TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1985, __FUNCTION__)))))
1986 && TREE_CODE (t2)((enum tree_code) (t2)->base.code) == CALL_EXPR)
1987 {
1988 tree fndecl = get_callee_fndecl (t2);
1989 tree arg = NULL_TREE(tree) __null;
1990 if (fndecl
1991 && TREE_CODE (fndecl)((enum tree_code) (fndecl)->base.code) == FUNCTION_DECL
1992 && fndecl_built_in_p (fndecl, BUILT_IN_NORMAL)
1993 && call_expr_nargs (t2)(((int)((unsigned long) (*tree_int_cst_elt_check (((tree_class_check
((t2), (tcc_vl_exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1993, __FUNCTION__))->exp.operands[0]), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1993, __FUNCTION__)))) - 3)
>= 2)
1994 switch (DECL_FUNCTION_CODE (fndecl))
1995 {
1996 case BUILT_IN_ATOMIC_STORE:
1997 arg = CALL_EXPR_ARG (t2, 1)(*((const_cast<tree*> (tree_operand_check (((tree_check
((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1997, __FUNCTION__, (CALL_EXPR)))), ((1) + 3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 1997, __FUNCTION__)))))
;
1998 break;
1999 case BUILT_IN_ATOMIC_STORE_1:
2000 case BUILT_IN_ATOMIC_STORE_2:
2001 case BUILT_IN_ATOMIC_STORE_4:
2002 case BUILT_IN_ATOMIC_STORE_8:
2003 case BUILT_IN_ATOMIC_STORE_16:
2004 arg = CALL_EXPR_ARG (t2, 0)(*((const_cast<tree*> (tree_operand_check (((tree_check
((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2004, __FUNCTION__, (CALL_EXPR)))), ((0) + 3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2004, __FUNCTION__)))))
;
2005 break;
2006 default:
2007 break;
2008 }
2009 if (arg)
2010 {
2011 STRIP_NOPS (arg)(arg) = tree_strip_nop_conversions ((const_cast<union tree_node
*> (((arg)))))
;
2012 if (TREE_CODE (arg)((enum tree_code) (arg)->base.code) == ADDR_EXPR
2013 && DECL_P (TREE_OPERAND (arg, 0))(tree_code_type[(int) (((enum tree_code) ((*((const_cast<tree
*> (tree_operand_check ((arg), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2013, __FUNCTION__))))))->base.code))] == tcc_declaration
)
2014 && TYPE_ATOMIC (TREE_TYPE (TREE_OPERAND (arg, 0)))((tree_class_check ((((contains_struct_check (((*((const_cast
<tree*> (tree_operand_check ((arg), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2014, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2014, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2014, __FUNCTION__))->base.u.bits.atomic_flag)
)
2015 mark_exp_read (TREE_OPERAND (arg, 0)(*((const_cast<tree*> (tree_operand_check ((arg), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2015, __FUNCTION__)))))
);
2016 }
2017 }
2018 }
2019 /* FALLTHRU */
2020 case C_MAYBE_CONST_EXPR:
2021 mark_exp_read (TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2021, __FUNCTION__)))))
);
2022 break;
2023 default:
2024 break;
2025 }
2026}
2027
2028/* Perform the default conversion of arrays and functions to pointers.
2029 Return the result of converting EXP. For any other expression, just
2030 return EXP.
2031
2032 LOC is the location of the expression. */
2033
2034struct c_expr
2035default_function_array_conversion (location_t loc, struct c_expr exp)
2036{
2037 tree orig_exp = exp.value;
2038 tree type = TREE_TYPE (exp.value)((contains_struct_check ((exp.value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2038, __FUNCTION__))->typed.type)
;
2039 enum tree_code code = TREE_CODE (type)((enum tree_code) (type)->base.code);
2040
2041 switch (code)
2042 {
2043 case ARRAY_TYPE:
2044 {
2045 bool not_lvalue = false;
2046 bool lvalue_array_p;
2047
2048 while ((TREE_CODE (exp.value)((enum tree_code) (exp.value)->base.code) == NON_LVALUE_EXPR
2049 || CONVERT_EXPR_P (exp.value)((((enum tree_code) (exp.value)->base.code)) == NOP_EXPR ||
(((enum tree_code) (exp.value)->base.code)) == CONVERT_EXPR
)
)
2050 && TREE_TYPE (TREE_OPERAND (exp.value, 0))((contains_struct_check (((*((const_cast<tree*> (tree_operand_check
((exp.value), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2050, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2050, __FUNCTION__))->typed.type)
== type)
2051 {
2052 if (TREE_CODE (exp.value)((enum tree_code) (exp.value)->base.code) == NON_LVALUE_EXPR)
2053 not_lvalue = true;
2054 exp.value = TREE_OPERAND (exp.value, 0)(*((const_cast<tree*> (tree_operand_check ((exp.value),
(0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2054, __FUNCTION__)))))
;
2055 }
2056
2057 copy_warning (exp.value, orig_exp);
2058
2059 lvalue_array_p = !not_lvalue && lvalue_p (exp.value);
2060 if (!flag_isoc99 && !lvalue_array_p)
2061 {
2062 /* Before C99, non-lvalue arrays do not decay to pointers.
2063 Normally, using such an array would be invalid; but it can
2064 be used correctly inside sizeof or as a statement expression.
2065 Thus, do not give an error here; an error will result later. */
2066 return exp;
2067 }
2068
2069 exp.value = array_to_pointer_conversion (loc, exp.value);
2070 }
2071 break;
2072 case FUNCTION_TYPE:
2073 exp.value = function_to_pointer_conversion (loc, exp.value);
2074 break;
2075 default:
2076 break;
2077 }
2078
2079 return exp;
2080}
2081
2082struct c_expr
2083default_function_array_read_conversion (location_t loc, struct c_expr exp)
2084{
2085 mark_exp_read (exp.value);
2086 return default_function_array_conversion (loc, exp);
2087}
2088
2089/* Return whether EXPR should be treated as an atomic lvalue for the
2090 purposes of load and store handling. */
2091
2092static bool
2093really_atomic_lvalue (tree expr)
2094{
2095 if (error_operand_p (expr))
2096 return false;
2097 if (!TYPE_ATOMIC (TREE_TYPE (expr))((tree_class_check ((((contains_struct_check ((expr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2097, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2097, __FUNCTION__))->base.u.bits.atomic_flag)
)
2098 return false;
2099 if (!lvalue_p (expr))
2100 return false;
2101
2102 /* Ignore _Atomic on register variables, since their addresses can't
2103 be taken so (a) atomicity is irrelevant and (b) the normal atomic
2104 sequences wouldn't work. Ignore _Atomic on structures containing
2105 bit-fields, since accessing elements of atomic structures or
2106 unions is undefined behavior (C11 6.5.2.3#5), but it's unclear if
2107 it's undefined at translation time or execution time, and the
2108 normal atomic sequences again wouldn't work. */
2109 while (handled_component_p (expr))
2110 {
2111 if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == COMPONENT_REF
2112 && DECL_C_BIT_FIELD (TREE_OPERAND (expr, 1))(((contains_struct_check (((tree_check (((*((const_cast<tree
*> (tree_operand_check ((expr), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2112, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2112, __FUNCTION__, (FIELD_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2112, __FUNCTION__))->decl_common.lang_flag_4) == 1)
)
2113 return false;
2114 expr = TREE_OPERAND (expr, 0)(*((const_cast<tree*> (tree_operand_check ((expr), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2114, __FUNCTION__)))))
;
2115 }
2116 if (DECL_P (expr)(tree_code_type[(int) (((enum tree_code) (expr)->base.code
))] == tcc_declaration)
&& C_DECL_REGISTER (expr)((contains_struct_check ((expr), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2116, __FUNCTION__))->decl_common.lang_flag_4)
)
2117 return false;
2118 return true;
2119}
2120
2121/* Convert expression EXP (location LOC) from lvalue to rvalue,
2122 including converting functions and arrays to pointers if CONVERT_P.
2123 If READ_P, also mark the expression as having been read. */
2124
2125struct c_expr
2126convert_lvalue_to_rvalue (location_t loc, struct c_expr exp,
2127 bool convert_p, bool read_p)
2128{
2129 if (read_p)
2130 mark_exp_read (exp.value);
2131 if (convert_p)
2132 exp = default_function_array_conversion (loc, exp);
2133 if (!VOID_TYPE_P (TREE_TYPE (exp.value))(((enum tree_code) (((contains_struct_check ((exp.value), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2133, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
)
)
2134 exp.value = require_complete_type (loc, exp.value);
2135 if (really_atomic_lvalue (exp.value))
2136 {
2137 vec<tree, va_gc> *params;
2138 tree nonatomic_type, tmp, tmp_addr, fndecl, func_call;
2139 tree expr_type = TREE_TYPE (exp.value)((contains_struct_check ((exp.value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2139, __FUNCTION__))->typed.type)
;
2140 tree expr_addr = build_unary_op (loc, ADDR_EXPR, exp.value, false);
2141 tree seq_cst = build_int_cst (integer_type_nodeinteger_types[itk_int], MEMMODEL_SEQ_CST);
2142
2143 gcc_assert (TYPE_ATOMIC (expr_type))((void)(!(((tree_class_check ((expr_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2143, __FUNCTION__))->base.u.bits.atomic_flag)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2143, __FUNCTION__), 0 : 0))
;
2144
2145 /* Expansion of a generic atomic load may require an addition
2146 element, so allocate enough to prevent a resize. */
2147 vec_alloc (params, 4);
2148
2149 /* Remove the qualifiers for the rest of the expressions and
2150 create the VAL temp variable to hold the RHS. */
2151 nonatomic_type = build_qualified_type (expr_type, TYPE_UNQUALIFIED);
2152 tmp = create_tmp_var_raw (nonatomic_type);
2153 tmp_addr = build_unary_op (loc, ADDR_EXPR, tmp, false);
2154 TREE_ADDRESSABLE (tmp)((tmp)->base.addressable_flag) = 1;
2155 /* Do not disable warnings for TMP even though it's artificial.
2156 -Winvalid-memory-model depends on it. */
2157
2158 /* Issue __atomic_load (&expr, &tmp, SEQ_CST); */
2159 fndecl = builtin_decl_explicit (BUILT_IN_ATOMIC_LOAD);
2160 params->quick_push (expr_addr);
2161 params->quick_push (tmp_addr);
2162 params->quick_push (seq_cst);
2163 func_call = c_build_function_call_vec (loc, vNULL, fndecl, params, NULL__null);
2164
2165 /* EXPR is always read. */
2166 mark_exp_read (exp.value);
2167
2168 /* Return tmp which contains the value loaded. */
2169 exp.value = build4 (TARGET_EXPR, nonatomic_type, tmp, func_call,
2170 NULL_TREE(tree) __null, NULL_TREE(tree) __null);
2171 }
2172 if (convert_p && !error_operand_p (exp.value)
2173 && (TREE_CODE (TREE_TYPE (exp.value))((enum tree_code) (((contains_struct_check ((exp.value), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2173, __FUNCTION__))->typed.type))->base.code)
!= ARRAY_TYPE))
2174 exp.value = convert (build_qualified_type (TREE_TYPE (exp.value)((contains_struct_check ((exp.value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2174, __FUNCTION__))->typed.type)
, TYPE_UNQUALIFIED), exp.value);
2175 return exp;
2176}
2177
2178/* EXP is an expression of integer type. Apply the integer promotions
2179 to it and return the promoted value. */
2180
2181tree
2182perform_integral_promotions (tree exp)
2183{
2184 tree type = TREE_TYPE (exp)((contains_struct_check ((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2184, __FUNCTION__))->typed.type)
;
2185 enum tree_code code = TREE_CODE (type)((enum tree_code) (type)->base.code);
2186
2187 gcc_assert (INTEGRAL_TYPE_P (type))((void)(!((((enum tree_code) (type)->base.code) == ENUMERAL_TYPE
|| ((enum tree_code) (type)->base.code) == BOOLEAN_TYPE ||
((enum tree_code) (type)->base.code) == INTEGER_TYPE)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2187, __FUNCTION__), 0 : 0))
;
2188
2189 /* Normally convert enums to int,
2190 but convert wide enums to something wider. */
2191 if (code == ENUMERAL_TYPE)
2192 {
2193 type = c_common_type_for_size (MAX (TYPE_PRECISION (type),((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2193, __FUNCTION__))->type_common.precision)) > (((tree_class_check
((integer_types[itk_int]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2194, __FUNCTION__))->type_common.precision)) ? (((tree_class_check
((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2193, __FUNCTION__))->type_common.precision)) : (((tree_class_check
((integer_types[itk_int]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2194, __FUNCTION__))->type_common.precision)))
2194 TYPE_PRECISION (integer_type_node))((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2193, __FUNCTION__))->type_common.precision)) > (((tree_class_check
((integer_types[itk_int]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2194, __FUNCTION__))->type_common.precision)) ? (((tree_class_check
((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2193, __FUNCTION__))->type_common.precision)) : (((tree_class_check
((integer_types[itk_int]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2194, __FUNCTION__))->type_common.precision)))
,
2195 ((TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2195, __FUNCTION__))->type_common.precision)
2196 >= TYPE_PRECISION (integer_type_node)((tree_class_check ((integer_types[itk_int]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2196, __FUNCTION__))->type_common.precision)
)
2197 && TYPE_UNSIGNED (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2197, __FUNCTION__))->base.u.bits.unsigned_flag)
));
2198
2199 return convert (type, exp);
2200 }
2201
2202 /* ??? This should no longer be needed now bit-fields have their
2203 proper types. */
2204 if (TREE_CODE (exp)((enum tree_code) (exp)->base.code) == COMPONENT_REF
2205 && DECL_C_BIT_FIELD (TREE_OPERAND (exp, 1))(((contains_struct_check (((tree_check (((*((const_cast<tree
*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2205, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2205, __FUNCTION__, (FIELD_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2205, __FUNCTION__))->decl_common.lang_flag_4) == 1)
2206 /* If it's thinner than an int, promote it like a
2207 c_promoting_integer_type_p, otherwise leave it alone. */
2208 && compare_tree_int (DECL_SIZE (TREE_OPERAND (exp, 1))((contains_struct_check (((*((const_cast<tree*> (tree_operand_check
((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2208, __FUNCTION__)))))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2208, __FUNCTION__))->decl_common.size)
,
2209 TYPE_PRECISION (integer_type_node)((tree_class_check ((integer_types[itk_int]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2209, __FUNCTION__))->type_common.precision)
) < 0)
2210 return convert (integer_type_nodeinteger_types[itk_int], exp);
2211
2212 if (c_promoting_integer_type_p (type))
2213 {
2214 /* Preserve unsignedness if not really getting any wider. */
2215 if (TYPE_UNSIGNED (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2215, __FUNCTION__))->base.u.bits.unsigned_flag)
2216 && TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2216, __FUNCTION__))->type_common.precision)
== TYPE_PRECISION (integer_type_node)((tree_class_check ((integer_types[itk_int]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2216, __FUNCTION__))->type_common.precision)
)
2217 return convert (unsigned_type_nodeinteger_types[itk_unsigned_int], exp);
2218
2219 return convert (integer_type_nodeinteger_types[itk_int], exp);
2220 }
2221
2222 return exp;
2223}
2224
2225
2226/* Perform default promotions for C data used in expressions.
2227 Enumeral types or short or char are converted to int.
2228 In addition, manifest constants symbols are replaced by their values. */
2229
2230tree
2231default_conversion (tree exp)
2232{
2233 tree orig_exp;
2234 tree type = TREE_TYPE (exp)((contains_struct_check ((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2234, __FUNCTION__))->typed.type)
;
2235 enum tree_code code = TREE_CODE (type)((enum tree_code) (type)->base.code);
2236 tree promoted_type;
2237
2238 mark_exp_read (exp);
2239
2240 /* Functions and arrays have been converted during parsing. */
2241 gcc_assert (code != FUNCTION_TYPE)((void)(!(code != FUNCTION_TYPE) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2241, __FUNCTION__), 0 : 0))
;
2242 if (code == ARRAY_TYPE)
2243 return exp;
2244
2245 /* Constants can be used directly unless they're not loadable. */
2246 if (TREE_CODE (exp)((enum tree_code) (exp)->base.code) == CONST_DECL)
2247 exp = DECL_INITIAL (exp)((contains_struct_check ((exp), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2247, __FUNCTION__))->decl_common.initial)
;
2248
2249 /* Strip no-op conversions. */
2250 orig_exp = exp;
2251 STRIP_TYPE_NOPS (exp)while ((((((enum tree_code) (exp)->base.code)) == NOP_EXPR
|| (((enum tree_code) (exp)->base.code)) == CONVERT_EXPR)
|| ((enum tree_code) (exp)->base.code) == NON_LVALUE_EXPR
) && (*((const_cast<tree*> (tree_operand_check (
(exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2251, __FUNCTION__))))) != global_trees[TI_ERROR_MARK] &&
(((contains_struct_check ((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2251, __FUNCTION__))->typed.type) == ((contains_struct_check
(((*((const_cast<tree*> (tree_operand_check ((exp), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2251, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2251, __FUNCTION__))->typed.type))) (exp) = (*((const_cast
<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2251, __FUNCTION__)))))
;
2252
2253 copy_warning (exp, orig_exp);
2254
2255 if (code == VOID_TYPE)
2256 {
2257 error_at (EXPR_LOC_OR_LOC (exp, input_location)((((IS_ADHOC_LOC (((((exp)) && ((tree_code_type[(int)
(((enum tree_code) ((exp))->base.code))]) >= tcc_reference
&& (tree_code_type[(int) (((enum tree_code) ((exp))->
base.code))]) <= tcc_expression)) ? (exp)->exp.locus : (
(location_t) 0)))) ? get_location_from_adhoc_loc (line_table,
((((exp)) && ((tree_code_type[(int) (((enum tree_code
) ((exp))->base.code))]) >= tcc_reference && (tree_code_type
[(int) (((enum tree_code) ((exp))->base.code))]) <= tcc_expression
)) ? (exp)->exp.locus : ((location_t) 0))) : (((((exp)) &&
((tree_code_type[(int) (((enum tree_code) ((exp))->base.code
))]) >= tcc_reference && (tree_code_type[(int) (((
enum tree_code) ((exp))->base.code))]) <= tcc_expression
)) ? (exp)->exp.locus : ((location_t) 0)))) != ((location_t
) 0)) ? (exp)->exp.locus : (input_location))
,
2258 "void value not ignored as it ought to be");
2259 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2260 }
2261
2262 exp = require_complete_type (EXPR_LOC_OR_LOC (exp, input_location)((((IS_ADHOC_LOC (((((exp)) && ((tree_code_type[(int)
(((enum tree_code) ((exp))->base.code))]) >= tcc_reference
&& (tree_code_type[(int) (((enum tree_code) ((exp))->
base.code))]) <= tcc_expression)) ? (exp)->exp.locus : (
(location_t) 0)))) ? get_location_from_adhoc_loc (line_table,
((((exp)) && ((tree_code_type[(int) (((enum tree_code
) ((exp))->base.code))]) >= tcc_reference && (tree_code_type
[(int) (((enum tree_code) ((exp))->base.code))]) <= tcc_expression
)) ? (exp)->exp.locus : ((location_t) 0))) : (((((exp)) &&
((tree_code_type[(int) (((enum tree_code) ((exp))->base.code
))]) >= tcc_reference && (tree_code_type[(int) (((
enum tree_code) ((exp))->base.code))]) <= tcc_expression
)) ? (exp)->exp.locus : ((location_t) 0)))) != ((location_t
) 0)) ? (exp)->exp.locus : (input_location))
, exp);
2263 if (exp == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2264 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2265
2266 promoted_type = targetm.promoted_type (type);
2267 if (promoted_type)
2268 return convert (promoted_type, exp);
2269
2270 if (INTEGRAL_TYPE_P (type)(((enum tree_code) (type)->base.code) == ENUMERAL_TYPE || (
(enum tree_code) (type)->base.code) == BOOLEAN_TYPE || ((enum
tree_code) (type)->base.code) == INTEGER_TYPE)
)
2271 return perform_integral_promotions (exp);
2272
2273 return exp;
2274}
2275
2276/* Look up COMPONENT in a structure or union TYPE.
2277
2278 If the component name is not found, returns NULL_TREE. Otherwise,
2279 the return value is a TREE_LIST, with each TREE_VALUE a FIELD_DECL
2280 stepping down the chain to the component, which is in the last
2281 TREE_VALUE of the list. Normally the list is of length one, but if
2282 the component is embedded within (nested) anonymous structures or
2283 unions, the list steps down the chain to the component. */
2284
2285static tree
2286lookup_field (tree type, tree component)
2287{
2288 tree field;
2289
2290 /* If TYPE_LANG_SPECIFIC is set, then it is a sorted array of pointers
2291 to the field elements. Use a binary search on this array to quickly
2292 find the element. Otherwise, do a linear search. TYPE_LANG_SPECIFIC
2293 will always be set for structures which have many elements.
2294
2295 Duplicate field checking replaces duplicates with NULL_TREE so
2296 TYPE_LANG_SPECIFIC arrays are potentially no longer sorted. In that
2297 case just iterate using DECL_CHAIN. */
2298
2299 if (TYPE_LANG_SPECIFIC (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2299, __FUNCTION__))->type_with_lang_specific.lang_specific
)
&& TYPE_LANG_SPECIFIC (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2299, __FUNCTION__))->type_with_lang_specific.lang_specific
)
->s
2300 && !seen_error ())
2301 {
2302 int bot, top, half;
2303 tree *field_array = &TYPE_LANG_SPECIFIC (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2303, __FUNCTION__))->type_with_lang_specific.lang_specific
)
->s->elts[0];
2304
2305 field = TYPE_FIELDS (type)((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2305, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
;
2306 bot = 0;
2307 top = TYPE_LANG_SPECIFIC (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2307, __FUNCTION__))->type_with_lang_specific.lang_specific
)
->s->len;
2308 while (top - bot > 1)
2309 {
2310 half = (top - bot + 1) >> 1;
2311 field = field_array[bot+half];
2312
2313 if (DECL_NAME (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2313, __FUNCTION__))->decl_minimal.name)
== NULL_TREE(tree) __null)
2314 {
2315 /* Step through all anon unions in linear fashion. */
2316 while (DECL_NAME (field_array[bot])((contains_struct_check ((field_array[bot]), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2316, __FUNCTION__))->decl_minimal.name)
== NULL_TREE(tree) __null)
2317 {
2318 field = field_array[bot++];
2319 if (RECORD_OR_UNION_TYPE_P (TREE_TYPE (field))(((enum tree_code) (((contains_struct_check ((field), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2319, __FUNCTION__))->typed.type))->base.code) == RECORD_TYPE
|| ((enum tree_code) (((contains_struct_check ((field), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2319, __FUNCTION__))->typed.type))->base.code) == UNION_TYPE
|| ((enum tree_code) (((contains_struct_check ((field), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2319, __FUNCTION__))->typed.type))->base.code) == QUAL_UNION_TYPE
)
)
2320 {
2321 tree anon = lookup_field (TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2321, __FUNCTION__))->typed.type)
, component);
2322
2323 if (anon)
2324 return tree_cons (NULL_TREE(tree) __null, field, anon);
2325
2326 /* The Plan 9 compiler permits referring
2327 directly to an anonymous struct/union field
2328 using a typedef name. */
2329 if (flag_plan9_extensionsglobal_options.x_flag_plan9_extensions
2330 && TYPE_NAME (TREE_TYPE (field))((tree_class_check ((((contains_struct_check ((field), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2330, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2330, __FUNCTION__))->type_common.name)
!= NULL_TREE(tree) __null
2331 && (TREE_CODE (TYPE_NAME (TREE_TYPE (field)))((enum tree_code) (((tree_class_check ((((contains_struct_check
((field), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2331, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2331, __FUNCTION__))->type_common.name))->base.code)
2332 == TYPE_DECL)
2333 && (DECL_NAME (TYPE_NAME (TREE_TYPE (field)))((contains_struct_check ((((tree_class_check ((((contains_struct_check
((field), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2333, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2333, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2333, __FUNCTION__))->decl_minimal.name)
2334 == component))
2335 break;
2336 }
2337 }
2338
2339 /* Entire record is only anon unions. */
2340 if (bot > top)
2341 return NULL_TREE(tree) __null;
2342
2343 /* Restart the binary search, with new lower bound. */
2344 continue;
2345 }
2346
2347 if (DECL_NAME (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2347, __FUNCTION__))->decl_minimal.name)
== component)
2348 break;
2349 if (DECL_NAME (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2349, __FUNCTION__))->decl_minimal.name)
< component)
2350 bot += half;
2351 else
2352 top = bot + half;
2353 }
2354
2355 if (DECL_NAME (field_array[bot])((contains_struct_check ((field_array[bot]), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2355, __FUNCTION__))->decl_minimal.name)
== component)
2356 field = field_array[bot];
2357 else if (DECL_NAME (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2357, __FUNCTION__))->decl_minimal.name)
!= component)
2358 return NULL_TREE(tree) __null;
2359 }
2360 else
2361 {
2362 for (field = TYPE_FIELDS (type)((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2362, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
; field; field = DECL_CHAIN (field)(((contains_struct_check (((contains_struct_check ((field), (
TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2362, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2362, __FUNCTION__))->common.chain))
)
2363 {
2364 if (DECL_NAME (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2364, __FUNCTION__))->decl_minimal.name)
== NULL_TREE(tree) __null
2365 && RECORD_OR_UNION_TYPE_P (TREE_TYPE (field))(((enum tree_code) (((contains_struct_check ((field), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2365, __FUNCTION__))->typed.type))->base.code) == RECORD_TYPE
|| ((enum tree_code) (((contains_struct_check ((field), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2365, __FUNCTION__))->typed.type))->base.code) == UNION_TYPE
|| ((enum tree_code) (((contains_struct_check ((field), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2365, __FUNCTION__))->typed.type))->base.code) == QUAL_UNION_TYPE
)
)
2366 {
2367 tree anon = lookup_field (TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2367, __FUNCTION__))->typed.type)
, component);
2368
2369 if (anon)
2370 return tree_cons (NULL_TREE(tree) __null, field, anon);
2371
2372 /* The Plan 9 compiler permits referring directly to an
2373 anonymous struct/union field using a typedef
2374 name. */
2375 if (flag_plan9_extensionsglobal_options.x_flag_plan9_extensions
2376 && TYPE_NAME (TREE_TYPE (field))((tree_class_check ((((contains_struct_check ((field), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2376, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2376, __FUNCTION__))->type_common.name)
!= NULL_TREE(tree) __null
2377 && TREE_CODE (TYPE_NAME (TREE_TYPE (field)))((enum tree_code) (((tree_class_check ((((contains_struct_check
((field), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2377, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2377, __FUNCTION__))->type_common.name))->base.code)
== TYPE_DECL
2378 && (DECL_NAME (TYPE_NAME (TREE_TYPE (field)))((contains_struct_check ((((tree_class_check ((((contains_struct_check
((field), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2378, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2378, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2378, __FUNCTION__))->decl_minimal.name)
2379 == component))
2380 break;
2381 }
2382
2383 if (DECL_NAME (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2383, __FUNCTION__))->decl_minimal.name)
== component)
2384 break;
2385 }
2386
2387 if (field == NULL_TREE(tree) __null)
2388 return NULL_TREE(tree) __null;
2389 }
2390
2391 return tree_cons (NULL_TREE(tree) __null, field, NULL_TREE(tree) __null);
2392}
2393
2394/* Recursively append candidate IDENTIFIER_NODEs to CANDIDATES. */
2395
2396static void
2397lookup_field_fuzzy_find_candidates (tree type, tree component,
2398 vec<tree> *candidates)
2399{
2400 tree field;
2401 for (field = TYPE_FIELDS (type)((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2401, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
; field; field = DECL_CHAIN (field)(((contains_struct_check (((contains_struct_check ((field), (
TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2401, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2401, __FUNCTION__))->common.chain))
)
2402 {
2403 if (DECL_NAME (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2403, __FUNCTION__))->decl_minimal.name)
== NULL_TREE(tree) __null
2404 && RECORD_OR_UNION_TYPE_P (TREE_TYPE (field))(((enum tree_code) (((contains_struct_check ((field), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2404, __FUNCTION__))->typed.type))->base.code) == RECORD_TYPE
|| ((enum tree_code) (((contains_struct_check ((field), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2404, __FUNCTION__))->typed.type))->base.code) == UNION_TYPE
|| ((enum tree_code) (((contains_struct_check ((field), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2404, __FUNCTION__))->typed.type))->base.code) == QUAL_UNION_TYPE
)
)
2405 lookup_field_fuzzy_find_candidates (TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2405, __FUNCTION__))->typed.type)
, component,
2406 candidates);
2407
2408 if (DECL_NAME (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2408, __FUNCTION__))->decl_minimal.name)
)
2409 candidates->safe_push (DECL_NAME (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2409, __FUNCTION__))->decl_minimal.name)
);
2410 }
2411}
2412
2413/* Like "lookup_field", but find the closest matching IDENTIFIER_NODE,
2414 rather than returning a TREE_LIST for an exact match. */
2415
2416static tree
2417lookup_field_fuzzy (tree type, tree component)
2418{
2419 gcc_assert (TREE_CODE (component) == IDENTIFIER_NODE)((void)(!(((enum tree_code) (component)->base.code) == IDENTIFIER_NODE
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2419, __FUNCTION__), 0 : 0))
;
2420
2421 /* First, gather a list of candidates. */
2422 auto_vec <tree> candidates;
2423
2424 lookup_field_fuzzy_find_candidates (type, component,
2425 &candidates);
2426
2427 return find_closest_identifier (component, &candidates);
2428}
2429
2430/* Support function for build_component_ref's error-handling.
2431
2432 Given DATUM_TYPE, and "DATUM.COMPONENT", where DATUM is *not* a
2433 struct or union, should we suggest "DATUM->COMPONENT" as a hint? */
2434
2435static bool
2436should_suggest_deref_p (tree datum_type)
2437{
2438 /* We don't do it for Objective-C, since Objective-C 2.0 dot-syntax
2439 allows "." for ptrs; we could be handling a failed attempt
2440 to access a property. */
2441 if (c_dialect_objc ()((c_language & clk_objc) != 0))
2442 return false;
2443
2444 /* Only suggest it for pointers... */
2445 if (TREE_CODE (datum_type)((enum tree_code) (datum_type)->base.code) != POINTER_TYPE)
2446 return false;
2447
2448 /* ...to structs/unions. */
2449 tree underlying_type = TREE_TYPE (datum_type)((contains_struct_check ((datum_type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2449, __FUNCTION__))->typed.type)
;
2450 enum tree_code code = TREE_CODE (underlying_type)((enum tree_code) (underlying_type)->base.code);
2451 if (code == RECORD_TYPE || code == UNION_TYPE)
2452 return true;
2453 else
2454 return false;
2455}
2456
2457/* Make an expression to refer to the COMPONENT field of structure or
2458 union value DATUM. COMPONENT is an IDENTIFIER_NODE. LOC is the
2459 location of the COMPONENT_REF. COMPONENT_LOC is the location
2460 of COMPONENT. */
2461
2462tree
2463build_component_ref (location_t loc, tree datum, tree component,
2464 location_t component_loc)
2465{
2466 tree type = TREE_TYPE (datum)((contains_struct_check ((datum), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2466, __FUNCTION__))->typed.type)
;
2467 enum tree_code code = TREE_CODE (type)((enum tree_code) (type)->base.code);
2468 tree field = NULL__null;
2469 tree ref;
2470 bool datum_lvalue = lvalue_p (datum);
2471
2472 if (!objc_is_public (datum, component))
2473 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2474
2475 /* Detect Objective-C property syntax object.property. */
2476 if (c_dialect_objc ()((c_language & clk_objc) != 0)
2477 && (ref = objc_maybe_build_component_ref (datum, component)))
2478 return ref;
2479
2480 /* See if there is a field or component with name COMPONENT. */
2481
2482 if (code == RECORD_TYPE || code == UNION_TYPE)
2483 {
2484 if (!COMPLETE_TYPE_P (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2484, __FUNCTION__))->type_common.size) != (tree) __null
)
)
2485 {
2486 c_incomplete_type_error (loc, NULL_TREE(tree) __null, type);
2487 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2488 }
2489
2490 field = lookup_field (type, component);
2491
2492 if (!field)
2493 {
2494 tree guessed_id = lookup_field_fuzzy (type, component);
2495 if (guessed_id)
2496 {
2497 /* Attempt to provide a fixit replacement hint, if
2498 we have a valid range for the component. */
2499 location_t reported_loc
2500 = (component_loc != UNKNOWN_LOCATION((location_t) 0)) ? component_loc : loc;
2501 gcc_rich_location rich_loc (reported_loc);
2502 if (component_loc != UNKNOWN_LOCATION((location_t) 0))
2503 rich_loc.add_fixit_misspelled_id (component_loc, guessed_id);
2504 error_at (&rich_loc,
2505 "%qT has no member named %qE; did you mean %qE?",
2506 type, component, guessed_id);
2507 }
2508 else
2509 error_at (loc, "%qT has no member named %qE", type, component);
2510 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2511 }
2512
2513 /* Accessing elements of atomic structures or unions is undefined
2514 behavior (C11 6.5.2.3#5). */
2515 if (TYPE_ATOMIC (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2515, __FUNCTION__))->base.u.bits.atomic_flag)
&& c_inhibit_evaluation_warnings == 0)
2516 {
2517 if (code == RECORD_TYPE)
2518 warning_at (loc, 0, "accessing a member %qE of an atomic "
2519 "structure %qE", component, datum);
2520 else
2521 warning_at (loc, 0, "accessing a member %qE of an atomic "
2522 "union %qE", component, datum);
2523 }
2524
2525 /* Chain the COMPONENT_REFs if necessary down to the FIELD.
2526 This might be better solved in future the way the C++ front
2527 end does it - by giving the anonymous entities each a
2528 separate name and type, and then have build_component_ref
2529 recursively call itself. We can't do that here. */
2530 do
2531 {
2532 tree subdatum = TREE_VALUE (field)((tree_check ((field), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2532, __FUNCTION__, (TREE_LIST)))->list.value)
;
2533 int quals;
2534 tree subtype;
2535 bool use_datum_quals;
2536
2537 if (TREE_TYPE (subdatum)((contains_struct_check ((subdatum), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2537, __FUNCTION__))->typed.type)
== error_mark_nodeglobal_trees[TI_ERROR_MARK])
2538 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2539
2540 /* If this is an rvalue, it does not have qualifiers in C
2541 standard terms and we must avoid propagating such
2542 qualifiers down to a non-lvalue array that is then
2543 converted to a pointer. */
2544 use_datum_quals = (datum_lvalue
2545 || TREE_CODE (TREE_TYPE (subdatum))((enum tree_code) (((contains_struct_check ((subdatum), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2545, __FUNCTION__))->typed.type))->base.code)
!= ARRAY_TYPE);
2546
2547 quals = TYPE_QUALS (strip_array_types (TREE_TYPE (subdatum)))((int) ((((tree_class_check ((strip_array_types (((contains_struct_check
((subdatum), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2547, __FUNCTION__))->typed.type))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2547, __FUNCTION__))->base.readonly_flag) * TYPE_QUAL_CONST
) | (((tree_class_check ((strip_array_types (((contains_struct_check
((subdatum), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2547, __FUNCTION__))->typed.type))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2547, __FUNCTION__))->base.volatile_flag) * TYPE_QUAL_VOLATILE
) | (((tree_class_check ((strip_array_types (((contains_struct_check
((subdatum), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2547, __FUNCTION__))->typed.type))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2547, __FUNCTION__))->base.u.bits.atomic_flag) * TYPE_QUAL_ATOMIC
) | (((tree_class_check ((strip_array_types (((contains_struct_check
((subdatum), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2547, __FUNCTION__))->typed.type))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2547, __FUNCTION__))->type_common.restrict_flag) * TYPE_QUAL_RESTRICT
) | (((((tree_class_check ((strip_array_types (((contains_struct_check
((subdatum), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2547, __FUNCTION__))->typed.type))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2547, __FUNCTION__))->base.u.bits.address_space) & 0xFF
) << 8))))
;
2548 if (use_datum_quals)
2549 quals |= TYPE_QUALS (TREE_TYPE (datum))((int) ((((tree_class_check ((((contains_struct_check ((datum
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2549, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2549, __FUNCTION__))->base.readonly_flag) * TYPE_QUAL_CONST
) | (((tree_class_check ((((contains_struct_check ((datum), (
TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2549, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2549, __FUNCTION__))->base.volatile_flag) * TYPE_QUAL_VOLATILE
) | (((tree_class_check ((((contains_struct_check ((datum), (
TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2549, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2549, __FUNCTION__))->base.u.bits.atomic_flag) * TYPE_QUAL_ATOMIC
) | (((tree_class_check ((((contains_struct_check ((datum), (
TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2549, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2549, __FUNCTION__))->type_common.restrict_flag) * TYPE_QUAL_RESTRICT
) | (((((tree_class_check ((((contains_struct_check ((datum),
(TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2549, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2549, __FUNCTION__))->base.u.bits.address_space) & 0xFF
) << 8))))
;
2550 subtype = c_build_qualified_type (TREE_TYPE (subdatum)((contains_struct_check ((subdatum), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2550, __FUNCTION__))->typed.type)
, quals);
2551
2552 ref = build3 (COMPONENT_REF, subtype, datum, subdatum,
2553 NULL_TREE(tree) __null);
2554 SET_EXPR_LOCATION (ref, loc)(expr_check (((ref)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2554, __FUNCTION__))->exp.locus = (loc)
;
2555 if (TREE_READONLY (subdatum)((non_type_check ((subdatum), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2555, __FUNCTION__))->base.readonly_flag)
2556 || (use_datum_quals && TREE_READONLY (datum)((non_type_check ((datum), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2556, __FUNCTION__))->base.readonly_flag)
))
2557 TREE_READONLY (ref)((non_type_check ((ref), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2557, __FUNCTION__))->base.readonly_flag)
= 1;
2558 if (TREE_THIS_VOLATILE (subdatum)((subdatum)->base.volatile_flag)
2559 || (use_datum_quals && TREE_THIS_VOLATILE (datum)((datum)->base.volatile_flag)))
2560 TREE_THIS_VOLATILE (ref)((ref)->base.volatile_flag) = 1;
2561
2562 if (TREE_UNAVAILABLE (subdatum)((subdatum)->base.u.bits.unavailable_flag))
2563 error_unavailable_use (subdatum, NULL_TREE(tree) __null);
2564 else if (TREE_DEPRECATED (subdatum)((subdatum)->base.deprecated_flag))
2565 warn_deprecated_use (subdatum, NULL_TREE(tree) __null);
2566
2567 datum = ref;
2568
2569 field = TREE_CHAIN (field)((contains_struct_check ((field), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2569, __FUNCTION__))->common.chain)
;
2570 }
2571 while (field);
2572
2573 return ref;
2574 }
2575 else if (should_suggest_deref_p (type))
2576 {
2577 /* Special-case the error message for "ptr.field" for the case
2578 where the user has confused "." vs "->". */
2579 rich_location richloc (line_table, loc);
2580 /* "loc" should be the "." token. */
2581 richloc.add_fixit_replace ("->");
2582 error_at (&richloc,
2583 "%qE is a pointer; did you mean to use %<->%>?",
2584 datum);
2585 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2586 }
2587 else if (code != ERROR_MARK)
2588 error_at (loc,
2589 "request for member %qE in something not a structure or union",
2590 component);
2591
2592 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2593}
2594
2595/* Given an expression PTR for a pointer, return an expression
2596 for the value pointed to.
2597 ERRORSTRING is the name of the operator to appear in error messages.
2598
2599 LOC is the location to use for the generated tree. */
2600
2601tree
2602build_indirect_ref (location_t loc, tree ptr, ref_operator errstring)
2603{
2604 tree pointer = default_conversion (ptr);
2605 tree type = TREE_TYPE (pointer)((contains_struct_check ((pointer), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2605, __FUNCTION__))->typed.type)
;
2606 tree ref;
2607
2608 if (TREE_CODE (type)((enum tree_code) (type)->base.code) == POINTER_TYPE)
2609 {
2610 if (CONVERT_EXPR_P (pointer)((((enum tree_code) (pointer)->base.code)) == NOP_EXPR || (
((enum tree_code) (pointer)->base.code)) == CONVERT_EXPR)
2611 || TREE_CODE (pointer)((enum tree_code) (pointer)->base.code) == VIEW_CONVERT_EXPR)
2612 {
2613 /* If a warning is issued, mark it to avoid duplicates from
2614 the backend. This only needs to be done at
2615 warn_strict_aliasing > 2. */
2616 if (warn_strict_aliasingglobal_options.x_warn_strict_aliasing > 2)
2617 if (strict_aliasing_warning (EXPR_LOCATION (pointer)((((pointer)) && ((tree_code_type[(int) (((enum tree_code
) ((pointer))->base.code))]) >= tcc_reference &&
(tree_code_type[(int) (((enum tree_code) ((pointer))->base
.code))]) <= tcc_expression)) ? (pointer)->exp.locus : (
(location_t) 0))
,
2618 type, TREE_OPERAND (pointer, 0)(*((const_cast<tree*> (tree_operand_check ((pointer), (
0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2618, __FUNCTION__)))))
))
2619 suppress_warning (pointer, OPT_Wstrict_aliasing_);
2620 }
2621
2622 if (TREE_CODE (pointer)((enum tree_code) (pointer)->base.code) == ADDR_EXPR
2623 && (TREE_TYPE (TREE_OPERAND (pointer, 0))((contains_struct_check (((*((const_cast<tree*> (tree_operand_check
((pointer), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2623, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2623, __FUNCTION__))->typed.type)
2624 == TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2624, __FUNCTION__))->typed.type)
))
2625 {
2626 ref = TREE_OPERAND (pointer, 0)(*((const_cast<tree*> (tree_operand_check ((pointer), (
0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2626, __FUNCTION__)))))
;
2627 protected_set_expr_location (ref, loc);
2628 return ref;
2629 }
2630 else
2631 {
2632 tree t = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2632, __FUNCTION__))->typed.type)
;
2633
2634 ref = build1 (INDIRECT_REF, t, pointer);
2635
2636 if (VOID_TYPE_P (t)(((enum tree_code) (t)->base.code) == VOID_TYPE) && c_inhibit_evaluation_warnings == 0)
2637 warning_at (loc, 0, "dereferencing %<void *%> pointer");
2638
2639 /* We *must* set TREE_READONLY when dereferencing a pointer to const,
2640 so that we get the proper error message if the result is used
2641 to assign to. Also, &* is supposed to be a no-op.
2642 And ANSI C seems to specify that the type of the result
2643 should be the const type. */
2644 /* A de-reference of a pointer to const is not a const. It is valid
2645 to change it via some other pointer. */
2646 TREE_READONLY (ref)((non_type_check ((ref), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2646, __FUNCTION__))->base.readonly_flag)
= TYPE_READONLY (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2646, __FUNCTION__))->base.readonly_flag)
;
2647 TREE_SIDE_EFFECTS (ref)((non_type_check ((ref), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2647, __FUNCTION__))->base.side_effects_flag)
2648 = TYPE_VOLATILE (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2648, __FUNCTION__))->base.volatile_flag)
|| TREE_SIDE_EFFECTS (pointer)((non_type_check ((pointer), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2648, __FUNCTION__))->base.side_effects_flag)
;
2649 TREE_THIS_VOLATILE (ref)((ref)->base.volatile_flag) = TYPE_VOLATILE (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2649, __FUNCTION__))->base.volatile_flag)
;
2650 protected_set_expr_location (ref, loc);
2651 return ref;
2652 }
2653 }
2654 else if (TREE_CODE (pointer)((enum tree_code) (pointer)->base.code) != ERROR_MARK)
2655 invalid_indirection_error (loc, type, errstring);
2656
2657 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2658}
2659
2660/* This handles expressions of the form "a[i]", which denotes
2661 an array reference.
2662
2663 This is logically equivalent in C to *(a+i), but we may do it differently.
2664 If A is a variable or a member, we generate a primitive ARRAY_REF.
2665 This avoids forcing the array out of registers, and can work on
2666 arrays that are not lvalues (for example, members of structures returned
2667 by functions).
2668
2669 For vector types, allow vector[i] but not i[vector], and create
2670 *(((type*)&vectortype) + i) for the expression.
2671
2672 LOC is the location to use for the returned expression. */
2673
2674tree
2675build_array_ref (location_t loc, tree array, tree index)
2676{
2677 tree ret;
2678 bool swapped = false;
2679 if (TREE_TYPE (array)((contains_struct_check ((array), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2679, __FUNCTION__))->typed.type)
== error_mark_nodeglobal_trees[TI_ERROR_MARK]
2680 || TREE_TYPE (index)((contains_struct_check ((index), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2680, __FUNCTION__))->typed.type)
== error_mark_nodeglobal_trees[TI_ERROR_MARK])
2681 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2682
2683 if (TREE_CODE (TREE_TYPE (array))((enum tree_code) (((contains_struct_check ((array), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2683, __FUNCTION__))->typed.type))->base.code)
!= ARRAY_TYPE
2684 && TREE_CODE (TREE_TYPE (array))((enum tree_code) (((contains_struct_check ((array), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2684, __FUNCTION__))->typed.type))->base.code)
!= POINTER_TYPE
2685 /* Allow vector[index] but not index[vector]. */
2686 && !gnu_vector_type_p (TREE_TYPE (array)((contains_struct_check ((array), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2686, __FUNCTION__))->typed.type)
))
2687 {
2688 if (TREE_CODE (TREE_TYPE (index))((enum tree_code) (((contains_struct_check ((index), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2688, __FUNCTION__))->typed.type))->base.code)
!= ARRAY_TYPE
2689 && TREE_CODE (TREE_TYPE (index))((enum tree_code) (((contains_struct_check ((index), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2689, __FUNCTION__))->typed.type))->base.code)
!= POINTER_TYPE)
2690 {
2691 error_at (loc,
2692 "subscripted value is neither array nor pointer nor vector");
2693
2694 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2695 }
2696 std::swap (array, index);
2697 swapped = true;
2698 }
2699
2700 if (!INTEGRAL_TYPE_P (TREE_TYPE (index))(((enum tree_code) (((contains_struct_check ((index), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2700, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE
|| ((enum tree_code) (((contains_struct_check ((index), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2700, __FUNCTION__))->typed.type))->base.code) == BOOLEAN_TYPE
|| ((enum tree_code) (((contains_struct_check ((index), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2700, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE
)
)
2701 {
2702 error_at (loc, "array subscript is not an integer");
2703 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2704 }
2705
2706 if (TREE_CODE (TREE_TYPE (TREE_TYPE (array)))((enum tree_code) (((contains_struct_check ((((contains_struct_check
((array), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2706, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2706, __FUNCTION__))->typed.type))->base.code)
== FUNCTION_TYPE)
2707 {
2708 error_at (loc, "subscripted value is pointer to function");
2709 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2710 }
2711
2712 /* ??? Existing practice has been to warn only when the char
2713 index is syntactically the index, not for char[array]. */
2714 if (!swapped)
2715 warn_array_subscript_with_type_char (loc, index);
2716
2717 /* Apply default promotions *after* noticing character types. */
2718 index = default_conversion (index);
2719 if (index == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2720 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2721
2722 gcc_assert (TREE_CODE (TREE_TYPE (index)) == INTEGER_TYPE)((void)(!(((enum tree_code) (((contains_struct_check ((index)
, (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2722, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2722, __FUNCTION__), 0 : 0))
;
2723
2724 bool was_vector = VECTOR_TYPE_P (TREE_TYPE (array))(((enum tree_code) (((contains_struct_check ((array), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2724, __FUNCTION__))->typed.type))->base.code) == VECTOR_TYPE
)
;
2725 bool non_lvalue = convert_vector_to_array_for_subscript (loc, &array, index);
2726
2727 if (TREE_CODE (TREE_TYPE (array))((enum tree_code) (((contains_struct_check ((array), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2727, __FUNCTION__))->typed.type))->base.code)
== ARRAY_TYPE)
2728 {
2729 tree rval, type;
2730
2731 /* An array that is indexed by a non-constant
2732 cannot be stored in a register; we must be able to do
2733 address arithmetic on its address.
2734 Likewise an array of elements of variable size. */
2735 if (TREE_CODE (index)((enum tree_code) (index)->base.code) != INTEGER_CST
2736 || (COMPLETE_TYPE_P (TREE_TYPE (TREE_TYPE (array)))(((tree_class_check ((((contains_struct_check ((((contains_struct_check
((array), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2736, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2736, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2736, __FUNCTION__))->type_common.size) != (tree) __null
)
2737 && TREE_CODE (TYPE_SIZE (TREE_TYPE (TREE_TYPE (array))))((enum tree_code) (((tree_class_check ((((contains_struct_check
((((contains_struct_check ((array), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2737, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2737, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2737, __FUNCTION__))->type_common.size))->base.code)
!= INTEGER_CST))
2738 {
2739 if (!c_mark_addressable (array, true))
2740 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2741 }
2742 /* An array that is indexed by a constant value which is not within
2743 the array bounds cannot be stored in a register either; because we
2744 would get a crash in store_bit_field/extract_bit_field when trying
2745 to access a non-existent part of the register. */
2746 if (TREE_CODE (index)((enum tree_code) (index)->base.code) == INTEGER_CST
2747 && TYPE_DOMAIN (TREE_TYPE (array))((tree_check ((((contains_struct_check ((array), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2747, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2747, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
2748 && !int_fits_type_p (index, TYPE_DOMAIN (TREE_TYPE (array))((tree_check ((((contains_struct_check ((array), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2748, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2748, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
))
2749 {
2750 if (!c_mark_addressable (array))
2751 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2752 }
2753
2754 if ((pedanticglobal_options.x_pedantic || warn_c90_c99_compatglobal_options.x_warn_c90_c99_compat)
2755 && ! was_vector)
2756 {
2757 tree foo = array;
2758 while (TREE_CODE (foo)((enum tree_code) (foo)->base.code) == COMPONENT_REF)
2759 foo = TREE_OPERAND (foo, 0)(*((const_cast<tree*> (tree_operand_check ((foo), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2759, __FUNCTION__)))))
;
2760 if (VAR_P (foo)(((enum tree_code) (foo)->base.code) == VAR_DECL) && C_DECL_REGISTER (foo)((contains_struct_check ((foo), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2760, __FUNCTION__))->decl_common.lang_flag_4)
)
2761 pedwarn (loc, OPT_Wpedantic,
2762 "ISO C forbids subscripting %<register%> array");
2763 else if (!lvalue_p (foo))
2764 pedwarn_c90 (loc, OPT_Wpedantic,
2765 "ISO C90 forbids subscripting non-lvalue "
2766 "array");
2767 }
2768
2769 type = TREE_TYPE (TREE_TYPE (array))((contains_struct_check ((((contains_struct_check ((array), (
TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2769, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2769, __FUNCTION__))->typed.type)
;
2770 rval = build4 (ARRAY_REF, type, array, index, NULL_TREE(tree) __null, NULL_TREE(tree) __null);
2771 /* Array ref is const/volatile if the array elements are
2772 or if the array is. */
2773 TREE_READONLY (rval)((non_type_check ((rval), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2773, __FUNCTION__))->base.readonly_flag)
2774 |= (TYPE_READONLY (TREE_TYPE (TREE_TYPE (array)))((tree_class_check ((((contains_struct_check ((((contains_struct_check
((array), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2774, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2774, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2774, __FUNCTION__))->base.readonly_flag)
2775 | TREE_READONLY (array)((non_type_check ((array), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2775, __FUNCTION__))->base.readonly_flag)
);
2776 TREE_SIDE_EFFECTS (rval)((non_type_check ((rval), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2776, __FUNCTION__))->base.side_effects_flag)
2777 |= (TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (array)))((tree_class_check ((((contains_struct_check ((((contains_struct_check
((array), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2777, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2777, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2777, __FUNCTION__))->base.volatile_flag)
2778 | TREE_SIDE_EFFECTS (array)((non_type_check ((array), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2778, __FUNCTION__))->base.side_effects_flag)
);
2779 TREE_THIS_VOLATILE (rval)((rval)->base.volatile_flag)
2780 |= (TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (array)))((tree_class_check ((((contains_struct_check ((((contains_struct_check
((array), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2780, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2780, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2780, __FUNCTION__))->base.volatile_flag)
2781 /* This was added by rms on 16 Nov 91.
2782 It fixes vol struct foo *a; a->elts[1]
2783 in an inline function.
2784 Hope it doesn't break something else. */
2785 | TREE_THIS_VOLATILE (array)((array)->base.volatile_flag));
2786 ret = require_complete_type (loc, rval);
2787 protected_set_expr_location (ret, loc);
2788 if (non_lvalue)
2789 ret = non_lvalue_loc (loc, ret);
2790 return ret;
2791 }
2792 else
2793 {
2794 tree ar = default_conversion (array);
2795
2796 if (ar == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2797 return ar;
2798
2799 gcc_assert (TREE_CODE (TREE_TYPE (ar)) == POINTER_TYPE)((void)(!(((enum tree_code) (((contains_struct_check ((ar), (
TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2799, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2799, __FUNCTION__), 0 : 0))
;
2800 gcc_assert (TREE_CODE (TREE_TYPE (TREE_TYPE (ar))) != FUNCTION_TYPE)((void)(!(((enum tree_code) (((contains_struct_check ((((contains_struct_check
((ar), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2800, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2800, __FUNCTION__))->typed.type))->base.code) != FUNCTION_TYPE
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2800, __FUNCTION__), 0 : 0))
;
2801
2802 ret = build_indirect_ref (loc, build_binary_op (loc, PLUS_EXPR, ar,
2803 index, false),
2804 RO_ARRAY_INDEXING);
2805 if (non_lvalue)
2806 ret = non_lvalue_loc (loc, ret);
2807 return ret;
2808 }
2809}
2810
2811/* Build an external reference to identifier ID. FUN indicates
2812 whether this will be used for a function call. LOC is the source
2813 location of the identifier. This sets *TYPE to the type of the
2814 identifier, which is not the same as the type of the returned value
2815 for CONST_DECLs defined as enum constants. If the type of the
2816 identifier is not available, *TYPE is set to NULL. */
2817tree
2818build_external_ref (location_t loc, tree id, bool fun, tree *type)
2819{
2820 tree ref;
2821 tree decl = lookup_name (id);
2822
2823 /* In Objective-C, an instance variable (ivar) may be preferred to
2824 whatever lookup_name() found. */
2825 decl = objc_lookup_ivar (decl, id);
2826
2827 *type = NULL__null;
2828 if (decl && decl != error_mark_nodeglobal_trees[TI_ERROR_MARK])
2829 {
2830 ref = decl;
2831 *type = TREE_TYPE (ref)((contains_struct_check ((ref), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2831, __FUNCTION__))->typed.type)
;
2832 }
2833 else if (fun)
2834 /* Implicit function declaration. */
2835 ref = implicitly_declare (loc, id);
2836 else if (decl == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2837 /* Don't complain about something that's already been
2838 complained about. */
2839 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2840 else
2841 {
2842 undeclared_variable (loc, id);
2843 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2844 }
2845
2846 if (TREE_TYPE (ref)((contains_struct_check ((ref), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2846, __FUNCTION__))->typed.type)
== error_mark_nodeglobal_trees[TI_ERROR_MARK])
2847 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2848
2849 if (TREE_UNAVAILABLE (ref)((ref)->base.u.bits.unavailable_flag))
2850 error_unavailable_use (ref, NULL_TREE(tree) __null);
2851 else if (TREE_DEPRECATED (ref)((ref)->base.deprecated_flag))
2852 warn_deprecated_use (ref, NULL_TREE(tree) __null);
2853
2854 /* Recursive call does not count as usage. */
2855 if (ref != current_function_decl)
2856 {
2857 TREE_USED (ref)((ref)->base.used_flag) = 1;
2858 }
2859
2860 if (TREE_CODE (ref)((enum tree_code) (ref)->base.code) == FUNCTION_DECL && !in_alignof)
2861 {
2862 if (!in_sizeof && !in_typeof)
2863 C_DECL_USED (ref)((contains_struct_check (((tree_check ((ref), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2863, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2863, __FUNCTION__))->decl_common.lang_flag_5)
= 1;
2864 else if (DECL_INITIAL (ref)((contains_struct_check ((ref), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2864, __FUNCTION__))->decl_common.initial)
== NULL_TREE(tree) __null
2865 && DECL_EXTERNAL (ref)((contains_struct_check ((ref), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2865, __FUNCTION__))->decl_common.decl_flag_1)
2866 && !TREE_PUBLIC (ref)((ref)->base.public_flag))
2867 record_maybe_used_decl (ref);
2868 }
2869
2870 if (TREE_CODE (ref)((enum tree_code) (ref)->base.code) == CONST_DECL)
2871 {
2872 used_types_insert (TREE_TYPE (ref)((contains_struct_check ((ref), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2872, __FUNCTION__))->typed.type)
);
2873
2874 if (warn_cxx_compatglobal_options.x_warn_cxx_compat
2875 && TREE_CODE (TREE_TYPE (ref))((enum tree_code) (((contains_struct_check ((ref), (TS_TYPED)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2875, __FUNCTION__))->typed.type))->base.code)
== ENUMERAL_TYPE
2876 && C_TYPE_DEFINED_IN_STRUCT (TREE_TYPE (ref))((tree_class_check ((((contains_struct_check ((ref), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2876, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2876, __FUNCTION__))->type_common.lang_flag_2)
)
2877 {
2878 warning_at (loc, OPT_Wc___compat,
2879 ("enum constant defined in struct or union "
2880 "is not visible in C++"));
2881 inform (DECL_SOURCE_LOCATION (ref)((contains_struct_check ((ref), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2881, __FUNCTION__))->decl_minimal.locus)
, "enum constant defined here");
2882 }
2883
2884 ref = DECL_INITIAL (ref)((contains_struct_check ((ref), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2884, __FUNCTION__))->decl_common.initial)
;
2885 TREE_CONSTANT (ref)((non_type_check ((ref), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2885, __FUNCTION__))->base.constant_flag)
= 1;
2886 }
2887 else if (current_function_decl != NULL_TREE(tree) __null
2888 && !DECL_FILE_SCOPE_P (current_function_decl)(! (((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2888, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2888, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL)
2889 && (VAR_OR_FUNCTION_DECL_P (ref)(((enum tree_code) (ref)->base.code) == VAR_DECL || ((enum
tree_code) (ref)->base.code) == FUNCTION_DECL)
2890 || TREE_CODE (ref)((enum tree_code) (ref)->base.code) == PARM_DECL))
2891 {
2892 tree context = decl_function_context (ref);
2893
2894 if (context != NULL_TREE(tree) __null && context != current_function_decl)
2895 DECL_NONLOCAL (ref)((contains_struct_check ((ref), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2895, __FUNCTION__))->decl_common.nonlocal_flag)
= 1;
2896 }
2897 /* C99 6.7.4p3: An inline definition of a function with external
2898 linkage ... shall not contain a reference to an identifier with
2899 internal linkage. */
2900 else if (current_function_decl != NULL_TREE(tree) __null
2901 && DECL_DECLARED_INLINE_P (current_function_decl)((tree_check ((current_function_decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2901, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag
)
2902 && DECL_EXTERNAL (current_function_decl)((contains_struct_check ((current_function_decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2902, __FUNCTION__))->decl_common.decl_flag_1)
2903 && VAR_OR_FUNCTION_DECL_P (ref)(((enum tree_code) (ref)->base.code) == VAR_DECL || ((enum
tree_code) (ref)->base.code) == FUNCTION_DECL)
2904 && (!VAR_P (ref)(((enum tree_code) (ref)->base.code) == VAR_DECL) || TREE_STATIC (ref)((ref)->base.static_flag))
2905 && ! TREE_PUBLIC (ref)((ref)->base.public_flag)
2906 && DECL_CONTEXT (ref)((contains_struct_check ((ref), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2906, __FUNCTION__))->decl_minimal.context)
!= current_function_decl)
2907 record_inline_static (loc, current_function_decl, ref,
2908 csi_internal);
2909
2910 return ref;
2911}
2912
2913/* Record details of decls possibly used inside sizeof or typeof. */
2914struct maybe_used_decl
2915{
2916 /* The decl. */
2917 tree decl;
2918 /* The level seen at (in_sizeof + in_typeof). */
2919 int level;
2920 /* The next one at this level or above, or NULL. */
2921 struct maybe_used_decl *next;
2922};
2923
2924static struct maybe_used_decl *maybe_used_decls;
2925
2926/* Record that DECL, an undefined static function reference seen
2927 inside sizeof or typeof, might be used if the operand of sizeof is
2928 a VLA type or the operand of typeof is a variably modified
2929 type. */
2930
2931static void
2932record_maybe_used_decl (tree decl)
2933{
2934 struct maybe_used_decl *t = XOBNEW (&parser_obstack, struct maybe_used_decl)((struct maybe_used_decl *) __extension__ ({ struct obstack *
__h = ((&parser_obstack)); __extension__ ({ struct obstack
*__o = (__h); size_t __len = ((sizeof (struct maybe_used_decl
))); if (__extension__ ({ struct obstack const *__o1 = (__o);
(size_t) (__o1->chunk_limit - __o1->next_free); }) <
__len) _obstack_newchunk (__o, __len); ((void) ((__o)->next_free
+= (__len))); }); __extension__ ({ struct obstack *__o1 = (__h
); void *__value = (void *) __o1->object_base; if (__o1->
next_free == __value) __o1->maybe_empty_object = 1; __o1->
next_free = (sizeof (ptrdiff_t) < sizeof (void *) ? ((__o1
->object_base) + (((__o1->next_free) - (__o1->object_base
) + (__o1->alignment_mask)) & ~(__o1->alignment_mask
))) : (char *) (((ptrdiff_t) (__o1->next_free) + (__o1->
alignment_mask)) & ~(__o1->alignment_mask))); if ((size_t
) (__o1->next_free - (char *) __o1->chunk) > (size_t
) (__o1->chunk_limit - (char *) __o1->chunk)) __o1->
next_free = __o1->chunk_limit; __o1->object_base = __o1
->next_free; __value; }); }))
;
2935 t->decl = decl;
2936 t->level = in_sizeof + in_typeof;
2937 t->next = maybe_used_decls;
2938 maybe_used_decls = t;
2939}
2940
2941/* Pop the stack of decls possibly used inside sizeof or typeof. If
2942 USED is false, just discard them. If it is true, mark them used
2943 (if no longer inside sizeof or typeof) or move them to the next
2944 level up (if still inside sizeof or typeof). */
2945
2946void
2947pop_maybe_used (bool used)
2948{
2949 struct maybe_used_decl *p = maybe_used_decls;
2950 int cur_level = in_sizeof + in_typeof;
2951 while (p && p->level > cur_level)
2952 {
2953 if (used)
2954 {
2955 if (cur_level == 0)
2956 C_DECL_USED (p->decl)((contains_struct_check (((tree_check ((p->decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2956, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2956, __FUNCTION__))->decl_common.lang_flag_5)
= 1;
2957 else
2958 p->level = cur_level;
2959 }
2960 p = p->next;
2961 }
2962 if (!used || cur_level == 0)
2963 maybe_used_decls = p;
2964}
2965
2966/* Return the result of sizeof applied to EXPR. */
2967
2968struct c_expr
2969c_expr_sizeof_expr (location_t loc, struct c_expr expr)
2970{
2971 struct c_expr ret;
2972 if (expr.value == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2973 {
2974 ret.value = error_mark_nodeglobal_trees[TI_ERROR_MARK];
2975 ret.original_code = ERROR_MARK;
2976 ret.original_type = NULL__null;
2977 pop_maybe_used (false);
2978 }
2979 else
2980 {
2981 bool expr_const_operands = true;
2982
2983 if (TREE_CODE (expr.value)((enum tree_code) (expr.value)->base.code) == PARM_DECL
2984 && C_ARRAY_PARAMETER (expr.value)((contains_struct_check ((expr.value), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2984, __FUNCTION__))->decl_common.lang_flag_0)
)
2985 {
2986 auto_diagnostic_group d;
2987 if (warning_at (loc, OPT_Wsizeof_array_argument,
2988 "%<sizeof%> on array function parameter %qE will "
2989 "return size of %qT", expr.value,
2990 TREE_TYPE (expr.value)((contains_struct_check ((expr.value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2990, __FUNCTION__))->typed.type)
))
2991 inform (DECL_SOURCE_LOCATION (expr.value)((contains_struct_check ((expr.value), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2991, __FUNCTION__))->decl_minimal.locus)
, "declared here");
2992 }
2993 tree folded_expr = c_fully_fold (expr.value, require_constant_value,
2994 &expr_const_operands);
2995 ret.value = c_sizeof (loc, TREE_TYPE (folded_expr))c_sizeof_or_alignof_type (loc, ((contains_struct_check ((folded_expr
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 2995, __FUNCTION__))->typed.type), true, false, 1)
;
2996 c_last_sizeof_arg = expr.value;
2997 c_last_sizeof_loc = loc;
2998 ret.original_code = SIZEOF_EXPR;
2999 ret.original_type = NULL__null;
3000 if (C_TYPE_VARIABLE_SIZE (TREE_TYPE (folded_expr))((tree_class_check ((((contains_struct_check ((folded_expr), (
TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3000, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3000, __FUNCTION__))->type_common.lang_flag_1)
)
3001 {
3002 /* sizeof is evaluated when given a vla (C99 6.5.3.4p2). */
3003 ret.value = build2 (C_MAYBE_CONST_EXPR, TREE_TYPE (ret.value)((contains_struct_check ((ret.value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3003, __FUNCTION__))->typed.type)
,
3004 folded_expr, ret.value);
3005 C_MAYBE_CONST_EXPR_NON_CONST (ret.value)((tree_not_check2 (((tree_check ((ret.value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3005, __FUNCTION__, (C_MAYBE_CONST_EXPR)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3005, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)
= !expr_const_operands;
3006 SET_EXPR_LOCATION (ret.value, loc)(expr_check (((ret.value)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3006, __FUNCTION__))->exp.locus = (loc)
;
3007 }
3008 pop_maybe_used (C_TYPE_VARIABLE_SIZE (TREE_TYPE (folded_expr))((tree_class_check ((((contains_struct_check ((folded_expr), (
TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3008, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3008, __FUNCTION__))->type_common.lang_flag_1)
);
3009 }
3010 return ret;
3011}
3012
3013/* Return the result of sizeof applied to T, a structure for the type
3014 name passed to sizeof (rather than the type itself). LOC is the
3015 location of the original expression. */
3016
3017struct c_expr
3018c_expr_sizeof_type (location_t loc, struct c_type_name *t)
3019{
3020 tree type;
3021 struct c_expr ret;
3022 tree type_expr = NULL_TREE(tree) __null;
3023 bool type_expr_const = true;
3024 type = groktypename (t, &type_expr, &type_expr_const);
3025 ret.value = c_sizeof (loc, type)c_sizeof_or_alignof_type (loc, type, true, false, 1);
3026 c_last_sizeof_arg = type;
3027 c_last_sizeof_loc = loc;
3028 ret.original_code = SIZEOF_EXPR;
3029 ret.original_type = NULL__null;
3030 if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3031 {
3032 ret.value = error_mark_nodeglobal_trees[TI_ERROR_MARK];
3033 ret.original_code = ERROR_MARK;
3034 }
3035 else
3036 if ((type_expr || TREE_CODE (ret.value)((enum tree_code) (ret.value)->base.code) == INTEGER_CST)
3037 && C_TYPE_VARIABLE_SIZE (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3037, __FUNCTION__))->type_common.lang_flag_1)
)
3038 {
3039 /* If the type is a [*] array, it is a VLA but is represented as
3040 having a size of zero. In such a case we must ensure that
3041 the result of sizeof does not get folded to a constant by
3042 c_fully_fold, because if the size is evaluated the result is
3043 not constant and so constraints on zero or negative size
3044 arrays must not be applied when this sizeof call is inside
3045 another array declarator. */
3046 if (!type_expr)
3047 type_expr = integer_zero_nodeglobal_trees[TI_INTEGER_ZERO];
3048 ret.value = build2 (C_MAYBE_CONST_EXPR, TREE_TYPE (ret.value)((contains_struct_check ((ret.value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3048, __FUNCTION__))->typed.type)
,
3049 type_expr, ret.value);
3050 C_MAYBE_CONST_EXPR_NON_CONST (ret.value)((tree_not_check2 (((tree_check ((ret.value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3050, __FUNCTION__, (C_MAYBE_CONST_EXPR)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3050, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)
= !type_expr_const;
3051 }
3052 pop_maybe_used (type != error_mark_nodeglobal_trees[TI_ERROR_MARK]
3053 ? C_TYPE_VARIABLE_SIZE (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3053, __FUNCTION__))->type_common.lang_flag_1)
: false);
3054 return ret;
3055}
3056
3057/* Build a function call to function FUNCTION with parameters PARAMS.
3058 The function call is at LOC.
3059 PARAMS is a list--a chain of TREE_LIST nodes--in which the
3060 TREE_VALUE of each node is a parameter-expression.
3061 FUNCTION's data type may be a function type or a pointer-to-function. */
3062
3063tree
3064build_function_call (location_t loc, tree function, tree params)
3065{
3066 vec<tree, va_gc> *v;
3067 tree ret;
3068
3069 vec_alloc (v, list_length (params));
1
Calling 'vec_alloc<tree_node *, va_gc>'
9
Returning from 'vec_alloc<tree_node *, va_gc>'
3070 for (; params; params = TREE_CHAIN (params)((contains_struct_check ((params), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3070, __FUNCTION__))->common.chain)
)
10
Loop condition is true. Entering loop body
3071 v->quick_push (TREE_VALUE (params)((tree_check ((params), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3071, __FUNCTION__, (TREE_LIST)))->list.value)
);
11
Called C++ object pointer is null
3072 ret = c_build_function_call_vec (loc, vNULL, function, v, NULL__null);
3073 vec_free (v);
3074 return ret;
3075}
3076
3077/* Give a note about the location of the declaration of DECL. */
3078
3079static void
3080inform_declaration (tree decl)
3081{
3082 if (decl && (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != FUNCTION_DECL
3083 || !DECL_IS_UNDECLARED_BUILTIN (decl)(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3083, __FUNCTION__))->decl_minimal.locus) <= ((location_t
) 1))
))
3084 inform (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3084, __FUNCTION__))->decl_minimal.locus)
, "declared here");
3085}
3086
3087/* Build a function call to function FUNCTION with parameters PARAMS.
3088 If FUNCTION is the result of resolving an overloaded target built-in,
3089 ORIG_FUNDECL is the original function decl, otherwise it is null.
3090 ORIGTYPES, if not NULL, is a vector of types; each element is
3091 either NULL or the original type of the corresponding element in
3092 PARAMS. The original type may differ from TREE_TYPE of the
3093 parameter for enums. FUNCTION's data type may be a function type
3094 or pointer-to-function. This function changes the elements of
3095 PARAMS. */
3096
3097tree
3098build_function_call_vec (location_t loc, vec<location_t> arg_loc,
3099 tree function, vec<tree, va_gc> *params,
3100 vec<tree, va_gc> *origtypes, tree orig_fundecl)
3101{
3102 tree fntype, fundecl = NULL_TREE(tree) __null;
3103 tree name = NULL_TREE(tree) __null, result;
3104 tree tem;
3105 int nargs;
3106 tree *argarray;
3107
3108
3109 /* Strip NON_LVALUE_EXPRs, etc., since we aren't using as an lvalue. */
3110 STRIP_TYPE_NOPS (function)while ((((((enum tree_code) (function)->base.code)) == NOP_EXPR
|| (((enum tree_code) (function)->base.code)) == CONVERT_EXPR
) || ((enum tree_code) (function)->base.code) == NON_LVALUE_EXPR
) && (*((const_cast<tree*> (tree_operand_check (
(function), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3110, __FUNCTION__))))) != global_trees[TI_ERROR_MARK] &&
(((contains_struct_check ((function), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3110, __FUNCTION__))->typed.type) == ((contains_struct_check
(((*((const_cast<tree*> (tree_operand_check ((function
), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3110, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3110, __FUNCTION__))->typed.type))) (function) = (*((const_cast
<tree*> (tree_operand_check ((function), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3110, __FUNCTION__)))))
;
3111
3112 /* Convert anything with function type to a pointer-to-function. */
3113 if (TREE_CODE (function)((enum tree_code) (function)->base.code) == FUNCTION_DECL)
3114 {
3115 name = DECL_NAME (function)((contains_struct_check ((function), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3115, __FUNCTION__))->decl_minimal.name)
;
3116
3117 if (flag_tmglobal_options.x_flag_tm)
3118 tm_malloc_replacement (function);
3119 fundecl = function;
3120 if (!orig_fundecl)
3121 orig_fundecl = fundecl;
3122 /* Atomic functions have type checking/casting already done. They are
3123 often rewritten and don't match the original parameter list. */
3124 if (name && startswith (IDENTIFIER_POINTER (name)((const char *) (tree_check ((name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3124, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str
)
, "__atomic_"))
3125 origtypes = NULL__null;
3126 }
3127 if (TREE_CODE (TREE_TYPE (function))((enum tree_code) (((contains_struct_check ((function), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3127, __FUNCTION__))->typed.type))->base.code)
== FUNCTION_TYPE)
3128 function = function_to_pointer_conversion (loc, function);
3129
3130 /* For Objective-C, convert any calls via a cast to OBJC_TYPE_REF
3131 expressions, like those used for ObjC messenger dispatches. */
3132 if (params && !params->is_empty ())
3133 function = objc_rewrite_function_call (function, (*params)[0]);
3134
3135 function = c_fully_fold (function, false, NULL__null);
3136
3137 fntype = TREE_TYPE (function)((contains_struct_check ((function), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3137, __FUNCTION__))->typed.type)
;
3138
3139 if (TREE_CODE (fntype)((enum tree_code) (fntype)->base.code) == ERROR_MARK)
3140 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3141
3142 if (!(TREE_CODE (fntype)((enum tree_code) (fntype)->base.code) == POINTER_TYPE
3143 && TREE_CODE (TREE_TYPE (fntype))((enum tree_code) (((contains_struct_check ((fntype), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3143, __FUNCTION__))->typed.type))->base.code)
== FUNCTION_TYPE))
3144 {
3145 if (!flag_diagnostics_show_caretglobal_options.x_flag_diagnostics_show_caret && !STATEMENT_CLASS_P (function)(tree_code_type[(int) (((enum tree_code) (function)->base.
code))] == tcc_statement)
)
3146 error_at (loc,
3147 "called object %qE is not a function or function pointer",
3148 function);
3149 else if (DECL_P (function)(tree_code_type[(int) (((enum tree_code) (function)->base.
code))] == tcc_declaration)
)
3150 {
3151 error_at (loc,
3152 "called object %qD is not a function or function pointer",
3153 function);
3154 inform_declaration (function);
3155 }
3156 else
3157 error_at (loc,
3158 "called object is not a function or function pointer");
3159 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3160 }
3161
3162 if (fundecl && TREE_THIS_VOLATILE (fundecl)((fundecl)->base.volatile_flag))
3163 current_function_returns_abnormally = 1;
3164
3165 /* fntype now gets the type of function pointed to. */
3166 fntype = TREE_TYPE (fntype)((contains_struct_check ((fntype), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3166, __FUNCTION__))->typed.type)
;
3167
3168 /* Convert the parameters to the types declared in the
3169 function prototype, or apply default promotions. */
3170
3171 nargs = convert_arguments (loc, arg_loc, TYPE_ARG_TYPES (fntype)((tree_check2 ((fntype), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3171, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
, params,
3172 origtypes, function, fundecl);
3173 if (nargs < 0)
3174 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3175
3176 /* Check that the function is called through a compatible prototype.
3177 If it is not, warn. */
3178 if (CONVERT_EXPR_P (function)((((enum tree_code) (function)->base.code)) == NOP_EXPR ||
(((enum tree_code) (function)->base.code)) == CONVERT_EXPR
)
3179 && TREE_CODE (tem = TREE_OPERAND (function, 0))((enum tree_code) (tem = (*((const_cast<tree*> (tree_operand_check
((function), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3179, __FUNCTION__))))))->base.code)
== ADDR_EXPR
3180 && TREE_CODE (tem = TREE_OPERAND (tem, 0))((enum tree_code) (tem = (*((const_cast<tree*> (tree_operand_check
((tem), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3180, __FUNCTION__))))))->base.code)
== FUNCTION_DECL
3181 && !comptypes (fntype, TREE_TYPE (tem)((contains_struct_check ((tem), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3181, __FUNCTION__))->typed.type)
))
3182 {
3183 tree return_type = TREE_TYPE (fntype)((contains_struct_check ((fntype), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3183, __FUNCTION__))->typed.type)
;
3184
3185 /* This situation leads to run-time undefined behavior. We can't,
3186 therefore, simply error unless we can prove that all possible
3187 executions of the program must execute the code. */
3188 warning_at (loc, 0, "function called through a non-compatible type");
3189
3190 if (VOID_TYPE_P (return_type)(((enum tree_code) (return_type)->base.code) == VOID_TYPE)
3191 && TYPE_QUALS (return_type)((int) ((((tree_class_check ((return_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3191, __FUNCTION__))->base.readonly_flag) * TYPE_QUAL_CONST
) | (((tree_class_check ((return_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3191, __FUNCTION__))->base.volatile_flag) * TYPE_QUAL_VOLATILE
) | (((tree_class_check ((return_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3191, __FUNCTION__))->base.u.bits.atomic_flag) * TYPE_QUAL_ATOMIC
) | (((tree_class_check ((return_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3191, __FUNCTION__))->type_common.restrict_flag) * TYPE_QUAL_RESTRICT
) | (((((tree_class_check ((return_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3191, __FUNCTION__))->base.u.bits.address_space) & 0xFF
) << 8))))
!= TYPE_UNQUALIFIED)
3192 pedwarn (loc, 0,
3193 "function with qualified void return type called");
3194 }
3195
3196 argarray = vec_safe_address (params);
3197
3198 /* Check that arguments to builtin functions match the expectations. */
3199 if (fundecl
3200 && fndecl_built_in_p (fundecl)
3201 && !check_builtin_function_arguments (loc, arg_loc, fundecl,
3202 orig_fundecl, nargs, argarray))
3203 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3204
3205 /* Check that the arguments to the function are valid. */
3206 bool warned_p = check_function_arguments (loc, fundecl, fntype,
3207 nargs, argarray, &arg_loc);
3208
3209 if (name != NULL_TREE(tree) __null
3210 && startswith (IDENTIFIER_POINTER (name)((const char *) (tree_check ((name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3210, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str
)
, "__builtin_"))
3211 {
3212 if (require_constant_value)
3213 result
3214 = fold_build_call_array_initializer_loc (loc, TREE_TYPE (fntype)((contains_struct_check ((fntype), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3214, __FUNCTION__))->typed.type)
,
3215 function, nargs, argarray);
3216 else
3217 result = fold_build_call_array_loc (loc, TREE_TYPE (fntype)((contains_struct_check ((fntype), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3217, __FUNCTION__))->typed.type)
,
3218 function, nargs, argarray);
3219 if (TREE_CODE (result)((enum tree_code) (result)->base.code) == NOP_EXPR
3220 && TREE_CODE (TREE_OPERAND (result, 0))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((result), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3220, __FUNCTION__))))))->base.code)
== INTEGER_CST)
3221 STRIP_TYPE_NOPS (result)while ((((((enum tree_code) (result)->base.code)) == NOP_EXPR
|| (((enum tree_code) (result)->base.code)) == CONVERT_EXPR
) || ((enum tree_code) (result)->base.code) == NON_LVALUE_EXPR
) && (*((const_cast<tree*> (tree_operand_check (
(result), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3221, __FUNCTION__))))) != global_trees[TI_ERROR_MARK] &&
(((contains_struct_check ((result), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3221, __FUNCTION__))->typed.type) == ((contains_struct_check
(((*((const_cast<tree*> (tree_operand_check ((result),
(0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3221, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3221, __FUNCTION__))->typed.type))) (result) = (*((const_cast
<tree*> (tree_operand_check ((result), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3221, __FUNCTION__)))))
;
3222 }
3223 else
3224 result = build_call_array_loc (loc, TREE_TYPE (fntype)((contains_struct_check ((fntype), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3224, __FUNCTION__))->typed.type)
,
3225 function, nargs, argarray);
3226 /* If -Wnonnull warning has been diagnosed, avoid diagnosing it again
3227 later. */
3228 if (warned_p && TREE_CODE (result)((enum tree_code) (result)->base.code) == CALL_EXPR)
3229 suppress_warning (result, OPT_Wnonnull);
3230
3231 /* In this improbable scenario, a nested function returns a VM type.
3232 Create a TARGET_EXPR so that the call always has a LHS, much as
3233 what the C++ FE does for functions returning non-PODs. */
3234 if (variably_modified_type_p (TREE_TYPE (fntype)((contains_struct_check ((fntype), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3234, __FUNCTION__))->typed.type)
, NULL_TREE(tree) __null))
3235 {
3236 tree tmp = create_tmp_var_raw (TREE_TYPE (fntype)((contains_struct_check ((fntype), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3236, __FUNCTION__))->typed.type)
);
3237 result = build4 (TARGET_EXPR, TREE_TYPE (fntype)((contains_struct_check ((fntype), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3237, __FUNCTION__))->typed.type)
, tmp, result,
3238 NULL_TREE(tree) __null, NULL_TREE(tree) __null);
3239 }
3240
3241 if (VOID_TYPE_P (TREE_TYPE (result))(((enum tree_code) (((contains_struct_check ((result), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3241, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
)
)
3242 {
3243 if (TYPE_QUALS (TREE_TYPE (result))((int) ((((tree_class_check ((((contains_struct_check ((result
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3243, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3243, __FUNCTION__))->base.readonly_flag) * TYPE_QUAL_CONST
) | (((tree_class_check ((((contains_struct_check ((result), (
TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3243, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3243, __FUNCTION__))->base.volatile_flag) * TYPE_QUAL_VOLATILE
) | (((tree_class_check ((((contains_struct_check ((result), (
TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3243, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3243, __FUNCTION__))->base.u.bits.atomic_flag) * TYPE_QUAL_ATOMIC
) | (((tree_class_check ((((contains_struct_check ((result), (
TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3243, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3243, __FUNCTION__))->type_common.restrict_flag) * TYPE_QUAL_RESTRICT
) | (((((tree_class_check ((((contains_struct_check ((result)
, (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3243, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3243, __FUNCTION__))->base.u.bits.address_space) & 0xFF
) << 8))))
!= TYPE_UNQUALIFIED)
3244 pedwarn (loc, 0,
3245 "function with qualified void return type called");
3246 return result;
3247 }
3248 return require_complete_type (loc, result);
3249}
3250
3251/* Like build_function_call_vec, but call also resolve_overloaded_builtin. */
3252
3253tree
3254c_build_function_call_vec (location_t loc, const vec<location_t> &arg_loc,
3255 tree function, vec<tree, va_gc> *params,
3256 vec<tree, va_gc> *origtypes)
3257{
3258 /* Strip NON_LVALUE_EXPRs, etc., since we aren't using as an lvalue. */
3259 STRIP_TYPE_NOPS (function)while ((((((enum tree_code) (function)->base.code)) == NOP_EXPR
|| (((enum tree_code) (function)->base.code)) == CONVERT_EXPR
) || ((enum tree_code) (function)->base.code) == NON_LVALUE_EXPR
) && (*((const_cast<tree*> (tree_operand_check (
(function), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3259, __FUNCTION__))))) != global_trees[TI_ERROR_MARK] &&
(((contains_struct_check ((function), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3259, __FUNCTION__))->typed.type) == ((contains_struct_check
(((*((const_cast<tree*> (tree_operand_check ((function
), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3259, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3259, __FUNCTION__))->typed.type))) (function) = (*((const_cast
<tree*> (tree_operand_check ((function), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3259, __FUNCTION__)))))
;
3260
3261 /* Convert anything with function type to a pointer-to-function. */
3262 if (TREE_CODE (function)((enum tree_code) (function)->base.code) == FUNCTION_DECL)
3263 {
3264 /* Implement type-directed function overloading for builtins.
3265 resolve_overloaded_builtin and targetm.resolve_overloaded_builtin
3266 handle all the type checking. The result is a complete expression
3267 that implements this function call. */
3268 tree tem = resolve_overloaded_builtin (loc, function, params);
3269 if (tem)
3270 return tem;
3271 }
3272 return build_function_call_vec (loc, arg_loc, function, params, origtypes);
3273}
3274
3275/* Helper for convert_arguments called to convert the VALue of argument
3276 number ARGNUM from ORIGTYPE to the corresponding parameter number
3277 PARMNUM and TYPE.
3278 PLOC is the location where the conversion is being performed.
3279 FUNCTION and FUNDECL are the same as in convert_arguments.
3280 VALTYPE is the original type of VAL before the conversion and,
3281 for EXCESS_PRECISION_EXPR, the operand of the expression.
3282 NPC is true if VAL represents the null pointer constant (VAL itself
3283 will have been folded to an integer constant).
3284 RNAME is the same as FUNCTION except in Objective C when it's
3285 the function selector.
3286 EXCESS_PRECISION is true when VAL was originally represented
3287 as EXCESS_PRECISION_EXPR.
3288 WARNOPT is the same as in convert_for_assignment. */
3289
3290static tree
3291convert_argument (location_t ploc, tree function, tree fundecl,
3292 tree type, tree origtype, tree val, tree valtype,
3293 bool npc, tree rname, int parmnum, int argnum,
3294 bool excess_precision, int warnopt)
3295{
3296 /* Formal parm type is specified by a function prototype. */
3297
3298 if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK] || !COMPLETE_TYPE_P (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3298, __FUNCTION__))->type_common.size) != (tree) __null
)
)
3299 {
3300 error_at (ploc, "type of formal parameter %d is incomplete",
3301 parmnum + 1);
3302 return val;
3303 }
3304
3305 /* Optionally warn about conversions that differ from the default
3306 conversions. */
3307 if (warn_traditional_conversionglobal_options.x_warn_traditional_conversion || warn_traditionalglobal_options.x_warn_traditional)
3308 {
3309 unsigned int formal_prec = TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3309, __FUNCTION__))->type_common.precision)
;
3310
3311 if (INTEGRAL_TYPE_P (type)(((enum tree_code) (type)->base.code) == ENUMERAL_TYPE || (
(enum tree_code) (type)->base.code) == BOOLEAN_TYPE || ((enum
tree_code) (type)->base.code) == INTEGER_TYPE)
3312 && TREE_CODE (valtype)((enum tree_code) (valtype)->base.code) == REAL_TYPE)
3313 warning_at (ploc, OPT_Wtraditional_conversion,
3314 "passing argument %d of %qE as integer rather "
3315 "than floating due to prototype",
3316 argnum, rname);
3317 if (INTEGRAL_TYPE_P (type)(((enum tree_code) (type)->base.code) == ENUMERAL_TYPE || (
(enum tree_code) (type)->base.code) == BOOLEAN_TYPE || ((enum
tree_code) (type)->base.code) == INTEGER_TYPE)
3318 && TREE_CODE (valtype)((enum tree_code) (valtype)->base.code) == COMPLEX_TYPE)
3319 warning_at (ploc, OPT_Wtraditional_conversion,
3320 "passing argument %d of %qE as integer rather "
3321 "than complex due to prototype",
3322 argnum, rname);
3323 else if (TREE_CODE (type)((enum tree_code) (type)->base.code) == COMPLEX_TYPE
3324 && TREE_CODE (valtype)((enum tree_code) (valtype)->base.code) == REAL_TYPE)
3325 warning_at (ploc, OPT_Wtraditional_conversion,
3326 "passing argument %d of %qE as complex rather "
3327 "than floating due to prototype",
3328 argnum, rname);
3329 else if (TREE_CODE (type)((enum tree_code) (type)->base.code) == REAL_TYPE
3330 && INTEGRAL_TYPE_P (valtype)(((enum tree_code) (valtype)->base.code) == ENUMERAL_TYPE ||
((enum tree_code) (valtype)->base.code) == BOOLEAN_TYPE ||
((enum tree_code) (valtype)->base.code) == INTEGER_TYPE)
)
3331 warning_at (ploc, OPT_Wtraditional_conversion,
3332 "passing argument %d of %qE as floating rather "
3333 "than integer due to prototype",
3334 argnum, rname);
3335 else if (TREE_CODE (type)((enum tree_code) (type)->base.code) == COMPLEX_TYPE
3336 && INTEGRAL_TYPE_P (valtype)(((enum tree_code) (valtype)->base.code) == ENUMERAL_TYPE ||
((enum tree_code) (valtype)->base.code) == BOOLEAN_TYPE ||
((enum tree_code) (valtype)->base.code) == INTEGER_TYPE)
)
3337 warning_at (ploc, OPT_Wtraditional_conversion,
3338 "passing argument %d of %qE as complex rather "
3339 "than integer due to prototype",
3340 argnum, rname);
3341 else if (TREE_CODE (type)((enum tree_code) (type)->base.code) == REAL_TYPE
3342 && TREE_CODE (valtype)((enum tree_code) (valtype)->base.code) == COMPLEX_TYPE)
3343 warning_at (ploc, OPT_Wtraditional_conversion,
3344 "passing argument %d of %qE as floating rather "
3345 "than complex due to prototype",
3346 argnum, rname);
3347 /* ??? At some point, messages should be written about
3348 conversions between complex types, but that's too messy
3349 to do now. */
3350 else if (TREE_CODE (type)((enum tree_code) (type)->base.code) == REAL_TYPE
3351 && TREE_CODE (valtype)((enum tree_code) (valtype)->base.code) == REAL_TYPE)
3352 {
3353 /* Warn if any argument is passed as `float',
3354 since without a prototype it would be `double'. */
3355 if (formal_prec == TYPE_PRECISION (float_type_node)((tree_class_check ((global_trees[TI_FLOAT_TYPE]), (tcc_type)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3355, __FUNCTION__))->type_common.precision)
3356 && type != dfloat32_type_nodeglobal_trees[TI_DFLOAT32_TYPE])
3357 warning_at (ploc, 0,
3358 "passing argument %d of %qE as %<float%> "
3359 "rather than %<double%> due to prototype",
3360 argnum, rname);
3361
3362 /* Warn if mismatch between argument and prototype
3363 for decimal float types. Warn of conversions with
3364 binary float types and of precision narrowing due to
3365 prototype. */
3366 else if (type != valtype
3367 && (type == dfloat32_type_nodeglobal_trees[TI_DFLOAT32_TYPE]
3368 || type == dfloat64_type_nodeglobal_trees[TI_DFLOAT64_TYPE]
3369 || type == dfloat128_type_nodeglobal_trees[TI_DFLOAT128_TYPE]
3370 || valtype == dfloat32_type_nodeglobal_trees[TI_DFLOAT32_TYPE]
3371 || valtype == dfloat64_type_nodeglobal_trees[TI_DFLOAT64_TYPE]
3372 || valtype == dfloat128_type_nodeglobal_trees[TI_DFLOAT128_TYPE])
3373 && (formal_prec
3374 <= TYPE_PRECISION (valtype)((tree_class_check ((valtype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3374, __FUNCTION__))->type_common.precision)
3375 || (type == dfloat128_type_nodeglobal_trees[TI_DFLOAT128_TYPE]
3376 && (valtype
3377 != dfloat64_type_nodeglobal_trees[TI_DFLOAT64_TYPE]
3378 && (valtype
3379 != dfloat32_type_nodeglobal_trees[TI_DFLOAT32_TYPE])))
3380 || (type == dfloat64_type_nodeglobal_trees[TI_DFLOAT64_TYPE]
3381 && (valtype
3382 != dfloat32_type_nodeglobal_trees[TI_DFLOAT32_TYPE]))))
3383 warning_at (ploc, 0,
3384 "passing argument %d of %qE as %qT "
3385 "rather than %qT due to prototype",
3386 argnum, rname, type, valtype);
3387
3388 }
3389 /* Detect integer changing in width or signedness.
3390 These warnings are only activated with
3391 -Wtraditional-conversion, not with -Wtraditional. */
3392 else if (warn_traditional_conversionglobal_options.x_warn_traditional_conversion
3393 && INTEGRAL_TYPE_P (type)(((enum tree_code) (type)->base.code) == ENUMERAL_TYPE || (
(enum tree_code) (type)->base.code) == BOOLEAN_TYPE || ((enum
tree_code) (type)->base.code) == INTEGER_TYPE)
3394 && INTEGRAL_TYPE_P (valtype)(((enum tree_code) (valtype)->base.code) == ENUMERAL_TYPE ||
((enum tree_code) (valtype)->base.code) == BOOLEAN_TYPE ||
((enum tree_code) (valtype)->base.code) == INTEGER_TYPE)
)
3395 {
3396 tree would_have_been = default_conversion (val);
3397 tree type1 = TREE_TYPE (would_have_been)((contains_struct_check ((would_have_been), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3397, __FUNCTION__))->typed.type)
;
3398
3399 if (val == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3400 /* VAL could have been of incomplete type. */;
3401 else if (TREE_CODE (type)((enum tree_code) (type)->base.code) == ENUMERAL_TYPE
3402 && (TYPE_MAIN_VARIANT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3402, __FUNCTION__))->type_common.main_variant)
3403 == TYPE_MAIN_VARIANT (valtype)((tree_class_check ((valtype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3403, __FUNCTION__))->type_common.main_variant)
))
3404 /* No warning if function asks for enum
3405 and the actual arg is that enum type. */
3406 ;
3407 else if (formal_prec != TYPE_PRECISION (type1)((tree_class_check ((type1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3407, __FUNCTION__))->type_common.precision)
)
3408 warning_at (ploc, OPT_Wtraditional_conversion,
3409 "passing argument %d of %qE "
3410 "with different width due to prototype",
3411 argnum, rname);
3412 else if (TYPE_UNSIGNED (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3412, __FUNCTION__))->base.u.bits.unsigned_flag)
== TYPE_UNSIGNED (type1)((tree_class_check ((type1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3412, __FUNCTION__))->base.u.bits.unsigned_flag)
)
3413 ;
3414 /* Don't complain if the formal parameter type
3415 is an enum, because we can't tell now whether
3416 the value was an enum--even the same enum. */
3417 else if (TREE_CODE (type)((enum tree_code) (type)->base.code) == ENUMERAL_TYPE)
3418 ;
3419 else if (TREE_CODE (val)((enum tree_code) (val)->base.code) == INTEGER_CST
3420 && int_fits_type_p (val, type))
3421 /* Change in signedness doesn't matter
3422 if a constant value is unaffected. */
3423 ;
3424 /* If the value is extended from a narrower
3425 unsigned type, it doesn't matter whether we
3426 pass it as signed or unsigned; the value
3427 certainly is the same either way. */
3428 else if (TYPE_PRECISION (valtype)((tree_class_check ((valtype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3428, __FUNCTION__))->type_common.precision)
< TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3428, __FUNCTION__))->type_common.precision)
3429 && TYPE_UNSIGNED (valtype)((tree_class_check ((valtype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3429, __FUNCTION__))->base.u.bits.unsigned_flag)
)
3430 ;
3431 else if (TYPE_UNSIGNED (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3431, __FUNCTION__))->base.u.bits.unsigned_flag)
)
3432 warning_at (ploc, OPT_Wtraditional_conversion,
3433 "passing argument %d of %qE "
3434 "as unsigned due to prototype",
3435 argnum, rname);
3436 else
3437 warning_at (ploc, OPT_Wtraditional_conversion,
3438 "passing argument %d of %qE "
3439 "as signed due to prototype",
3440 argnum, rname);
3441 }
3442 }
3443
3444 /* Possibly restore an EXCESS_PRECISION_EXPR for the
3445 sake of better warnings from convert_and_check. */
3446 if (excess_precision)
3447 val = build1 (EXCESS_PRECISION_EXPR, valtype, val);
3448
3449 tree parmval = convert_for_assignment (ploc, ploc, type,
3450 val, origtype, ic_argpass,
3451 npc, fundecl, function,
3452 parmnum + 1, warnopt);
3453
3454 if (targetm.calls.promote_prototypes (fundecl ? TREE_TYPE (fundecl)((contains_struct_check ((fundecl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3454, __FUNCTION__))->typed.type)
: 0)
3455 && INTEGRAL_TYPE_P (type)(((enum tree_code) (type)->base.code) == ENUMERAL_TYPE || (
(enum tree_code) (type)->base.code) == BOOLEAN_TYPE || ((enum
tree_code) (type)->base.code) == INTEGER_TYPE)
3456 && (TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3456, __FUNCTION__))->type_common.precision)
< TYPE_PRECISION (integer_type_node)((tree_class_check ((integer_types[itk_int]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3456, __FUNCTION__))->type_common.precision)
))
3457 parmval = default_conversion (parmval);
3458
3459 return parmval;
3460}
3461
3462/* Convert the argument expressions in the vector VALUES
3463 to the types in the list TYPELIST.
3464
3465 If TYPELIST is exhausted, or when an element has NULL as its type,
3466 perform the default conversions.
3467
3468 ORIGTYPES is the original types of the expressions in VALUES. This
3469 holds the type of enum values which have been converted to integral
3470 types. It may be NULL.
3471
3472 FUNCTION is a tree for the called function. It is used only for
3473 error messages, where it is formatted with %qE.
3474
3475 This is also where warnings about wrong number of args are generated.
3476
3477 ARG_LOC are locations of function arguments (if any).
3478
3479 Returns the actual number of arguments processed (which may be less
3480 than the length of VALUES in some error situations), or -1 on
3481 failure. */
3482
3483static int
3484convert_arguments (location_t loc, vec<location_t> arg_loc, tree typelist,
3485 vec<tree, va_gc> *values, vec<tree, va_gc> *origtypes,
3486 tree function, tree fundecl)
3487{
3488 unsigned int parmnum;
3489 bool error_args = false;
3490 const bool type_generic = fundecl
3491 && lookup_attribute ("type generic", TYPE_ATTRIBUTES (TREE_TYPE (fundecl))((tree_class_check ((((contains_struct_check ((fundecl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3491, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3491, __FUNCTION__))->type_common.attributes)
);
3492 bool type_generic_remove_excess_precision = false;
3493 bool type_generic_overflow_p = false;
3494 tree selector;
3495
3496 /* Change pointer to function to the function itself for
3497 diagnostics. */
3498 if (TREE_CODE (function)((enum tree_code) (function)->base.code) == ADDR_EXPR
3499 && TREE_CODE (TREE_OPERAND (function, 0))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((function), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3499, __FUNCTION__))))))->base.code)
== FUNCTION_DECL)
3500 function = TREE_OPERAND (function, 0)(*((const_cast<tree*> (tree_operand_check ((function), (
0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3500, __FUNCTION__)))))
;
3501
3502 /* Handle an ObjC selector specially for diagnostics. */
3503 selector = objc_message_selector ();
3504
3505 /* For a call to a built-in function declared without a prototype,
3506 set to the built-in function's argument list. */
3507 tree builtin_typelist = NULL_TREE(tree) __null;
3508
3509 /* For type-generic built-in functions, determine whether excess
3510 precision should be removed (classification) or not
3511 (comparison). */
3512 if (fundecl
3513 && fndecl_built_in_p (fundecl, BUILT_IN_NORMAL))
3514 {
3515 built_in_function code = DECL_FUNCTION_CODE (fundecl);
3516 if (C_DECL_BUILTIN_PROTOTYPE (fundecl)((contains_struct_check (((tree_check ((fundecl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3516, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3516, __FUNCTION__))->decl_common.lang_flag_6)
)
3517 {
3518 /* For a call to a built-in function declared without a prototype
3519 use the types of the parameters of the internal built-in to
3520 match those of the arguments to. */
3521 if (tree bdecl = builtin_decl_explicit (code))
3522 builtin_typelist = TYPE_ARG_TYPES (TREE_TYPE (bdecl))((tree_check2 ((((contains_struct_check ((bdecl), (TS_TYPED),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3522, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3522, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
3523 }
3524
3525 /* For type-generic built-in functions, determine whether excess
3526 precision should be removed (classification) or not
3527 (comparison). */
3528 if (type_generic)
3529 switch (code)
3530 {
3531 case BUILT_IN_ISFINITE:
3532 case BUILT_IN_ISINF:
3533 case BUILT_IN_ISINF_SIGN:
3534 case BUILT_IN_ISNAN:
3535 case BUILT_IN_ISNORMAL:
3536 case BUILT_IN_FPCLASSIFY:
3537 type_generic_remove_excess_precision = true;
3538 break;
3539
3540 case BUILT_IN_ADD_OVERFLOW_P:
3541 case BUILT_IN_SUB_OVERFLOW_P:
3542 case BUILT_IN_MUL_OVERFLOW_P:
3543 /* The last argument of these type-generic builtins
3544 should not be promoted. */
3545 type_generic_overflow_p = true;
3546 break;
3547
3548 default:
3549 break;
3550 }
3551 }
3552
3553 /* Scan the given expressions (VALUES) and types (TYPELIST), producing
3554 individual converted arguments. */
3555
3556 tree typetail, builtin_typetail, val;
3557 for (typetail = typelist,
3558 builtin_typetail = builtin_typelist,
3559 parmnum = 0;
3560 values && values->iterate (parmnum, &val);
3561 ++parmnum)
3562 {
3563 /* The type of the function parameter (if it was declared with one). */
3564 tree type = typetail ? TREE_VALUE (typetail)((tree_check ((typetail), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3564, __FUNCTION__, (TREE_LIST)))->list.value)
: NULL_TREE(tree) __null;
3565 /* The type of the built-in function parameter (if the function
3566 is a built-in). Used to detect type incompatibilities in
3567 calls to built-ins declared without a prototype. */
3568 tree builtin_type = (builtin_typetail
3569 ? TREE_VALUE (builtin_typetail)((tree_check ((builtin_typetail), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3569, __FUNCTION__, (TREE_LIST)))->list.value)
: NULL_TREE(tree) __null);
3570 /* The original type of the argument being passed to the function. */
3571 tree valtype = TREE_TYPE (val)((contains_struct_check ((val), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3571, __FUNCTION__))->typed.type)
;
3572 /* The called function (or function selector in Objective C). */
3573 tree rname = function;
3574 int argnum = parmnum + 1;
3575 const char *invalid_func_diag;
3576 /* Set for EXCESS_PRECISION_EXPR arguments. */
3577 bool excess_precision = false;
3578 /* The value of the argument after conversion to the type
3579 of the function parameter it is passed to. */
3580 tree parmval;
3581 /* Some __atomic_* builtins have additional hidden argument at
3582 position 0. */
3583 location_t ploc
3584 = !arg_loc.is_empty () && values->length () == arg_loc.length ()
3585 ? expansion_point_location_if_in_system_header (arg_loc[parmnum])
3586 : input_location;
3587
3588 if (type == void_type_nodeglobal_trees[TI_VOID_TYPE])
3589 {
3590 if (selector)
3591 error_at (loc, "too many arguments to method %qE", selector);
3592 else
3593 error_at (loc, "too many arguments to function %qE", function);
3594 inform_declaration (fundecl);
3595 return error_args ? -1 : (int) parmnum;
3596 }
3597
3598 if (builtin_type == void_type_nodeglobal_trees[TI_VOID_TYPE])
3599 {
3600 if (warning_at (loc, OPT_Wbuiltin_declaration_mismatch,
3601 "too many arguments to built-in function %qE "
3602 "expecting %d", function, parmnum))
3603 inform_declaration (fundecl);
3604 builtin_typetail = NULL_TREE(tree) __null;
3605 }
3606
3607 if (selector && argnum > 2)
3608 {
3609 rname = selector;
3610 argnum -= 2;
3611 }
3612
3613 /* Determine if VAL is a null pointer constant before folding it. */
3614 bool npc = null_pointer_constant_p (val);
3615
3616 /* If there is excess precision and a prototype, convert once to
3617 the required type rather than converting via the semantic
3618 type. Likewise without a prototype a float value represented
3619 as long double should be converted once to double. But for
3620 type-generic classification functions excess precision must
3621 be removed here. */
3622 if (TREE_CODE (val)((enum tree_code) (val)->base.code) == EXCESS_PRECISION_EXPR
3623 && (type || !type_generic || !type_generic_remove_excess_precision))
3624 {
3625 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/c/c-typeck.c"
, 3625, __FUNCTION__)))))
;
3626 excess_precision = true;
3627 }
3628 val = c_fully_fold (val, false, NULL__null);
3629 STRIP_TYPE_NOPS (val)while ((((((enum tree_code) (val)->base.code)) == NOP_EXPR
|| (((enum tree_code) (val)->base.code)) == CONVERT_EXPR)
|| ((enum tree_code) (val)->base.code) == NON_LVALUE_EXPR
) && (*((const_cast<tree*> (tree_operand_check (
(val), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3629, __FUNCTION__))))) != global_trees[TI_ERROR_MARK] &&
(((contains_struct_check ((val), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3629, __FUNCTION__))->typed.type) == ((contains_struct_check
(((*((const_cast<tree*> (tree_operand_check ((val), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3629, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3629, __FUNCTION__))->typed.type))) (val) = (*((const_cast
<tree*> (tree_operand_check ((val), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3629, __FUNCTION__)))))
;
3630
3631 val = require_complete_type (ploc, val);
3632
3633 /* Some floating-point arguments must be promoted to double when
3634 no type is specified by a prototype. This applies to
3635 arguments of type float, and to architecture-specific types
3636 (ARM __fp16), but not to _FloatN or _FloatNx types. */
3637 bool promote_float_arg = false;
3638 if (type == NULL_TREE(tree) __null
3639 && TREE_CODE (valtype)((enum tree_code) (valtype)->base.code) == REAL_TYPE
3640 && (TYPE_PRECISION (valtype)((tree_class_check ((valtype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3640, __FUNCTION__))->type_common.precision)
3641 <= TYPE_PRECISION (double_type_node)((tree_class_check ((global_trees[TI_DOUBLE_TYPE]), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3641, __FUNCTION__))->type_common.precision)
)
3642 && TYPE_MAIN_VARIANT (valtype)((tree_class_check ((valtype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3642, __FUNCTION__))->type_common.main_variant)
!= double_type_nodeglobal_trees[TI_DOUBLE_TYPE]
3643 && TYPE_MAIN_VARIANT (valtype)((tree_class_check ((valtype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3643, __FUNCTION__))->type_common.main_variant)
!= long_double_type_nodeglobal_trees[TI_LONG_DOUBLE_TYPE]
3644 && !DECIMAL_FLOAT_MODE_P (TYPE_MODE (valtype))(((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check
((valtype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3644, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(valtype) : (valtype)->type_common.mode)]) == MODE_DECIMAL_FLOAT
)
)
3645 {
3646 /* Promote this argument, unless it has a _FloatN or
3647 _FloatNx type. */
3648 promote_float_arg = true;
3649 for (int i = 0; i < NUM_FLOATN_NX_TYPES(TI_FLOATN_NX_TYPE_LAST - TI_FLOATN_NX_TYPE_FIRST + 1); i++)
3650 if (TYPE_MAIN_VARIANT (valtype)((tree_class_check ((valtype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3650, __FUNCTION__))->type_common.main_variant)
== FLOATN_NX_TYPE_NODE (i)global_trees[TI_FLOATN_NX_TYPE_FIRST + (i)])
3651 {
3652 promote_float_arg = false;
3653 break;
3654 }
3655 }
3656
3657 if (type != NULL_TREE(tree) __null)
3658 {
3659 tree origtype = (!origtypes) ? NULL_TREE(tree) __null : (*origtypes)[parmnum];
3660 parmval = convert_argument (ploc, function, fundecl, type, origtype,
3661 val, valtype, npc, rname, parmnum, argnum,
3662 excess_precision, 0);
3663 }
3664 else if (promote_float_arg)
3665 {
3666 if (type_generic)
3667 parmval = val;
3668 else
3669 {
3670 /* Convert `float' to `double'. */
3671 if (warn_double_promotionglobal_options.x_warn_double_promotion && !c_inhibit_evaluation_warnings)
3672 warning_at (ploc, OPT_Wdouble_promotion,
3673 "implicit conversion from %qT to %qT when passing "
3674 "argument to function",
3675 valtype, double_type_nodeglobal_trees[TI_DOUBLE_TYPE]);
3676 parmval = convert (double_type_nodeglobal_trees[TI_DOUBLE_TYPE], val);
3677 }
3678 }
3679 else if ((excess_precision && !type_generic)
3680 || (type_generic_overflow_p && parmnum == 2))
3681 /* A "double" argument with excess precision being passed
3682 without a prototype or in variable arguments.
3683 The last argument of __builtin_*_overflow_p should not be
3684 promoted. */
3685 parmval = convert (valtype, val);
3686 else if ((invalid_func_diag =
3687 targetm.calls.invalid_arg_for_unprototyped_fn (typelist, fundecl, val)))
3688 {
3689 error (invalid_func_diag);
3690 return -1;
3691 }
3692 else if (TREE_CODE (val)((enum tree_code) (val)->base.code) == ADDR_EXPR && reject_gcc_builtin (val))
3693 {
3694 return -1;
3695 }
3696 else
3697 /* Convert `short' and `char' to full-size `int'. */
3698 parmval = default_conversion (val);
3699
3700 (*values)[parmnum] = parmval;
3701 if (parmval == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3702 error_args = true;
3703
3704 if (!type && builtin_type && TREE_CODE (builtin_type)((enum tree_code) (builtin_type)->base.code) != VOID_TYPE)
3705 {
3706 /* For a call to a built-in function declared without a prototype,
3707 perform the conversions from the argument to the expected type
3708 but issue warnings rather than errors for any mismatches.
3709 Ignore the converted argument and use the PARMVAL obtained
3710 above by applying default conversions instead. */
3711 tree origtype = (!origtypes) ? NULL_TREE(tree) __null : (*origtypes)[parmnum];
3712 convert_argument (ploc, function, fundecl, builtin_type, origtype,
3713 val, valtype, npc, rname, parmnum, argnum,
3714 excess_precision,
3715 OPT_Wbuiltin_declaration_mismatch);
3716 }
3717
3718 if (typetail)
3719 typetail = TREE_CHAIN (typetail)((contains_struct_check ((typetail), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3719, __FUNCTION__))->common.chain)
;
3720
3721 if (builtin_typetail)
3722 builtin_typetail = TREE_CHAIN (builtin_typetail)((contains_struct_check ((builtin_typetail), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3722, __FUNCTION__))->common.chain)
;
3723 }
3724
3725 gcc_assert (parmnum == vec_safe_length (values))((void)(!(parmnum == vec_safe_length (values)) ? fancy_abort (
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3725, __FUNCTION__), 0 : 0))
;
3726
3727 if (typetail != NULL_TREE(tree) __null && TREE_VALUE (typetail)((tree_check ((typetail), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3727, __FUNCTION__, (TREE_LIST)))->list.value)
!= void_type_nodeglobal_trees[TI_VOID_TYPE])
3728 {
3729 error_at (loc, "too few arguments to function %qE", function);
3730 inform_declaration (fundecl);
3731 return -1;
3732 }
3733
3734 if (builtin_typetail && TREE_VALUE (builtin_typetail)((tree_check ((builtin_typetail), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3734, __FUNCTION__, (TREE_LIST)))->list.value)
!= void_type_nodeglobal_trees[TI_VOID_TYPE])
3735 {
3736 unsigned nargs = parmnum;
3737 for (tree t = builtin_typetail; t; t = TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3737, __FUNCTION__))->common.chain)
)
3738 ++nargs;
3739
3740 if (warning_at (loc, OPT_Wbuiltin_declaration_mismatch,
3741 "too few arguments to built-in function %qE "
3742 "expecting %u", function, nargs - 1))
3743 inform_declaration (fundecl);
3744 }
3745
3746 return error_args ? -1 : (int) parmnum;
3747}
3748
3749/* This is the entry point used by the parser to build unary operators
3750 in the input. CODE, a tree_code, specifies the unary operator, and
3751 ARG is the operand. For unary plus, the C parser currently uses
3752 CONVERT_EXPR for code.
3753
3754 LOC is the location to use for the tree generated.
3755*/
3756
3757struct c_expr
3758parser_build_unary_op (location_t loc, enum tree_code code, struct c_expr arg)
3759{
3760 struct c_expr result;
3761
3762 result.original_code = code;
3763 result.original_type = NULL__null;
3764
3765 if (reject_gcc_builtin (arg.value))
3766 {
3767 result.value = error_mark_nodeglobal_trees[TI_ERROR_MARK];
3768 }
3769 else
3770 {
3771 result.value = build_unary_op (loc, code, arg.value, false);
3772
3773 if (TREE_OVERFLOW_P (result.value)((tree_code_type[(int) (((enum tree_code) (result.value)->
base.code))] == tcc_constant) && ((tree_class_check (
(result.value), (tcc_constant), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3773, __FUNCTION__))->base.public_flag))
&& !TREE_OVERFLOW_P (arg.value)((tree_code_type[(int) (((enum tree_code) (arg.value)->base
.code))] == tcc_constant) && ((tree_class_check ((arg
.value), (tcc_constant), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3773, __FUNCTION__))->base.public_flag))
)
3774 overflow_warning (loc, result.value, arg.value);
3775 }
3776
3777 /* We are typically called when parsing a prefix token at LOC acting on
3778 ARG. Reflect this by updating the source range of the result to
3779 start at LOC and end at the end of ARG. */
3780 set_c_expr_source_range (&result,
3781 loc, arg.get_finish ());
3782
3783 return result;
3784}
3785
3786/* Returns true if TYPE is a character type, *not* including wchar_t. */
3787
3788bool
3789char_type_p (tree type)
3790{
3791 return (type == char_type_nodeinteger_types[itk_char]
3792 || type == unsigned_char_type_nodeinteger_types[itk_unsigned_char]
3793 || type == signed_char_type_nodeinteger_types[itk_signed_char]
3794 || type == char16_type_nodec_global_trees[CTI_CHAR16_TYPE]
3795 || type == char32_type_nodec_global_trees[CTI_CHAR32_TYPE]);
3796}
3797
3798/* This is the entry point used by the parser to build binary operators
3799 in the input. CODE, a tree_code, specifies the binary operator, and
3800 ARG1 and ARG2 are the operands. In addition to constructing the
3801 expression, we check for operands that were written with other binary
3802 operators in a way that is likely to confuse the user.
3803
3804 LOCATION is the location of the binary operator. */
3805
3806struct c_expr
3807parser_build_binary_op (location_t location, enum tree_code code,
3808 struct c_expr arg1, struct c_expr arg2)
3809{
3810 struct c_expr result;
3811
3812 enum tree_code code1 = arg1.original_code;
3813 enum tree_code code2 = arg2.original_code;
3814 tree type1 = (arg1.original_type
3815 ? arg1.original_type
3816 : TREE_TYPE (arg1.value)((contains_struct_check ((arg1.value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3816, __FUNCTION__))->typed.type)
);
3817 tree type2 = (arg2.original_type
3818 ? arg2.original_type
3819 : TREE_TYPE (arg2.value)((contains_struct_check ((arg2.value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3819, __FUNCTION__))->typed.type)
);
3820
3821 result.value = build_binary_op (location, code,
3822 arg1.value, arg2.value, true);
3823 result.original_code = code;
3824 result.original_type = NULL__null;
3825
3826 if (TREE_CODE (result.value)((enum tree_code) (result.value)->base.code) == ERROR_MARK)
3827 {
3828 set_c_expr_source_range (&result,
3829 arg1.get_start (),
3830 arg2.get_finish ());
3831 return result;
3832 }
3833
3834 if (location != UNKNOWN_LOCATION((location_t) 0))
3835 protected_set_expr_location (result.value, location);
3836
3837 set_c_expr_source_range (&result,
3838 arg1.get_start (),
3839 arg2.get_finish ());
3840
3841 /* Check for cases such as x+y<<z which users are likely
3842 to misinterpret. */
3843 if (warn_parenthesesglobal_options.x_warn_parentheses)
3844 warn_about_parentheses (location, code, code1, arg1.value, code2,
3845 arg2.value);
3846
3847 if (warn_logical_opglobal_options.x_warn_logical_op)
3848 warn_logical_operator (location, code, TREE_TYPE (result.value)((contains_struct_check ((result.value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3848, __FUNCTION__))->typed.type)
,
3849 code1, arg1.value, code2, arg2.value);
3850
3851 if (warn_tautological_compareglobal_options.x_warn_tautological_compare)
3852 {
3853 tree lhs = arg1.value;
3854 tree rhs = arg2.value;
3855 if (TREE_CODE (lhs)((enum tree_code) (lhs)->base.code) == C_MAYBE_CONST_EXPR)
3856 {
3857 if (C_MAYBE_CONST_EXPR_PRE (lhs)(*((const_cast<tree*> (tree_operand_check (((tree_check
((lhs), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3857, __FUNCTION__, (C_MAYBE_CONST_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3857, __FUNCTION__)))))
!= NULL_TREE(tree) __null
3858 && TREE_SIDE_EFFECTS (C_MAYBE_CONST_EXPR_PRE (lhs))((non_type_check (((*((const_cast<tree*> (tree_operand_check
(((tree_check ((lhs), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3858, __FUNCTION__, (C_MAYBE_CONST_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3858, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3858, __FUNCTION__))->base.side_effects_flag)
)
3859 lhs = NULL_TREE(tree) __null;
3860 else
3861 lhs = C_MAYBE_CONST_EXPR_EXPR (lhs)(*((const_cast<tree*> (tree_operand_check (((tree_check
((lhs), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3861, __FUNCTION__, (C_MAYBE_CONST_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3861, __FUNCTION__)))))
;
3862 }
3863 if (TREE_CODE (rhs)((enum tree_code) (rhs)->base.code) == C_MAYBE_CONST_EXPR)
3864 {
3865 if (C_MAYBE_CONST_EXPR_PRE (rhs)(*((const_cast<tree*> (tree_operand_check (((tree_check
((rhs), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3865, __FUNCTION__, (C_MAYBE_CONST_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3865, __FUNCTION__)))))
!= NULL_TREE(tree) __null
3866 && TREE_SIDE_EFFECTS (C_MAYBE_CONST_EXPR_PRE (rhs))((non_type_check (((*((const_cast<tree*> (tree_operand_check
(((tree_check ((rhs), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3866, __FUNCTION__, (C_MAYBE_CONST_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3866, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3866, __FUNCTION__))->base.side_effects_flag)
)
3867 rhs = NULL_TREE(tree) __null;
3868 else
3869 rhs = C_MAYBE_CONST_EXPR_EXPR (rhs)(*((const_cast<tree*> (tree_operand_check (((tree_check
((rhs), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3869, __FUNCTION__, (C_MAYBE_CONST_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3869, __FUNCTION__)))))
;
3870 }
3871 if (lhs != NULL_TREE(tree) __null && rhs != NULL_TREE(tree) __null)
3872 warn_tautological_cmp (location, code, lhs, rhs);
3873 }
3874
3875 if (warn_logical_not_parenglobal_options.x_warn_logical_not_paren
3876 && TREE_CODE_CLASS (code)tree_code_type[(int) (code)] == tcc_comparison
3877 && code1 == TRUTH_NOT_EXPR
3878 && code2 != TRUTH_NOT_EXPR
3879 /* Avoid warning for !!x == y. */
3880 && (TREE_CODE (arg1.value)((enum tree_code) (arg1.value)->base.code) != NE_EXPR
3881 || !integer_zerop (TREE_OPERAND (arg1.value, 1)(*((const_cast<tree*> (tree_operand_check ((arg1.value)
, (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3881, __FUNCTION__)))))
)))
3882 {
3883 /* Avoid warning for !b == y where b has _Bool type. */
3884 tree t = integer_zero_nodeglobal_trees[TI_INTEGER_ZERO];
3885 if (TREE_CODE (arg1.value)((enum tree_code) (arg1.value)->base.code) == EQ_EXPR
3886 && integer_zerop (TREE_OPERAND (arg1.value, 1)(*((const_cast<tree*> (tree_operand_check ((arg1.value)
, (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3886, __FUNCTION__)))))
)
3887 && TREE_TYPE (TREE_OPERAND (arg1.value, 0))((contains_struct_check (((*((const_cast<tree*> (tree_operand_check
((arg1.value), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3887, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3887, __FUNCTION__))->typed.type)
== integer_type_nodeinteger_types[itk_int])
3888 {
3889 t = TREE_OPERAND (arg1.value, 0)(*((const_cast<tree*> (tree_operand_check ((arg1.value)
, (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3889, __FUNCTION__)))))
;
3890 do
3891 {
3892 if (TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3892, __FUNCTION__))->typed.type)
!= integer_type_nodeinteger_types[itk_int])
3893 break;
3894 if (TREE_CODE (t)((enum tree_code) (t)->base.code) == C_MAYBE_CONST_EXPR)
3895 t = C_MAYBE_CONST_EXPR_EXPR (t)(*((const_cast<tree*> (tree_operand_check (((tree_check
((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3895, __FUNCTION__, (C_MAYBE_CONST_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3895, __FUNCTION__)))))
;
3896 else if (CONVERT_EXPR_P (t)((((enum tree_code) (t)->base.code)) == NOP_EXPR || (((enum
tree_code) (t)->base.code)) == CONVERT_EXPR)
)
3897 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/c/c-typeck.c"
, 3897, __FUNCTION__)))))
;
3898 else
3899 break;
3900 }
3901 while (1);
3902 }
3903 if (TREE_CODE (TREE_TYPE (t))((enum tree_code) (((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3903, __FUNCTION__))->typed.type))->base.code)
!= BOOLEAN_TYPE)
3904 warn_logical_not_parentheses (location, code, arg1.value, arg2.value);
3905 }
3906
3907 /* Warn about comparisons against string literals, with the exception
3908 of testing for equality or inequality of a string literal with NULL. */
3909 if (code == EQ_EXPR || code == NE_EXPR)
3910 {
3911 if ((code1 == STRING_CST
3912 && !integer_zerop (tree_strip_nop_conversions (arg2.value)))
3913 || (code2 == STRING_CST
3914 && !integer_zerop (tree_strip_nop_conversions (arg1.value))))
3915 warning_at (location, OPT_Waddress,
3916 "comparison with string literal results in unspecified behavior");
3917 /* Warn for ptr == '\0', it's likely that it should've been ptr[0]. */
3918 if (POINTER_TYPE_P (type1)(((enum tree_code) (type1)->base.code) == POINTER_TYPE || (
(enum tree_code) (type1)->base.code) == REFERENCE_TYPE)
3919 && null_pointer_constant_p (arg2.value)
3920 && char_type_p (type2))
3921 {
3922 auto_diagnostic_group d;
3923 if (warning_at (location, OPT_Wpointer_compare,
3924 "comparison between pointer and zero character "
3925 "constant"))
3926 inform (arg1.get_start (),
3927 "did you mean to dereference the pointer?");
3928 }
3929 else if (POINTER_TYPE_P (type2)(((enum tree_code) (type2)->base.code) == POINTER_TYPE || (
(enum tree_code) (type2)->base.code) == REFERENCE_TYPE)
3930 && null_pointer_constant_p (arg1.value)
3931 && char_type_p (type1))
3932 {
3933 auto_diagnostic_group d;
3934 if (warning_at (location, OPT_Wpointer_compare,
3935 "comparison between pointer and zero character "
3936 "constant"))
3937 inform (arg2.get_start (),
3938 "did you mean to dereference the pointer?");
3939 }
3940 }
3941 else if (TREE_CODE_CLASS (code)tree_code_type[(int) (code)] == tcc_comparison
3942 && (code1 == STRING_CST || code2 == STRING_CST))
3943 warning_at (location, OPT_Waddress,
3944 "comparison with string literal results in unspecified "
3945 "behavior");
3946
3947 if (warn_array_compareglobal_options.x_warn_array_compare
3948 && TREE_CODE_CLASS (code)tree_code_type[(int) (code)] == tcc_comparison
3949 && TREE_CODE (type1)((enum tree_code) (type1)->base.code) == ARRAY_TYPE
3950 && TREE_CODE (type2)((enum tree_code) (type2)->base.code) == ARRAY_TYPE)
3951 do_warn_array_compare (location, code, arg1.value, arg2.value);
3952
3953 if (TREE_OVERFLOW_P (result.value)((tree_code_type[(int) (((enum tree_code) (result.value)->
base.code))] == tcc_constant) && ((tree_class_check (
(result.value), (tcc_constant), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3953, __FUNCTION__))->base.public_flag))
3954 && !TREE_OVERFLOW_P (arg1.value)((tree_code_type[(int) (((enum tree_code) (arg1.value)->base
.code))] == tcc_constant) && ((tree_class_check ((arg1
.value), (tcc_constant), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3954, __FUNCTION__))->base.public_flag))
3955 && !TREE_OVERFLOW_P (arg2.value)((tree_code_type[(int) (((enum tree_code) (arg2.value)->base
.code))] == tcc_constant) && ((tree_class_check ((arg2
.value), (tcc_constant), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3955, __FUNCTION__))->base.public_flag))
)
3956 overflow_warning (location, result.value);
3957
3958 /* Warn about comparisons of different enum types. */
3959 if (warn_enum_compareglobal_options.x_warn_enum_compare
3960 && TREE_CODE_CLASS (code)tree_code_type[(int) (code)] == tcc_comparison
3961 && TREE_CODE (type1)((enum tree_code) (type1)->base.code) == ENUMERAL_TYPE
3962 && TREE_CODE (type2)((enum tree_code) (type2)->base.code) == ENUMERAL_TYPE
3963 && TYPE_MAIN_VARIANT (type1)((tree_class_check ((type1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3963, __FUNCTION__))->type_common.main_variant)
!= TYPE_MAIN_VARIANT (type2)((tree_class_check ((type2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3963, __FUNCTION__))->type_common.main_variant)
)
3964 warning_at (location, OPT_Wenum_compare,
3965 "comparison between %qT and %qT",
3966 type1, type2);
3967
3968 return result;
3969}
3970
3971/* Return a tree for the difference of pointers OP0 and OP1.
3972 The resulting tree has type ptrdiff_t. If POINTER_SUBTRACT sanitization is
3973 enabled, assign to INSTRUMENT_EXPR call to libsanitizer. */
3974
3975static tree
3976pointer_diff (location_t loc, tree op0, tree op1, tree *instrument_expr)
3977{
3978 tree restype = ptrdiff_type_nodeglobal_trees[TI_PTRDIFF_TYPE];
3979 tree result, inttype;
3980
3981 addr_space_t as0 = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (op0)))((tree_class_check ((((contains_struct_check ((((contains_struct_check
((op0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3981, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3981, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3981, __FUNCTION__))->base.u.bits.address_space)
;
3982 addr_space_t as1 = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (op1)))((tree_class_check ((((contains_struct_check ((((contains_struct_check
((op1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3982, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3982, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3982, __FUNCTION__))->base.u.bits.address_space)
;
3983 tree target_type = TREE_TYPE (TREE_TYPE (op0))((contains_struct_check ((((contains_struct_check ((op0), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3983, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3983, __FUNCTION__))->typed.type)
;
3984 tree orig_op0 = op0;
3985 tree orig_op1 = op1;
3986
3987 /* If the operands point into different address spaces, we need to
3988 explicitly convert them to pointers into the common address space
3989 before we can subtract the numerical address values. */
3990 if (as0 != as1)
3991 {
3992 addr_space_t as_common;
3993 tree common_type;
3994
3995 /* Determine the common superset address space. This is guaranteed
3996 to exist because the caller verified that comp_target_types
3997 returned non-zero. */
3998 if (!addr_space_superset (as0, as1, &as_common))
3999 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 3999, __FUNCTION__))
;
4000
4001 common_type = common_pointer_type (TREE_TYPE (op0)((contains_struct_check ((op0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4001, __FUNCTION__))->typed.type)
, TREE_TYPE (op1)((contains_struct_check ((op1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4001, __FUNCTION__))->typed.type)
);
4002 op0 = convert (common_type, op0);
4003 op1 = convert (common_type, op1);
4004 }
4005
4006 /* Determine integer type result of the subtraction. This will usually
4007 be the same as the result type (ptrdiff_t), but may need to be a wider
4008 type if pointers for the address space are wider than ptrdiff_t. */
4009 if (TYPE_PRECISION (restype)((tree_class_check ((restype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4009, __FUNCTION__))->type_common.precision)
< TYPE_PRECISION (TREE_TYPE (op0))((tree_class_check ((((contains_struct_check ((op0), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4009, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4009, __FUNCTION__))->type_common.precision)
)
4010 inttype = c_common_type_for_size (TYPE_PRECISION (TREE_TYPE (op0))((tree_class_check ((((contains_struct_check ((op0), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4010, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4010, __FUNCTION__))->type_common.precision)
, 0);
4011 else
4012 inttype = restype;
4013
4014 if (TREE_CODE (target_type)((enum tree_code) (target_type)->base.code) == VOID_TYPE)
4015 pedwarn (loc, OPT_Wpointer_arith,
4016 "pointer of type %<void *%> used in subtraction");
4017 if (TREE_CODE (target_type)((enum tree_code) (target_type)->base.code) == FUNCTION_TYPE)
4018 pedwarn (loc, OPT_Wpointer_arith,
4019 "pointer to a function used in subtraction");
4020
4021 if (current_function_decl != NULL_TREE(tree) __null
4022 && sanitize_flags_p (SANITIZE_POINTER_SUBTRACT))
4023 {
4024 op0 = save_expr (op0);
4025 op1 = save_expr (op1);
4026
4027 tree tt = builtin_decl_explicit (BUILT_IN_ASAN_POINTER_SUBTRACT);
4028 *instrument_expr = build_call_expr_loc (loc, tt, 2, op0, op1);
4029 }
4030
4031 /* First do the subtraction, then build the divide operator
4032 and only convert at the very end.
4033 Do not do default conversions in case restype is a short type. */
4034
4035 /* POINTER_DIFF_EXPR requires a signed integer type of the same size as
4036 pointers. If some platform cannot provide that, or has a larger
4037 ptrdiff_type to support differences larger than half the address
4038 space, cast the pointers to some larger integer type and do the
4039 computations in that type. */
4040 if (TYPE_PRECISION (inttype)((tree_class_check ((inttype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4040, __FUNCTION__))->type_common.precision)
> TYPE_PRECISION (TREE_TYPE (op0))((tree_class_check ((((contains_struct_check ((op0), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4040, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4040, __FUNCTION__))->type_common.precision)
)
4041 op0 = build_binary_op (loc, MINUS_EXPR, convert (inttype, op0),
4042 convert (inttype, op1), false);
4043 else
4044 {
4045 /* Cast away qualifiers. */
4046 op0 = convert (c_common_type (TREE_TYPE (op0)((contains_struct_check ((op0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4046, __FUNCTION__))->typed.type)
, TREE_TYPE (op0)((contains_struct_check ((op0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4046, __FUNCTION__))->typed.type)
), op0);
4047 op1 = convert (c_common_type (TREE_TYPE (op1)((contains_struct_check ((op1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4047, __FUNCTION__))->typed.type)
, TREE_TYPE (op1)((contains_struct_check ((op1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4047, __FUNCTION__))->typed.type)
), op1);
4048 op0 = build2_loc (loc, POINTER_DIFF_EXPR, inttype, op0, op1);
4049 }
4050
4051 /* This generates an error if op1 is pointer to incomplete type. */
4052 if (!COMPLETE_OR_VOID_TYPE_P (TREE_TYPE (TREE_TYPE (orig_op1)))((((tree_class_check ((((contains_struct_check ((((contains_struct_check
((orig_op1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4052, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4052, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4052, __FUNCTION__))->type_common.size) != (tree) __null
) || (((enum tree_code) (((contains_struct_check ((((contains_struct_check
((orig_op1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4052, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4052, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
))
)
4053 error_at (loc, "arithmetic on pointer to an incomplete type");
4054 else if (verify_type_context (loc, TCTX_POINTER_ARITH,
4055 TREE_TYPE (TREE_TYPE (orig_op0))((contains_struct_check ((((contains_struct_check ((orig_op0)
, (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4055, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4055, __FUNCTION__))->typed.type)
))
4056 verify_type_context (loc, TCTX_POINTER_ARITH,
4057 TREE_TYPE (TREE_TYPE (orig_op1))((contains_struct_check ((((contains_struct_check ((orig_op1)
, (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4057, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4057, __FUNCTION__))->typed.type)
);
4058
4059 op1 = c_size_in_bytes (target_type);
4060
4061 if (pointer_to_zero_sized_aggr_p (TREE_TYPE (orig_op1)((contains_struct_check ((orig_op1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4061, __FUNCTION__))->typed.type)
))
4062 error_at (loc, "arithmetic on pointer to an empty aggregate");
4063
4064 /* Divide by the size, in easiest possible way. */
4065 result = fold_build2_loc (loc, EXACT_DIV_EXPR, inttype,
4066 op0, convert (inttype, op1));
4067
4068 /* Convert to final result type if necessary. */
4069 return convert (restype, result);
4070}
4071
4072/* Expand atomic compound assignments into an appropriate sequence as
4073 specified by the C11 standard section 6.5.16.2.
4074
4075 _Atomic T1 E1
4076 T2 E2
4077 E1 op= E2
4078
4079 This sequence is used for all types for which these operations are
4080 supported.
4081
4082 In addition, built-in versions of the 'fe' prefixed routines may
4083 need to be invoked for floating point (real, complex or vector) when
4084 floating-point exceptions are supported. See 6.5.16.2 footnote 113.
4085
4086 T1 newval;
4087 T1 old;
4088 T1 *addr
4089 T2 val
4090 fenv_t fenv
4091
4092 addr = &E1;
4093 val = (E2);
4094 __atomic_load (addr, &old, SEQ_CST);
4095 feholdexcept (&fenv);
4096loop:
4097 newval = old op val;
4098 if (__atomic_compare_exchange_strong (addr, &old, &newval, SEQ_CST,
4099 SEQ_CST))
4100 goto done;
4101 feclearexcept (FE_ALL_EXCEPT);
4102 goto loop:
4103done:
4104 feupdateenv (&fenv);
4105
4106 The compiler will issue the __atomic_fetch_* built-in when possible,
4107 otherwise it will generate the generic form of the atomic operations.
4108 This requires temp(s) and has their address taken. The atomic processing
4109 is smart enough to figure out when the size of an object can utilize
4110 a lock-free version, and convert the built-in call to the appropriate
4111 lock-free routine. The optimizers will then dispose of any temps that
4112 are no longer required, and lock-free implementations are utilized as
4113 long as there is target support for the required size.
4114
4115 If the operator is NOP_EXPR, then this is a simple assignment, and
4116 an __atomic_store is issued to perform the assignment rather than
4117 the above loop. */
4118
4119/* Build an atomic assignment at LOC, expanding into the proper
4120 sequence to store LHS MODIFYCODE= RHS. Return a value representing
4121 the result of the operation, unless RETURN_OLD_P, in which case
4122 return the old value of LHS (this is only for postincrement and
4123 postdecrement). */
4124
4125static tree
4126build_atomic_assign (location_t loc, tree lhs, enum tree_code modifycode,
4127 tree rhs, bool return_old_p)
4128{
4129 tree fndecl, func_call;
4130 vec<tree, va_gc> *params;
4131 tree val, nonatomic_lhs_type, nonatomic_rhs_type, newval, newval_addr;
4132 tree old, old_addr;
4133 tree compound_stmt = NULL_TREE(tree) __null;
4134 tree stmt, goto_stmt;
4135 tree loop_label, loop_decl, done_label, done_decl;
4136
4137 tree lhs_type = TREE_TYPE (lhs)((contains_struct_check ((lhs), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4137, __FUNCTION__))->typed.type)
;
4138 tree lhs_addr = build_unary_op (loc, ADDR_EXPR, lhs, false);
4139 tree seq_cst = build_int_cst (integer_type_nodeinteger_types[itk_int], MEMMODEL_SEQ_CST);
4140 tree rhs_semantic_type = TREE_TYPE (rhs)((contains_struct_check ((rhs), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4140, __FUNCTION__))->typed.type)
;
4141 tree nonatomic_rhs_semantic_type;
4142 tree rhs_type;
4143
4144 gcc_assert (TYPE_ATOMIC (lhs_type))((void)(!(((tree_class_check ((lhs_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4144, __FUNCTION__))->base.u.bits.atomic_flag)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4144, __FUNCTION__), 0 : 0))
;
4145
4146 if (return_old_p)
4147 gcc_assert (modifycode == PLUS_EXPR || modifycode == MINUS_EXPR)((void)(!(modifycode == PLUS_EXPR || modifycode == MINUS_EXPR
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4147, __FUNCTION__), 0 : 0))
;
4148
4149 /* Allocate enough vector items for a compare_exchange. */
4150 vec_alloc (params, 6);
4151
4152 /* Create a compound statement to hold the sequence of statements
4153 with a loop. */
4154 if (modifycode != NOP_EXPR)
4155 {
4156 compound_stmt = c_begin_compound_stmt (false);
4157
4158 /* For consistency with build_modify_expr on non-_Atomic,
4159 mark the lhs as read. Also, it would be very hard to match
4160 such expressions in mark_exp_read. */
4161 mark_exp_read (lhs);
4162 }
4163
4164 /* Remove any excess precision (which is only present here in the
4165 case of compound assignments). */
4166 if (TREE_CODE (rhs)((enum tree_code) (rhs)->base.code) == EXCESS_PRECISION_EXPR)
4167 {
4168 gcc_assert (modifycode != NOP_EXPR)((void)(!(modifycode != NOP_EXPR) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4168, __FUNCTION__), 0 : 0))
;
4169 rhs = TREE_OPERAND (rhs, 0)(*((const_cast<tree*> (tree_operand_check ((rhs), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4169, __FUNCTION__)))))
;
4170 }
4171 rhs_type = TREE_TYPE (rhs)((contains_struct_check ((rhs), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4171, __FUNCTION__))->typed.type)
;
4172
4173 /* Fold the RHS if it hasn't already been folded. */
4174 if (modifycode != NOP_EXPR)
4175 rhs = c_fully_fold (rhs, false, NULL__null);
4176
4177 /* Remove the qualifiers for the rest of the expressions and create
4178 the VAL temp variable to hold the RHS. */
4179 nonatomic_lhs_type = build_qualified_type (lhs_type, TYPE_UNQUALIFIED);
4180 nonatomic_rhs_type = build_qualified_type (rhs_type, TYPE_UNQUALIFIED);
4181 nonatomic_rhs_semantic_type = build_qualified_type (rhs_semantic_type,
4182 TYPE_UNQUALIFIED);
4183 val = create_tmp_var_raw (nonatomic_rhs_type);
4184 TREE_ADDRESSABLE (val)((val)->base.addressable_flag) = 1;
4185 suppress_warning (val);
4186 rhs = build4 (TARGET_EXPR, nonatomic_rhs_type, val, rhs, NULL_TREE(tree) __null,
4187 NULL_TREE(tree) __null);
4188 TREE_SIDE_EFFECTS (rhs)((non_type_check ((rhs), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4188, __FUNCTION__))->base.side_effects_flag)
= 1;
4189 SET_EXPR_LOCATION (rhs, loc)(expr_check (((rhs)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4189, __FUNCTION__))->exp.locus = (loc)
;
4190 if (modifycode != NOP_EXPR)
4191 add_stmt (rhs);
4192
4193 /* NOP_EXPR indicates it's a straight store of the RHS. Simply issue
4194 an atomic_store. */
4195 if (modifycode == NOP_EXPR)
4196 {
4197 compound_stmt = rhs;
4198 /* Build __atomic_store (&lhs, &val, SEQ_CST) */
4199 rhs = build_unary_op (loc, ADDR_EXPR, val, false);
4200 fndecl = builtin_decl_explicit (BUILT_IN_ATOMIC_STORE);
4201 params->quick_push (lhs_addr);
4202 params->quick_push (rhs);
4203 params->quick_push (seq_cst);
4204 func_call = c_build_function_call_vec (loc, vNULL, fndecl, params, NULL__null);
4205
4206 compound_stmt = build2 (COMPOUND_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE],
4207 compound_stmt, func_call);
4208
4209 /* VAL is the value which was stored, return a COMPOUND_STMT of
4210 the statement and that value. */
4211 return build2 (COMPOUND_EXPR, nonatomic_lhs_type, compound_stmt, val);
4212 }
4213
4214 /* Attempt to implement the atomic operation as an __atomic_fetch_* or
4215 __atomic_*_fetch built-in rather than a CAS loop. atomic_bool type
4216 isn't applicable for such builtins. ??? Do we want to handle enums? */
4217 if ((TREE_CODE (lhs_type)((enum tree_code) (lhs_type)->base.code) == INTEGER_TYPE || POINTER_TYPE_P (lhs_type)(((enum tree_code) (lhs_type)->base.code) == POINTER_TYPE ||
((enum tree_code) (lhs_type)->base.code) == REFERENCE_TYPE
)
)
4218 && TREE_CODE (rhs_type)((enum tree_code) (rhs_type)->base.code) == INTEGER_TYPE)
4219 {
4220 built_in_function fncode;
4221 switch (modifycode)
4222 {
4223 case PLUS_EXPR:
4224 case POINTER_PLUS_EXPR:
4225 fncode = (return_old_p
4226 ? BUILT_IN_ATOMIC_FETCH_ADD_N
4227 : BUILT_IN_ATOMIC_ADD_FETCH_N);
4228 break;
4229 case MINUS_EXPR:
4230 fncode = (return_old_p
4231 ? BUILT_IN_ATOMIC_FETCH_SUB_N
4232 : BUILT_IN_ATOMIC_SUB_FETCH_N);
4233 break;
4234 case BIT_AND_EXPR:
4235 fncode = (return_old_p
4236 ? BUILT_IN_ATOMIC_FETCH_AND_N
4237 : BUILT_IN_ATOMIC_AND_FETCH_N);
4238 break;
4239 case BIT_IOR_EXPR:
4240 fncode = (return_old_p
4241 ? BUILT_IN_ATOMIC_FETCH_OR_N
4242 : BUILT_IN_ATOMIC_OR_FETCH_N);
4243 break;
4244 case BIT_XOR_EXPR:
4245 fncode = (return_old_p
4246 ? BUILT_IN_ATOMIC_FETCH_XOR_N
4247 : BUILT_IN_ATOMIC_XOR_FETCH_N);
4248 break;
4249 default:
4250 goto cas_loop;
4251 }
4252
4253 /* We can only use "_1" through "_16" variants of the atomic fetch
4254 built-ins. */
4255 unsigned HOST_WIDE_INTlong size = tree_to_uhwi (TYPE_SIZE_UNIT (lhs_type)((tree_class_check ((lhs_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4255, __FUNCTION__))->type_common.size_unit)
);
4256 if (size != 1 && size != 2 && size != 4 && size != 8 && size != 16)
4257 goto cas_loop;
4258
4259 /* If this is a pointer type, we need to multiply by the size of
4260 the pointer target type. */
4261 if (POINTER_TYPE_P (lhs_type)(((enum tree_code) (lhs_type)->base.code) == POINTER_TYPE ||
((enum tree_code) (lhs_type)->base.code) == REFERENCE_TYPE
)
)
4262 {
4263 if (!COMPLETE_TYPE_P (TREE_TYPE (lhs_type))(((tree_class_check ((((contains_struct_check ((lhs_type), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4263, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4263, __FUNCTION__))->type_common.size) != (tree) __null
)
4264 /* ??? This would introduce -Wdiscarded-qualifiers
4265 warning: __atomic_fetch_* expect volatile void *
4266 type as the first argument. (Assignments between
4267 atomic and non-atomic objects are OK.) */
4268 || TYPE_RESTRICT (lhs_type)((tree_class_check ((lhs_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4268, __FUNCTION__))->type_common.restrict_flag)
)
4269 goto cas_loop;
4270 tree sz = TYPE_SIZE_UNIT (TREE_TYPE (lhs_type))((tree_class_check ((((contains_struct_check ((lhs_type), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4270, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4270, __FUNCTION__))->type_common.size_unit)
;
4271 rhs = fold_build2_loc (loc, MULT_EXPR, ptrdiff_type_nodeglobal_trees[TI_PTRDIFF_TYPE],
4272 convert (ptrdiff_type_nodeglobal_trees[TI_PTRDIFF_TYPE], rhs),
4273 convert (ptrdiff_type_nodeglobal_trees[TI_PTRDIFF_TYPE], sz));
4274 }
4275
4276 /* Build __atomic_fetch_* (&lhs, &val, SEQ_CST), or
4277 __atomic_*_fetch (&lhs, &val, SEQ_CST). */
4278 fndecl = builtin_decl_explicit (fncode);
4279 params->quick_push (lhs_addr);
4280 params->quick_push (rhs);
4281 params->quick_push (seq_cst);
4282 func_call = c_build_function_call_vec (loc, vNULL, fndecl, params, NULL__null);
4283
4284 newval = create_tmp_var_raw (nonatomic_lhs_type);
4285 TREE_ADDRESSABLE (newval)((newval)->base.addressable_flag) = 1;
4286 suppress_warning (newval);
4287 rhs = build4 (TARGET_EXPR, nonatomic_lhs_type, newval, func_call,
4288 NULL_TREE(tree) __null, NULL_TREE(tree) __null);
4289 SET_EXPR_LOCATION (rhs, loc)(expr_check (((rhs)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4289, __FUNCTION__))->exp.locus = (loc)
;
4290 add_stmt (rhs);
4291
4292 /* Finish the compound statement. */
4293 compound_stmt = c_end_compound_stmt (loc, compound_stmt, false);
4294
4295 /* NEWVAL is the value which was stored, return a COMPOUND_STMT of
4296 the statement and that value. */
4297 return build2 (COMPOUND_EXPR, nonatomic_lhs_type, compound_stmt, newval);
4298 }
4299
4300cas_loop:
4301 /* Create the variables and labels required for the op= form. */
4302 old = create_tmp_var_raw (nonatomic_lhs_type);
4303 old_addr = build_unary_op (loc, ADDR_EXPR, old, false);
4304 TREE_ADDRESSABLE (old)((old)->base.addressable_flag) = 1;
4305 suppress_warning (old);
4306
4307 newval = create_tmp_var_raw (nonatomic_lhs_type);
4308 newval_addr = build_unary_op (loc, ADDR_EXPR, newval, false);
4309 TREE_ADDRESSABLE (newval)((newval)->base.addressable_flag) = 1;
4310 suppress_warning (newval);
4311
4312 loop_decl = create_artificial_label (loc);
4313 loop_label = build1 (LABEL_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE], loop_decl);
4314
4315 done_decl = create_artificial_label (loc);
4316 done_label = build1 (LABEL_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE], done_decl);
4317
4318 /* __atomic_load (addr, &old, SEQ_CST). */
4319 fndecl = builtin_decl_explicit (BUILT_IN_ATOMIC_LOAD);
4320 params->quick_push (lhs_addr);
4321 params->quick_push (old_addr);
4322 params->quick_push (seq_cst);
4323 func_call = c_build_function_call_vec (loc, vNULL, fndecl, params, NULL__null);
4324 old = build4 (TARGET_EXPR, nonatomic_lhs_type, old, func_call, NULL_TREE(tree) __null,
4325 NULL_TREE(tree) __null);
4326 add_stmt (old);
4327 params->truncate (0);
4328
4329 /* Create the expressions for floating-point environment
4330 manipulation, if required. */
4331 bool need_fenv = (flag_trapping_mathglobal_options.x_flag_trapping_math
4332 && (FLOAT_TYPE_P (lhs_type)((((enum tree_code) (lhs_type)->base.code) == REAL_TYPE) ||
((((enum tree_code) (lhs_type)->base.code) == COMPLEX_TYPE
|| (((enum tree_code) (lhs_type)->base.code) == VECTOR_TYPE
)) && (((enum tree_code) (((contains_struct_check ((lhs_type
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4332, __FUNCTION__))->typed.type))->base.code) == REAL_TYPE
)))
|| FLOAT_TYPE_P (rhs_type)((((enum tree_code) (rhs_type)->base.code) == REAL_TYPE) ||
((((enum tree_code) (rhs_type)->base.code) == COMPLEX_TYPE
|| (((enum tree_code) (rhs_type)->base.code) == VECTOR_TYPE
)) && (((enum tree_code) (((contains_struct_check ((rhs_type
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4332, __FUNCTION__))->typed.type))->base.code) == REAL_TYPE
)))
));
4333 tree hold_call = NULL_TREE(tree) __null, clear_call = NULL_TREE(tree) __null, update_call = NULL_TREE(tree) __null;
4334 if (need_fenv)
4335 targetm.atomic_assign_expand_fenv (&hold_call, &clear_call, &update_call);
4336
4337 if (hold_call)
4338 add_stmt (hold_call);
4339
4340 /* loop: */
4341 add_stmt (loop_label);
4342
4343 /* newval = old + val; */
4344 if (rhs_type != rhs_semantic_type)
4345 val = build1 (EXCESS_PRECISION_EXPR, nonatomic_rhs_semantic_type, val);
4346 rhs = build_binary_op (loc, modifycode, old, val, true);
4347 if (TREE_CODE (rhs)((enum tree_code) (rhs)->base.code) == EXCESS_PRECISION_EXPR)
4348 {
4349 tree eptype = TREE_TYPE (rhs)((contains_struct_check ((rhs), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4349, __FUNCTION__))->typed.type)
;
4350 rhs = c_fully_fold (TREE_OPERAND (rhs, 0)(*((const_cast<tree*> (tree_operand_check ((rhs), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4350, __FUNCTION__)))))
, false, NULL__null);
4351 rhs = build1 (EXCESS_PRECISION_EXPR, eptype, rhs);
4352 }
4353 else
4354 rhs = c_fully_fold (rhs, false, NULL__null);
4355 rhs = convert_for_assignment (loc, UNKNOWN_LOCATION((location_t) 0), nonatomic_lhs_type,
4356 rhs, NULL_TREE(tree) __null, ic_assign, false, NULL_TREE(tree) __null,
4357 NULL_TREE(tree) __null, 0);
4358 if (rhs != error_mark_nodeglobal_trees[TI_ERROR_MARK])
4359 {
4360 rhs = build4 (TARGET_EXPR, nonatomic_lhs_type, newval, rhs, NULL_TREE(tree) __null,
4361 NULL_TREE(tree) __null);
4362 SET_EXPR_LOCATION (rhs, loc)(expr_check (((rhs)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4362, __FUNCTION__))->exp.locus = (loc)
;
4363 add_stmt (rhs);
4364 }
4365
4366 /* if (__atomic_compare_exchange (addr, &old, &new, false, SEQ_CST, SEQ_CST))
4367 goto done; */
4368 fndecl = builtin_decl_explicit (BUILT_IN_ATOMIC_COMPARE_EXCHANGE);
4369 params->quick_push (lhs_addr);
4370 params->quick_push (old_addr);
4371 params->quick_push (newval_addr);
4372 params->quick_push (integer_zero_nodeglobal_trees[TI_INTEGER_ZERO]);
4373 params->quick_push (seq_cst);
4374 params->quick_push (seq_cst);
4375 func_call = c_build_function_call_vec (loc, vNULL, fndecl, params, NULL__null);
4376
4377 goto_stmt = build1 (GOTO_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE], done_decl);
4378 SET_EXPR_LOCATION (goto_stmt, loc)(expr_check (((goto_stmt)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4378, __FUNCTION__))->exp.locus = (loc)
;
4379
4380 stmt = build3 (COND_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE], func_call, goto_stmt, NULL_TREE(tree) __null);
4381 SET_EXPR_LOCATION (stmt, loc)(expr_check (((stmt)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4381, __FUNCTION__))->exp.locus = (loc)
;
4382 add_stmt (stmt);
4383
4384 if (clear_call)
4385 add_stmt (clear_call);
4386
4387 /* goto loop; */
4388 goto_stmt = build1 (GOTO_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE], loop_decl);
4389 SET_EXPR_LOCATION (goto_stmt, loc)(expr_check (((goto_stmt)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4389, __FUNCTION__))->exp.locus = (loc)
;
4390 add_stmt (goto_stmt);
4391
4392 /* done: */
4393 add_stmt (done_label);
4394
4395 if (update_call)
4396 add_stmt (update_call);
4397
4398 /* Finish the compound statement. */
4399 compound_stmt = c_end_compound_stmt (loc, compound_stmt, false);
4400
4401 /* NEWVAL is the value that was successfully stored, return a
4402 COMPOUND_EXPR of the statement and the appropriate value. */
4403 return build2 (COMPOUND_EXPR, nonatomic_lhs_type, compound_stmt,
4404 return_old_p ? old : newval);
4405}
4406
4407/* Construct and perhaps optimize a tree representation
4408 for a unary operation. CODE, a tree_code, specifies the operation
4409 and XARG is the operand.
4410 For any CODE other than ADDR_EXPR, NOCONVERT suppresses the default
4411 promotions (such as from short to int).
4412 For ADDR_EXPR, the default promotions are not applied; NOCONVERT allows
4413 non-lvalues; this is only used to handle conversion of non-lvalue arrays
4414 to pointers in C99.
4415
4416 LOCATION is the location of the operator. */
4417
4418tree
4419build_unary_op (location_t location, enum tree_code code, tree xarg,
4420 bool noconvert)
4421{
4422 /* No default_conversion here. It causes trouble for ADDR_EXPR. */
4423 tree arg = xarg;
4424 tree argtype = NULL_TREE(tree) __null;
4425 enum tree_code typecode;
4426 tree val;
4427 tree ret = error_mark_nodeglobal_trees[TI_ERROR_MARK];
4428 tree eptype = NULL_TREE(tree) __null;
4429 const char *invalid_op_diag;
4430 bool int_operands;
4431
4432 int_operands = EXPR_INT_CONST_OPERANDS (xarg)((((enum tree_code) (((contains_struct_check ((xarg), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4432, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE
|| ((enum tree_code) (((contains_struct_check ((xarg), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4432, __FUNCTION__))->typed.type))->base.code) == BOOLEAN_TYPE
|| ((enum tree_code) (((contains_struct_check ((xarg), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4432, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE
) && (((enum tree_code) (xarg)->base.code) == INTEGER_CST
|| (((enum tree_code) (xarg)->base.code) == C_MAYBE_CONST_EXPR
&& ((tree_not_check2 (((tree_check ((xarg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4432, __FUNCTION__, (C_MAYBE_CONST_EXPR)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4432, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0))))
;
4433 if (int_operands)
4434 arg = remove_c_maybe_const_expr (arg);
4435
4436 if (code != ADDR_EXPR)
4437 arg = require_complete_type (location, arg);
4438
4439 typecode = TREE_CODE (TREE_TYPE (arg))((enum tree_code) (((contains_struct_check ((arg), (TS_TYPED)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4439, __FUNCTION__))->typed.type))->base.code)
;
4440 if (typecode == ERROR_MARK)
4441 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
4442 if (typecode == ENUMERAL_TYPE || typecode == BOOLEAN_TYPE)
4443 typecode = INTEGER_TYPE;
4444
4445 if ((invalid_op_diag
4446 = targetm.invalid_unary_op (code, TREE_TYPE (xarg)((contains_struct_check ((xarg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4446, __FUNCTION__))->typed.type)
)))
4447 {
4448 error_at (location, invalid_op_diag);
4449 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
4450 }
4451
4452 if (TREE_CODE (arg)((enum tree_code) (arg)->base.code) == EXCESS_PRECISION_EXPR)
4453 {
4454 eptype = TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4454, __FUNCTION__))->typed.type)
;
4455 arg = TREE_OPERAND (arg, 0)(*((const_cast<tree*> (tree_operand_check ((arg), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4455, __FUNCTION__)))))
;
4456 }
4457
4458 switch (code)
4459 {
4460 case CONVERT_EXPR:
4461 /* This is used for unary plus, because a CONVERT_EXPR
4462 is enough to prevent anybody from looking inside for
4463 associativity, but won't generate any code. */
4464 if (!(typecode == INTEGER_TYPE || typecode == REAL_TYPE
4465 || typecode == FIXED_POINT_TYPE || typecode == COMPLEX_TYPE
4466 || gnu_vector_type_p (TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4466, __FUNCTION__))->typed.type)
)))
4467 {
4468 error_at (location, "wrong type argument to unary plus");
4469 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
4470 }
4471 else if (!noconvert)
4472 arg = default_conversion (arg);
4473 arg = non_lvalue_loc (location, arg);
4474 break;
4475
4476 case NEGATE_EXPR:
4477 if (!(typecode == INTEGER_TYPE || typecode == REAL_TYPE
4478 || typecode == FIXED_POINT_TYPE || typecode == COMPLEX_TYPE
4479 || gnu_vector_type_p (TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4479, __FUNCTION__))->typed.type)
)))
4480 {
4481 error_at (location, "wrong type argument to unary minus");
4482 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
4483 }
4484 else if (!noconvert)
4485 arg = default_conversion (arg);
4486 break;
4487
4488 case BIT_NOT_EXPR:
4489 /* ~ works on integer types and non float vectors. */
4490 if (typecode == INTEGER_TYPE
4491 || (gnu_vector_type_p (TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4491, __FUNCTION__))->typed.type)
)
4492 && !VECTOR_FLOAT_TYPE_P (TREE_TYPE (arg))((((enum tree_code) (((contains_struct_check ((arg), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4492, __FUNCTION__))->typed.type))->base.code) == VECTOR_TYPE
) && ((enum tree_code) (((contains_struct_check ((((contains_struct_check
((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4492, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4492, __FUNCTION__))->typed.type))->base.code) == REAL_TYPE
)
))
4493 {
4494 tree e = arg;
4495
4496 /* Warn if the expression has boolean value. */
4497 while (TREE_CODE (e)((enum tree_code) (e)->base.code) == COMPOUND_EXPR)
4498 e = TREE_OPERAND (e, 1)(*((const_cast<tree*> (tree_operand_check ((e), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4498, __FUNCTION__)))))
;
4499
4500 if ((TREE_CODE (TREE_TYPE (arg))((enum tree_code) (((contains_struct_check ((arg), (TS_TYPED)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4500, __FUNCTION__))->typed.type))->base.code)
== BOOLEAN_TYPE
4501 || truth_value_p (TREE_CODE (e)((enum tree_code) (e)->base.code))))
4502 {
4503 auto_diagnostic_group d;
4504 if (warning_at (location, OPT_Wbool_operation,
4505 "%<~%> on a boolean expression"))
4506 {
4507 gcc_rich_location richloc (location);
4508 richloc.add_fixit_insert_before (location, "!");
4509 inform (&richloc, "did you mean to use logical not?");
4510 }
4511 }
4512 if (!noconvert)
4513 arg = default_conversion (arg);
4514 }
4515 else if (typecode == COMPLEX_TYPE)
4516 {
4517 code = CONJ_EXPR;
4518 pedwarn (location, OPT_Wpedantic,
4519 "ISO C does not support %<~%> for complex conjugation");
4520 if (!noconvert)
4521 arg = default_conversion (arg);
4522 }
4523 else
4524 {
4525 error_at (location, "wrong type argument to bit-complement");
4526 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
4527 }
4528 break;
4529
4530 case ABS_EXPR:
4531 if (!(typecode == INTEGER_TYPE || typecode == REAL_TYPE))
4532 {
4533 error_at (location, "wrong type argument to abs");
4534 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
4535 }
4536 else if (!noconvert)
4537 arg = default_conversion (arg);
4538 break;
4539
4540 case ABSU_EXPR:
4541 if (!(typecode == INTEGER_TYPE))
4542 {
4543 error_at (location, "wrong type argument to absu");
4544 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
4545 }
4546 else if (!noconvert)
4547 arg = default_conversion (arg);
4548 break;
4549
4550 case CONJ_EXPR:
4551 /* Conjugating a real value is a no-op, but allow it anyway. */
4552 if (!(typecode == INTEGER_TYPE || typecode == REAL_TYPE
4553 || typecode == COMPLEX_TYPE))
4554 {
4555 error_at (location, "wrong type argument to conjugation");
4556 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
4557 }
4558 else if (!noconvert)
4559 arg = default_conversion (arg);
4560 break;
4561
4562 case TRUTH_NOT_EXPR:
4563 if (typecode != INTEGER_TYPE && typecode != FIXED_POINT_TYPE
4564 && typecode != REAL_TYPE && typecode != POINTER_TYPE
4565 && typecode != COMPLEX_TYPE)
4566 {
4567 error_at (location,
4568 "wrong type argument to unary exclamation mark");
4569 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
4570 }
4571 if (int_operands)
4572 {
4573 arg = c_objc_common_truthvalue_conversion (location, xarg);
4574 arg = remove_c_maybe_const_expr (arg);
4575 }
4576 else
4577 arg = c_objc_common_truthvalue_conversion (location, arg);
4578 ret = invert_truthvalue_loc (location, arg);
4579 /* If the TRUTH_NOT_EXPR has been folded, reset the location. */
4580 if (EXPR_P (ret)((tree_code_type[(int) (((enum tree_code) (ret)->base.code
))]) >= tcc_reference && (tree_code_type[(int) (((
enum tree_code) (ret)->base.code))]) <= tcc_expression)
&& EXPR_HAS_LOCATION (ret)(((IS_ADHOC_LOC (((((ret)) && ((tree_code_type[(int) (
((enum tree_code) ((ret))->base.code))]) >= tcc_reference
&& (tree_code_type[(int) (((enum tree_code) ((ret))->
base.code))]) <= tcc_expression)) ? (ret)->exp.locus : (
(location_t) 0)))) ? get_location_from_adhoc_loc (line_table,
((((ret)) && ((tree_code_type[(int) (((enum tree_code
) ((ret))->base.code))]) >= tcc_reference && (tree_code_type
[(int) (((enum tree_code) ((ret))->base.code))]) <= tcc_expression
)) ? (ret)->exp.locus : ((location_t) 0))) : (((((ret)) &&
((tree_code_type[(int) (((enum tree_code) ((ret))->base.code
))]) >= tcc_reference && (tree_code_type[(int) (((
enum tree_code) ((ret))->base.code))]) <= tcc_expression
)) ? (ret)->exp.locus : ((location_t) 0)))) != ((location_t
) 0))
)
4581 location = EXPR_LOCATION (ret)((((ret)) && ((tree_code_type[(int) (((enum tree_code
) ((ret))->base.code))]) >= tcc_reference && (tree_code_type
[(int) (((enum tree_code) ((ret))->base.code))]) <= tcc_expression
)) ? (ret)->exp.locus : ((location_t) 0))
;
4582 goto return_build_unary_op;
4583
4584 case REALPART_EXPR:
4585 case IMAGPART_EXPR:
4586 ret = build_real_imag_expr (location, code, arg);
4587 if (ret == error_mark_nodeglobal_trees[TI_ERROR_MARK])
4588 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
4589 if (eptype && TREE_CODE (eptype)((enum tree_code) (eptype)->base.code) == COMPLEX_TYPE)
4590 eptype = TREE_TYPE (eptype)((contains_struct_check ((eptype), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4590, __FUNCTION__))->typed.type)
;
4591 goto return_build_unary_op;
4592
4593 case PREINCREMENT_EXPR:
4594 case POSTINCREMENT_EXPR:
4595 case PREDECREMENT_EXPR:
4596 case POSTDECREMENT_EXPR:
4597
4598 if (TREE_CODE (arg)((enum tree_code) (arg)->base.code) == C_MAYBE_CONST_EXPR)
4599 {
4600 tree inner = build_unary_op (location, code,
4601 C_MAYBE_CONST_EXPR_EXPR (arg)(*((const_cast<tree*> (tree_operand_check (((tree_check
((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4601, __FUNCTION__, (C_MAYBE_CONST_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4601, __FUNCTION__)))))
,
4602 noconvert);
4603 if (inner == error_mark_nodeglobal_trees[TI_ERROR_MARK])
4604 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
4605 ret = build2 (C_MAYBE_CONST_EXPR, TREE_TYPE (inner)((contains_struct_check ((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4605, __FUNCTION__))->typed.type)
,
4606 C_MAYBE_CONST_EXPR_PRE (arg)(*((const_cast<tree*> (tree_operand_check (((tree_check
((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4606, __FUNCTION__, (C_MAYBE_CONST_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4606, __FUNCTION__)))))
, inner);
4607 gcc_assert (!C_MAYBE_CONST_EXPR_INT_OPERANDS (arg))((void)(!(!((tree_not_check2 (((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4607, __FUNCTION__, (C_MAYBE_CONST_EXPR)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4607, __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/c/c-typeck.c"
, 4607, __FUNCTION__), 0 : 0))
;
4608 C_MAYBE_CONST_EXPR_NON_CONST (ret)((tree_not_check2 (((tree_check ((ret), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4608, __FUNCTION__, (C_MAYBE_CONST_EXPR)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4608, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)
= 1;
4609 goto return_build_unary_op;
4610 }
4611
4612 /* Complain about anything that is not a true lvalue. In
4613 Objective-C, skip this check for property_refs. */
4614 if (!objc_is_property_ref (arg)
4615 && !lvalue_or_else (location,
4616 arg, ((code == PREINCREMENT_EXPR
4617 || code == POSTINCREMENT_EXPR)
4618 ? lv_increment
4619 : lv_decrement)))
4620 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
4621
4622 if (warn_cxx_compatglobal_options.x_warn_cxx_compat && TREE_CODE (TREE_TYPE (arg))((enum tree_code) (((contains_struct_check ((arg), (TS_TYPED)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4622, __FUNCTION__))->typed.type))->base.code)
== ENUMERAL_TYPE)
4623 {
4624 if (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR)
4625 warning_at (location, OPT_Wc___compat,
4626 "increment of enumeration value is invalid in C++");
4627 else
4628 warning_at (location, OPT_Wc___compat,
4629 "decrement of enumeration value is invalid in C++");
4630 }
4631
4632 if (TREE_CODE (TREE_TYPE (arg))((enum tree_code) (((contains_struct_check ((arg), (TS_TYPED)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4632, __FUNCTION__))->typed.type))->base.code)
== BOOLEAN_TYPE)
4633 {
4634 if (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR)
4635 warning_at (location, OPT_Wbool_operation,
4636 "increment of a boolean expression");
4637 else
4638 warning_at (location, OPT_Wbool_operation,
4639 "decrement of a boolean expression");
4640 }
4641
4642 /* Ensure the argument is fully folded inside any SAVE_EXPR. */
4643 arg = c_fully_fold (arg, false, NULL__null, true);
4644
4645 bool atomic_op;
4646 atomic_op = really_atomic_lvalue (arg);
4647
4648 /* Increment or decrement the real part of the value,
4649 and don't change the imaginary part. */
4650 if (typecode == COMPLEX_TYPE)
4651 {
4652 tree real, imag;
4653
4654 pedwarn (location, OPT_Wpedantic,
4655 "ISO C does not support %<++%> and %<--%> on complex types");
4656
4657 if (!atomic_op)
4658 {
4659 arg = stabilize_reference (arg);
4660 real = build_unary_op (EXPR_LOCATION (arg)((((arg)) && ((tree_code_type[(int) (((enum tree_code
) ((arg))->base.code))]) >= tcc_reference && (tree_code_type
[(int) (((enum tree_code) ((arg))->base.code))]) <= tcc_expression
)) ? (arg)->exp.locus : ((location_t) 0))
, REALPART_EXPR, arg,
4661 true);
4662 imag = build_unary_op (EXPR_LOCATION (arg)((((arg)) && ((tree_code_type[(int) (((enum tree_code
) ((arg))->base.code))]) >= tcc_reference && (tree_code_type
[(int) (((enum tree_code) ((arg))->base.code))]) <= tcc_expression
)) ? (arg)->exp.locus : ((location_t) 0))
, IMAGPART_EXPR, arg,
4663 true);
4664 real = build_unary_op (EXPR_LOCATION (arg)((((arg)) && ((tree_code_type[(int) (((enum tree_code
) ((arg))->base.code))]) >= tcc_reference && (tree_code_type
[(int) (((enum tree_code) ((arg))->base.code))]) <= tcc_expression
)) ? (arg)->exp.locus : ((location_t) 0))
, code, real, true);
4665 if (real == error_mark_nodeglobal_trees[TI_ERROR_MARK] || imag == error_mark_nodeglobal_trees[TI_ERROR_MARK])
4666 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
4667 ret = build2 (COMPLEX_EXPR, TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4667, __FUNCTION__))->typed.type)
,
4668 real, imag);
4669 goto return_build_unary_op;
4670 }
4671 }
4672
4673 /* Report invalid types. */
4674
4675 if (typecode != POINTER_TYPE && typecode != FIXED_POINT_TYPE
4676 && typecode != INTEGER_TYPE && typecode != REAL_TYPE
4677 && typecode != COMPLEX_TYPE
4678 && !gnu_vector_type_p (TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4678, __FUNCTION__))->typed.type)
))
4679 {
4680 if (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR)
4681 error_at (location, "wrong type argument to increment");
4682 else
4683 error_at (location, "wrong type argument to decrement");
4684
4685 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
4686 }
4687
4688 {
4689 tree inc;
4690
4691 argtype = TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4691, __FUNCTION__))->typed.type)
;
4692
4693 /* Compute the increment. */
4694
4695 if (typecode == POINTER_TYPE)
4696 {
4697 /* If pointer target is an incomplete type,
4698 we just cannot know how to do the arithmetic. */
4699 if (!COMPLETE_OR_VOID_TYPE_P (TREE_TYPE (argtype))((((tree_class_check ((((contains_struct_check ((argtype), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4699, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4699, __FUNCTION__))->type_common.size) != (tree) __null
) || (((enum tree_code) (((contains_struct_check ((argtype), (
TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4699, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
))
)
4700 {
4701 if (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR)
4702 error_at (location,
4703 "increment of pointer to an incomplete type %qT",
4704 TREE_TYPE (argtype)((contains_struct_check ((argtype), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4704, __FUNCTION__))->typed.type)
);
4705 else
4706 error_at (location,
4707 "decrement of pointer to an incomplete type %qT",
4708 TREE_TYPE (argtype)((contains_struct_check ((argtype), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4708, __FUNCTION__))->typed.type)
);
4709 }
4710 else if (TREE_CODE (TREE_TYPE (argtype))((enum tree_code) (((contains_struct_check ((argtype), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4710, __FUNCTION__))->typed.type))->base.code)
== FUNCTION_TYPE
4711 || TREE_CODE (TREE_TYPE (argtype))((enum tree_code) (((contains_struct_check ((argtype), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4711, __FUNCTION__))->typed.type))->base.code)
== VOID_TYPE)
4712 {
4713 if (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR)
4714 pedwarn (location, OPT_Wpointer_arith,
4715 "wrong type argument to increment");
4716 else
4717 pedwarn (location, OPT_Wpointer_arith,
4718 "wrong type argument to decrement");
4719 }
4720 else
4721 verify_type_context (location, TCTX_POINTER_ARITH,
4722 TREE_TYPE (argtype)((contains_struct_check ((argtype), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4722, __FUNCTION__))->typed.type)
);
4723
4724 inc = c_size_in_bytes (TREE_TYPE (argtype)((contains_struct_check ((argtype), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4724, __FUNCTION__))->typed.type)
);
4725 inc = convert_to_ptrofftype_loc (location, inc);
4726 }
4727 else if (FRACT_MODE_P (TYPE_MODE (argtype))(((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check
((argtype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4727, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(argtype) : (argtype)->type_common.mode)]) == MODE_FRACT ||
((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check
((argtype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c/c-typeck.c"
, 4727, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(argtype) : (argtype)->type_common.mode)]) == MODE_VECTOR_FRACT
)
)
4728 {
4729 /* For signed fract types, we invert ++ to -- or
4730 -- to ++, and change inc from 1 to -1, because
4731 it is not possible to represent 1 in signed fract constants.
4732 For unsigned fract types, the result always overflows and
4733 we get an undefined (original) or the maximum value. */
4734 if (code == PREINCREMENT_EXPR)
4735 code = PREDECREMENT_EXPR;
4736 else if (code == PREDECREMENT_EXPR)
4737 code = PREINCREMENT_EXPR;
4738 else if (code == POSTINCREMENT_EXPR)
4739 code = POSTDECREMENT_EXPR;
4740 else /* code == POSTDECREMENT_EXPR */
4741 code = POSTINCREMENT_EXPR;
4742
4743 inc = integer_minus_one_nodeglobal_trees[TI_INTEGER_MINUS_ONE];
4744