Bug Summary

File:build/gcc/c-family/c-common.c
Warning:line 1228, column 29
Division by zero

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-common.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_FRONTEND -D IN_GCC -D HAVE_CONFIG_H -I . -I c-family -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-family -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-rL2PVx.plist -x c++ /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c

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

1/* Subroutines shared by all languages that are variants of C.
2 Copyright (C) 1992-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#define GCC_C_COMMON_C
21
22#include "config.h"
23#include "system.h"
24#include "coretypes.h"
25#include "target.h"
26#include "function.h"
27#include "tree.h"
28#include "memmodel.h"
29#include "c-common.h"
30#include "gimple-expr.h"
31#include "tm_p.h"
32#include "stringpool.h"
33#include "cgraph.h"
34#include "diagnostic.h"
35#include "intl.h"
36#include "stor-layout.h"
37#include "calls.h"
38#include "attribs.h"
39#include "varasm.h"
40#include "trans-mem.h"
41#include "c-objc.h"
42#include "common/common-target.h"
43#include "langhooks.h"
44#include "tree-inline.h"
45#include "toplev.h"
46#include "tree-iterator.h"
47#include "opts.h"
48#include "gimplify.h"
49#include "substring-locations.h"
50#include "spellcheck.h"
51#include "c-spellcheck.h"
52#include "selftest.h"
53#include "debug.h"
54#include "tree-vector-builder.h"
55#include "vec-perm-indices.h"
56
57cpp_reader *parse_in; /* Declared in c-pragma.h. */
58
59/* Mode used to build pointers (VOIDmode means ptr_mode). */
60
61machine_mode c_default_pointer_mode = VOIDmode((void) 0, E_VOIDmode);
62
63/* The following symbols are subsumed in the c_global_trees array, and
64 listed here individually for documentation purposes.
65
66 INTEGER_TYPE and REAL_TYPE nodes for the standard data types.
67
68 tree short_integer_type_node;
69 tree long_integer_type_node;
70 tree long_long_integer_type_node;
71
72 tree short_unsigned_type_node;
73 tree long_unsigned_type_node;
74 tree long_long_unsigned_type_node;
75
76 tree truthvalue_type_node;
77 tree truthvalue_false_node;
78 tree truthvalue_true_node;
79
80 tree ptrdiff_type_node;
81
82 tree unsigned_char_type_node;
83 tree signed_char_type_node;
84 tree wchar_type_node;
85
86 tree char8_type_node;
87 tree char16_type_node;
88 tree char32_type_node;
89
90 tree float_type_node;
91 tree double_type_node;
92 tree long_double_type_node;
93
94 tree complex_integer_type_node;
95 tree complex_float_type_node;
96 tree complex_double_type_node;
97 tree complex_long_double_type_node;
98
99 tree dfloat32_type_node;
100 tree dfloat64_type_node;
101 tree_dfloat128_type_node;
102
103 tree intQI_type_node;
104 tree intHI_type_node;
105 tree intSI_type_node;
106 tree intDI_type_node;
107 tree intTI_type_node;
108
109 tree unsigned_intQI_type_node;
110 tree unsigned_intHI_type_node;
111 tree unsigned_intSI_type_node;
112 tree unsigned_intDI_type_node;
113 tree unsigned_intTI_type_node;
114
115 tree widest_integer_literal_type_node;
116 tree widest_unsigned_literal_type_node;
117
118 Nodes for types `void *' and `const void *'.
119
120 tree ptr_type_node, const_ptr_type_node;
121
122 Nodes for types `char *' and `const char *'.
123
124 tree string_type_node, const_string_type_node;
125
126 Type `char[SOMENUMBER]'.
127 Used when an array of char is needed and the size is irrelevant.
128
129 tree char_array_type_node;
130
131 Type `wchar_t[SOMENUMBER]' or something like it.
132 Used when a wide string literal is created.
133
134 tree wchar_array_type_node;
135
136 Type `char8_t[SOMENUMBER]' or something like it.
137 Used when a UTF-8 string literal is created.
138
139 tree char8_array_type_node;
140
141 Type `char16_t[SOMENUMBER]' or something like it.
142 Used when a UTF-16 string literal is created.
143
144 tree char16_array_type_node;
145
146 Type `char32_t[SOMENUMBER]' or something like it.
147 Used when a UTF-32 string literal is created.
148
149 tree char32_array_type_node;
150
151 Type `int ()' -- used for implicit declaration of functions.
152
153 tree default_function_type;
154
155 A VOID_TYPE node, packaged in a TREE_LIST.
156
157 tree void_list_node;
158
159 The lazily created VAR_DECLs for __FUNCTION__, __PRETTY_FUNCTION__,
160 and __func__. (C doesn't generate __FUNCTION__ and__PRETTY_FUNCTION__
161 VAR_DECLS, but C++ does.)
162
163 tree function_name_decl_node;
164 tree pretty_function_name_decl_node;
165 tree c99_function_name_decl_node;
166
167 Stack of nested function name VAR_DECLs.
168
169 tree saved_function_name_decls;
170
171*/
172
173tree c_global_trees[CTI_MAX];
174
175/* Switches common to the C front ends. */
176
177/* Nonzero means don't output line number information. */
178
179char flag_no_line_commands;
180
181/* Nonzero causes -E output not to be done, but directives such as
182 #define that have side effects are still obeyed. */
183
184char flag_no_output;
185
186/* Nonzero means dump macros in some fashion. */
187
188char flag_dump_macros;
189
190/* Nonzero means pass #include lines through to the output. */
191
192char flag_dump_includes;
193
194/* Nonzero means process PCH files while preprocessing. */
195
196bool flag_pch_preprocess;
197
198/* The file name to which we should write a precompiled header, or
199 NULL if no header will be written in this compile. */
200
201const char *pch_file;
202
203/* Nonzero if an ISO standard was selected. It rejects macros in the
204 user's namespace. */
205int flag_iso;
206
207/* C/ObjC language option variables. */
208
209
210/* Nonzero means allow type mismatches in conditional expressions;
211 just make their values `void'. */
212
213int flag_cond_mismatch;
214
215/* Nonzero means enable C89 Amendment 1 features. */
216
217int flag_isoc94;
218
219/* Nonzero means use the ISO C99 (or C11) dialect of C. */
220
221int flag_isoc99;
222
223/* Nonzero means use the ISO C11 dialect of C. */
224
225int flag_isoc11;
226
227/* Nonzero means use the ISO C2X dialect of C. */
228
229int flag_isoc2x;
230
231/* Nonzero means that we have builtin functions, and main is an int. */
232
233int flag_hosted = 1;
234
235
236/* ObjC language option variables. */
237
238
239/* Tells the compiler that this is a special run. Do not perform any
240 compiling, instead we are to test some platform dependent features
241 and output a C header file with appropriate definitions. */
242
243int print_struct_values;
244
245/* Tells the compiler what is the constant string class for ObjC. */
246
247const char *constant_string_class_name;
248
249
250/* C++ language option variables. */
251
252/* The reference version of the ABI for -Wabi. */
253
254int warn_abi_version = -1;
255
256/* The C++ dialect being used. Default set in c_common_post_options. */
257
258enum cxx_dialect cxx_dialect = cxx_unset;
259
260/* Maximum template instantiation depth. This limit exists to limit the
261 time it takes to notice excessively recursive template instantiations.
262
263 The default is lower than the 1024 recommended by the C++0x standard
264 because G++ runs out of stack before 1024 with highly recursive template
265 argument deduction substitution (g++.dg/cpp0x/enum11.C). */
266
267int max_tinst_depth = 900;
268
269/* The elements of `ridpointers' are identifier nodes for the reserved
270 type names and storage classes. It is indexed by a RID_... value. */
271tree *ridpointers;
272
273tree (*make_fname_decl) (location_t, tree, int);
274
275/* Nonzero means don't warn about problems that occur when the code is
276 executed. */
277int c_inhibit_evaluation_warnings;
278
279/* Whether we are building a boolean conversion inside
280 convert_for_assignment, or some other late binary operation. If
281 build_binary_op is called for C (from code shared by C and C++) in
282 this case, then the operands have already been folded and the
283 result will not be folded again, so C_MAYBE_CONST_EXPR should not
284 be generated. */
285bool in_late_binary_op;
286
287/* Whether lexing has been completed, so subsequent preprocessor
288 errors should use the compiler's input_location. */
289bool done_lexing = false;
290
291/* Information about how a function name is generated. */
292struct fname_var_t
293{
294 tree *const decl; /* pointer to the VAR_DECL. */
295 const unsigned rid; /* RID number for the identifier. */
296 const int pretty; /* How pretty is it? */
297};
298
299/* The three ways of getting then name of the current function. */
300
301const struct fname_var_t fname_vars[] =
302{
303 /* C99 compliant __func__, must be first. */
304 {&c99_function_name_decl_nodec_global_trees[CTI_C99_FUNCTION_NAME_DECL], RID_C99_FUNCTION_NAME, 0},
305 /* GCC __FUNCTION__ compliant. */
306 {&function_name_decl_nodec_global_trees[CTI_FUNCTION_NAME_DECL], RID_FUNCTION_NAME, 0},
307 /* GCC __PRETTY_FUNCTION__ compliant. */
308 {&pretty_function_name_decl_nodec_global_trees[CTI_PRETTY_FUNCTION_NAME_DECL], RID_PRETTY_FUNCTION_NAME, 1},
309 {NULL__null, 0, 0},
310};
311
312/* Global visibility options. */
313struct visibility_flags visibility_options;
314
315static tree check_case_value (location_t, tree);
316
317
318static void check_nonnull_arg (void *, tree, unsigned HOST_WIDE_INTlong);
319static bool nonnull_check_p (tree, unsigned HOST_WIDE_INTlong);
320
321/* Reserved words. The third field is a mask: keywords are disabled
322 if they match the mask.
323
324 Masks for languages:
325 C --std=c89: D_C99 | D_CXXONLY | D_OBJC | D_CXX_OBJC
326 C --std=c99: D_CXXONLY | D_OBJC
327 ObjC is like C except that D_OBJC and D_CXX_OBJC are not set
328 C++ --std=c++98: D_CONLY | D_CXX11 | D_CXX20 | D_OBJC
329 C++ --std=c++11: D_CONLY | D_CXX20 | D_OBJC
330 C++ --std=c++20: D_CONLY | D_OBJC
331 ObjC++ is like C++ except that D_OBJC is not set
332
333 If -fno-asm is used, D_ASM is added to the mask. If
334 -fno-gnu-keywords is used, D_EXT is added. If -fno-asm and C in
335 C89 mode, D_EXT89 is added for both -fno-asm and -fno-gnu-keywords.
336 In C with -Wc++-compat, we warn if D_CXXWARN is set.
337
338 Note the complication of the D_CXX_OBJC keywords. These are
339 reserved words such as 'class'. In C++, 'class' is a reserved
340 word. In Objective-C++ it is too. In Objective-C, it is a
341 reserved word too, but only if it follows an '@' sign.
342*/
343const struct c_common_resword c_common_reswords[] =
344{
345 { "_Alignas", RID_ALIGNAS, D_CONLY0x0001 },
346 { "_Alignof", RID_ALIGNOF, D_CONLY0x0001 },
347 { "_Atomic", RID_ATOMIC, D_CONLY0x0001 },
348 { "_Bool", RID_BOOL, D_CONLY0x0001 },
349 { "_Complex", RID_COMPLEX, 0 },
350 { "_Imaginary", RID_IMAGINARY, D_CONLY0x0001 },
351 { "_Float16", RID_FLOAT16, D_CONLY0x0001 },
352 { "_Float32", RID_FLOAT32, D_CONLY0x0001 },
353 { "_Float64", RID_FLOAT64, D_CONLY0x0001 },
354 { "_Float128", RID_FLOAT128, D_CONLY0x0001 },
355 { "_Float32x", RID_FLOAT32X, D_CONLY0x0001 },
356 { "_Float64x", RID_FLOAT64X, D_CONLY0x0001 },
357 { "_Float128x", RID_FLOAT128X, D_CONLY0x0001 },
358 { "_Decimal32", RID_DFLOAT32, D_CONLY0x0001 },
359 { "_Decimal64", RID_DFLOAT64, D_CONLY0x0001 },
360 { "_Decimal128", RID_DFLOAT128, D_CONLY0x0001 },
361 { "_Fract", RID_FRACT, D_CONLY0x0001 | D_EXT0x0010 },
362 { "_Accum", RID_ACCUM, D_CONLY0x0001 | D_EXT0x0010 },
363 { "_Sat", RID_SAT, D_CONLY0x0001 | D_EXT0x0010 },
364 { "_Static_assert", RID_STATIC_ASSERT, D_CONLY0x0001 },
365 { "_Noreturn", RID_NORETURN, D_CONLY0x0001 },
366 { "_Generic", RID_GENERIC, D_CONLY0x0001 },
367 { "_Thread_local", RID_THREAD, D_CONLY0x0001 },
368 { "__FUNCTION__", RID_FUNCTION_NAME, 0 },
369 { "__PRETTY_FUNCTION__", RID_PRETTY_FUNCTION_NAME, 0 },
370 { "__alignof", RID_ALIGNOF, 0 },
371 { "__alignof__", RID_ALIGNOF, 0 },
372 { "__asm", RID_ASM, 0 },
373 { "__asm__", RID_ASM, 0 },
374 { "__attribute", RID_ATTRIBUTE, 0 },
375 { "__attribute__", RID_ATTRIBUTE, 0 },
376 { "__auto_type", RID_AUTO_TYPE, D_CONLY0x0001 },
377 { "__bases", RID_BASES, D_CXXONLY0x0002 },
378 { "__builtin_addressof", RID_ADDRESSOF, D_CXXONLY0x0002 },
379 { "__builtin_bit_cast", RID_BUILTIN_BIT_CAST, D_CXXONLY0x0002 },
380 { "__builtin_call_with_static_chain",
381 RID_BUILTIN_CALL_WITH_STATIC_CHAIN, D_CONLY0x0001 },
382 { "__builtin_choose_expr", RID_CHOOSE_EXPR, D_CONLY0x0001 },
383 { "__builtin_complex", RID_BUILTIN_COMPLEX, D_CONLY0x0001 },
384 { "__builtin_convertvector", RID_BUILTIN_CONVERTVECTOR, 0 },
385 { "__builtin_has_attribute", RID_BUILTIN_HAS_ATTRIBUTE, 0 },
386 { "__builtin_launder", RID_BUILTIN_LAUNDER, D_CXXONLY0x0002 },
387 { "__builtin_assoc_barrier", RID_BUILTIN_ASSOC_BARRIER, 0 },
388 { "__builtin_shuffle", RID_BUILTIN_SHUFFLE, 0 },
389 { "__builtin_shufflevector", RID_BUILTIN_SHUFFLEVECTOR, 0 },
390 { "__builtin_tgmath", RID_BUILTIN_TGMATH, D_CONLY0x0001 },
391 { "__builtin_offsetof", RID_OFFSETOF, 0 },
392 { "__builtin_types_compatible_p", RID_TYPES_COMPATIBLE_P, D_CONLY0x0001 },
393 { "__builtin_va_arg", RID_VA_ARG, 0 },
394 { "__complex", RID_COMPLEX, 0 },
395 { "__complex__", RID_COMPLEX, 0 },
396 { "__const", RID_CONST, 0 },
397 { "__const__", RID_CONST, 0 },
398 { "__constinit", RID_CONSTINIT, D_CXXONLY0x0002 },
399 { "__decltype", RID_DECLTYPE, D_CXXONLY0x0002 },
400 { "__direct_bases", RID_DIRECT_BASES, D_CXXONLY0x0002 },
401 { "__extension__", RID_EXTENSION, 0 },
402 { "__func__", RID_C99_FUNCTION_NAME, 0 },
403 { "__has_nothrow_assign", RID_HAS_NOTHROW_ASSIGN, D_CXXONLY0x0002 },
404 { "__has_nothrow_constructor", RID_HAS_NOTHROW_CONSTRUCTOR, D_CXXONLY0x0002 },
405 { "__has_nothrow_copy", RID_HAS_NOTHROW_COPY, D_CXXONLY0x0002 },
406 { "__has_trivial_assign", RID_HAS_TRIVIAL_ASSIGN, D_CXXONLY0x0002 },
407 { "__has_trivial_constructor", RID_HAS_TRIVIAL_CONSTRUCTOR, D_CXXONLY0x0002 },
408 { "__has_trivial_copy", RID_HAS_TRIVIAL_COPY, D_CXXONLY0x0002 },
409 { "__has_trivial_destructor", RID_HAS_TRIVIAL_DESTRUCTOR, D_CXXONLY0x0002 },
410 { "__has_unique_object_representations", RID_HAS_UNIQUE_OBJ_REPRESENTATIONS,
411 D_CXXONLY0x0002 },
412 { "__has_virtual_destructor", RID_HAS_VIRTUAL_DESTRUCTOR, D_CXXONLY0x0002 },
413 { "__imag", RID_IMAGPART, 0 },
414 { "__imag__", RID_IMAGPART, 0 },
415 { "__inline", RID_INLINE, 0 },
416 { "__inline__", RID_INLINE, 0 },
417 { "__is_abstract", RID_IS_ABSTRACT, D_CXXONLY0x0002 },
418 { "__is_aggregate", RID_IS_AGGREGATE, D_CXXONLY0x0002 },
419 { "__is_base_of", RID_IS_BASE_OF, D_CXXONLY0x0002 },
420 { "__is_class", RID_IS_CLASS, D_CXXONLY0x0002 },
421 { "__is_empty", RID_IS_EMPTY, D_CXXONLY0x0002 },
422 { "__is_enum", RID_IS_ENUM, D_CXXONLY0x0002 },
423 { "__is_final", RID_IS_FINAL, D_CXXONLY0x0002 },
424 { "__is_layout_compatible", RID_IS_LAYOUT_COMPATIBLE, D_CXXONLY0x0002 },
425 { "__is_literal_type", RID_IS_LITERAL_TYPE, D_CXXONLY0x0002 },
426 { "__is_pointer_interconvertible_base_of",
427 RID_IS_POINTER_INTERCONVERTIBLE_BASE_OF, D_CXXONLY0x0002 },
428 { "__is_pod", RID_IS_POD, D_CXXONLY0x0002 },
429 { "__is_polymorphic", RID_IS_POLYMORPHIC, D_CXXONLY0x0002 },
430 { "__is_same", RID_IS_SAME_AS, D_CXXONLY0x0002 },
431 { "__is_same_as", RID_IS_SAME_AS, D_CXXONLY0x0002 },
432 { "__is_standard_layout", RID_IS_STD_LAYOUT, D_CXXONLY0x0002 },
433 { "__is_trivial", RID_IS_TRIVIAL, D_CXXONLY0x0002 },
434 { "__is_trivially_assignable", RID_IS_TRIVIALLY_ASSIGNABLE, D_CXXONLY0x0002 },
435 { "__is_trivially_constructible", RID_IS_TRIVIALLY_CONSTRUCTIBLE, D_CXXONLY0x0002 },
436 { "__is_trivially_copyable", RID_IS_TRIVIALLY_COPYABLE, D_CXXONLY0x0002 },
437 { "__is_union", RID_IS_UNION, D_CXXONLY0x0002 },
438 { "__label__", RID_LABEL, 0 },
439 { "__null", RID_NULL, 0 },
440 { "__real", RID_REALPART, 0 },
441 { "__real__", RID_REALPART, 0 },
442 { "__restrict", RID_RESTRICT, 0 },
443 { "__restrict__", RID_RESTRICT, 0 },
444 { "__signed", RID_SIGNED, 0 },
445 { "__signed__", RID_SIGNED, 0 },
446 { "__thread", RID_THREAD, 0 },
447 { "__transaction_atomic", RID_TRANSACTION_ATOMIC, 0 },
448 { "__transaction_relaxed", RID_TRANSACTION_RELAXED, 0 },
449 { "__transaction_cancel", RID_TRANSACTION_CANCEL, 0 },
450 { "__typeof", RID_TYPEOF, 0 },
451 { "__typeof__", RID_TYPEOF, 0 },
452 { "__underlying_type", RID_UNDERLYING_TYPE, D_CXXONLY0x0002 },
453 { "__volatile", RID_VOLATILE, 0 },
454 { "__volatile__", RID_VOLATILE, 0 },
455 { "__GIMPLE", RID_GIMPLE, D_CONLY0x0001 },
456 { "__PHI", RID_PHI, D_CONLY0x0001 },
457 { "__RTL", RID_RTL, D_CONLY0x0001 },
458 { "alignas", RID_ALIGNAS, D_CXXONLY0x0002 | D_CXX110x0008 | D_CXXWARN0x0200 },
459 { "alignof", RID_ALIGNOF, D_CXXONLY0x0002 | D_CXX110x0008 | D_CXXWARN0x0200 },
460 { "asm", RID_ASM, D_ASM0x0040 },
461 { "auto", RID_AUTO, 0 },
462 { "bool", RID_BOOL, D_CXXONLY0x0002 | D_CXXWARN0x0200 },
463 { "break", RID_BREAK, 0 },
464 { "case", RID_CASE, 0 },
465 { "catch", RID_CATCH, D_CXX_OBJC0x0100 | D_CXXWARN0x0200 },
466 { "char", RID_CHAR, 0 },
467 { "char8_t", RID_CHAR8, D_CXX_CHAR8_T_FLAGS0x0002 | 0X1000 | D_CXXWARN0x0200 },
468 { "char16_t", RID_CHAR16, D_CXXONLY0x0002 | D_CXX110x0008 | D_CXXWARN0x0200 },
469 { "char32_t", RID_CHAR32, D_CXXONLY0x0002 | D_CXX110x0008 | D_CXXWARN0x0200 },
470 { "class", RID_CLASS, D_CXX_OBJC0x0100 | D_CXXWARN0x0200 },
471 { "const", RID_CONST, 0 },
472 { "consteval", RID_CONSTEVAL, D_CXXONLY0x0002 | D_CXX200x2000 | D_CXXWARN0x0200 },
473 { "constexpr", RID_CONSTEXPR, D_CXXONLY0x0002 | D_CXX110x0008 | D_CXXWARN0x0200 },
474 { "constinit", RID_CONSTINIT, D_CXXONLY0x0002 | D_CXX200x2000 | D_CXXWARN0x0200 },
475 { "const_cast", RID_CONSTCAST, D_CXXONLY0x0002 | D_CXXWARN0x0200 },
476 { "continue", RID_CONTINUE, 0 },
477 { "decltype", RID_DECLTYPE, D_CXXONLY0x0002 | D_CXX110x0008 | D_CXXWARN0x0200 },
478 { "default", RID_DEFAULT, 0 },
479 { "delete", RID_DELETE, D_CXXONLY0x0002 | D_CXXWARN0x0200 },
480 { "do", RID_DO, 0 },
481 { "double", RID_DOUBLE, 0 },
482 { "dynamic_cast", RID_DYNCAST, D_CXXONLY0x0002 | D_CXXWARN0x0200 },
483 { "else", RID_ELSE, 0 },
484 { "enum", RID_ENUM, 0 },
485 { "explicit", RID_EXPLICIT, D_CXXONLY0x0002 | D_CXXWARN0x0200 },
486 { "export", RID_EXPORT, D_CXXONLY0x0002 | D_CXXWARN0x0200 },
487 { "extern", RID_EXTERN, 0 },
488 { "false", RID_FALSE, D_CXXONLY0x0002 | D_CXXWARN0x0200 },
489 { "float", RID_FLOAT, 0 },
490 { "for", RID_FOR, 0 },
491 { "friend", RID_FRIEND, D_CXXONLY0x0002 | D_CXXWARN0x0200 },
492 { "goto", RID_GOTO, 0 },
493 { "if", RID_IF, 0 },
494 { "inline", RID_INLINE, D_EXT890x0020 },
495 { "int", RID_INT, 0 },
496 { "long", RID_LONG, 0 },
497 { "mutable", RID_MUTABLE, D_CXXONLY0x0002 | D_CXXWARN0x0200 },
498 { "namespace", RID_NAMESPACE, D_CXXONLY0x0002 | D_CXXWARN0x0200 },
499 { "new", RID_NEW, D_CXXONLY0x0002 | D_CXXWARN0x0200 },
500 { "noexcept", RID_NOEXCEPT, D_CXXONLY0x0002 | D_CXX110x0008 | D_CXXWARN0x0200 },
501 { "nullptr", RID_NULLPTR, D_CXXONLY0x0002 | D_CXX110x0008 | D_CXXWARN0x0200 },
502 { "operator", RID_OPERATOR, D_CXXONLY0x0002 | D_CXXWARN0x0200 },
503 { "private", RID_PRIVATE, D_CXX_OBJC0x0100 | D_CXXWARN0x0200 },
504 { "protected", RID_PROTECTED, D_CXX_OBJC0x0100 | D_CXXWARN0x0200 },
505 { "public", RID_PUBLIC, D_CXX_OBJC0x0100 | D_CXXWARN0x0200 },
506 { "register", RID_REGISTER, 0 },
507 { "reinterpret_cast", RID_REINTCAST, D_CXXONLY0x0002 | D_CXXWARN0x0200 },
508 { "restrict", RID_RESTRICT, D_CONLY0x0001 | D_C990x0004 },
509 { "return", RID_RETURN, 0 },
510 { "short", RID_SHORT, 0 },
511 { "signed", RID_SIGNED, 0 },
512 { "sizeof", RID_SIZEOF, 0 },
513 { "static", RID_STATIC, 0 },
514 { "static_assert", RID_STATIC_ASSERT, D_CXXONLY0x0002 | D_CXX110x0008 | D_CXXWARN0x0200 },
515 { "static_cast", RID_STATCAST, D_CXXONLY0x0002 | D_CXXWARN0x0200 },
516 { "struct", RID_STRUCT, 0 },
517 { "switch", RID_SWITCH, 0 },
518 { "template", RID_TEMPLATE, D_CXXONLY0x0002 | D_CXXWARN0x0200 },
519 { "this", RID_THIS, D_CXXONLY0x0002 | D_CXXWARN0x0200 },
520 { "thread_local", RID_THREAD, D_CXXONLY0x0002 | D_CXX110x0008 | D_CXXWARN0x0200 },
521 { "throw", RID_THROW, D_CXX_OBJC0x0100 | D_CXXWARN0x0200 },
522 { "true", RID_TRUE, D_CXXONLY0x0002 | D_CXXWARN0x0200 },
523 { "try", RID_TRY, D_CXX_OBJC0x0100 | D_CXXWARN0x0200 },
524 { "typedef", RID_TYPEDEF, 0 },
525 { "typename", RID_TYPENAME, D_CXXONLY0x0002 | D_CXXWARN0x0200 },
526 { "typeid", RID_TYPEID, D_CXXONLY0x0002 | D_CXXWARN0x0200 },
527 { "typeof", RID_TYPEOF, D_ASM0x0040 | D_EXT0x0010 },
528 { "union", RID_UNION, 0 },
529 { "unsigned", RID_UNSIGNED, 0 },
530 { "using", RID_USING, D_CXXONLY0x0002 | D_CXXWARN0x0200 },
531 { "virtual", RID_VIRTUAL, D_CXXONLY0x0002 | D_CXXWARN0x0200 },
532 { "void", RID_VOID, 0 },
533 { "volatile", RID_VOLATILE, 0 },
534 { "wchar_t", RID_WCHAR, D_CXXONLY0x0002 },
535 { "while", RID_WHILE, 0 },
536 { "__is_assignable", RID_IS_ASSIGNABLE, D_CXXONLY0x0002 },
537 { "__is_constructible", RID_IS_CONSTRUCTIBLE, D_CXXONLY0x0002 },
538 { "__is_nothrow_assignable", RID_IS_NOTHROW_ASSIGNABLE, D_CXXONLY0x0002 },
539 { "__is_nothrow_constructible", RID_IS_NOTHROW_CONSTRUCTIBLE, D_CXXONLY0x0002 },
540
541 /* C++ transactional memory. */
542 { "synchronized", RID_SYNCHRONIZED, D_CXX_OBJC0x0100 | D_TRANSMEM0X0800 },
543 { "atomic_noexcept", RID_ATOMIC_NOEXCEPT, D_CXXONLY0x0002 | D_TRANSMEM0X0800 },
544 { "atomic_cancel", RID_ATOMIC_CANCEL, D_CXXONLY0x0002 | D_TRANSMEM0X0800 },
545 { "atomic_commit", RID_TRANSACTION_ATOMIC, D_CXXONLY0x0002 | D_TRANSMEM0X0800 },
546
547 /* Concepts-related keywords */
548 { "concept", RID_CONCEPT, D_CXX_CONCEPTS_FLAGS0x0002 | 0x0400 | D_CXXWARN0x0200 },
549 { "requires", RID_REQUIRES, D_CXX_CONCEPTS_FLAGS0x0002 | 0x0400 | D_CXXWARN0x0200 },
550
551 /* Modules-related keywords, these are internal unspellable tokens,
552 created by the preprocessor. */
553 { "module ", RID__MODULE, D_CXX_MODULES_FLAGS(0x0002 | 0x8000) | D_CXXWARN0x0200 },
554 { "import ", RID__IMPORT, D_CXX_MODULES_FLAGS(0x0002 | 0x8000) | D_CXXWARN0x0200 },
555 { "export ", RID__EXPORT, D_CXX_MODULES_FLAGS(0x0002 | 0x8000) | D_CXXWARN0x0200 },
556
557 /* Coroutines-related keywords */
558 { "co_await", RID_CO_AWAIT, D_CXX_COROUTINES_FLAGS(0x0002 | 0x4000) | D_CXXWARN0x0200 },
559 { "co_yield", RID_CO_YIELD, D_CXX_COROUTINES_FLAGS(0x0002 | 0x4000) | D_CXXWARN0x0200 },
560 { "co_return", RID_CO_RETURN, D_CXX_COROUTINES_FLAGS(0x0002 | 0x4000) | D_CXXWARN0x0200 },
561
562 /* These Objective-C keywords are recognized only immediately after
563 an '@'. */
564 { "compatibility_alias", RID_AT_ALIAS, D_OBJC0x0080 },
565 { "defs", RID_AT_DEFS, D_OBJC0x0080 },
566 { "encode", RID_AT_ENCODE, D_OBJC0x0080 },
567 { "end", RID_AT_END, D_OBJC0x0080 },
568 { "implementation", RID_AT_IMPLEMENTATION, D_OBJC0x0080 },
569 { "interface", RID_AT_INTERFACE, D_OBJC0x0080 },
570 { "protocol", RID_AT_PROTOCOL, D_OBJC0x0080 },
571 { "selector", RID_AT_SELECTOR, D_OBJC0x0080 },
572 { "finally", RID_AT_FINALLY, D_OBJC0x0080 },
573 { "optional", RID_AT_OPTIONAL, D_OBJC0x0080 },
574 { "required", RID_AT_REQUIRED, D_OBJC0x0080 },
575 { "property", RID_AT_PROPERTY, D_OBJC0x0080 },
576 { "package", RID_AT_PACKAGE, D_OBJC0x0080 },
577 { "synthesize", RID_AT_SYNTHESIZE, D_OBJC0x0080 },
578 { "dynamic", RID_AT_DYNAMIC, D_OBJC0x0080 },
579 /* These are recognized only in protocol-qualifier context
580 (see above) */
581 { "bycopy", RID_BYCOPY, D_OBJC0x0080 },
582 { "byref", RID_BYREF, D_OBJC0x0080 },
583 { "in", RID_IN, D_OBJC0x0080 },
584 { "inout", RID_INOUT, D_OBJC0x0080 },
585 { "oneway", RID_ONEWAY, D_OBJC0x0080 },
586 { "out", RID_OUT, D_OBJC0x0080 },
587 /* These are recognized inside a property attribute list */
588 { "assign", RID_ASSIGN, D_OBJC0x0080 },
589 { "atomic", RID_PROPATOMIC, D_OBJC0x0080 },
590 { "copy", RID_COPY, D_OBJC0x0080 },
591 { "getter", RID_GETTER, D_OBJC0x0080 },
592 { "nonatomic", RID_NONATOMIC, D_OBJC0x0080 },
593 { "readonly", RID_READONLY, D_OBJC0x0080 },
594 { "readwrite", RID_READWRITE, D_OBJC0x0080 },
595 { "retain", RID_RETAIN, D_OBJC0x0080 },
596 { "setter", RID_SETTER, D_OBJC0x0080 },
597 /* These are Objective C implementation of nullability, accepted only in
598 specific contexts. */
599 { "null_unspecified", RID_NULL_UNSPECIFIED, D_OBJC0x0080 },
600 { "nullable", RID_NULLABLE, D_OBJC0x0080 },
601 { "nonnull", RID_NONNULL, D_OBJC0x0080 },
602 { "null_resettable", RID_NULL_RESETTABLE, D_OBJC0x0080 },
603};
604
605const unsigned int num_c_common_reswords =
606 sizeof c_common_reswords / sizeof (struct c_common_resword);
607
608/* Return identifier for address space AS. */
609
610const char *
611c_addr_space_name (addr_space_t as)
612{
613 int rid = RID_FIRST_ADDR_SPACE + as;
614 gcc_assert (ridpointers [rid])((void)(!(ridpointers [rid]) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 614, __FUNCTION__), 0 : 0))
;
615 return IDENTIFIER_POINTER (ridpointers [rid])((const char *) (tree_check ((ridpointers [rid]), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 615, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str
)
;
616}
617
618/* Push current bindings for the function name VAR_DECLS. */
619
620void
621start_fname_decls (void)
622{
623 unsigned ix;
624 tree saved = NULL_TREE(tree) __null;
625
626 for (ix = 0; fname_vars[ix].decl; ix++)
627 {
628 tree decl = *fname_vars[ix].decl;
629
630 if (decl)
631 {
632 saved = tree_cons (decl, build_int_cst (integer_type_nodeinteger_types[itk_int], ix),
633 saved);
634 *fname_vars[ix].decl = NULL_TREE(tree) __null;
635 }
636 }
637 if (saved || saved_function_name_declsc_global_trees[CTI_SAVED_FUNCTION_NAME_DECLS])
638 /* Normally they'll have been NULL, so only push if we've got a
639 stack, or they are non-NULL. */
640 saved_function_name_declsc_global_trees[CTI_SAVED_FUNCTION_NAME_DECLS] = tree_cons (saved, NULL_TREE(tree) __null,
641 saved_function_name_declsc_global_trees[CTI_SAVED_FUNCTION_NAME_DECLS]);
642}
643
644/* Finish up the current bindings, adding them into the current function's
645 statement tree. This must be done _before_ finish_stmt_tree is called.
646 If there is no current function, we must be at file scope and no statements
647 are involved. Pop the previous bindings. */
648
649void
650finish_fname_decls (void)
651{
652 unsigned ix;
653 tree stmts = NULL_TREE(tree) __null;
654 tree stack = saved_function_name_declsc_global_trees[CTI_SAVED_FUNCTION_NAME_DECLS];
655
656 for (; stack && TREE_VALUE (stack)((tree_check ((stack), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 656, __FUNCTION__, (TREE_LIST)))->list.value)
; stack = TREE_CHAIN (stack)((contains_struct_check ((stack), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 656, __FUNCTION__))->common.chain)
)
657 append_to_statement_list (TREE_VALUE (stack)((tree_check ((stack), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 657, __FUNCTION__, (TREE_LIST)))->list.value)
, &stmts);
658
659 if (stmts)
660 {
661 tree *bodyp = &DECL_SAVED_TREE (current_function_decl)((tree_check ((current_function_decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 661, __FUNCTION__, (FUNCTION_DECL)))->function_decl.saved_tree
)
;
662
663 if (TREE_CODE (*bodyp)((enum tree_code) (*bodyp)->base.code) == BIND_EXPR)
664 bodyp = &BIND_EXPR_BODY (*bodyp)((*((const_cast<tree*> (tree_operand_check (((tree_check
((*bodyp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 664, __FUNCTION__, (BIND_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 664, __FUNCTION__))))))
;
665
666 append_to_statement_list_force (*bodyp, &stmts);
667 *bodyp = stmts;
668 }
669
670 for (ix = 0; fname_vars[ix].decl; ix++)
671 *fname_vars[ix].decl = NULL_TREE(tree) __null;
672
673 if (stack)
674 {
675 /* We had saved values, restore them. */
676 tree saved;
677
678 for (saved = TREE_PURPOSE (stack)((tree_check ((stack), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 678, __FUNCTION__, (TREE_LIST)))->list.purpose)
; saved; saved = TREE_CHAIN (saved)((contains_struct_check ((saved), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 678, __FUNCTION__))->common.chain)
)
679 {
680 tree decl = TREE_PURPOSE (saved)((tree_check ((saved), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 680, __FUNCTION__, (TREE_LIST)))->list.purpose)
;
681 unsigned ix = TREE_INT_CST_LOW (TREE_VALUE (saved))((unsigned long) (*tree_int_cst_elt_check ((((tree_check ((saved
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 681, __FUNCTION__, (TREE_LIST)))->list.value)), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 681, __FUNCTION__)))
;
682
683 *fname_vars[ix].decl = decl;
684 }
685 stack = TREE_CHAIN (stack)((contains_struct_check ((stack), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 685, __FUNCTION__))->common.chain)
;
686 }
687 saved_function_name_declsc_global_trees[CTI_SAVED_FUNCTION_NAME_DECLS] = stack;
688}
689
690/* Return the text name of the current function, suitably prettified
691 by PRETTY_P. Return string must be freed by caller. */
692
693const char *
694fname_as_string (int pretty_p)
695{
696 const char *name = "top level";
697 char *namep;
698 int vrb = 2, len;
699 cpp_string cstr = { 0, 0 }, strname;
700
701 if (!pretty_p)
702 {
703 name = "";
704 vrb = 0;
705 }
706
707 if (current_function_decl)
708 name = lang_hooks.decl_printable_name (current_function_decl, vrb);
709
710 len = strlen (name) + 3; /* Two for '"'s. One for NULL. */
711
712 namep = XNEWVEC (char, len)((char *) xmalloc (sizeof (char) * (len)));
713 snprintf (namep, len, "\"%s\"", name);
714 strname.text = (unsigned char *) namep;
715 strname.len = len - 1;
716
717 if (cpp_interpret_string (parse_in, &strname, 1, &cstr, CPP_STRING))
718 {
719 XDELETEVEC (namep)free ((void*) (namep));
720 return (const char *) cstr.text;
721 }
722
723 return namep;
724}
725
726/* Return the VAR_DECL for a const char array naming the current
727 function. If the VAR_DECL has not yet been created, create it
728 now. RID indicates how it should be formatted and IDENTIFIER_NODE
729 ID is its name (unfortunately C and C++ hold the RID values of
730 keywords in different places, so we can't derive RID from ID in
731 this language independent code. LOC is the location of the
732 function. */
733
734tree
735fname_decl (location_t loc, unsigned int rid, tree id)
736{
737 unsigned ix;
738 tree decl = NULL_TREE(tree) __null;
739
740 for (ix = 0; fname_vars[ix].decl; ix++)
741 if (fname_vars[ix].rid == rid)
742 break;
743
744 decl = *fname_vars[ix].decl;
745 if (!decl)
746 {
747 /* If a tree is built here, it would normally have the lineno of
748 the current statement. Later this tree will be moved to the
749 beginning of the function and this line number will be wrong.
750 To avoid this problem set the lineno to 0 here; that prevents
751 it from appearing in the RTL. */
752 tree stmts;
753 location_t saved_location = input_location;
754 input_location = UNKNOWN_LOCATION((location_t) 0);
755
756 stmts = push_stmt_list ();
757 decl = (*make_fname_decl) (loc, id, fname_vars[ix].pretty);
758 stmts = pop_stmt_list (stmts);
759 if (!IS_EMPTY_STMT (stmts)(((enum tree_code) (stmts)->base.code) == NOP_EXPR &&
(((enum tree_code) (((contains_struct_check ((stmts), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 759, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
) && integer_zerop ((*((const_cast<tree*> (tree_operand_check
((stmts), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 759, __FUNCTION__)))))))
)
760 saved_function_name_declsc_global_trees[CTI_SAVED_FUNCTION_NAME_DECLS]
761 = tree_cons (decl, stmts, saved_function_name_declsc_global_trees[CTI_SAVED_FUNCTION_NAME_DECLS]);
762 *fname_vars[ix].decl = decl;
763 input_location = saved_location;
764 }
765 if (!ix && !current_function_decl)
766 pedwarn (loc, 0, "%qD is not defined outside of function scope", decl);
767
768 return decl;
769}
770
771/* Given a STRING_CST, give it a suitable array-of-chars data type. */
772
773tree
774fix_string_type (tree value)
775{
776 int length = TREE_STRING_LENGTH (value)((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 776, __FUNCTION__, (STRING_CST)))->string.length)
;
777 int nchars, charsz;
778 tree e_type, i_type, a_type;
779
780 /* Compute the number of elements, for the array type. */
781 if (TREE_TYPE (value)((contains_struct_check ((value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 781, __FUNCTION__))->typed.type)
== char_array_type_nodec_global_trees[CTI_CHAR_ARRAY_TYPE] || !TREE_TYPE (value)((contains_struct_check ((value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 781, __FUNCTION__))->typed.type)
)
782 {
783 charsz = 1;
784 e_type = char_type_nodeinteger_types[itk_char];
785 }
786 else if (flag_char8_tglobal_options.x_flag_char8_t && TREE_TYPE (value)((contains_struct_check ((value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 786, __FUNCTION__))->typed.type)
== char8_array_type_nodec_global_trees[CTI_CHAR8_ARRAY_TYPE])
787 {
788 charsz = TYPE_PRECISION (char8_type_node)((tree_class_check ((c_global_trees[CTI_CHAR8_TYPE]), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 788, __FUNCTION__))->type_common.precision)
/ BITS_PER_UNIT(8);
789 e_type = char8_type_nodec_global_trees[CTI_CHAR8_TYPE];
790 }
791 else if (TREE_TYPE (value)((contains_struct_check ((value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 791, __FUNCTION__))->typed.type)
== char16_array_type_nodec_global_trees[CTI_CHAR16_ARRAY_TYPE])
792 {
793 charsz = TYPE_PRECISION (char16_type_node)((tree_class_check ((c_global_trees[CTI_CHAR16_TYPE]), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 793, __FUNCTION__))->type_common.precision)
/ BITS_PER_UNIT(8);
794 e_type = char16_type_nodec_global_trees[CTI_CHAR16_TYPE];
795 }
796 else if (TREE_TYPE (value)((contains_struct_check ((value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 796, __FUNCTION__))->typed.type)
== char32_array_type_nodec_global_trees[CTI_CHAR32_ARRAY_TYPE])
797 {
798 charsz = TYPE_PRECISION (char32_type_node)((tree_class_check ((c_global_trees[CTI_CHAR32_TYPE]), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 798, __FUNCTION__))->type_common.precision)
/ BITS_PER_UNIT(8);
799 e_type = char32_type_nodec_global_trees[CTI_CHAR32_TYPE];
800 }
801 else
802 {
803 charsz = TYPE_PRECISION (wchar_type_node)((tree_class_check ((c_global_trees[CTI_WCHAR_TYPE]), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 803, __FUNCTION__))->type_common.precision)
/ BITS_PER_UNIT(8);
804 e_type = wchar_type_nodec_global_trees[CTI_WCHAR_TYPE];
805 }
806
807 /* This matters only for targets where ssizetype has smaller precision
808 than 32 bits. */
809 if (wi::lts_p (wi::to_wide (TYPE_MAX_VALUE (ssizetype)((tree_check5 ((sizetype_tab[(int) stk_ssizetype]), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 809, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)
), length))
810 {
811 error ("size of string literal is too large");
812 length = tree_to_shwi (TYPE_MAX_VALUE (ssizetype)((tree_check5 ((sizetype_tab[(int) stk_ssizetype]), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 812, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)
) / charsz * charsz;
813 char *str = CONST_CAST (char *, TREE_STRING_POINTER (value))(const_cast<char *> ((((const char *)((tree_check ((value
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 813, __FUNCTION__, (STRING_CST)))->string.str)))))
;
814 memset (str + length, '\0',
815 MIN (TREE_STRING_LENGTH (value) - length, charsz)((((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 815, __FUNCTION__, (STRING_CST)))->string.length) - length
) < (charsz) ? (((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 815, __FUNCTION__, (STRING_CST)))->string.length) - length
) : (charsz))
);
816 TREE_STRING_LENGTH (value)((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 816, __FUNCTION__, (STRING_CST)))->string.length)
= length;
817 }
818 nchars = length / charsz;
819
820 /* C89 2.2.4.1, C99 5.2.4.1 (Translation limits). The analogous
821 limit in C++98 Annex B is very large (65536) and is not normative,
822 so we do not diagnose it (warn_overlength_strings is forced off
823 in c_common_post_options). */
824 if (warn_overlength_stringsglobal_options.x_warn_overlength_strings)
825 {
826 const int nchars_max = flag_isoc99 ? 4095 : 509;
827 const int relevant_std = flag_isoc99 ? 99 : 90;
828 if (nchars - 1 > nchars_max)
829 /* Translators: The %d after 'ISO C' will be 90 or 99. Do not
830 separate the %d from the 'C'. 'ISO' should not be
831 translated, but it may be moved after 'C%d' in languages
832 where modifiers follow nouns. */
833 pedwarn (input_location, OPT_Woverlength_strings,
834 "string length %qd is greater than the length %qd "
835 "ISO C%d compilers are required to support",
836 nchars - 1, nchars_max, relevant_std);
837 }
838
839 /* Create the array type for the string constant. The ISO C++
840 standard says that a string literal has type `const char[N]' or
841 `const wchar_t[N]'. We use the same logic when invoked as a C
842 front-end with -Wwrite-strings.
843 ??? We should change the type of an expression depending on the
844 state of a warning flag. We should just be warning -- see how
845 this is handled in the C++ front-end for the deprecated implicit
846 conversion from string literals to `char*' or `wchar_t*'.
847
848 The C++ front end relies on TYPE_MAIN_VARIANT of a cv-qualified
849 array type being the unqualified version of that type.
850 Therefore, if we are constructing an array of const char, we must
851 construct the matching unqualified array type first. The C front
852 end does not require this, but it does no harm, so we do it
853 unconditionally. */
854 i_type = build_index_type (size_int (nchars - 1)size_int_kind (nchars - 1, stk_sizetype));
855 a_type = build_array_type (e_type, i_type);
856 if (c_dialect_cxx()((c_language & clk_cxx) != 0) || warn_write_stringsglobal_options.x_warn_write_strings)
857 a_type = c_build_qualified_type (a_type, TYPE_QUAL_CONST);
858
859 TREE_TYPE (value)((contains_struct_check ((value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 859, __FUNCTION__))->typed.type)
= a_type;
860 TREE_CONSTANT (value)((non_type_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 860, __FUNCTION__))->base.constant_flag)
= 1;
861 TREE_READONLY (value)((non_type_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 861, __FUNCTION__))->base.readonly_flag)
= 1;
862 TREE_STATIC (value)((value)->base.static_flag) = 1;
863 return value;
864}
865
866/* Given a string of type STRING_TYPE, determine what kind of string
867 token would give an equivalent execution encoding: CPP_STRING,
868 CPP_STRING16, or CPP_STRING32. Return CPP_OTHER in case of error.
869 This may not be exactly the string token type that initially created
870 the string, since CPP_WSTRING is indistinguishable from the 16/32 bit
871 string type, and CPP_UTF8STRING is indistinguishable from CPP_STRING
872 at this point.
873
874 This effectively reverses part of the logic in lex_string and
875 fix_string_type. */
876
877static enum cpp_ttype
878get_cpp_ttype_from_string_type (tree string_type)
879{
880 gcc_assert (string_type)((void)(!(string_type) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 880, __FUNCTION__), 0 : 0))
;
881 if (TREE_CODE (string_type)((enum tree_code) (string_type)->base.code) == POINTER_TYPE)
882 string_type = TREE_TYPE (string_type)((contains_struct_check ((string_type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 882, __FUNCTION__))->typed.type)
;
883
884 if (TREE_CODE (string_type)((enum tree_code) (string_type)->base.code) != ARRAY_TYPE)
885 return CPP_OTHER;
886
887 tree element_type = TREE_TYPE (string_type)((contains_struct_check ((string_type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 887, __FUNCTION__))->typed.type)
;
888 if (TREE_CODE (element_type)((enum tree_code) (element_type)->base.code) != INTEGER_TYPE)
889 return CPP_OTHER;
890
891 int bits_per_character = TYPE_PRECISION (element_type)((tree_class_check ((element_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 891, __FUNCTION__))->type_common.precision)
;
892 switch (bits_per_character)
893 {
894 case 8:
895 return CPP_STRING; /* It could have also been CPP_UTF8STRING. */
896 case 16:
897 return CPP_STRING16;
898 case 32:
899 return CPP_STRING32;
900 }
901
902 return CPP_OTHER;
903}
904
905/* The global record of string concatentations, for use in
906 extracting locations within string literals. */
907
908GTY(()) string_concat_db *g_string_concat_db;
909
910/* Implementation of LANG_HOOKS_GET_SUBSTRING_LOCATION. */
911
912const char *
913c_get_substring_location (const substring_loc &substr_loc,
914 location_t *out_loc)
915{
916 enum cpp_ttype tok_type
917 = get_cpp_ttype_from_string_type (substr_loc.get_string_type ());
918 if (tok_type == CPP_OTHER)
919 return "unrecognized string type";
920
921 return get_location_within_string (parse_in, g_string_concat_db,
922 substr_loc.get_fmt_string_loc (),
923 tok_type,
924 substr_loc.get_caret_idx (),
925 substr_loc.get_start_idx (),
926 substr_loc.get_end_idx (),
927 out_loc);
928}
929
930
931/* Return true iff T is a boolean promoted to int. */
932
933bool
934bool_promoted_to_int_p (tree t)
935{
936 return (CONVERT_EXPR_P (t)((((enum tree_code) (t)->base.code)) == NOP_EXPR || (((enum
tree_code) (t)->base.code)) == CONVERT_EXPR)
937 && TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 937, __FUNCTION__))->typed.type)
== integer_type_nodeinteger_types[itk_int]
938 && TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0)))((enum tree_code) (((contains_struct_check (((*((const_cast<
tree*> (tree_operand_check ((t), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 938, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 938, __FUNCTION__))->typed.type))->base.code)
== BOOLEAN_TYPE);
939}
940
941/* vector_targets_convertible_p is used for vector pointer types. The
942 callers perform various checks that the qualifiers are satisfactory,
943 while OTOH vector_targets_convertible_p ignores the number of elements
944 in the vectors. That's fine with vector pointers as we can consider,
945 say, a vector of 8 elements as two consecutive vectors of 4 elements,
946 and that does not require and conversion of the pointer values.
947 In contrast, vector_types_convertible_p and
948 vector_types_compatible_elements_p are used for vector value types. */
949/* True if pointers to distinct types T1 and T2 can be converted to
950 each other without an explicit cast. Only returns true for opaque
951 vector types. */
952bool
953vector_targets_convertible_p (const_tree t1, const_tree t2)
954{
955 if (VECTOR_TYPE_P (t1)(((enum tree_code) (t1)->base.code) == VECTOR_TYPE) && VECTOR_TYPE_P (t2)(((enum tree_code) (t2)->base.code) == VECTOR_TYPE)
956 && (TYPE_VECTOR_OPAQUE (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 956, __FUNCTION__, (VECTOR_TYPE)))->base.default_def_flag
)
|| TYPE_VECTOR_OPAQUE (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 956, __FUNCTION__, (VECTOR_TYPE)))->base.default_def_flag
)
)
957 && tree_int_cst_equal (TYPE_SIZE (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 957, __FUNCTION__))->type_common.size)
, TYPE_SIZE (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 957, __FUNCTION__))->type_common.size)
))
958 return true;
959
960 return false;
961}
962
963/* vector_types_convertible_p is used for vector value types.
964 It could in principle call vector_targets_convertible_p as a subroutine,
965 but then the check for vector type would be duplicated with its callers,
966 and also the purpose of vector_targets_convertible_p would become
967 muddled.
968 Where vector_types_convertible_p returns true, a conversion might still be
969 needed to make the types match.
970 In contrast, vector_targets_convertible_p is used for vector pointer
971 values, and vector_types_compatible_elements_p is used specifically
972 in the context for binary operators, as a check if use is possible without
973 conversion. */
974/* True if vector types T1 and T2 can be converted to each other
975 without an explicit cast. If EMIT_LAX_NOTE is true, and T1 and T2
976 can only be converted with -flax-vector-conversions yet that is not
977 in effect, emit a note telling the user about that option if such
978 a note has not previously been emitted. */
979bool
980vector_types_convertible_p (const_tree t1, const_tree t2, bool emit_lax_note)
981{
982 static bool emitted_lax_note = false;
983 bool convertible_lax;
984
985 if ((TYPE_VECTOR_OPAQUE (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 985, __FUNCTION__, (VECTOR_TYPE)))->base.default_def_flag
)
|| TYPE_VECTOR_OPAQUE (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 985, __FUNCTION__, (VECTOR_TYPE)))->base.default_def_flag
)
)
986 && tree_int_cst_equal (TYPE_SIZE (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 986, __FUNCTION__))->type_common.size)
, TYPE_SIZE (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 986, __FUNCTION__))->type_common.size)
))
987 return true;
988
989 convertible_lax =
990 (tree_int_cst_equal (TYPE_SIZE (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 990, __FUNCTION__))->type_common.size)
, TYPE_SIZE (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 990, __FUNCTION__))->type_common.size)
)
991 && (TREE_CODE (TREE_TYPE (t1))((enum tree_code) (((contains_struct_check ((t1), (TS_TYPED),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 991, __FUNCTION__))->typed.type))->base.code)
!= REAL_TYPE
992 || known_eq (TYPE_VECTOR_SUBPARTS (t1),(!maybe_ne (TYPE_VECTOR_SUBPARTS (t1), TYPE_VECTOR_SUBPARTS (
t2)))
993 TYPE_VECTOR_SUBPARTS (t2))(!maybe_ne (TYPE_VECTOR_SUBPARTS (t1), TYPE_VECTOR_SUBPARTS (
t2)))
)
994 && (INTEGRAL_TYPE_P (TREE_TYPE (t1))(((enum tree_code) (((contains_struct_check ((t1), (TS_TYPED)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 994, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE
|| ((enum tree_code) (((contains_struct_check ((t1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 994, __FUNCTION__))->typed.type))->base.code) == BOOLEAN_TYPE
|| ((enum tree_code) (((contains_struct_check ((t1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 994, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE
)
995 == INTEGRAL_TYPE_P (TREE_TYPE (t2))(((enum tree_code) (((contains_struct_check ((t2), (TS_TYPED)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 995, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE
|| ((enum tree_code) (((contains_struct_check ((t2), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 995, __FUNCTION__))->typed.type))->base.code) == BOOLEAN_TYPE
|| ((enum tree_code) (((contains_struct_check ((t2), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 995, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE
)
));
996
997 if (!convertible_lax || flag_lax_vector_conversionsglobal_options.x_flag_lax_vector_conversions)
998 return convertible_lax;
999
1000 if (known_eq (TYPE_VECTOR_SUBPARTS (t1), TYPE_VECTOR_SUBPARTS (t2))(!maybe_ne (TYPE_VECTOR_SUBPARTS (t1), TYPE_VECTOR_SUBPARTS (
t2)))
1001 && lang_hooks.types_compatible_p (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1001, __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-family/c-common.c"
, 1001, __FUNCTION__))->typed.type)
))
1002 return true;
1003
1004 if (emit_lax_note && !emitted_lax_note)
1005 {
1006 emitted_lax_note = true;
1007 inform (input_location, "use %<-flax-vector-conversions%> to permit "
1008 "conversions between vectors with differing "
1009 "element types or numbers of subparts");
1010 }
1011
1012 return false;
1013}
1014
1015/* Build a VEC_PERM_EXPR if V0, V1 and MASK are not error_mark_nodes
1016 and have vector types, V0 has the same type as V1, and the number of
1017 elements of V0, V1, MASK is the same.
1018
1019 In case V1 is a NULL_TREE it is assumed that __builtin_shuffle was
1020 called with two arguments. In this case implementation passes the
1021 first argument twice in order to share the same tree code. This fact
1022 could enable the mask-values being twice the vector length. This is
1023 an implementation accident and this semantics is not guaranteed to
1024 the user. */
1025tree
1026c_build_vec_perm_expr (location_t loc, tree v0, tree v1, tree mask,
1027 bool complain)
1028{
1029 tree ret;
1030 bool wrap = true;
1031 bool maybe_const = false;
1032 bool two_arguments = false;
1033
1034 if (v1 == NULL_TREE(tree) __null)
1035 {
1036 two_arguments = true;
1037 v1 = v0;
1038 }
1039
1040 if (v0 == error_mark_nodeglobal_trees[TI_ERROR_MARK] || v1 == error_mark_nodeglobal_trees[TI_ERROR_MARK]
1041 || mask == error_mark_nodeglobal_trees[TI_ERROR_MARK])
1042 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1043
1044 if (!gnu_vector_type_p (TREE_TYPE (mask)((contains_struct_check ((mask), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1044, __FUNCTION__))->typed.type)
)
1045 || !VECTOR_INTEGER_TYPE_P (TREE_TYPE (mask))((((enum tree_code) (((contains_struct_check ((mask), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1045, __FUNCTION__))->typed.type))->base.code) == VECTOR_TYPE
) && ((enum tree_code) (((contains_struct_check ((((contains_struct_check
((mask), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1045, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1045, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE
)
)
1046 {
1047 if (complain)
1048 error_at (loc, "%<__builtin_shuffle%> last argument must "
1049 "be an integer vector");
1050 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1051 }
1052
1053 if (!gnu_vector_type_p (TREE_TYPE (v0)((contains_struct_check ((v0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1053, __FUNCTION__))->typed.type)
)
1054 || !gnu_vector_type_p (TREE_TYPE (v1)((contains_struct_check ((v1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1054, __FUNCTION__))->typed.type)
))
1055 {
1056 if (complain)
1057 error_at (loc, "%<__builtin_shuffle%> arguments must be vectors");
1058 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1059 }
1060
1061 if (TYPE_MAIN_VARIANT (TREE_TYPE (v0))((tree_class_check ((((contains_struct_check ((v0), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1061, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1061, __FUNCTION__))->type_common.main_variant)
!= TYPE_MAIN_VARIANT (TREE_TYPE (v1))((tree_class_check ((((contains_struct_check ((v1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1061, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1061, __FUNCTION__))->type_common.main_variant)
)
1062 {
1063 if (complain)
1064 error_at (loc, "%<__builtin_shuffle%> argument vectors must be of "
1065 "the same type");
1066 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1067 }
1068
1069 if (maybe_ne (TYPE_VECTOR_SUBPARTS (TREE_TYPE (v0)((contains_struct_check ((v0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1069, __FUNCTION__))->typed.type)
),
1070 TYPE_VECTOR_SUBPARTS (TREE_TYPE (mask)((contains_struct_check ((mask), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1070, __FUNCTION__))->typed.type)
))
1071 && maybe_ne (TYPE_VECTOR_SUBPARTS (TREE_TYPE (v1)((contains_struct_check ((v1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1071, __FUNCTION__))->typed.type)
),
1072 TYPE_VECTOR_SUBPARTS (TREE_TYPE (mask)((contains_struct_check ((mask), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1072, __FUNCTION__))->typed.type)
)))
1073 {
1074 if (complain)
1075 error_at (loc, "%<__builtin_shuffle%> number of elements of the "
1076 "argument vector(s) and the mask vector should "
1077 "be the same");
1078 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1079 }
1080
1081 if (GET_MODE_BITSIZE (SCALAR_TYPE_MODE (TREE_TYPE (TREE_TYPE (v0)))(as_a <scalar_mode> ((tree_class_check ((((contains_struct_check
((((contains_struct_check ((v0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1081, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1081, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1081, __FUNCTION__))->type_common.mode))
)
1082 != GET_MODE_BITSIZE (SCALAR_TYPE_MODE (TREE_TYPE (TREE_TYPE (mask)))(as_a <scalar_mode> ((tree_class_check ((((contains_struct_check
((((contains_struct_check ((mask), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1082, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1082, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1082, __FUNCTION__))->type_common.mode))
))
1083 {
1084 if (complain)
1085 error_at (loc, "%<__builtin_shuffle%> argument vector(s) inner type "
1086 "must have the same size as inner type of the mask");
1087 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1088 }
1089
1090 if (!c_dialect_cxx ()((c_language & clk_cxx) != 0))
1091 {
1092 /* Avoid C_MAYBE_CONST_EXPRs inside VEC_PERM_EXPR. */
1093 v0 = c_fully_fold (v0, false, &maybe_const);
1094 wrap &= maybe_const;
1095
1096 if (two_arguments)
1097 v1 = v0 = save_expr (v0);
1098 else
1099 {
1100 v1 = c_fully_fold (v1, false, &maybe_const);
1101 wrap &= maybe_const;
1102 }
1103
1104 mask = c_fully_fold (mask, false, &maybe_const);
1105 wrap &= maybe_const;
1106 }
1107 else if (two_arguments)
1108 v1 = v0 = save_expr (v0);
1109
1110 ret = build3_loc (loc, VEC_PERM_EXPR, TREE_TYPE (v0)((contains_struct_check ((v0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1110, __FUNCTION__))->typed.type)
, v0, v1, mask);
1111
1112 if (!c_dialect_cxx ()((c_language & clk_cxx) != 0) && !wrap)
1113 ret = c_wrap_maybe_const (ret, true);
1114
1115 return ret;
1116}
1117
1118/* Build a VEC_PERM_EXPR if V0, V1 are not error_mark_nodes
1119 and have vector types, V0 has the same element type as V1, and the
1120 number of elements the result is that of MASK. */
1121tree
1122c_build_shufflevector (location_t loc, tree v0, tree v1,
1123 const vec<tree> &mask, bool complain)
1124{
1125 tree ret;
1126 bool wrap = true;
1127 bool maybe_const = false;
1128
1129 if (v0 == error_mark_nodeglobal_trees[TI_ERROR_MARK] || v1 == error_mark_nodeglobal_trees[TI_ERROR_MARK])
1
Assuming the condition is false
2
Assuming the condition is false
3
Taking false branch
1130 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1131
1132 if (!gnu_vector_type_p (TREE_TYPE (v0)((contains_struct_check ((v0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1132, __FUNCTION__))->typed.type)
)
4
Calling 'gnu_vector_type_p'
8
Returning from 'gnu_vector_type_p'
14
Taking false branch
1133 || !gnu_vector_type_p (TREE_TYPE (v1)((contains_struct_check ((v1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1133, __FUNCTION__))->typed.type)
)
)
9
Calling 'gnu_vector_type_p'
13
Returning from 'gnu_vector_type_p'
1134 {
1135 if (complain)
1136 error_at (loc, "%<__builtin_shufflevector%> arguments must be vectors");
1137 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1138 }
1139
1140 /* ??? In principle one could select a constant part of a variable size
1141 vector but things get a bit awkward with trying to support this here. */
1142 unsigned HOST_WIDE_INTlong v0n, v1n;
1143 if (!TYPE_VECTOR_SUBPARTS (TREE_TYPE (v0)((contains_struct_check ((v0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1143, __FUNCTION__))->typed.type)
)
.is_constant (&v0n)
15
Calling 'TYPE_VECTOR_SUBPARTS'
24
Returning from 'TYPE_VECTOR_SUBPARTS'
25
Calling 'poly_int_pod::is_constant'
32
Returning from 'poly_int_pod::is_constant'
33
Taking false branch
1144 || !TYPE_VECTOR_SUBPARTS (TREE_TYPE (v1)((contains_struct_check ((v1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1144, __FUNCTION__))->typed.type)
).is_constant (&v1n))
1145 {
1146 if (complain)
1147 error_at (loc, "%<__builtin_shufflevector%> arguments must be constant"
1148 " size vectors");
1149 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1150 }
1151
1152 if (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (v0)))((tree_class_check ((((contains_struct_check ((((contains_struct_check
((v0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1152, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1152, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1152, __FUNCTION__))->type_common.main_variant)
34
Assuming '' is equal to ''
35
Taking false branch
1153 != TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (v1)))((tree_class_check ((((contains_struct_check ((((contains_struct_check
((v1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1153, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1153, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1153, __FUNCTION__))->type_common.main_variant)
)
1154 {
1155 if (complain)
1156 error_at (loc, "%<__builtin_shufflevector%> argument vectors must "
1157 "have the same element type");
1158 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1159 }
1160
1161 if (!pow2p_hwi (mask.length ()))
36
Assuming the condition is false
37
Taking false branch
1162 {
1163 if (complain)
1164 error_at (loc, "%<__builtin_shufflevector%> must specify a result "
1165 "with a power of two number of elements");
1166 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1167 }
1168
1169 if (!c_dialect_cxx ()((c_language & clk_cxx) != 0))
38
Assuming the condition is true
39
Taking false branch
1170 {
1171 /* Avoid C_MAYBE_CONST_EXPRs inside VEC_PERM_EXPR. */
1172 v0 = c_fully_fold (v0, false, &maybe_const);
1173 wrap &= maybe_const;
1174
1175 v1 = c_fully_fold (v1, false, &maybe_const);
1176 wrap &= maybe_const;
1177 }
1178
1179 unsigned HOST_WIDE_INTlong maskl = MAX (mask.length (), MAX (v0n, v1n))((mask.length ()) > (((v0n) > (v1n) ? (v0n) : (v1n))) ?
(mask.length ()) : (((v0n) > (v1n) ? (v0n) : (v1n))))
;
40
Assuming 'v0n' is <= 'v1n'
41
'?' condition is false
42
Assuming the condition is true
43
'?' condition is true
1180 unsigned HOST_WIDE_INTlong pad = (v0n < maskl ? maskl - v0n : 0);
44
Assuming 'v0n' is >= 'maskl'
45
'?' condition is false
1181 vec_perm_builder sel (maskl, maskl, 1);
1182 unsigned i;
1183 for (i = 0; i < mask.length (); ++i)
46
Assuming the condition is false
47
Loop condition is false. Execution continues on line 1214
1184 {
1185 tree idx = mask[i];
1186 if (!tree_fits_shwi_p (idx))
1187 {
1188 if (complain)
1189 error_at (loc, "invalid element index %qE to "
1190 "%<__builtin_shufflevector%>", idx);
1191 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1192 }
1193 HOST_WIDE_INTlong iidx = tree_to_shwi (idx);
1194 if (iidx < -1
1195 || (iidx != -1
1196 && (unsigned HOST_WIDE_INTlong) iidx >= v0n + v1n))
1197 {
1198 if (complain)
1199 error_at (loc, "invalid element index %qE to "
1200 "%<__builtin_shufflevector%>", idx);
1201 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1202 }
1203 /* ??? Our VEC_PERM_EXPR does not allow for -1 yet. */
1204 if (iidx == -1)
1205 iidx = i;
1206 /* ??? Our VEC_PERM_EXPR does not allow different sized inputs,
1207 so pad out a smaller v0. */
1208 else if ((unsigned HOST_WIDE_INTlong) iidx >= v0n)
1209 iidx += pad;
1210 sel.quick_push (iidx);
1211 }
1212 /* ??? VEC_PERM_EXPR does not support a result that is smaller than
1213 the inputs, so we have to pad id out. */
1214 for (; i < maskl; ++i)
48
Assuming 'i' is < 'maskl'
49
Loop condition is true. Entering loop body
50
Assuming 'i' is >= 'maskl'
51
Loop condition is false. Execution continues on line 1217
1215 sel.quick_push (i);
1216
1217 vec_perm_indices indices (sel, 2, maskl);
1218
1219 tree ret_type = build_vector_type (TREE_TYPE (TREE_TYPE (v0))((contains_struct_check ((((contains_struct_check ((v0), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1219, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1219, __FUNCTION__))->typed.type)
, maskl);
1220 tree mask_type = build_vector_type (build_nonstandard_integer_type
1221 (TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (ret_type)))((unsigned long) (*tree_int_cst_elt_check ((((tree_class_check
((((contains_struct_check ((ret_type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1221, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1221, __FUNCTION__))->type_common.size)), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1221, __FUNCTION__)))
, 1),
1222 maskl);
1223 /* Pad out arguments to the common vector size. */
1224 if (v0n < maskl)
52
Assuming 'v0n' is < 'maskl'
53
Taking true branch
1225 {
1226 constructor_elt elt = { NULL_TREE(tree) __null, build_zero_cst (TREE_TYPE (v0)((contains_struct_check ((v0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1226, __FUNCTION__))->typed.type)
) };
1227 v0 = build_constructor_single (ret_type, NULL_TREE(tree) __null, v0);
1228 for (i = 1; i < maskl / v0n; ++i)
54
Division by zero
1229 vec_safe_push (CONSTRUCTOR_ELTS (v0)((tree_check ((v0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1229, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)
, elt);
1230 }
1231 if (v1n < maskl)
1232 {
1233 constructor_elt elt = { NULL_TREE(tree) __null, build_zero_cst (TREE_TYPE (v1)((contains_struct_check ((v1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1233, __FUNCTION__))->typed.type)
) };
1234 v1 = build_constructor_single (ret_type, NULL_TREE(tree) __null, v1);
1235 for (i = 1; i < maskl / v1n; ++i)
1236 vec_safe_push (CONSTRUCTOR_ELTS (v1)((tree_check ((v1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1236, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)
, elt);
1237 }
1238 ret = build3_loc (loc, VEC_PERM_EXPR, ret_type, v0, v1,
1239 vec_perm_indices_to_tree (mask_type, indices));
1240 /* Get the lowpart we are interested in. */
1241 if (mask.length () < maskl)
1242 {
1243 tree lpartt = build_vector_type (TREE_TYPE (ret_type)((contains_struct_check ((ret_type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1243, __FUNCTION__))->typed.type)
, mask.length ());
1244 ret = build3_loc (loc, BIT_FIELD_REF,
1245 lpartt, ret, TYPE_SIZE (lpartt)((tree_class_check ((lpartt), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1245, __FUNCTION__))->type_common.size)
, bitsize_zero_nodeglobal_trees[TI_BITSIZE_ZERO]);
1246 }
1247
1248 if (!c_dialect_cxx ()((c_language & clk_cxx) != 0) && !wrap)
1249 ret = c_wrap_maybe_const (ret, true);
1250
1251 return ret;
1252}
1253
1254/* Build a VEC_CONVERT ifn for __builtin_convertvector builtin. */
1255
1256tree
1257c_build_vec_convert (location_t loc1, tree expr, location_t loc2, tree type,
1258 bool complain)
1259{
1260 if (error_operand_p (type))
1261 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1262 if (error_operand_p (expr))
1263 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1264
1265 if (!gnu_vector_type_p (TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1265, __FUNCTION__))->typed.type)
)
1266 || (!VECTOR_INTEGER_TYPE_P (TREE_TYPE (expr))((((enum tree_code) (((contains_struct_check ((expr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1266, __FUNCTION__))->typed.type))->base.code) == VECTOR_TYPE
) && ((enum tree_code) (((contains_struct_check ((((contains_struct_check
((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1266, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1266, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE
)
1267 && !VECTOR_FLOAT_TYPE_P (TREE_TYPE (expr))((((enum tree_code) (((contains_struct_check ((expr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1267, __FUNCTION__))->typed.type))->base.code) == VECTOR_TYPE
) && ((enum tree_code) (((contains_struct_check ((((contains_struct_check
((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1267, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1267, __FUNCTION__))->typed.type))->base.code) == REAL_TYPE
)
))
1268 {
1269 if (complain)
1270 error_at (loc1, "%<__builtin_convertvector%> first argument must "
1271 "be an integer or floating vector");
1272 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1273 }
1274
1275 if (!gnu_vector_type_p (type)
1276 || (!VECTOR_INTEGER_TYPE_P (type)((((enum tree_code) (type)->base.code) == VECTOR_TYPE) &&
((enum tree_code) (((contains_struct_check ((type), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1276, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE
)
&& !VECTOR_FLOAT_TYPE_P (type)((((enum tree_code) (type)->base.code) == VECTOR_TYPE) &&
((enum tree_code) (((contains_struct_check ((type), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1276, __FUNCTION__))->typed.type))->base.code) == REAL_TYPE
)
))
1277 {
1278 if (complain)
1279 error_at (loc2, "%<__builtin_convertvector%> second argument must "
1280 "be an integer or floating vector type");
1281 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1282 }
1283
1284 if (maybe_ne (TYPE_VECTOR_SUBPARTS (TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1284, __FUNCTION__))->typed.type)
),
1285 TYPE_VECTOR_SUBPARTS (type)))
1286 {
1287 if (complain)
1288 error_at (loc1, "%<__builtin_convertvector%> number of elements "
1289 "of the first argument vector and the second argument "
1290 "vector type should be the same");
1291 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1292 }
1293
1294 if ((TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (expr)))((tree_class_check ((((contains_struct_check ((((contains_struct_check
((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1294, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1294, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1294, __FUNCTION__))->type_common.main_variant)
1295 == TYPE_MAIN_VARIANT (TREE_TYPE (type))((tree_class_check ((((contains_struct_check ((type), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1295, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1295, __FUNCTION__))->type_common.main_variant)
)
1296 || (VECTOR_INTEGER_TYPE_P (TREE_TYPE (expr))((((enum tree_code) (((contains_struct_check ((expr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1296, __FUNCTION__))->typed.type))->base.code) == VECTOR_TYPE
) && ((enum tree_code) (((contains_struct_check ((((contains_struct_check
((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1296, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1296, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE
)
1297 && VECTOR_INTEGER_TYPE_P (type)((((enum tree_code) (type)->base.code) == VECTOR_TYPE) &&
((enum tree_code) (((contains_struct_check ((type), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1297, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE
)
1298 && (TYPE_PRECISION (TREE_TYPE (TREE_TYPE (expr)))((tree_class_check ((((contains_struct_check ((((contains_struct_check
((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1298, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1298, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1298, __FUNCTION__))->type_common.precision)
1299 == TYPE_PRECISION (TREE_TYPE (type))((tree_class_check ((((contains_struct_check ((type), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1299, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1299, __FUNCTION__))->type_common.precision)
)))
1300 return build1_loc (loc1, VIEW_CONVERT_EXPR, type, expr);
1301
1302 bool wrap = true;
1303 bool maybe_const = false;
1304 tree ret;
1305 if (!c_dialect_cxx ()((c_language & clk_cxx) != 0))
1306 {
1307 /* Avoid C_MAYBE_CONST_EXPRs inside of VEC_CONVERT argument. */
1308 expr = c_fully_fold (expr, false, &maybe_const);
1309 wrap &= maybe_const;
1310 }
1311
1312 ret = build_call_expr_internal_loc (loc1, IFN_VEC_CONVERT, type, 1, expr);
1313
1314 if (!wrap)
1315 ret = c_wrap_maybe_const (ret, true);
1316
1317 return ret;
1318}
1319
1320/* Like tree.c:get_narrower, but retain conversion from C++0x scoped enum
1321 to integral type. */
1322
1323tree
1324c_common_get_narrower (tree op, int *unsignedp_ptr)
1325{
1326 op = get_narrower (op, unsignedp_ptr);
1327
1328 if (TREE_CODE (TREE_TYPE (op))((enum tree_code) (((contains_struct_check ((op), (TS_TYPED),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1328, __FUNCTION__))->typed.type))->base.code)
== ENUMERAL_TYPE
1329 && ENUM_IS_SCOPED (TREE_TYPE (op))((tree_check ((((contains_struct_check ((op), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1329, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1329, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag)
)
1330 {
1331 /* C++0x scoped enumerations don't implicitly convert to integral
1332 type; if we stripped an explicit conversion to a larger type we
1333 need to replace it so common_type will still work. */
1334 tree type = c_common_type_for_size (TYPE_PRECISION (TREE_TYPE (op))((tree_class_check ((((contains_struct_check ((op), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1334, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1334, __FUNCTION__))->type_common.precision)
,
1335 TYPE_UNSIGNED (TREE_TYPE (op))((tree_class_check ((((contains_struct_check ((op), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1335, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1335, __FUNCTION__))->base.u.bits.unsigned_flag)
);
1336 op = fold_convert (type, op)fold_convert_loc (((location_t) 0), type, op);
1337 }
1338 return op;
1339}
1340
1341/* This is a helper function of build_binary_op.
1342
1343 For certain operations if both args were extended from the same
1344 smaller type, do the arithmetic in that type and then extend.
1345
1346 BITWISE indicates a bitwise operation.
1347 For them, this optimization is safe only if
1348 both args are zero-extended or both are sign-extended.
1349 Otherwise, we might change the result.
1350 Eg, (short)-1 | (unsigned short)-1 is (int)-1
1351 but calculated in (unsigned short) it would be (unsigned short)-1.
1352*/
1353tree
1354shorten_binary_op (tree result_type, tree op0, tree op1, bool bitwise)
1355{
1356 int unsigned0, unsigned1;
1357 tree arg0, arg1;
1358 int uns;
1359 tree type;
1360
1361 /* Cast OP0 and OP1 to RESULT_TYPE. Doing so prevents
1362 excessive narrowing when we call get_narrower below. For
1363 example, suppose that OP0 is of unsigned int extended
1364 from signed char and that RESULT_TYPE is long long int.
1365 If we explicitly cast OP0 to RESULT_TYPE, OP0 would look
1366 like
1367
1368 (long long int) (unsigned int) signed_char
1369
1370 which get_narrower would narrow down to
1371
1372 (unsigned int) signed char
1373
1374 If we do not cast OP0 first, get_narrower would return
1375 signed_char, which is inconsistent with the case of the
1376 explicit cast. */
1377 op0 = convert (result_type, op0);
1378 op1 = convert (result_type, op1);
1379
1380 arg0 = c_common_get_narrower (op0, &unsigned0);
1381 arg1 = c_common_get_narrower (op1, &unsigned1);
1382
1383 /* UNS is 1 if the operation to be done is an unsigned one. */
1384 uns = TYPE_UNSIGNED (result_type)((tree_class_check ((result_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1384, __FUNCTION__))->base.u.bits.unsigned_flag)
;
1385
1386 /* Handle the case that OP0 (or OP1) does not *contain* a conversion
1387 but it *requires* conversion to FINAL_TYPE. */
1388
1389 if ((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-family/c-common.c"
, 1389, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1389, __FUNCTION__))->type_common.precision)
1390 == TYPE_PRECISION (TREE_TYPE (arg0))((tree_class_check ((((contains_struct_check ((arg0), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1390, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1390, __FUNCTION__))->type_common.precision)
)
1391 && TREE_TYPE (op0)((contains_struct_check ((op0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1391, __FUNCTION__))->typed.type)
!= result_type)
1392 unsigned0 = TYPE_UNSIGNED (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-family/c-common.c"
, 1392, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1392, __FUNCTION__))->base.u.bits.unsigned_flag)
;
1393 if ((TYPE_PRECISION (TREE_TYPE (op1))((tree_class_check ((((contains_struct_check ((op1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1393, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1393, __FUNCTION__))->type_common.precision)
1394 == TYPE_PRECISION (TREE_TYPE (arg1))((tree_class_check ((((contains_struct_check ((arg1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1394, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1394, __FUNCTION__))->type_common.precision)
)
1395 && TREE_TYPE (op1)((contains_struct_check ((op1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1395, __FUNCTION__))->typed.type)
!= result_type)
1396 unsigned1 = TYPE_UNSIGNED (TREE_TYPE (op1))((tree_class_check ((((contains_struct_check ((op1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1396, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1396, __FUNCTION__))->base.u.bits.unsigned_flag)
;
1397
1398 /* Now UNSIGNED0 is 1 if ARG0 zero-extends to FINAL_TYPE. */
1399
1400 /* For bitwise operations, signedness of nominal type
1401 does not matter. Consider only how operands were extended. */
1402 if (bitwise)
1403 uns = unsigned0;
1404
1405 /* Note that in all three cases below we refrain from optimizing
1406 an unsigned operation on sign-extended args.
1407 That would not be valid. */
1408
1409 /* Both args variable: if both extended in same way
1410 from same width, do it in that width.
1411 Do it unsigned if args were zero-extended. */
1412 if ((TYPE_PRECISION (TREE_TYPE (arg0))((tree_class_check ((((contains_struct_check ((arg0), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1412, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1412, __FUNCTION__))->type_common.precision)
1413 < TYPE_PRECISION (result_type)((tree_class_check ((result_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1413, __FUNCTION__))->type_common.precision)
)
1414 && (TYPE_PRECISION (TREE_TYPE (arg1))((tree_class_check ((((contains_struct_check ((arg1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1414, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1414, __FUNCTION__))->type_common.precision)
1415 == TYPE_PRECISION (TREE_TYPE (arg0))((tree_class_check ((((contains_struct_check ((arg0), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1415, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1415, __FUNCTION__))->type_common.precision)
)
1416 && unsigned0 == unsigned1
1417 && (unsigned0 || !uns))
1418 return c_common_signed_or_unsigned_type
1419 (unsigned0, common_type (TREE_TYPE (arg0)((contains_struct_check ((arg0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1419, __FUNCTION__))->typed.type)
, TREE_TYPE (arg1)((contains_struct_check ((arg1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1419, __FUNCTION__))->typed.type)
));
1420
1421 else if (TREE_CODE (arg0)((enum tree_code) (arg0)->base.code) == INTEGER_CST
1422 && (unsigned1 || !uns)
1423 && (TYPE_PRECISION (TREE_TYPE (arg1))((tree_class_check ((((contains_struct_check ((arg1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1423, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1423, __FUNCTION__))->type_common.precision)
1424 < TYPE_PRECISION (result_type)((tree_class_check ((result_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1424, __FUNCTION__))->type_common.precision)
)
1425 && (type
1426 = c_common_signed_or_unsigned_type (unsigned1,
1427 TREE_TYPE (arg1)((contains_struct_check ((arg1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1427, __FUNCTION__))->typed.type)
))
1428 && !POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || (
(enum tree_code) (type)->base.code) == REFERENCE_TYPE)
1429 && int_fits_type_p (arg0, type))
1430 return type;
1431
1432 else if (TREE_CODE (arg1)((enum tree_code) (arg1)->base.code) == INTEGER_CST
1433 && (unsigned0 || !uns)
1434 && (TYPE_PRECISION (TREE_TYPE (arg0))((tree_class_check ((((contains_struct_check ((arg0), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1434, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1434, __FUNCTION__))->type_common.precision)
1435 < TYPE_PRECISION (result_type)((tree_class_check ((result_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1435, __FUNCTION__))->type_common.precision)
)
1436 && (type
1437 = c_common_signed_or_unsigned_type (unsigned0,
1438 TREE_TYPE (arg0)((contains_struct_check ((arg0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1438, __FUNCTION__))->typed.type)
))
1439 && !POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || (
(enum tree_code) (type)->base.code) == REFERENCE_TYPE)
1440 && int_fits_type_p (arg1, type))
1441 return type;
1442
1443 return result_type;
1444}
1445
1446/* Returns true iff any integer value of type FROM_TYPE can be represented as
1447 real of type TO_TYPE. This is a helper function for unsafe_conversion_p. */
1448
1449static bool
1450int_safely_convertible_to_real_p (const_tree from_type, const_tree to_type)
1451{
1452 tree type_low_bound = TYPE_MIN_VALUE (from_type)((tree_check5 ((from_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1452, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.minval
)
;
1453 tree type_high_bound = TYPE_MAX_VALUE (from_type)((tree_check5 ((from_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1453, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)
;
1454 REAL_VALUE_TYPEstruct real_value real_low_bound =
1455 real_value_from_int_cst (0, type_low_bound);
1456 REAL_VALUE_TYPEstruct real_value real_high_bound =
1457 real_value_from_int_cst (0, type_high_bound);
1458
1459 return exact_real_truncate (TYPE_MODE (to_type)((((enum tree_code) ((tree_class_check ((to_type), (tcc_type)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1459, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(to_type) : (to_type)->type_common.mode)
, &real_low_bound)
1460 && exact_real_truncate (TYPE_MODE (to_type)((((enum tree_code) ((tree_class_check ((to_type), (tcc_type)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1460, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(to_type) : (to_type)->type_common.mode)
, &real_high_bound);
1461}
1462
1463/* Checks if expression EXPR of complex/real/integer type cannot be converted
1464 to the complex/real/integer type TYPE. Function returns non-zero when:
1465 * EXPR is a constant which cannot be exactly converted to TYPE.
1466 * EXPR is not a constant and size of EXPR's type > than size of TYPE,
1467 for EXPR type and TYPE being both integers or both real, or both
1468 complex.
1469 * EXPR is not a constant of complex type and TYPE is a real or
1470 an integer.
1471 * EXPR is not a constant of real type and TYPE is an integer.
1472 * EXPR is not a constant of integer type which cannot be
1473 exactly converted to real type.
1474
1475 Function allows conversions between types of different signedness if
1476 CHECK_SIGN is false and can return SAFE_CONVERSION (zero) in that
1477 case. Function can return UNSAFE_SIGN if CHECK_SIGN is true.
1478
1479 RESULT, when non-null is the result of the conversion. When constant
1480 it is included in the text of diagnostics.
1481
1482 Function allows conversions from complex constants to non-complex types,
1483 provided that imaginary part is zero and real part can be safely converted
1484 to TYPE. */
1485
1486enum conversion_safety
1487unsafe_conversion_p (tree type, tree expr, tree result, bool check_sign)
1488{
1489 enum conversion_safety give_warning = SAFE_CONVERSION; /* is 0 or false */
1490 tree expr_type = TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1490, __FUNCTION__))->typed.type)
;
1491
1492 expr = fold_for_warn (expr);
1493
1494 if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == REAL_CST || TREE_CODE (expr)((enum tree_code) (expr)->base.code) == INTEGER_CST)
1495 {
1496 /* If type is complex, we are interested in compatibility with
1497 underlying type. */
1498 if (TREE_CODE (type)((enum tree_code) (type)->base.code) == COMPLEX_TYPE)
1499 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1499, __FUNCTION__))->typed.type)
;
1500
1501 /* Warn for real constant that is not an exact integer converted
1502 to integer type. */
1503 if (TREE_CODE (expr_type)((enum tree_code) (expr_type)->base.code) == REAL_TYPE
1504 && TREE_CODE (type)((enum tree_code) (type)->base.code) == INTEGER_TYPE)
1505 {
1506 if (!real_isinteger (TREE_REAL_CST_PTR (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1506, __FUNCTION__, (REAL_CST)))->real_cst.real_cst_ptr)
, TYPE_MODE (expr_type)((((enum tree_code) ((tree_class_check ((expr_type), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1506, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(expr_type) : (expr_type)->type_common.mode)
))
1507 give_warning = UNSAFE_REAL;
1508 }
1509 /* Warn for an integer constant that does not fit into integer type. */
1510 else if (TREE_CODE (expr_type)((enum tree_code) (expr_type)->base.code) == INTEGER_TYPE
1511 && TREE_CODE (type)((enum tree_code) (type)->base.code) == INTEGER_TYPE
1512 && !int_fits_type_p (expr, type))
1513 {
1514 if (TYPE_UNSIGNED (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1514, __FUNCTION__))->base.u.bits.unsigned_flag)
&& !TYPE_UNSIGNED (expr_type)((tree_class_check ((expr_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1514, __FUNCTION__))->base.u.bits.unsigned_flag)
1515 && tree_int_cst_sgn (expr) < 0)
1516 {
1517 if (check_sign)
1518 give_warning = UNSAFE_SIGN;
1519 }
1520 else if (!TYPE_UNSIGNED (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1520, __FUNCTION__))->base.u.bits.unsigned_flag)
&& TYPE_UNSIGNED (expr_type)((tree_class_check ((expr_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1520, __FUNCTION__))->base.u.bits.unsigned_flag)
)
1521 {
1522 if (check_sign)
1523 give_warning = UNSAFE_SIGN;
1524 }
1525 else
1526 give_warning = UNSAFE_OTHER;
1527 }
1528 else if (TREE_CODE (type)((enum tree_code) (type)->base.code) == REAL_TYPE)
1529 {
1530 /* Warn for an integer constant that does not fit into real type. */
1531 if (TREE_CODE (expr_type)((enum tree_code) (expr_type)->base.code) == INTEGER_TYPE)
1532 {
1533 REAL_VALUE_TYPEstruct real_value a = real_value_from_int_cst (0, expr);
1534 if (!exact_real_truncate (TYPE_MODE (type)((((enum tree_code) ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1534, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(type) : (type)->type_common.mode)
, &a))
1535 give_warning = UNSAFE_REAL;
1536 }
1537 /* Warn for a real constant that does not fit into a smaller
1538 real type. */
1539 else if (TREE_CODE (expr_type)((enum tree_code) (expr_type)->base.code) == REAL_TYPE
1540 && TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1540, __FUNCTION__))->type_common.precision)
< TYPE_PRECISION (expr_type)((tree_class_check ((expr_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1540, __FUNCTION__))->type_common.precision)
)
1541 {
1542 REAL_VALUE_TYPEstruct real_value a = TREE_REAL_CST (expr)(*((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1542, __FUNCTION__, (REAL_CST)))->real_cst.real_cst_ptr)
)
;
1543 if (!exact_real_truncate (TYPE_MODE (type)((((enum tree_code) ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1543, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(type) : (type)->type_common.mode)
, &a))
1544 give_warning = UNSAFE_REAL;
1545 }
1546 }
1547 }
1548
1549 else if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == COMPLEX_CST)
1550 {
1551 tree imag_part = TREE_IMAGPART (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1551, __FUNCTION__, (COMPLEX_CST)))->complex.imag)
;
1552 /* Conversion from complex constant with zero imaginary part,
1553 perform check for conversion of real part. */
1554 if ((TREE_CODE (imag_part)((enum tree_code) (imag_part)->base.code) == REAL_CST
1555 && real_zerop (imag_part))
1556 || (TREE_CODE (imag_part)((enum tree_code) (imag_part)->base.code) == INTEGER_CST
1557 && integer_zerop (imag_part)))
1558 /* Note: in this branch we use recursive call to unsafe_conversion_p
1559 with different type of EXPR, but it is still safe, because when EXPR
1560 is a constant, it's type is not used in text of generated warnings
1561 (otherwise they could sound misleading). */
1562 return unsafe_conversion_p (type, TREE_REALPART (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1562, __FUNCTION__, (COMPLEX_CST)))->complex.real)
, result,
1563 check_sign);
1564 /* Conversion from complex constant with non-zero imaginary part. */
1565 else
1566 {
1567 /* Conversion to complex type.
1568 Perform checks for both real and imaginary parts. */
1569 if (TREE_CODE (type)((enum tree_code) (type)->base.code) == COMPLEX_TYPE)
1570 {
1571 enum conversion_safety re_safety =
1572 unsafe_conversion_p (type, TREE_REALPART (expr)((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1572, __FUNCTION__, (COMPLEX_CST)))->complex.real)
,
1573 result, check_sign);
1574 enum conversion_safety im_safety =
1575 unsafe_conversion_p (type, imag_part, result, check_sign);
1576
1577 /* Merge the results into appropriate single warning. */
1578
1579 /* Note: this case includes SAFE_CONVERSION, i.e. success. */
1580 if (re_safety == im_safety)
1581 give_warning = re_safety;
1582 else if (!re_safety && im_safety)
1583 give_warning = im_safety;
1584 else if (re_safety && !im_safety)
1585 give_warning = re_safety;
1586 else
1587 give_warning = UNSAFE_OTHER;
1588 }
1589 /* Warn about conversion from complex to real or integer type. */
1590 else
1591 give_warning = UNSAFE_IMAGINARY;
1592 }
1593 }
1594
1595 /* Checks for remaining case: EXPR is not constant. */
1596 else
1597 {
1598 /* Warn for real types converted to integer types. */
1599 if (TREE_CODE (expr_type)((enum tree_code) (expr_type)->base.code) == REAL_TYPE
1600 && TREE_CODE (type)((enum tree_code) (type)->base.code) == INTEGER_TYPE)
1601 give_warning = UNSAFE_REAL;
1602
1603 else if (TREE_CODE (expr_type)((enum tree_code) (expr_type)->base.code) == INTEGER_TYPE
1604 && TREE_CODE (type)((enum tree_code) (type)->base.code) == INTEGER_TYPE)
1605 {
1606 /* Don't warn about unsigned char y = 0xff, x = (int) y; */
1607 expr = get_unwidened (expr, 0);
1608 expr_type = TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1608, __FUNCTION__))->typed.type)
;
1609
1610 /* Don't warn for short y; short x = ((int)y & 0xff); */
1611 if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == BIT_AND_EXPR
1612 || TREE_CODE (expr)((enum tree_code) (expr)->base.code) == BIT_IOR_EXPR
1613 || TREE_CODE (expr)((enum tree_code) (expr)->base.code) == BIT_XOR_EXPR)
1614 {
1615 /* If both args were extended from a shortest type,
1616 use that type if that is safe. */
1617 expr_type = shorten_binary_op (expr_type,
1618 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-family/c-common.c"
, 1618, __FUNCTION__)))))
,
1619 TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1619, __FUNCTION__)))))
,
1620 /* bitwise */1);
1621
1622 if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == BIT_AND_EXPR)
1623 {
1624 tree op0 = TREE_OPERAND (expr, 0)(*((const_cast<tree*> (tree_operand_check ((expr), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1624, __FUNCTION__)))))
;
1625 tree op1 = TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1625, __FUNCTION__)))))
;
1626 bool unsigned0 = TYPE_UNSIGNED (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-family/c-common.c"
, 1626, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1626, __FUNCTION__))->base.u.bits.unsigned_flag)
;
1627 bool unsigned1 = TYPE_UNSIGNED (TREE_TYPE (op1))((tree_class_check ((((contains_struct_check ((op1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1627, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1627, __FUNCTION__))->base.u.bits.unsigned_flag)
;
1628
1629 /* If one of the operands is a non-negative constant
1630 that fits in the target type, then the type of the
1631 other operand does not matter. */
1632 if ((TREE_CODE (op0)((enum tree_code) (op0)->base.code) == INTEGER_CST
1633 && int_fits_type_p (op0, c_common_signed_type (type))
1634 && int_fits_type_p (op0, c_common_unsigned_type (type)))
1635 || (TREE_CODE (op1)((enum tree_code) (op1)->base.code) == INTEGER_CST
1636 && int_fits_type_p (op1, c_common_signed_type (type))
1637 && int_fits_type_p (op1,
1638 c_common_unsigned_type (type))))
1639 return SAFE_CONVERSION;
1640 /* If constant is unsigned and fits in the target
1641 type, then the result will also fit. */
1642 else if ((TREE_CODE (op0)((enum tree_code) (op0)->base.code) == INTEGER_CST
1643 && unsigned0
1644 && int_fits_type_p (op0, type))
1645 || (TREE_CODE (op1)((enum tree_code) (op1)->base.code) == INTEGER_CST
1646 && unsigned1
1647 && int_fits_type_p (op1, type)))
1648 return SAFE_CONVERSION;
1649 }
1650 }
1651 /* Warn for integer types converted to smaller integer types. */
1652 if (TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1652, __FUNCTION__))->type_common.precision)
< TYPE_PRECISION (expr_type)((tree_class_check ((expr_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1652, __FUNCTION__))->type_common.precision)
)
1653 give_warning = UNSAFE_OTHER;
1654
1655 /* When they are the same width but different signedness,
1656 then the value may change. */
1657 else if (((TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1657, __FUNCTION__))->type_common.precision)
== TYPE_PRECISION (expr_type)((tree_class_check ((expr_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1657, __FUNCTION__))->type_common.precision)
1658 && TYPE_UNSIGNED (expr_type)((tree_class_check ((expr_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1658, __FUNCTION__))->base.u.bits.unsigned_flag)
!= TYPE_UNSIGNED (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1658, __FUNCTION__))->base.u.bits.unsigned_flag)
)
1659 /* Even when converted to a bigger type, if the type is
1660 unsigned but expr is signed, then negative values
1661 will be changed. */
1662 || (TYPE_UNSIGNED (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1662, __FUNCTION__))->base.u.bits.unsigned_flag)
&& !TYPE_UNSIGNED (expr_type)((tree_class_check ((expr_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1662, __FUNCTION__))->base.u.bits.unsigned_flag)
))
1663 && check_sign)
1664 give_warning = UNSAFE_SIGN;
1665 }
1666
1667 /* Warn for integer types converted to real types if and only if
1668 all the range of values of the integer type cannot be
1669 represented by the real type. */
1670 else if (TREE_CODE (expr_type)((enum tree_code) (expr_type)->base.code) == INTEGER_TYPE
1671 && TREE_CODE (type)((enum tree_code) (type)->base.code) == REAL_TYPE)
1672 {
1673 /* Don't warn about char y = 0xff; float x = (int) y; */
1674 expr = get_unwidened (expr, 0);
1675 expr_type = TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1675, __FUNCTION__))->typed.type)
;
1676
1677 if (!int_safely_convertible_to_real_p (expr_type, type))
1678 give_warning = UNSAFE_OTHER;
1679 }
1680
1681 /* Warn for real types converted to smaller real types. */
1682 else if (TREE_CODE (expr_type)((enum tree_code) (expr_type)->base.code) == REAL_TYPE
1683 && TREE_CODE (type)((enum tree_code) (type)->base.code) == REAL_TYPE
1684 && TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1684, __FUNCTION__))->type_common.precision)
< TYPE_PRECISION (expr_type)((tree_class_check ((expr_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1684, __FUNCTION__))->type_common.precision)
)
1685 give_warning = UNSAFE_REAL;
1686
1687 /* Check conversion between two complex types. */
1688 else if (TREE_CODE (expr_type)((enum tree_code) (expr_type)->base.code) == COMPLEX_TYPE
1689 && TREE_CODE (type)((enum tree_code) (type)->base.code) == COMPLEX_TYPE)
1690 {
1691 /* Extract underlying types (i.e., type of real and imaginary
1692 parts) of expr_type and type. */
1693 tree from_type = TREE_TYPE (expr_type)((contains_struct_check ((expr_type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1693, __FUNCTION__))->typed.type)
;
1694 tree to_type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1694, __FUNCTION__))->typed.type)
;
1695
1696 /* Warn for real types converted to integer types. */
1697 if (TREE_CODE (from_type)((enum tree_code) (from_type)->base.code) == REAL_TYPE
1698 && TREE_CODE (to_type)((enum tree_code) (to_type)->base.code) == INTEGER_TYPE)
1699 give_warning = UNSAFE_REAL;
1700
1701 /* Warn for real types converted to smaller real types. */
1702 else if (TREE_CODE (from_type)((enum tree_code) (from_type)->base.code) == REAL_TYPE
1703 && TREE_CODE (to_type)((enum tree_code) (to_type)->base.code) == REAL_TYPE
1704 && TYPE_PRECISION (to_type)((tree_class_check ((to_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1704, __FUNCTION__))->type_common.precision)
< TYPE_PRECISION (from_type)((tree_class_check ((from_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1704, __FUNCTION__))->type_common.precision)
)
1705 give_warning = UNSAFE_REAL;
1706
1707 /* Check conversion for complex integer types. Here implementation
1708 is simpler than for real-domain integers because it does not
1709 involve sophisticated cases, such as bitmasks, casts, etc. */
1710 else if (TREE_CODE (from_type)((enum tree_code) (from_type)->base.code) == INTEGER_TYPE
1711 && TREE_CODE (to_type)((enum tree_code) (to_type)->base.code) == INTEGER_TYPE)
1712 {
1713 /* Warn for integer types converted to smaller integer types. */
1714 if (TYPE_PRECISION (to_type)((tree_class_check ((to_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1714, __FUNCTION__))->type_common.precision)
< TYPE_PRECISION (from_type)((tree_class_check ((from_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1714, __FUNCTION__))->type_common.precision)
)
1715 give_warning = UNSAFE_OTHER;
1716
1717 /* Check for different signedness, see case for real-domain
1718 integers (above) for a more detailed comment. */
1719 else if (((TYPE_PRECISION (to_type)((tree_class_check ((to_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1719, __FUNCTION__))->type_common.precision)
== TYPE_PRECISION (from_type)((tree_class_check ((from_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1719, __FUNCTION__))->type_common.precision)
1720 && TYPE_UNSIGNED (to_type)((tree_class_check ((to_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1720, __FUNCTION__))->base.u.bits.unsigned_flag)
!= TYPE_UNSIGNED (from_type)((tree_class_check ((from_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1720, __FUNCTION__))->base.u.bits.unsigned_flag)
)
1721 || (TYPE_UNSIGNED (to_type)((tree_class_check ((to_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1721, __FUNCTION__))->base.u.bits.unsigned_flag)
&& !TYPE_UNSIGNED (from_type)((tree_class_check ((from_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1721, __FUNCTION__))->base.u.bits.unsigned_flag)
))
1722 && check_sign)
1723 give_warning = UNSAFE_SIGN;
1724 }
1725 else if (TREE_CODE (from_type)((enum tree_code) (from_type)->base.code) == INTEGER_TYPE
1726 && TREE_CODE (to_type)((enum tree_code) (to_type)->base.code) == REAL_TYPE
1727 && !int_safely_convertible_to_real_p (from_type, to_type))
1728 give_warning = UNSAFE_OTHER;
1729 }
1730
1731 /* Warn for complex types converted to real or integer types. */
1732 else if (TREE_CODE (expr_type)((enum tree_code) (expr_type)->base.code) == COMPLEX_TYPE
1733 && TREE_CODE (type)((enum tree_code) (type)->base.code) != COMPLEX_TYPE)
1734 give_warning = UNSAFE_IMAGINARY;
1735 }
1736
1737 return give_warning;
1738}
1739
1740
1741/* Convert EXPR to TYPE, warning about conversion problems with constants.
1742 Invoke this function on every expression that is converted implicitly,
1743 i.e. because of language rules and not because of an explicit cast.
1744 INIT_CONST is true if the conversion is for arithmetic types for a static
1745 initializer and folding must apply accordingly (discarding floating-point
1746 exceptions and assuming the default rounding mode is in effect). */
1747
1748tree
1749convert_and_check (location_t loc, tree type, tree expr, bool init_const)
1750{
1751 tree result;
1752 tree expr_for_warning;
1753
1754 /* Convert from a value with possible excess precision rather than
1755 via the semantic type, but do not warn about values not fitting
1756 exactly in the semantic type. */
1757 if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == EXCESS_PRECISION_EXPR)
1758 {
1759 tree orig_type = TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1759, __FUNCTION__))->typed.type)
;
1760 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-family/c-common.c"
, 1760, __FUNCTION__)))))
;
1761 expr_for_warning = (init_const
1762 ? convert_init (orig_type, expr)
1763 : convert (orig_type, expr));
1764 if (orig_type == type)
1765 return expr_for_warning;
1766 }
1767 else
1768 expr_for_warning = expr;
1769
1770 if (TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1770, __FUNCTION__))->typed.type)
== type)
1771 return expr;
1772
1773 result = init_const ? convert_init (type, expr) : convert (type, expr);
1774
1775 if (c_inhibit_evaluation_warnings == 0
1776 && !TREE_OVERFLOW_P (expr)((tree_code_type[(int) (((enum tree_code) (expr)->base.code
))] == tcc_constant) && ((tree_class_check ((expr), (
tcc_constant), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1776, __FUNCTION__))->base.public_flag))
1777 && result != error_mark_nodeglobal_trees[TI_ERROR_MARK])
1778 warnings_for_convert_and_check (loc, type, expr_for_warning, result);
1779
1780 return result;
1781}
1782
1783/* A node in a list that describes references to variables (EXPR), which are
1784 either read accesses if WRITER is zero, or write accesses, in which case
1785 WRITER is the parent of EXPR. */
1786struct tlist
1787{
1788 struct tlist *next;
1789 tree expr, writer;
1790};
1791
1792/* Used to implement a cache the results of a call to verify_tree. We only
1793 use this for SAVE_EXPRs. */
1794struct tlist_cache
1795{
1796 struct tlist_cache *next;
1797 struct tlist *cache_before_sp;
1798 struct tlist *cache_after_sp;
1799 tree expr;
1800};
1801
1802/* Obstack to use when allocating tlist structures, and corresponding
1803 firstobj. */
1804static struct obstack tlist_obstack;
1805static char *tlist_firstobj = 0;
1806
1807/* Keep track of the identifiers we've warned about, so we can avoid duplicate
1808 warnings. */
1809static struct tlist *warned_ids;
1810/* SAVE_EXPRs need special treatment. We process them only once and then
1811 cache the results. */
1812static struct tlist_cache *save_expr_cache;
1813
1814static void add_tlist (struct tlist **, struct tlist *, tree, int);
1815static void merge_tlist (struct tlist **, struct tlist *, int);
1816static void verify_tree (tree, struct tlist **, struct tlist **, tree);
1817static bool warning_candidate_p (tree);
1818static bool candidate_equal_p (const_tree, const_tree);
1819static void warn_for_collisions (struct tlist *);
1820static void warn_for_collisions_1 (tree, tree, struct tlist *, int);
1821static struct tlist *new_tlist (struct tlist *, tree, tree);
1822
1823/* Create a new struct tlist and fill in its fields. */
1824static struct tlist *
1825new_tlist (struct tlist *next, tree t, tree writer)
1826{
1827 struct tlist *l;
1828 l = XOBNEW (&tlist_obstack, struct tlist)((struct tlist *) __extension__ ({ struct obstack *__h = ((&
tlist_obstack)); __extension__ ({ struct obstack *__o = (__h)
; size_t __len = ((sizeof (struct tlist))); 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; }); }))
;
1829 l->next = next;
1830 l->expr = t;
1831 l->writer = writer;
1832 return l;
1833}
1834
1835/* Add duplicates of the nodes found in ADD to the list *TO. If EXCLUDE_WRITER
1836 is nonnull, we ignore any node we find which has a writer equal to it. */
1837
1838static void
1839add_tlist (struct tlist **to, struct tlist *add, tree exclude_writer, int copy)
1840{
1841 while (add)
1842 {
1843 struct tlist *next = add->next;
1844 if (!copy)
1845 add->next = *to;
1846 if (!exclude_writer || !candidate_equal_p (add->writer, exclude_writer))
1847 *to = copy ? new_tlist (*to, add->expr, add->writer) : add;
1848 add = next;
1849 }
1850}
1851
1852/* Merge the nodes of ADD into TO. This merging process is done so that for
1853 each variable that already exists in TO, no new node is added; however if
1854 there is a write access recorded in ADD, and an occurrence on TO is only
1855 a read access, then the occurrence in TO will be modified to record the
1856 write. */
1857
1858static void
1859merge_tlist (struct tlist **to, struct tlist *add, int copy)
1860{
1861 struct tlist **end = to;
1862
1863 while (*end)
1864 end = &(*end)->next;
1865
1866 while (add)
1867 {
1868 int found = 0;
1869 struct tlist *tmp2;
1870 struct tlist *next = add->next;
1871
1872 for (tmp2 = *to; tmp2; tmp2 = tmp2->next)
1873 if (candidate_equal_p (tmp2->expr, add->expr))
1874 {
1875 found = 1;
1876 if (!tmp2->writer)
1877 tmp2->writer = add->writer;
1878 }
1879 if (!found)
1880 {
1881 *end = copy ? new_tlist (NULL__null, add->expr, add->writer) : add;
1882 end = &(*end)->next;
1883 *end = 0;
1884 }
1885 add = next;
1886 }
1887}
1888
1889/* WRITTEN is a variable, WRITER is its parent. Warn if any of the variable
1890 references in list LIST conflict with it, excluding reads if ONLY writers
1891 is nonzero. */
1892
1893static void
1894warn_for_collisions_1 (tree written, tree writer, struct tlist *list,
1895 int only_writes)
1896{
1897 struct tlist *tmp;
1898
1899 /* Avoid duplicate warnings. */
1900 for (tmp = warned_ids; tmp; tmp = tmp->next)
1901 if (candidate_equal_p (tmp->expr, written))
1902 return;
1903
1904 while (list)
1905 {
1906 if (candidate_equal_p (list->expr, written)
1907 && !candidate_equal_p (list->writer, writer)
1908 && (!only_writes || list->writer))
1909 {
1910 warned_ids = new_tlist (warned_ids, written, NULL_TREE(tree) __null);
1911 warning_at (EXPR_LOC_OR_LOC (writer, input_location)((((IS_ADHOC_LOC (((((writer)) && ((tree_code_type[(int
) (((enum tree_code) ((writer))->base.code))]) >= tcc_reference
&& (tree_code_type[(int) (((enum tree_code) ((writer
))->base.code))]) <= tcc_expression)) ? (writer)->exp
.locus : ((location_t) 0)))) ? get_location_from_adhoc_loc (line_table
, ((((writer)) && ((tree_code_type[(int) (((enum tree_code
) ((writer))->base.code))]) >= tcc_reference &&
(tree_code_type[(int) (((enum tree_code) ((writer))->base
.code))]) <= tcc_expression)) ? (writer)->exp.locus : (
(location_t) 0))) : (((((writer)) && ((tree_code_type
[(int) (((enum tree_code) ((writer))->base.code))]) >= tcc_reference
&& (tree_code_type[(int) (((enum tree_code) ((writer
))->base.code))]) <= tcc_expression)) ? (writer)->exp
.locus : ((location_t) 0)))) != ((location_t) 0)) ? (writer)->
exp.locus : (input_location))
,
1912 OPT_Wsequence_point, "operation on %qE may be undefined",
1913 list->expr);
1914 }
1915 list = list->next;
1916 }
1917}
1918
1919/* Given a list LIST of references to variables, find whether any of these
1920 can cause conflicts due to missing sequence points. */
1921
1922static void
1923warn_for_collisions (struct tlist *list)
1924{
1925 struct tlist *tmp;
1926
1927 for (tmp = list; tmp; tmp = tmp->next)
1928 {
1929 if (tmp->writer)
1930 warn_for_collisions_1 (tmp->expr, tmp->writer, list, 0);
1931 }
1932}
1933
1934/* Return nonzero if X is a tree that can be verified by the sequence point
1935 warnings. */
1936
1937static bool
1938warning_candidate_p (tree x)
1939{
1940 if (DECL_P (x)(tree_code_type[(int) (((enum tree_code) (x)->base.code))]
== tcc_declaration)
&& DECL_ARTIFICIAL (x)((contains_struct_check ((x), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1940, __FUNCTION__))->decl_common.artificial_flag)
)
1941 return false;
1942
1943 if (TREE_CODE (x)((enum tree_code) (x)->base.code) == BLOCK)
1944 return false;
1945
1946 /* VOID_TYPE_P (TREE_TYPE (x)) is workaround for cp/tree.c
1947 (lvalue_p) crash on TRY/CATCH. */
1948 if (TREE_TYPE (x)((contains_struct_check ((x), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1948, __FUNCTION__))->typed.type)
== NULL_TREE(tree) __null || VOID_TYPE_P (TREE_TYPE (x))(((enum tree_code) (((contains_struct_check ((x), (TS_TYPED),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 1948, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
)
)
1949 return false;
1950
1951 if (!lvalue_p (x))
1952 return false;
1953
1954 /* No point to track non-const calls, they will never satisfy
1955 operand_equal_p. */
1956 if (TREE_CODE (x)((enum tree_code) (x)->base.code) == CALL_EXPR && (call_expr_flags (x) & ECF_CONST(1 << 0)) == 0)
1957 return false;
1958
1959 if (TREE_CODE (x)((enum tree_code) (x)->base.code) == STRING_CST)
1960 return false;
1961
1962 return true;
1963}
1964
1965/* Return nonzero if X and Y appear to be the same candidate (or NULL) */
1966static bool
1967candidate_equal_p (const_tree x, const_tree y)
1968{
1969 return (x == y) || (x && y && operand_equal_p (x, y, 0));
1970}
1971
1972/* Walk the tree X, and record accesses to variables. If X is written by the
1973 parent tree, WRITER is the parent.
1974 We store accesses in one of the two lists: PBEFORE_SP, and PNO_SP. If this
1975 expression or its only operand forces a sequence point, then everything up
1976 to the sequence point is stored in PBEFORE_SP. Everything else gets stored
1977 in PNO_SP.
1978 Once we return, we will have emitted warnings if any subexpression before
1979 such a sequence point could be undefined. On a higher level, however, the
1980 sequence point may not be relevant, and we'll merge the two lists.
1981
1982 Example: (b++, a) + b;
1983 The call that processes the COMPOUND_EXPR will store the increment of B
1984 in PBEFORE_SP, and the use of A in PNO_SP. The higher-level call that
1985 processes the PLUS_EXPR will need to merge the two lists so that
1986 eventually, all accesses end up on the same list (and we'll warn about the
1987 unordered subexpressions b++ and b.
1988
1989 A note on merging. If we modify the former example so that our expression
1990 becomes
1991 (b++, b) + a
1992 care must be taken not simply to add all three expressions into the final
1993 PNO_SP list. The function merge_tlist takes care of that by merging the
1994 before-SP list of the COMPOUND_EXPR into its after-SP list in a special
1995 way, so that no more than one access to B is recorded. */
1996
1997static void
1998verify_tree (tree x, struct tlist **pbefore_sp, struct tlist **pno_sp,
1999 tree writer)
2000{
2001 struct tlist *tmp_before, *tmp_nosp, *tmp_list2, *tmp_list3;
2002 enum tree_code code;
2003 enum tree_code_class cl;
2004
2005 /* X may be NULL if it is the operand of an empty statement expression
2006 ({ }). */
2007 if (x == NULL__null)
2008 return;
2009
2010 restart:
2011 code = TREE_CODE (x)((enum tree_code) (x)->base.code);
2012 cl = TREE_CODE_CLASS (code)tree_code_type[(int) (code)];
2013
2014 if (warning_candidate_p (x))
2015 *pno_sp = new_tlist (*pno_sp, x, writer);
2016
2017 switch (code)
2018 {
2019 case CONSTRUCTOR:
2020 case SIZEOF_EXPR:
2021 case PAREN_SIZEOF_EXPR:
2022 return;
2023
2024 case COMPOUND_EXPR:
2025 case TRUTH_ANDIF_EXPR:
2026 case TRUTH_ORIF_EXPR:
2027 sequenced_binary:
2028 tmp_before = tmp_nosp = tmp_list2 = tmp_list3 = 0;
2029 verify_tree (TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2029, __FUNCTION__)))))
, &tmp_before, &tmp_nosp, NULL_TREE(tree) __null);
2030 warn_for_collisions (tmp_nosp);
2031 merge_tlist (pbefore_sp, tmp_before, 0);
2032 merge_tlist (pbefore_sp, tmp_nosp, 0);
2033 verify_tree (TREE_OPERAND (x, 1)(*((const_cast<tree*> (tree_operand_check ((x), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2033, __FUNCTION__)))))
, &tmp_list3, &tmp_list2, NULL_TREE(tree) __null);
2034 warn_for_collisions (tmp_list2);
2035 merge_tlist (pbefore_sp, tmp_list3, 0);
2036 merge_tlist (pno_sp, tmp_list2, 0);
2037 return;
2038
2039 case COND_EXPR:
2040 tmp_before = tmp_list2 = 0;
2041 verify_tree (TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2041, __FUNCTION__)))))
, &tmp_before, &tmp_list2, NULL_TREE(tree) __null);
2042 warn_for_collisions (tmp_list2);
2043 merge_tlist (pbefore_sp, tmp_before, 0);
2044 merge_tlist (pbefore_sp, tmp_list2, 0);
2045
2046 tmp_list3 = tmp_nosp = 0;
2047 verify_tree (TREE_OPERAND (x, 1)(*((const_cast<tree*> (tree_operand_check ((x), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2047, __FUNCTION__)))))
, &tmp_list3, &tmp_nosp, NULL_TREE(tree) __null);
2048 warn_for_collisions (tmp_nosp);
2049 merge_tlist (pbefore_sp, tmp_list3, 0);
2050
2051 tmp_list3 = tmp_list2 = 0;
2052 verify_tree (TREE_OPERAND (x, 2)(*((const_cast<tree*> (tree_operand_check ((x), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2052, __FUNCTION__)))))
, &tmp_list3, &tmp_list2, NULL_TREE(tree) __null);
2053 warn_for_collisions (tmp_list2);
2054 merge_tlist (pbefore_sp, tmp_list3, 0);
2055 /* Rather than add both tmp_nosp and tmp_list2, we have to merge the
2056 two first, to avoid warning for (a ? b++ : b++). */
2057 merge_tlist (&tmp_nosp, tmp_list2, 0);
2058 add_tlist (pno_sp, tmp_nosp, NULL_TREE(tree) __null, 0);
2059 return;
2060
2061 case PREDECREMENT_EXPR:
2062 case PREINCREMENT_EXPR:
2063 case POSTDECREMENT_EXPR:
2064 case POSTINCREMENT_EXPR:
2065 verify_tree (TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2065, __FUNCTION__)))))
, pno_sp, pno_sp, x);
2066 return;
2067
2068 case MODIFY_EXPR:
2069 tmp_before = tmp_nosp = tmp_list3 = 0;
2070 verify_tree (TREE_OPERAND (x, 1)(*((const_cast<tree*> (tree_operand_check ((x), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2070, __FUNCTION__)))))
, &tmp_before, &tmp_nosp, NULL_TREE(tree) __null);
2071 verify_tree (TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2071, __FUNCTION__)))))
, &tmp_list3, &tmp_list3, x);
2072 /* Expressions inside the LHS are not ordered wrt. the sequence points
2073 in the RHS. Example:
2074 *a = (a++, 2)
2075 Despite the fact that the modification of "a" is in the before_sp
2076 list (tmp_before), it conflicts with the use of "a" in the LHS.
2077 We can handle this by adding the contents of tmp_list3
2078 to those of tmp_before, and redoing the collision warnings for that
2079 list. */
2080 add_tlist (&tmp_before, tmp_list3, x, 1);
2081 warn_for_collisions (tmp_before);
2082 /* Exclude the LHS itself here; we first have to merge it into the
2083 tmp_nosp list. This is done to avoid warning for "a = a"; if we
2084 didn't exclude the LHS, we'd get it twice, once as a read and once
2085 as a write. */
2086 add_tlist (pno_sp, tmp_list3, x, 0);
2087 warn_for_collisions_1 (TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2087, __FUNCTION__)))))
, x, tmp_nosp, 1);
2088
2089 merge_tlist (pbefore_sp, tmp_before, 0);
2090 if (warning_candidate_p (TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2090, __FUNCTION__)))))
))
2091 merge_tlist (&tmp_nosp, new_tlist (NULL__null, TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2091, __FUNCTION__)))))
, x), 0);
2092 add_tlist (pno_sp, tmp_nosp, NULL_TREE(tree) __null, 1);
2093 return;
2094
2095 case CALL_EXPR:
2096 /* We need to warn about conflicts among arguments and conflicts between
2097 args and the function address. Side effects of the function address,
2098 however, are not ordered by the sequence point of the call. */
2099 {
2100 call_expr_arg_iterator iter;
2101 tree arg;
2102 tmp_before = tmp_nosp = 0;
2103 verify_tree (CALL_EXPR_FN (x)(*((const_cast<tree*> (tree_operand_check (((tree_check
((x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2103, __FUNCTION__, (CALL_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2103, __FUNCTION__)))))
, &tmp_before, &tmp_nosp, NULL_TREE(tree) __null);
2104 FOR_EACH_CALL_EXPR_ARG (arg, iter, x)for ((arg) = first_call_expr_arg ((x), &(iter)); (arg); (
arg) = next_call_expr_arg (&(iter)))
2105 {
2106 tmp_list2 = tmp_list3 = 0;
2107 verify_tree (arg, &tmp_list2, &tmp_list3, NULL_TREE(tree) __null);
2108 merge_tlist (&tmp_list3, tmp_list2, 0);
2109 add_tlist (&tmp_before, tmp_list3, NULL_TREE(tree) __null, 0);
2110 }
2111 add_tlist (&tmp_before, tmp_nosp, NULL_TREE(tree) __null, 0);
2112 warn_for_collisions (tmp_before);
2113 add_tlist (pbefore_sp, tmp_before, NULL_TREE(tree) __null, 0);
2114 return;
2115 }
2116
2117 case TREE_LIST:
2118 /* Scan all the list, e.g. indices of multi dimensional array. */
2119 while (x)
2120 {
2121 tmp_before = tmp_nosp = 0;
2122 verify_tree (TREE_VALUE (x)((tree_check ((x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2122, __FUNCTION__, (TREE_LIST)))->list.value)
, &tmp_before, &tmp_nosp, NULL_TREE(tree) __null);
2123 merge_tlist (&tmp_nosp, tmp_before, 0);
2124 add_tlist (pno_sp, tmp_nosp, NULL_TREE(tree) __null, 0);
2125 x = TREE_CHAIN (x)((contains_struct_check ((x), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2125, __FUNCTION__))->common.chain)
;
2126 }
2127 return;
2128
2129 case SAVE_EXPR:
2130 {
2131 struct tlist_cache *t;
2132 for (t = save_expr_cache; t; t = t->next)
2133 if (candidate_equal_p (t->expr, x))
2134 break;
2135
2136 if (!t)
2137 {
2138 t = XOBNEW (&tlist_obstack, struct tlist_cache)((struct tlist_cache *) __extension__ ({ struct obstack *__h =
((&tlist_obstack)); __extension__ ({ struct obstack *__o
= (__h); size_t __len = ((sizeof (struct tlist_cache))); 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
; }); }))
;
2139 t->next = save_expr_cache;
2140 t->expr = x;
2141 save_expr_cache = t;
2142
2143 tmp_before = tmp_nosp = 0;
2144 verify_tree (TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2144, __FUNCTION__)))))
, &tmp_before, &tmp_nosp, NULL_TREE(tree) __null);
2145 warn_for_collisions (tmp_nosp);
2146
2147 tmp_list3 = 0;
2148 merge_tlist (&tmp_list3, tmp_nosp, 0);
2149 t->cache_before_sp = tmp_before;
2150 t->cache_after_sp = tmp_list3;
2151 }
2152 merge_tlist (pbefore_sp, t->cache_before_sp, 1);
2153 add_tlist (pno_sp, t->cache_after_sp, NULL_TREE(tree) __null, 1);
2154 return;
2155 }
2156
2157 case ADDR_EXPR:
2158 x = TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2158, __FUNCTION__)))))
;
2159 if (DECL_P (x)(tree_code_type[(int) (((enum tree_code) (x)->base.code))]
== tcc_declaration)
)
2160 return;
2161 writer = 0;
2162 goto restart;
2163
2164 case VIEW_CONVERT_EXPR:
2165 if (location_wrapper_p (x))
2166 {
2167 x = TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2167, __FUNCTION__)))))
;
2168 goto restart;
2169 }
2170 goto do_default;
2171
2172 case LSHIFT_EXPR:
2173 case RSHIFT_EXPR:
2174 case COMPONENT_REF:
2175 case ARRAY_REF:
2176 if (cxx_dialect >= cxx17)
2177 goto sequenced_binary;
2178 goto do_default;
2179
2180 default:
2181 do_default:
2182 /* For other expressions, simply recurse on their operands.
2183 Manual tail recursion for unary expressions.
2184 Other non-expressions need not be processed. */
2185 if (cl == tcc_unary)
2186 {
2187 x = TREE_OPERAND (x, 0)(*((const_cast<tree*> (tree_operand_check ((x), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2187, __FUNCTION__)))))
;
2188 writer = 0;
2189 goto restart;
2190 }
2191 else if (IS_EXPR_CODE_CLASS (cl)((cl) >= tcc_reference && (cl) <= tcc_expression
)
)
2192 {
2193 int lp;
2194 int max = TREE_OPERAND_LENGTH (x)tree_operand_length (x);
2195 for (lp = 0; lp < max; lp++)
2196 {
2197 tmp_before = tmp_nosp = 0;
2198 verify_tree (TREE_OPERAND (x, lp)(*((const_cast<tree*> (tree_operand_check ((x), (lp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2198, __FUNCTION__)))))
, &tmp_before, &tmp_nosp, 0);
2199 merge_tlist (&tmp_nosp, tmp_before, 0);
2200 add_tlist (pno_sp, tmp_nosp, NULL_TREE(tree) __null, 0);
2201 }
2202 }
2203 return;
2204 }
2205}
2206
2207static constexpr size_t verify_sequence_points_limit = 1024;
2208
2209/* Called from verify_sequence_points via walk_tree. */
2210
2211static tree
2212verify_tree_lim_r (tree *tp, int *walk_subtrees, void *data)
2213{
2214 if (++*((size_t *) data) > verify_sequence_points_limit)
2215 return integer_zero_nodeglobal_trees[TI_INTEGER_ZERO];
2216
2217 if (TYPE_P (*tp)(tree_code_type[(int) (((enum tree_code) (*tp)->base.code)
)] == tcc_type)
)
2218 *walk_subtrees = 0;
2219
2220 return NULL_TREE(tree) __null;
2221}
2222
2223/* Try to warn for undefined behavior in EXPR due to missing sequence
2224 points. */
2225
2226void
2227verify_sequence_points (tree expr)
2228{
2229 tlist *before_sp = nullptr, *after_sp = nullptr;
2230
2231 /* verify_tree is highly recursive, and merge_tlist is O(n^2),
2232 so we return early if the expression is too big. */
2233 size_t n = 0;
2234 if (walk_tree (&expr, verify_tree_lim_r, &n, nullptr)walk_tree_1 (&expr, verify_tree_lim_r, &n, nullptr, __null
)
)
2235 return;
2236
2237 warned_ids = nullptr;
2238 save_expr_cache = nullptr;
2239 if (!tlist_firstobj)
2240 {
2241 gcc_obstack_init (&tlist_obstack)_obstack_begin (((&tlist_obstack)), (memory_block_pool::block_size
), (0), (mempool_obstack_chunk_alloc), (mempool_obstack_chunk_free
))
;
2242 tlist_firstobj = (char *) obstack_alloc (&tlist_obstack, 0)__extension__ ({ struct obstack *__h = (&tlist_obstack); __extension__
({ struct obstack *__o = (__h); size_t __len = ((0)); 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; }); })
;
2243 }
2244
2245 verify_tree (expr, &before_sp, &after_sp, NULL_TREE(tree) __null);
2246 warn_for_collisions (after_sp);
2247 obstack_free (&tlist_obstack, tlist_firstobj)__extension__ ({ struct obstack *__o = (&tlist_obstack); void
*__obj = (void *) (tlist_firstobj); if (__obj > (void *) __o
->chunk && __obj < (void *) __o->chunk_limit
) __o->next_free = __o->object_base = (char *) __obj; else
_obstack_free (__o, __obj); })
;
2248}
2249
2250/* Validate the expression after `case' and apply default promotions. */
2251
2252static tree
2253check_case_value (location_t loc, tree value)
2254{
2255 if (value == NULL_TREE(tree) __null)
2256 return value;
2257
2258 if (TREE_CODE (value)((enum tree_code) (value)->base.code) == INTEGER_CST)
2259 /* Promote char or short to int. */
2260 value = perform_integral_promotions (value);
2261 else if (value != error_mark_nodeglobal_trees[TI_ERROR_MARK])
2262 {
2263 error_at (loc, "case label does not reduce to an integer constant");
2264 value = error_mark_nodeglobal_trees[TI_ERROR_MARK];
2265 }
2266
2267 constant_expression_warning (value);
2268
2269 return value;
2270}
2271
2272/* Return an integer type with BITS bits of precision,
2273 that is unsigned if UNSIGNEDP is nonzero, otherwise signed. */
2274
2275tree
2276c_common_type_for_size (unsigned int bits, int unsignedp)
2277{
2278 int i;
2279
2280 if (bits == 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-family/c-common.c"
, 2280, __FUNCTION__))->type_common.precision)
)
2281 return unsignedp ? unsigned_type_nodeinteger_types[itk_unsigned_int] : integer_type_nodeinteger_types[itk_int];
2282
2283 if (bits == TYPE_PRECISION (signed_char_type_node)((tree_class_check ((integer_types[itk_signed_char]), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2283, __FUNCTION__))->type_common.precision)
)
2284 return unsignedp ? unsigned_char_type_nodeinteger_types[itk_unsigned_char] : signed_char_type_nodeinteger_types[itk_signed_char];
2285
2286 if (bits == TYPE_PRECISION (short_integer_type_node)((tree_class_check ((integer_types[itk_short]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2286, __FUNCTION__))->type_common.precision)
)
2287 return unsignedp ? short_unsigned_type_nodeinteger_types[itk_unsigned_short] : short_integer_type_nodeinteger_types[itk_short];
2288
2289 if (bits == TYPE_PRECISION (long_integer_type_node)((tree_class_check ((integer_types[itk_long]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2289, __FUNCTION__))->type_common.precision)
)
2290 return unsignedp ? long_unsigned_type_nodeinteger_types[itk_unsigned_long] : long_integer_type_nodeinteger_types[itk_long];
2291
2292 if (bits == TYPE_PRECISION (long_long_integer_type_node)((tree_class_check ((integer_types[itk_long_long]), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2292, __FUNCTION__))->type_common.precision)
)
2293 return (unsignedp ? long_long_unsigned_type_nodeinteger_types[itk_unsigned_long_long]
2294 : long_long_integer_type_nodeinteger_types[itk_long_long]);
2295
2296 for (i = 0; i < NUM_INT_N_ENTS1; i ++)
2297 if (int_n_enabled_p[i]
2298 && bits == int_n_data[i].bitsize)
2299 return (unsignedp ? int_n_trees[i].unsigned_type
2300 : int_n_trees[i].signed_type);
2301
2302 if (bits == TYPE_PRECISION (widest_integer_literal_type_node)((tree_class_check ((c_global_trees[CTI_WIDEST_INT_LIT_TYPE])
, (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2302, __FUNCTION__))->type_common.precision)
)
2303 return (unsignedp ? widest_unsigned_literal_type_nodec_global_trees[CTI_WIDEST_UINT_LIT_TYPE]
2304 : widest_integer_literal_type_nodec_global_trees[CTI_WIDEST_INT_LIT_TYPE]);
2305
2306 if (bits <= TYPE_PRECISION (intQI_type_node)((tree_class_check ((global_trees[TI_INTQI_TYPE]), (tcc_type)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2306, __FUNCTION__))->type_common.precision)
)
2307 return unsignedp ? unsigned_intQI_type_nodeglobal_trees[TI_UINTQI_TYPE] : intQI_type_nodeglobal_trees[TI_INTQI_TYPE];
2308
2309 if (bits <= TYPE_PRECISION (intHI_type_node)((tree_class_check ((global_trees[TI_INTHI_TYPE]), (tcc_type)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2309, __FUNCTION__))->type_common.precision)
)
2310 return unsignedp ? unsigned_intHI_type_nodeglobal_trees[TI_UINTHI_TYPE] : intHI_type_nodeglobal_trees[TI_INTHI_TYPE];
2311
2312 if (bits <= TYPE_PRECISION (intSI_type_node)((tree_class_check ((global_trees[TI_INTSI_TYPE]), (tcc_type)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2312, __FUNCTION__))->type_common.precision)
)
2313 return unsignedp ? unsigned_intSI_type_nodeglobal_trees[TI_UINTSI_TYPE] : intSI_type_nodeglobal_trees[TI_INTSI_TYPE];
2314
2315 if (bits <= TYPE_PRECISION (intDI_type_node)((tree_class_check ((global_trees[TI_INTDI_TYPE]), (tcc_type)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2315, __FUNCTION__))->type_common.precision)
)
2316 return unsignedp ? unsigned_intDI_type_nodeglobal_trees[TI_UINTDI_TYPE] : intDI_type_nodeglobal_trees[TI_INTDI_TYPE];
2317
2318 return NULL_TREE(tree) __null;
2319}
2320
2321/* Return a fixed-point type that has at least IBIT ibits and FBIT fbits
2322 that is unsigned if UNSIGNEDP is nonzero, otherwise signed;
2323 and saturating if SATP is nonzero, otherwise not saturating. */
2324
2325tree
2326c_common_fixed_point_type_for_size (unsigned int ibit, unsigned int fbit,
2327 int unsignedp, int satp)
2328{
2329 enum mode_class mclass;
2330 if (ibit == 0)
2331 mclass = unsignedp ? MODE_UFRACT : MODE_FRACT;
2332 else
2333 mclass = unsignedp ? MODE_UACCUM : MODE_ACCUM;
2334
2335 opt_scalar_mode opt_mode;
2336 scalar_mode mode;
2337 FOR_EACH_MODE_IN_CLASS (opt_mode, mclass)for (mode_iterator::start (&(opt_mode), mclass); mode_iterator
::iterate_p (&(opt_mode)); mode_iterator::get_wider (&
(opt_mode)))
2338 {
2339 mode = opt_mode.require ();
2340 if (GET_MODE_IBIT (mode)mode_ibit[mode] >= ibit && GET_MODE_FBIT (mode)mode_fbit[mode] >= fbit)
2341 break;
2342 }
2343
2344 if (!opt_mode.exists (&mode) || !targetm.scalar_mode_supported_p (mode))
2345 {
2346 sorry ("GCC cannot support operators with integer types and "
2347 "fixed-point types that have too many integral and "
2348 "fractional bits together");
2349 return NULL_TREE(tree) __null;
2350 }
2351
2352 return c_common_type_for_mode (mode, satp);
2353}
2354
2355/* Used for communication between c_common_type_for_mode and
2356 c_register_builtin_type. */
2357tree registered_builtin_types;
2358
2359/* Return a data type that has machine mode MODE.
2360 If the mode is an integer,
2361 then UNSIGNEDP selects between signed and unsigned types.
2362 If the mode is a fixed-point mode,
2363 then UNSIGNEDP selects between saturating and nonsaturating types. */
2364
2365tree
2366c_common_type_for_mode (machine_mode mode, int unsignedp)
2367{
2368 tree t;
2369 int i;
2370
2371 if (mode == TYPE_MODE (integer_type_node)((((enum tree_code) ((tree_class_check ((integer_types[itk_int
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2371, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(integer_types[itk_int]) : (integer_types[itk_int])->type_common
.mode)
)
2372 return unsignedp ? unsigned_type_nodeinteger_types[itk_unsigned_int] : integer_type_nodeinteger_types[itk_int];
2373
2374 if (mode == TYPE_MODE (signed_char_type_node)((((enum tree_code) ((tree_class_check ((integer_types[itk_signed_char
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2374, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(integer_types[itk_signed_char]) : (integer_types[itk_signed_char
])->type_common.mode)
)
2375 return unsignedp ? unsigned_char_type_nodeinteger_types[itk_unsigned_char] : signed_char_type_nodeinteger_types[itk_signed_char];
2376
2377 if (mode == TYPE_MODE (short_integer_type_node)((((enum tree_code) ((tree_class_check ((integer_types[itk_short
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2377, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(integer_types[itk_short]) : (integer_types[itk_short])->
type_common.mode)
)
2378 return unsignedp ? short_unsigned_type_nodeinteger_types[itk_unsigned_short] : short_integer_type_nodeinteger_types[itk_short];
2379
2380 if (mode == TYPE_MODE (long_integer_type_node)((((enum tree_code) ((tree_class_check ((integer_types[itk_long
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2380, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(integer_types[itk_long]) : (integer_types[itk_long])->type_common
.mode)
)
2381 return unsignedp ? long_unsigned_type_nodeinteger_types[itk_unsigned_long] : long_integer_type_nodeinteger_types[itk_long];
2382
2383 if (mode == TYPE_MODE (long_long_integer_type_node)((((enum tree_code) ((tree_class_check ((integer_types[itk_long_long
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2383, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(integer_types[itk_long_long]) : (integer_types[itk_long_long
])->type_common.mode)
)
2384 return unsignedp ? long_long_unsigned_type_nodeinteger_types[itk_unsigned_long_long] : long_long_integer_type_nodeinteger_types[itk_long_long];
2385
2386 for (i = 0; i < NUM_INT_N_ENTS1; i ++)
2387 if (int_n_enabled_p[i]
2388 && mode == int_n_data[i].m)
2389 return (unsignedp ? int_n_trees[i].unsigned_type
2390 : int_n_trees[i].signed_type);
2391
2392 if (mode == QImode(scalar_int_mode ((scalar_int_mode::from_int) E_QImode)))
2393 return unsignedp ? unsigned_intQI_type_nodeglobal_trees[TI_UINTQI_TYPE] : intQI_type_nodeglobal_trees[TI_INTQI_TYPE];
2394
2395 if (mode == HImode(scalar_int_mode ((scalar_int_mode::from_int) E_HImode)))
2396 return unsignedp ? unsigned_intHI_type_nodeglobal_trees[TI_UINTHI_TYPE] : intHI_type_nodeglobal_trees[TI_INTHI_TYPE];
2397
2398 if (mode == SImode(scalar_int_mode ((scalar_int_mode::from_int) E_SImode)))
2399 return unsignedp ? unsigned_intSI_type_nodeglobal_trees[TI_UINTSI_TYPE] : intSI_type_nodeglobal_trees[TI_INTSI_TYPE];
2400
2401 if (mode == DImode(scalar_int_mode ((scalar_int_mode::from_int) E_DImode)))
2402 return unsignedp ? unsigned_intDI_type_nodeglobal_trees[TI_UINTDI_TYPE] : intDI_type_nodeglobal_trees[TI_INTDI_TYPE];
2403
2404#if HOST_BITS_PER_WIDE_INT64 >= 64
2405 if (mode == TYPE_MODE (intTI_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_INTTI_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2405, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_INTTI_TYPE]) : (global_trees[TI_INTTI_TYPE]
)->type_common.mode)
)
2406 return unsignedp ? unsigned_intTI_type_nodeglobal_trees[TI_UINTTI_TYPE] : intTI_type_nodeglobal_trees[TI_INTTI_TYPE];
2407#endif
2408
2409 if (mode == TYPE_MODE (float_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_FLOAT_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2409, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_FLOAT_TYPE]) : (global_trees[TI_FLOAT_TYPE]
)->type_common.mode)
)
2410 return float_type_nodeglobal_trees[TI_FLOAT_TYPE];
2411
2412 if (mode == TYPE_MODE (double_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_DOUBLE_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2412, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_DOUBLE_TYPE]) : (global_trees[TI_DOUBLE_TYPE
])->type_common.mode)
)
2413 return double_type_nodeglobal_trees[TI_DOUBLE_TYPE];
2414
2415 if (mode == TYPE_MODE (long_double_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_LONG_DOUBLE_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2415, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_LONG_DOUBLE_TYPE]) : (global_trees[TI_LONG_DOUBLE_TYPE
])->type_common.mode)
)
2416 return long_double_type_nodeglobal_trees[TI_LONG_DOUBLE_TYPE];
2417
2418 for (i = 0; i < NUM_FLOATN_NX_TYPES(TI_FLOATN_NX_TYPE_LAST - TI_FLOATN_NX_TYPE_FIRST + 1); i++)
2419 if (FLOATN_NX_TYPE_NODE (i)global_trees[TI_FLOATN_NX_TYPE_FIRST + (i)] != NULL_TREE(tree) __null
2420 && mode == TYPE_MODE (FLOATN_NX_TYPE_NODE (i))((((enum tree_code) ((tree_class_check ((global_trees[TI_FLOATN_NX_TYPE_FIRST
+ (i)]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2420, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_FLOATN_NX_TYPE_FIRST + (i)]) : (global_trees
[TI_FLOATN_NX_TYPE_FIRST + (i)])->type_common.mode)
)
2421 return FLOATN_NX_TYPE_NODE (i)global_trees[TI_FLOATN_NX_TYPE_FIRST + (i)];
2422
2423 if (mode == TYPE_MODE (void_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_VOID_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2423, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_VOID_TYPE]) : (global_trees[TI_VOID_TYPE])->
type_common.mode)
)
2424 return void_type_nodeglobal_trees[TI_VOID_TYPE];
2425
2426 if (mode == TYPE_MODE (build_pointer_type (char_type_node))((((enum tree_code) ((tree_class_check ((build_pointer_type (
integer_types[itk_char])), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2426, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(build_pointer_type (integer_types[itk_char])) : (build_pointer_type
(integer_types[itk_char]))->type_common.mode)
2427 || mode == TYPE_MODE (build_pointer_type (integer_type_node))((((enum tree_code) ((tree_class_check ((build_pointer_type (
integer_types[itk_int])), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2427, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(build_pointer_type (integer_types[itk_int])) : (build_pointer_type
(integer_types[itk_int]))->type_common.mode)
)
2428 {
2429 unsigned int precision
2430 = GET_MODE_PRECISION (as_a <scalar_int_mode> (mode));
2431 return (unsignedp
2432 ? make_unsigned_type (precision)
2433 : make_signed_type (precision));
2434 }
2435
2436 if (COMPLEX_MODE_P (mode)(((enum mode_class) mode_class[mode]) == MODE_COMPLEX_INT || (
(enum mode_class) mode_class[mode]) == MODE_COMPLEX_FLOAT)
)
2437 {
2438 machine_mode inner_mode;
2439 tree inner_type;
2440
2441 if (mode == TYPE_MODE (complex_float_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_COMPLEX_FLOAT_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2441, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_COMPLEX_FLOAT_TYPE]) : (global_trees[TI_COMPLEX_FLOAT_TYPE
])->type_common.mode)
)
2442 return complex_float_type_nodeglobal_trees[TI_COMPLEX_FLOAT_TYPE];
2443 if (mode == TYPE_MODE (complex_double_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_COMPLEX_DOUBLE_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2443, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_COMPLEX_DOUBLE_TYPE]) : (global_trees[TI_COMPLEX_DOUBLE_TYPE
])->type_common.mode)
)
2444 return complex_double_type_nodeglobal_trees[TI_COMPLEX_DOUBLE_TYPE];
2445 if (mode == TYPE_MODE (complex_long_double_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_COMPLEX_LONG_DOUBLE_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2445, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_COMPLEX_LONG_DOUBLE_TYPE]) : (global_trees[
TI_COMPLEX_LONG_DOUBLE_TYPE])->type_common.mode)
)
2446 return complex_long_double_type_nodeglobal_trees[TI_COMPLEX_LONG_DOUBLE_TYPE];
2447
2448 for (i = 0; i < NUM_FLOATN_NX_TYPES(TI_FLOATN_NX_TYPE_LAST - TI_FLOATN_NX_TYPE_FIRST + 1); i++)
2449 if (COMPLEX_FLOATN_NX_TYPE_NODE (i)global_trees[TI_COMPLEX_FLOATN_NX_TYPE_FIRST + (i)] != NULL_TREE(tree) __null
2450 && mode == TYPE_MODE (COMPLEX_FLOATN_NX_TYPE_NODE (i))((((enum tree_code) ((tree_class_check ((global_trees[TI_COMPLEX_FLOATN_NX_TYPE_FIRST
+ (i)]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2450, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_COMPLEX_FLOATN_NX_TYPE_FIRST + (i)]) : (global_trees
[TI_COMPLEX_FLOATN_NX_TYPE_FIRST + (i)])->type_common.mode
)
)
2451 return COMPLEX_FLOATN_NX_TYPE_NODE (i)global_trees[TI_COMPLEX_FLOATN_NX_TYPE_FIRST + (i)];
2452
2453 if (mode == TYPE_MODE (complex_integer_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_COMPLEX_INTEGER_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2453, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_COMPLEX_INTEGER_TYPE]) : (global_trees[TI_COMPLEX_INTEGER_TYPE
])->type_common.mode)
&& !unsignedp)
2454 return complex_integer_type_nodeglobal_trees[TI_COMPLEX_INTEGER_TYPE];
2455
2456 inner_mode = GET_MODE_INNER (mode)(mode_to_inner (mode));
2457 inner_type = c_common_type_for_mode (inner_mode, unsignedp);
2458 if (inner_type != NULL_TREE(tree) __null)
2459 return build_complex_type (inner_type);
2460 }
2461 else if (GET_MODE_CLASS (mode)((enum mode_class) mode_class[mode]) == MODE_VECTOR_BOOL
2462 && valid_vector_subparts_p (GET_MODE_NUNITS (mode)))
2463 {
2464 unsigned int elem_bits = vector_element_size (GET_MODE_BITSIZE (mode),(exact_div (GET_MODE_BITSIZE (mode), GET_MODE_NUNITS (mode)).
to_constant ())
2465 GET_MODE_NUNITS (mode))(exact_div (GET_MODE_BITSIZE (mode), GET_MODE_NUNITS (mode)).
to_constant ())
;
2466 tree bool_type = build_nonstandard_boolean_type (elem_bits);
2467 return build_vector_type_for_mode (bool_type, mode);
2468 }
2469 else if (VECTOR_MODE_P (mode)(((enum mode_class) mode_class[mode]) == MODE_VECTOR_BOOL || (
(enum mode_class) mode_class[mode]) == MODE_VECTOR_INT || ((enum
mode_class) mode_class[mode]) == MODE_VECTOR_FLOAT || ((enum
mode_class) mode_class[mode]) == MODE_VECTOR_FRACT || ((enum
mode_class) mode_class[mode]) == MODE_VECTOR_UFRACT || ((enum
mode_class) mode_class[mode]) == MODE_VECTOR_ACCUM || ((enum
mode_class) mode_class[mode]) == MODE_VECTOR_UACCUM)
2470 && valid_vector_subparts_p (GET_MODE_NUNITS (mode)))
2471 {
2472 machine_mode inner_mode = GET_MODE_INNER (mode)(mode_to_inner (mode));
2473 tree inner_type = c_common_type_for_mode (inner_mode, unsignedp);
2474 if (inner_type != NULL_TREE(tree) __null)
2475 return build_vector_type_for_mode (inner_type, mode);
2476 }
2477
2478 if (dfloat32_type_nodeglobal_trees[TI_DFLOAT32_TYPE] != NULL_TREE(tree) __null
2479 && mode == TYPE_MODE (dfloat32_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_DFLOAT32_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2479, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_DFLOAT32_TYPE]) : (global_trees[TI_DFLOAT32_TYPE
])->type_common.mode)
)
2480 return dfloat32_type_nodeglobal_trees[TI_DFLOAT32_TYPE];
2481 if (dfloat64_type_nodeglobal_trees[TI_DFLOAT64_TYPE] != NULL_TREE(tree) __null
2482 && mode == TYPE_MODE (dfloat64_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_DFLOAT64_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2482, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_DFLOAT64_TYPE]) : (global_trees[TI_DFLOAT64_TYPE
])->type_common.mode)
)
2483 return dfloat64_type_nodeglobal_trees[TI_DFLOAT64_TYPE];
2484 if (dfloat128_type_nodeglobal_trees[TI_DFLOAT128_TYPE] != NULL_TREE(tree) __null
2485 && mode == TYPE_MODE (dfloat128_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_DFLOAT128_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2485, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_DFLOAT128_TYPE]) : (global_trees[TI_DFLOAT128_TYPE
])->type_common.mode)
)
2486 return dfloat128_type_nodeglobal_trees[TI_DFLOAT128_TYPE];
2487
2488 if (ALL_SCALAR_FIXED_POINT_MODE_P (mode)(((((enum mode_class) mode_class[mode]) == MODE_FRACT) || (((
enum mode_class) mode_class[mode]) == MODE_ACCUM)) || ((((enum
mode_class) mode_class[mode]) == MODE_UFRACT) || (((enum mode_class
) mode_class[mode]) == MODE_UACCUM)))
)
2489 {
2490 if (mode == TYPE_MODE (short_fract_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_SFRACT_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2490, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_SFRACT_TYPE]) : (global_trees[TI_SFRACT_TYPE
])->type_common.mode)
)
2491 return unsignedp ? sat_short_fract_type_nodeglobal_trees[TI_SAT_SFRACT_TYPE] : short_fract_type_nodeglobal_trees[TI_SFRACT_TYPE];
2492 if (mode == TYPE_MODE (fract_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_FRACT_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2492, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_FRACT_TYPE]) : (global_trees[TI_FRACT_TYPE]
)->type_common.mode)
)
2493 return unsignedp ? sat_fract_type_nodeglobal_trees[TI_SAT_FRACT_TYPE] : fract_type_nodeglobal_trees[TI_FRACT_TYPE];
2494 if (mode == TYPE_MODE (long_fract_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_LFRACT_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2494, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_LFRACT_TYPE]) : (global_trees[TI_LFRACT_TYPE
])->type_common.mode)
)
2495 return unsignedp ? sat_long_fract_type_nodeglobal_trees[TI_SAT_LFRACT_TYPE] : long_fract_type_nodeglobal_trees[TI_LFRACT_TYPE];
2496 if (mode == TYPE_MODE (long_long_fract_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_LLFRACT_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2496, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_LLFRACT_TYPE]) : (global_trees[TI_LLFRACT_TYPE
])->type_common.mode)
)
2497 return unsignedp ? sat_long_long_fract_type_nodeglobal_trees[TI_SAT_LLFRACT_TYPE]
2498 : long_long_fract_type_nodeglobal_trees[TI_LLFRACT_TYPE];
2499
2500 if (mode == TYPE_MODE (unsigned_short_fract_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_USFRACT_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2500, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_USFRACT_TYPE]) : (global_trees[TI_USFRACT_TYPE
])->type_common.mode)
)
2501 return unsignedp ? sat_unsigned_short_fract_type_nodeglobal_trees[TI_SAT_USFRACT_TYPE]
2502 : unsigned_short_fract_type_nodeglobal_trees[TI_USFRACT_TYPE];
2503 if (mode == TYPE_MODE (unsigned_fract_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_UFRACT_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2503, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_UFRACT_TYPE]) : (global_trees[TI_UFRACT_TYPE
])->type_common.mode)
)
2504 return unsignedp ? sat_unsigned_fract_type_nodeglobal_trees[TI_SAT_UFRACT_TYPE]
2505 : unsigned_fract_type_nodeglobal_trees[TI_UFRACT_TYPE];
2506 if (mode == TYPE_MODE (unsigned_long_fract_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_ULFRACT_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2506, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_ULFRACT_TYPE]) : (global_trees[TI_ULFRACT_TYPE
])->type_common.mode)
)
2507 return unsignedp ? sat_unsigned_long_fract_type_nodeglobal_trees[TI_SAT_ULFRACT_TYPE]
2508 : unsigned_long_fract_type_nodeglobal_trees[TI_ULFRACT_TYPE];
2509 if (mode == TYPE_MODE (unsigned_long_long_fract_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_ULLFRACT_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2509, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_ULLFRACT_TYPE]) : (global_trees[TI_ULLFRACT_TYPE
])->type_common.mode)
)
2510 return unsignedp ? sat_unsigned_long_long_fract_type_nodeglobal_trees[TI_SAT_ULLFRACT_TYPE]
2511 : unsigned_long_long_fract_type_nodeglobal_trees[TI_ULLFRACT_TYPE];
2512
2513 if (mode == TYPE_MODE (short_accum_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_SACCUM_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2513, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_SACCUM_TYPE]) : (global_trees[TI_SACCUM_TYPE
])->type_common.mode)
)
2514 return unsignedp ? sat_short_accum_type_nodeglobal_trees[TI_SAT_SACCUM_TYPE] : short_accum_type_nodeglobal_trees[TI_SACCUM_TYPE];
2515 if (mode == TYPE_MODE (accum_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_ACCUM_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2515, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_ACCUM_TYPE]) : (global_trees[TI_ACCUM_TYPE]
)->type_common.mode)
)
2516 return unsignedp ? sat_accum_type_nodeglobal_trees[TI_SAT_ACCUM_TYPE] : accum_type_nodeglobal_trees[TI_ACCUM_TYPE];
2517 if (mode == TYPE_MODE (long_accum_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_LACCUM_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2517, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_LACCUM_TYPE]) : (global_trees[TI_LACCUM_TYPE
])->type_common.mode)
)
2518 return unsignedp ? sat_long_accum_type_nodeglobal_trees[TI_SAT_LACCUM_TYPE] : long_accum_type_nodeglobal_trees[TI_LACCUM_TYPE];
2519 if (mode == TYPE_MODE (long_long_accum_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_LLACCUM_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2519, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_LLACCUM_TYPE]) : (global_trees[TI_LLACCUM_TYPE
])->type_common.mode)
)
2520 return unsignedp ? sat_long_long_accum_type_nodeglobal_trees[TI_SAT_LLACCUM_TYPE]
2521 : long_long_accum_type_nodeglobal_trees[TI_LLACCUM_TYPE];
2522
2523 if (mode == TYPE_MODE (unsigned_short_accum_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_USACCUM_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2523, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_USACCUM_TYPE]) : (global_trees[TI_USACCUM_TYPE
])->type_common.mode)
)
2524 return unsignedp ? sat_unsigned_short_accum_type_nodeglobal_trees[TI_SAT_USACCUM_TYPE]
2525 : unsigned_short_accum_type_nodeglobal_trees[TI_USACCUM_TYPE];
2526 if (mode == TYPE_MODE (unsigned_accum_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_UACCUM_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2526, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_UACCUM_TYPE]) : (global_trees[TI_UACCUM_TYPE
])->type_common.mode)
)
2527 return unsignedp ? sat_unsigned_accum_type_nodeglobal_trees[TI_SAT_UACCUM_TYPE]
2528 : unsigned_accum_type_nodeglobal_trees[TI_UACCUM_TYPE];
2529 if (mode == TYPE_MODE (unsigned_long_accum_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_ULACCUM_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2529, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_ULACCUM_TYPE]) : (global_trees[TI_ULACCUM_TYPE
])->type_common.mode)
)
2530 return unsignedp ? sat_unsigned_long_accum_type_nodeglobal_trees[TI_SAT_ULACCUM_TYPE]
2531 : unsigned_long_accum_type_nodeglobal_trees[TI_ULACCUM_TYPE];
2532 if (mode == TYPE_MODE (unsigned_long_long_accum_type_node)((((enum tree_code) ((tree_class_check ((global_trees[TI_ULLACCUM_TYPE
]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2532, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(global_trees[TI_ULLACCUM_TYPE]) : (global_trees[TI_ULLACCUM_TYPE
])->type_common.mode)
)
2533 return unsignedp ? sat_unsigned_long_long_accum_type_nodeglobal_trees[TI_SAT_ULLACCUM_TYPE]
2534 : unsigned_long_long_accum_type_nodeglobal_trees[TI_ULLACCUM_TYPE];
2535
2536 if (mode == QQmode(scalar_mode ((scalar_mode::from_int) E_QQmode)))
2537 return unsignedp ? sat_qq_type_nodeglobal_trees[TI_SAT_QQ_TYPE] : qq_type_nodeglobal_trees[TI_QQ_TYPE];
2538 if (mode == HQmode(scalar_mode ((scalar_mode::from_int) E_HQmode)))
2539 return unsignedp ? sat_hq_type_nodeglobal_trees[TI_SAT_HQ_TYPE] : hq_type_nodeglobal_trees[TI_HQ_TYPE];
2540 if (mode == SQmode(scalar_mode ((scalar_mode::from_int) E_SQmode)))
2541 return unsignedp ? sat_sq_type_nodeglobal_trees[TI_SAT_SQ_TYPE] : sq_type_nodeglobal_trees[TI_SQ_TYPE];
2542 if (mode == DQmode(scalar_mode ((scalar_mode::from_int) E_DQmode)))
2543 return unsignedp ? sat_dq_type_nodeglobal_trees[TI_SAT_DQ_TYPE] : dq_type_nodeglobal_trees[TI_DQ_TYPE];
2544 if (mode == TQmode(scalar_mode ((scalar_mode::from_int) E_TQmode)))
2545 return unsignedp ? sat_tq_type_nodeglobal_trees[TI_SAT_TQ_TYPE] : tq_type_nodeglobal_trees[TI_TQ_TYPE];
2546
2547 if (mode == UQQmode(scalar_mode ((scalar_mode::from_int) E_UQQmode)))
2548 return unsignedp ? sat_uqq_type_nodeglobal_trees[TI_SAT_UQQ_TYPE] : uqq_type_nodeglobal_trees[TI_UQQ_TYPE];
2549 if (mode == UHQmode(scalar_mode ((scalar_mode::from_int) E_UHQmode)))
2550 return unsignedp ? sat_uhq_type_nodeglobal_trees[TI_SAT_UHQ_TYPE] : uhq_type_nodeglobal_trees[TI_UHQ_TYPE];
2551 if (mode == USQmode(scalar_mode ((scalar_mode::from_int) E_USQmode)))
2552 return unsignedp ? sat_usq_type_nodeglobal_trees[TI_SAT_USQ_TYPE] : usq_type_nodeglobal_trees[TI_USQ_TYPE];
2553 if (mode == UDQmode(scalar_mode ((scalar_mode::from_int) E_UDQmode)))
2554 return unsignedp ? sat_udq_type_nodeglobal_trees[TI_SAT_UDQ_TYPE] : udq_type_nodeglobal_trees[TI_UDQ_TYPE];
2555 if (mode == UTQmode(scalar_mode ((scalar_mode::from_int) E_UTQmode)))
2556 return unsignedp ? sat_utq_type_nodeglobal_trees[TI_SAT_UTQ_TYPE] : utq_type_nodeglobal_trees[TI_UTQ_TYPE];
2557
2558 if (mode == HAmode(scalar_mode ((scalar_mode::from_int) E_HAmode)))
2559 return unsignedp ? sat_ha_type_nodeglobal_trees[TI_SAT_HA_TYPE] : ha_type_nodeglobal_trees[TI_HA_TYPE];
2560 if (mode == SAmode(scalar_mode ((scalar_mode::from_int) E_SAmode)))
2561 return unsignedp ? sat_sa_type_nodeglobal_trees[TI_SAT_SA_TYPE] : sa_type_nodeglobal_trees[TI_SA_TYPE];
2562 if (mode == DAmode(scalar_mode ((scalar_mode::from_int) E_DAmode)))
2563 return unsignedp ? sat_da_type_nodeglobal_trees[TI_SAT_DA_TYPE] : da_type_nodeglobal_trees[TI_DA_TYPE];
2564 if (mode == TAmode(scalar_mode ((scalar_mode::from_int) E_TAmode)))
2565 return unsignedp ? sat_ta_type_nodeglobal_trees[TI_SAT_TA_TYPE] : ta_type_nodeglobal_trees[TI_TA_TYPE];
2566
2567 if (mode == UHAmode(scalar_mode ((scalar_mode::from_int) E_UHAmode)))
2568 return unsignedp ? sat_uha_type_nodeglobal_trees[TI_SAT_UHA_TYPE] : uha_type_nodeglobal_trees[TI_UHA_TYPE];
2569 if (mode == USAmode(scalar_mode ((scalar_mode::from_int) E_USAmode)))
2570 return unsignedp ? sat_usa_type_nodeglobal_trees[TI_SAT_USA_TYPE] : usa_type_nodeglobal_trees[TI_USA_TYPE];
2571 if (mode == UDAmode(scalar_mode ((scalar_mode::from_int) E_UDAmode)))
2572 return unsignedp ? sat_uda_type_nodeglobal_trees[TI_SAT_UDA_TYPE] : uda_type_nodeglobal_trees[TI_UDA_TYPE];
2573 if (mode == UTAmode(scalar_mode ((scalar_mode::from_int) E_UTAmode)))
2574 return unsignedp ? sat_uta_type_nodeglobal_trees[TI_SAT_UTA_TYPE] : uta_type_nodeglobal_trees[TI_UTA_TYPE];
2575 }
2576
2577 for (t = registered_builtin_types; t; t = TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2577, __FUNCTION__))->common.chain)
)
2578 {
2579 tree type = TREE_VALUE (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2579, __FUNCTION__, (TREE_LIST)))->list.value)
;
2580 if (TYPE_MODE (type)((((enum tree_code) ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2580, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(type) : (type)->type_common.mode)
== mode
2581 && VECTOR_TYPE_P (type)(((enum tree_code) (type)->base.code) == VECTOR_TYPE) == VECTOR_MODE_P (mode)(((enum mode_class) mode_class[mode]) == MODE_VECTOR_BOOL || (
(enum mode_class) mode_class[mode]) == MODE_VECTOR_INT || ((enum
mode_class) mode_class[mode]) == MODE_VECTOR_FLOAT || ((enum
mode_class) mode_class[mode]) == MODE_VECTOR_FRACT || ((enum
mode_class) mode_class[mode]) == MODE_VECTOR_UFRACT || ((enum
mode_class) mode_class[mode]) == MODE_VECTOR_ACCUM || ((enum
mode_class) mode_class[mode]) == MODE_VECTOR_UACCUM)
2582 && !!unsignedp == !!TYPE_UNSIGNED (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2582, __FUNCTION__))->base.u.bits.unsigned_flag)
)
2583 return type;
2584 }
2585 return NULL_TREE(tree) __null;
2586}
2587
2588tree
2589c_common_unsigned_type (tree type)
2590{
2591 return c_common_signed_or_unsigned_type (1, type);
2592}
2593
2594/* Return a signed type the same as TYPE in other respects. */
2595
2596tree
2597c_common_signed_type (tree type)
2598{
2599 return c_common_signed_or_unsigned_type (0, type);
2600}
2601
2602/* Return a type the same as TYPE except unsigned or
2603 signed according to UNSIGNEDP. */
2604
2605tree
2606c_common_signed_or_unsigned_type (int unsignedp, tree type)
2607{
2608 tree type1;
2609 int i;
2610
2611 /* This block of code emulates the behavior of the old
2612 c_common_unsigned_type. In particular, it returns
2613 long_unsigned_type_node if passed a long, even when a int would
2614 have the same size. This is necessary for warnings to work
2615 correctly in archs where sizeof(int) == sizeof(long) */
2616
2617 type1 = TYPE_MAIN_VARIANT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2617, __FUNCTION__))->type_common.main_variant)
;
2618 if (type1 == signed_char_type_nodeinteger_types[itk_signed_char] || type1 == char_type_nodeinteger_types[itk_char] || type1 == unsigned_char_type_nodeinteger_types[itk_unsigned_char])
2619 return unsignedp ? unsigned_char_type_nodeinteger_types[itk_unsigned_char] : signed_char_type_nodeinteger_types[itk_signed_char];
2620 if (type1 == integer_type_nodeinteger_types[itk_int] || type1 == unsigned_type_nodeinteger_types[itk_unsigned_int])
2621 return unsignedp ? unsigned_type_nodeinteger_types[itk_unsigned_int] : integer_type_nodeinteger_types[itk_int];
2622 if (type1 == short_integer_type_nodeinteger_types[itk_short] || type1 == short_unsigned_type_nodeinteger_types[itk_unsigned_short])
2623 return unsignedp ? short_unsigned_type_nodeinteger_types[itk_unsigned_short] : short_integer_type_nodeinteger_types[itk_short];
2624 if (type1 == long_integer_type_nodeinteger_types[itk_long] || type1 == long_unsigned_type_nodeinteger_types[itk_unsigned_long])
2625 return unsignedp ? long_unsigned_type_nodeinteger_types[itk_unsigned_long] : long_integer_type_nodeinteger_types[itk_long];
2626 if (type1 == long_long_integer_type_nodeinteger_types[itk_long_long] || type1 == long_long_unsigned_type_nodeinteger_types[itk_unsigned_long_long])
2627 return unsignedp ? long_long_unsigned_type_nodeinteger_types[itk_unsigned_long_long] : long_long_integer_type_nodeinteger_types[itk_long_long];
2628
2629 for (i = 0; i < NUM_INT_N_ENTS1; i ++)
2630 if (int_n_enabled_p[i]
2631 && (type1 == int_n_trees[i].unsigned_type
2632 || type1 == int_n_trees[i].signed_type))
2633 return (unsignedp ? int_n_trees[i].unsigned_type
2634 : int_n_trees[i].signed_type);
2635
2636#if HOST_BITS_PER_WIDE_INT64 >= 64
2637 if (type1 == intTI_type_nodeglobal_trees[TI_INTTI_TYPE] || type1 == unsigned_intTI_type_nodeglobal_trees[TI_UINTTI_TYPE])
2638 return unsignedp ? unsigned_intTI_type_nodeglobal_trees[TI_UINTTI_TYPE] : intTI_type_nodeglobal_trees[TI_INTTI_TYPE];
2639#endif
2640 if (type1 == intDI_type_nodeglobal_trees[TI_INTDI_TYPE] || type1 == unsigned_intDI_type_nodeglobal_trees[TI_UINTDI_TYPE])
2641 return unsignedp ? unsigned_intDI_type_nodeglobal_trees[TI_UINTDI_TYPE] : intDI_type_nodeglobal_trees[TI_INTDI_TYPE];
2642 if (type1 == intSI_type_nodeglobal_trees[TI_INTSI_TYPE] || type1 == unsigned_intSI_type_nodeglobal_trees[TI_UINTSI_TYPE])
2643 return unsignedp ? unsigned_intSI_type_nodeglobal_trees[TI_UINTSI_TYPE] : intSI_type_nodeglobal_trees[TI_INTSI_TYPE];
2644 if (type1 == intHI_type_nodeglobal_trees[TI_INTHI_TYPE] || type1 == unsigned_intHI_type_nodeglobal_trees[TI_UINTHI_TYPE])
2645 return unsignedp ? unsigned_intHI_type_nodeglobal_trees[TI_UINTHI_TYPE] : intHI_type_nodeglobal_trees[TI_INTHI_TYPE];
2646 if (type1 == intQI_type_nodeglobal_trees[TI_INTQI_TYPE] || type1 == unsigned_intQI_type_nodeglobal_trees[TI_UINTQI_TYPE])
2647 return unsignedp ? unsigned_intQI_type_nodeglobal_trees[TI_UINTQI_TYPE] : intQI_type_nodeglobal_trees[TI_INTQI_TYPE];
2648
2649#define C_COMMON_FIXED_TYPES(NAME)if (type1 == short_NAME_type_node || type1 == unsigned_short_NAME_type_node
) return unsignedp ? unsigned_short_NAME_type_node : short_NAME_type_node
; if (type1 == NAME_type_node || type1 == unsigned_NAME_type_node
) return unsignedp ? unsigned_NAME_type_node : NAME_type_node
; if (type1 == long_NAME_type_node || type1 == unsigned_long_NAME_type_node
) return unsignedp ? unsigned_long_NAME_type_node : long_NAME_type_node
; if (type1 == long_long_NAME_type_node || type1 == unsigned_long_long_NAME_type_node
) return unsignedp ? unsigned_long_long_NAME_type_node : long_long_NAME_type_node
;
\
2650 if (type1 == short_ ## NAME ## _type_node \
2651 || type1 == unsigned_short_ ## NAME ## _type_node) \
2652 return unsignedp ? unsigned_short_ ## NAME ## _type_node \
2653 : short_ ## NAME ## _type_node; \
2654 if (type1 == NAME ## _type_node \
2655 || type1 == unsigned_ ## NAME ## _type_node) \
2656 return unsignedp ? unsigned_ ## NAME ## _type_node \
2657 : NAME ## _type_node; \
2658 if (type1 == long_ ## NAME ## _type_node \
2659 || type1 == unsigned_long_ ## NAME ## _type_node) \
2660 return unsignedp ? unsigned_long_ ## NAME ## _type_node \
2661 : long_ ## NAME ## _type_node; \
2662 if (type1 == long_long_ ## NAME ## _type_node \
2663 || type1 == unsigned_long_long_ ## NAME ## _type_node) \
2664 return unsignedp ? unsigned_long_long_ ## NAME ## _type_node \
2665 : long_long_ ## NAME ## _type_node;
2666
2667#define C_COMMON_FIXED_MODE_TYPES(NAME)if (type1 == NAME_type_node || type1 == uNAME_type_node) return
unsignedp ? uNAME_type_node : NAME_type_node;
\
2668 if (type1 == NAME ## _type_node \
2669 || type1 == u ## NAME ## _type_node) \
2670 return unsignedp ? u ## NAME ## _type_node \
2671 : NAME ## _type_node;
2672
2673#define C_COMMON_FIXED_TYPES_SAT(NAME)if (type1 == sat_short_NAME_type_node || type1 == sat_unsigned_short_NAME_type_node
) return unsignedp ? sat_unsigned_short_NAME_type_node : sat_short_NAME_type_node
; if (type1 == sat_NAME_type_node || type1 == sat_unsigned_NAME_type_node
) return unsignedp ? sat_unsigned_NAME_type_node : sat_NAME_type_node
; if (type1 == sat_long_NAME_type_node || type1 == sat_unsigned_long_NAME_type_node
) return unsignedp ? sat_unsigned_long_NAME_type_node : sat_long_NAME_type_node
; if (type1 == sat_long_long_NAME_type_node || type1 == sat_unsigned_long_long_NAME_type_node
) return unsignedp ? sat_unsigned_long_long_NAME_type_node : sat_long_long_NAME_type_node
;
\
2674 if (type1 == sat_ ## short_ ## NAME ## _type_node \
2675 || type1 == sat_ ## unsigned_short_ ## NAME ## _type_node) \
2676 return unsignedp ? sat_ ## unsigned_short_ ## NAME ## _type_node \
2677 : sat_ ## short_ ## NAME ## _type_node; \
2678 if (type1 == sat_ ## NAME ## _type_node \
2679 || type1 == sat_ ## unsigned_ ## NAME ## _type_node) \
2680 return unsignedp ? sat_ ## unsigned_ ## NAME ## _type_node \
2681 : sat_ ## NAME ## _type_node; \
2682 if (type1 == sat_ ## long_ ## NAME ## _type_node \
2683 || type1 == sat_ ## unsigned_long_ ## NAME ## _type_node) \
2684 return unsignedp ? sat_ ## unsigned_long_ ## NAME ## _type_node \
2685 : sat_ ## long_ ## NAME ## _type_node; \
2686 if (type1 == sat_ ## long_long_ ## NAME ## _type_node \
2687 || type1 == sat_ ## unsigned_long_long_ ## NAME ## _type_node) \
2688 return unsignedp ? sat_ ## unsigned_long_long_ ## NAME ## _type_node \
2689 : sat_ ## long_long_ ## NAME ## _type_node;
2690
2691#define C_COMMON_FIXED_MODE_TYPES_SAT(NAME)if (type1 == sat_NAME_type_node || type1 == sat_uNAME_type_node
) return unsignedp ? sat_uNAME_type_node : sat_NAME_type_node
;
\
2692 if (type1 == sat_ ## NAME ## _type_node \
2693 || type1 == sat_ ## u ## NAME ## _type_node) \
2694 return unsignedp ? sat_ ## u ## NAME ## _type_node \
2695 : sat_ ## NAME ## _type_node;
2696
2697 C_COMMON_FIXED_TYPES (fract)if (type1 == global_trees[TI_SFRACT_TYPE] || type1 == global_trees
[TI_USFRACT_TYPE]) return unsignedp ? global_trees[TI_USFRACT_TYPE
] : global_trees[TI_SFRACT_TYPE]; if (type1 == global_trees[TI_FRACT_TYPE
] || type1 == global_trees[TI_UFRACT_TYPE]) return unsignedp ?
global_trees[TI_UFRACT_TYPE] : global_trees[TI_FRACT_TYPE]; if
(type1 == global_trees[TI_LFRACT_TYPE] || type1 == global_trees
[TI_ULFRACT_TYPE]) return unsignedp ? global_trees[TI_ULFRACT_TYPE
] : global_trees[TI_LFRACT_TYPE]; if (type1 == global_trees[TI_LLFRACT_TYPE
] || type1 == global_trees[TI_ULLFRACT_TYPE]) return unsignedp
? global_trees[TI_ULLFRACT_TYPE] : global_trees[TI_LLFRACT_TYPE
];
;
2698 C_COMMON_FIXED_TYPES_SAT (fract)if (type1 == global_trees[TI_SAT_SFRACT_TYPE] || type1 == global_trees
[TI_SAT_USFRACT_TYPE]) return unsignedp ? global_trees[TI_SAT_USFRACT_TYPE
] : global_trees[TI_SAT_SFRACT_TYPE]; if (type1 == global_trees
[TI_SAT_FRACT_TYPE] || type1 == global_trees[TI_SAT_UFRACT_TYPE
]) return unsignedp ? global_trees[TI_SAT_UFRACT_TYPE] : global_trees
[TI_SAT_FRACT_TYPE]; if (type1 == global_trees[TI_SAT_LFRACT_TYPE
] || type1 == global_trees[TI_SAT_ULFRACT_TYPE]) return unsignedp
? global_trees[TI_SAT_ULFRACT_TYPE] : global_trees[TI_SAT_LFRACT_TYPE
]; if (type1 == global_trees[TI_SAT_LLFRACT_TYPE] || type1 ==
global_trees[TI_SAT_ULLFRACT_TYPE]) return unsignedp ? global_trees
[TI_SAT_ULLFRACT_TYPE] : global_trees[TI_SAT_LLFRACT_TYPE];
;
2699 C_COMMON_FIXED_TYPES (accum)if (type1 == global_trees[TI_SACCUM_TYPE] || type1 == global_trees
[TI_USACCUM_TYPE]) return unsignedp ? global_trees[TI_USACCUM_TYPE
] : global_trees[TI_SACCUM_TYPE]; if (type1 == global_trees[TI_ACCUM_TYPE
] || type1 == global_trees[TI_UACCUM_TYPE]) return unsignedp ?
global_trees[TI_UACCUM_TYPE] : global_trees[TI_ACCUM_TYPE]; if
(type1 == global_trees[TI_LACCUM_TYPE] || type1 == global_trees
[TI_ULACCUM_TYPE]) return unsignedp ? global_trees[TI_ULACCUM_TYPE
] : global_trees[TI_LACCUM_TYPE]; if (type1 == global_trees[TI_LLACCUM_TYPE
] || type1 == global_trees[TI_ULLACCUM_TYPE]) return unsignedp
? global_trees[TI_ULLACCUM_TYPE] : global_trees[TI_LLACCUM_TYPE
];
;
2700 C_COMMON_FIXED_TYPES_SAT (accum)if (type1 == global_trees[TI_SAT_SACCUM_TYPE] || type1 == global_trees
[TI_SAT_USACCUM_TYPE]) return unsignedp ? global_trees[TI_SAT_USACCUM_TYPE
] : global_trees[TI_SAT_SACCUM_TYPE]; if (type1 == global_trees
[TI_SAT_ACCUM_TYPE] || type1 == global_trees[TI_SAT_UACCUM_TYPE
]) return unsignedp ? global_trees[TI_SAT_UACCUM_TYPE] : global_trees
[TI_SAT_ACCUM_TYPE]; if (type1 == global_trees[TI_SAT_LACCUM_TYPE
] || type1 == global_trees[TI_SAT_ULACCUM_TYPE]) return unsignedp
? global_trees[TI_SAT_ULACCUM_TYPE] : global_trees[TI_SAT_LACCUM_TYPE
]; if (type1 == global_trees[TI_SAT_LLACCUM_TYPE] || type1 ==
global_trees[TI_SAT_ULLACCUM_TYPE]) return unsignedp ? global_trees
[TI_SAT_ULLACCUM_TYPE] : global_trees[TI_SAT_LLACCUM_TYPE];
;
2701
2702 C_COMMON_FIXED_MODE_TYPES (qq)if (type1 == global_trees[TI_QQ_TYPE] || type1 == global_trees
[TI_UQQ_TYPE]) return unsignedp ? global_trees[TI_UQQ_TYPE] :
global_trees[TI_QQ_TYPE];
;
2703 C_COMMON_FIXED_MODE_TYPES (hq)if (type1 == global_trees[TI_HQ_TYPE] || type1 == global_trees
[TI_UHQ_TYPE]) return unsignedp ? global_trees[TI_UHQ_TYPE] :
global_trees[TI_HQ_TYPE];
;
2704 C_COMMON_FIXED_MODE_TYPES (sq)if (type1 == global_trees[TI_SQ_TYPE] || type1 == global_trees
[TI_USQ_TYPE]) return unsignedp ? global_trees[TI_USQ_TYPE] :
global_trees[TI_SQ_TYPE];
;
2705 C_COMMON_FIXED_MODE_TYPES (dq)if (type1 == global_trees[TI_DQ_TYPE] || type1 == global_trees
[TI_UDQ_TYPE]) return unsignedp ? global_trees[TI_UDQ_TYPE] :
global_trees[TI_DQ_TYPE];
;
2706 C_COMMON_FIXED_MODE_TYPES (tq)if (type1 == global_trees[TI_TQ_TYPE] || type1 == global_trees
[TI_UTQ_TYPE]) return unsignedp ? global_trees[TI_UTQ_TYPE] :
global_trees[TI_TQ_TYPE];
;
2707 C_COMMON_FIXED_MODE_TYPES_SAT (qq)if (type1 == global_trees[TI_SAT_QQ_TYPE] || type1 == global_trees
[TI_SAT_UQQ_TYPE]) return unsignedp ? global_trees[TI_SAT_UQQ_TYPE
] : global_trees[TI_SAT_QQ_TYPE];
;
2708 C_COMMON_FIXED_MODE_TYPES_SAT (hq)if (type1 == global_trees[TI_SAT_HQ_TYPE] || type1 == global_trees
[TI_SAT_UHQ_TYPE]) return unsignedp ? global_trees[TI_SAT_UHQ_TYPE
] : global_trees[TI_SAT_HQ_TYPE];
;
2709 C_COMMON_FIXED_MODE_TYPES_SAT (sq)if (type1 == global_trees[TI_SAT_SQ_TYPE] || type1 == global_trees
[TI_SAT_USQ_TYPE]) return unsignedp ? global_trees[TI_SAT_USQ_TYPE
] : global_trees[TI_SAT_SQ_TYPE];
;
2710 C_COMMON_FIXED_MODE_TYPES_SAT (dq)if (type1 == global_trees[TI_SAT_DQ_TYPE] || type1 == global_trees
[TI_SAT_UDQ_TYPE]) return unsignedp ? global_trees[TI_SAT_UDQ_TYPE
] : global_trees[TI_SAT_DQ_TYPE];
;
2711 C_COMMON_FIXED_MODE_TYPES_SAT (tq)if (type1 == global_trees[TI_SAT_TQ_TYPE] || type1 == global_trees
[TI_SAT_UTQ_TYPE]) return unsignedp ? global_trees[TI_SAT_UTQ_TYPE
] : global_trees[TI_SAT_TQ_TYPE];
;
2712 C_COMMON_FIXED_MODE_TYPES (ha)if (type1 == global_trees[TI_HA_TYPE] || type1 == global_trees
[TI_UHA_TYPE]) return unsignedp ? global_trees[TI_UHA_TYPE] :
global_trees[TI_HA_TYPE];
;
2713 C_COMMON_FIXED_MODE_TYPES (sa)if (type1 == global_trees[TI_SA_TYPE] || type1 == global_trees
[TI_USA_TYPE]) return unsignedp ? global_trees[TI_USA_TYPE] :
global_trees[TI_SA_TYPE];
;
2714 C_COMMON_FIXED_MODE_TYPES (da)if (type1 == global_trees[TI_DA_TYPE] || type1 == global_trees
[TI_UDA_TYPE]) return unsignedp ? global_trees[TI_UDA_TYPE] :
global_trees[TI_DA_TYPE];
;
2715 C_COMMON_FIXED_MODE_TYPES (ta)if (type1 == global_trees[TI_TA_TYPE] || type1 == global_trees
[TI_UTA_TYPE]) return unsignedp ? global_trees[TI_UTA_TYPE] :
global_trees[TI_TA_TYPE];
;
2716 C_COMMON_FIXED_MODE_TYPES_SAT (ha)if (type1 == global_trees[TI_SAT_HA_TYPE] || type1 == global_trees
[TI_SAT_UHA_TYPE]) return unsignedp ? global_trees[TI_SAT_UHA_TYPE
] : global_trees[TI_SAT_HA_TYPE];
;
2717 C_COMMON_FIXED_MODE_TYPES_SAT (sa)if (type1 == global_trees[TI_SAT_SA_TYPE] || type1 == global_trees
[TI_SAT_USA_TYPE]) return unsignedp ? global_trees[TI_SAT_USA_TYPE
] : global_trees[TI_SAT_SA_TYPE];
;
2718 C_COMMON_FIXED_MODE_TYPES_SAT (da)if (type1 == global_trees[TI_SAT_DA_TYPE] || type1 == global_trees
[TI_SAT_UDA_TYPE]) return unsignedp ? global_trees[TI_SAT_UDA_TYPE
] : global_trees[TI_SAT_DA_TYPE];
;
2719 C_COMMON_FIXED_MODE_TYPES_SAT (ta)if (type1 == global_trees[TI_SAT_TA_TYPE] || type1 == global_trees
[TI_SAT_UTA_TYPE]) return unsignedp ? global_trees[TI_SAT_UTA_TYPE
] : global_trees[TI_SAT_TA_TYPE];
;
2720
2721 /* For ENUMERAL_TYPEs in C++, must check the mode of the types, not
2722 the precision; they have precision set to match their range, but
2723 may use a wider mode to match an ABI. If we change modes, we may
2724 wind up with bad conversions. For INTEGER_TYPEs in C, must check
2725 the precision as well, so as to yield correct results for
2726 bit-field types. C++ does not have these separate bit-field
2727 types, and producing a signed or unsigned variant of an
2728 ENUMERAL_TYPE may cause other problems as well. */
2729
2730 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)
2731 || TYPE_UNSIGNED (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2731, __FUNCTION__))->base.u.bits.unsigned_flag)
== unsignedp)
2732 return type;
2733
2734#define TYPE_OK(node) \
2735 (TYPE_MODE (type)((((enum tree_code) ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2735, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(type) : (type)->type_common.mode)
== TYPE_MODE (node)((((enum tree_code) ((tree_class_check ((node), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2735, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(node) : (node)->type_common.mode)
\
2736 && TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2736, __FUNCTION__))->type_common.precision)
== TYPE_PRECISION (node)((tree_class_check ((node), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2736, __FUNCTION__))->type_common.precision)
)
2737 if (TYPE_OK (signed_char_type_nodeinteger_types[itk_signed_char]))
2738 return unsignedp ? unsigned_char_type_nodeinteger_types[itk_unsigned_char] : signed_char_type_nodeinteger_types[itk_signed_char];
2739 if (TYPE_OK (integer_type_nodeinteger_types[itk_int]))
2740 return unsignedp ? unsigned_type_nodeinteger_types[itk_unsigned_int] : integer_type_nodeinteger_types[itk_int];
2741 if (TYPE_OK (short_integer_type_nodeinteger_types[itk_short]))
2742 return unsignedp ? short_unsigned_type_nodeinteger_types[itk_unsigned_short] : short_integer_type_nodeinteger_types[itk_short];
2743 if (TYPE_OK (long_integer_type_nodeinteger_types[itk_long]))
2744 return unsignedp ? long_unsigned_type_nodeinteger_types[itk_unsigned_long] : long_integer_type_nodeinteger_types[itk_long];
2745 if (TYPE_OK (long_long_integer_type_nodeinteger_types[itk_long_long]))
2746 return (unsignedp ? long_long_unsigned_type_nodeinteger_types[itk_unsigned_long_long]
2747 : long_long_integer_type_nodeinteger_types[itk_long_long]);
2748
2749 for (i = 0; i < NUM_INT_N_ENTS1; i ++)
2750 if (int_n_enabled_p[i]
2751 && TYPE_MODE (type)((((enum tree_code) ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2751, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(type) : (type)->type_common.mode)
== int_n_data[i].m
2752 && TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2752, __FUNCTION__))->type_common.precision)
== int_n_data[i].bitsize)
2753 return (unsignedp ? int_n_trees[i].unsigned_type
2754 : int_n_trees[i].signed_type);
2755
2756#if HOST_BITS_PER_WIDE_INT64 >= 64
2757 if (TYPE_OK (intTI_type_nodeglobal_trees[TI_INTTI_TYPE]))
2758 return unsignedp ? unsigned_intTI_type_nodeglobal_trees[TI_UINTTI_TYPE] : intTI_type_nodeglobal_trees[TI_INTTI_TYPE];
2759#endif
2760 if (TYPE_OK (intDI_type_nodeglobal_trees[TI_INTDI_TYPE]))
2761 return unsignedp ? unsigned_intDI_type_nodeglobal_trees[TI_UINTDI_TYPE] : intDI_type_nodeglobal_trees[TI_INTDI_TYPE];
2762 if (TYPE_OK (intSI_type_nodeglobal_trees[TI_INTSI_TYPE]))
2763 return unsignedp ? unsigned_intSI_type_nodeglobal_trees[TI_UINTSI_TYPE] : intSI_type_nodeglobal_trees[TI_INTSI_TYPE];
2764 if (TYPE_OK (intHI_type_nodeglobal_trees[TI_INTHI_TYPE]))
2765 return unsignedp ? unsigned_intHI_type_nodeglobal_trees[TI_UINTHI_TYPE] : intHI_type_nodeglobal_trees[TI_INTHI_TYPE];
2766 if (TYPE_OK (intQI_type_nodeglobal_trees[TI_INTQI_TYPE]))
2767 return unsignedp ? unsigned_intQI_type_nodeglobal_trees[TI_UINTQI_TYPE] : intQI_type_nodeglobal_trees[TI_INTQI_TYPE];
2768#undef TYPE_OK
2769
2770 return build_nonstandard_integer_type (TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2770, __FUNCTION__))->type_common.precision)
, unsignedp);
2771}
2772
2773/* Build a bit-field integer type for the given WIDTH and UNSIGNEDP. */
2774
2775tree
2776c_build_bitfield_integer_type (unsigned HOST_WIDE_INTlong width, int unsignedp)
2777{
2778 int i;
2779
2780 /* Extended integer types of the same width as a standard type have
2781 lesser rank, so those of the same width as int promote to int or
2782 unsigned int and are valid for printf formats expecting int or
2783 unsigned int. To avoid such special cases, avoid creating
2784 extended integer types for bit-fields if a standard integer type
2785 is available. */
2786 if (width == 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-family/c-common.c"
, 2786, __FUNCTION__))->type_common.precision)
)
2787 return unsignedp ? unsigned_type_nodeinteger_types[itk_unsigned_int] : integer_type_nodeinteger_types[itk_int];
2788 if (width == TYPE_PRECISION (signed_char_type_node)((tree_class_check ((integer_types[itk_signed_char]), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2788, __FUNCTION__))->type_common.precision)
)
2789 return unsignedp ? unsigned_char_type_nodeinteger_types[itk_unsigned_char] : signed_char_type_nodeinteger_types[itk_signed_char];
2790 if (width == TYPE_PRECISION (short_integer_type_node)((tree_class_check ((integer_types[itk_short]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2790, __FUNCTION__))->type_common.precision)
)
2791 return unsignedp ? short_unsigned_type_nodeinteger_types[itk_unsigned_short] : short_integer_type_nodeinteger_types[itk_short];
2792 if (width == TYPE_PRECISION (long_integer_type_node)((tree_class_check ((integer_types[itk_long]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2792, __FUNCTION__))->type_common.precision)
)
2793 return unsignedp ? long_unsigned_type_nodeinteger_types[itk_unsigned_long] : long_integer_type_nodeinteger_types[itk_long];
2794 if (width == TYPE_PRECISION (long_long_integer_type_node)((tree_class_check ((integer_types[itk_long_long]), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2794, __FUNCTION__))->type_common.precision)
)
2795 return (unsignedp ? long_long_unsigned_type_nodeinteger_types[itk_unsigned_long_long]
2796 : long_long_integer_type_nodeinteger_types[itk_long_long]);
2797 for (i = 0; i < NUM_INT_N_ENTS1; i ++)
2798 if (int_n_enabled_p[i]
2799 && width == int_n_data[i].bitsize)
2800 return (unsignedp ? int_n_trees[i].unsigned_type
2801 : int_n_trees[i].signed_type);
2802 return build_nonstandard_integer_type (width, unsignedp);
2803}
2804
2805/* The C version of the register_builtin_type langhook. */
2806
2807void
2808c_register_builtin_type (tree type, const char* name)
2809{
2810 tree decl;
2811
2812 decl = build_decl (UNKNOWN_LOCATION((location_t) 0),
2813 TYPE_DECL, get_identifier (name)(__builtin_constant_p (name) ? get_identifier_with_length ((name
), strlen (name)) : get_identifier (name))
, type);
2814 DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2814, __FUNCTION__))->decl_common.artificial_flag)
= 1;
2815 if (!TYPE_NAME (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2815, __FUNCTION__))->type_common.name)
)
2816 TYPE_NAME (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2816, __FUNCTION__))->type_common.name)
= decl;
2817 lang_hooks.decls.pushdecl (decl);
2818
2819 registered_builtin_types = tree_cons (0, type, registered_builtin_types);
2820}
2821
2822/* Print an error message for invalid operands to arith operation
2823 CODE with TYPE0 for operand 0, and TYPE1 for operand 1.
2824 RICHLOC is a rich location for the message, containing either
2825 three separate locations for each of the operator and operands
2826
2827 lhs op rhs
2828 ~~~ ^~ ~~~
2829
2830 (C FE), or one location ranging over all over them
2831
2832 lhs op rhs
2833 ~~~~^~~~~~
2834
2835 (C++ FE). */
2836
2837void
2838binary_op_error (rich_location *richloc, enum tree_code code,
2839 tree type0, tree type1)
2840{
2841 const char *opname;
2842
2843 switch (code)
2844 {
2845 case PLUS_EXPR:
2846 opname = "+"; break;
2847 case MINUS_EXPR:
2848 opname = "-"; break;
2849 case MULT_EXPR:
2850 opname = "*"; break;
2851 case MAX_EXPR:
2852 opname = "max"; break;
2853 case MIN_EXPR:
2854 opname = "min"; break;
2855 case EQ_EXPR:
2856 opname = "=="; break;
2857 case NE_EXPR:
2858 opname = "!="; break;
2859 case LE_EXPR:
2860 opname = "<="; break;
2861 case GE_EXPR:
2862 opname = ">="; break;
2863 case LT_EXPR:
2864 opname = "<"; break;
2865 case GT_EXPR:
2866 opname = ">"; break;
2867 case LSHIFT_EXPR:
2868 opname = "<<"; break;
2869 case RSHIFT_EXPR:
2870 opname = ">>"; break;
2871 case TRUNC_MOD_EXPR:
2872 case FLOOR_MOD_EXPR:
2873 opname = "%"; break;
2874 case TRUNC_DIV_EXPR:
2875 case FLOOR_DIV_EXPR:
2876 opname = "/"; break;
2877 case BIT_AND_EXPR:
2878 opname = "&"; break;
2879 case BIT_IOR_EXPR:
2880 opname = "|"; break;
2881 case TRUTH_ANDIF_EXPR:
2882 opname = "&&"; break;
2883 case TRUTH_ORIF_EXPR:
2884 opname = "||"; break;
2885 case BIT_XOR_EXPR:
2886 opname = "^"; break;
2887 default:
2888 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2888, __FUNCTION__))
;
2889 }
2890 error_at (richloc,
2891 "invalid operands to binary %s (have %qT and %qT)",
2892 opname, type0, type1);
2893}
2894
2895/* Given an expression as a tree, return its original type. Do this
2896 by stripping any conversion that preserves the sign and precision. */
2897static tree
2898expr_original_type (tree expr)
2899{
2900 STRIP_SIGN_NOPS (expr)(expr) = tree_strip_sign_nop_conversions ((const_cast<union
tree_node *> (((expr)))))
;
2901 return TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2901, __FUNCTION__))->typed.type)
;
2902}
2903
2904/* Subroutine of build_binary_op, used for comparison operations.
2905 See if the operands have both been converted from subword integer types
2906 and, if so, perhaps change them both back to their original type.
2907 This function is also responsible for converting the two operands
2908 to the proper common type for comparison.
2909
2910 The arguments of this function are all pointers to local variables
2911 of build_binary_op: OP0_PTR is &OP0, OP1_PTR is &OP1,
2912 RESTYPE_PTR is &RESULT_TYPE and RESCODE_PTR is &RESULTCODE.
2913
2914 LOC is the location of the comparison.
2915
2916 If this function returns non-NULL_TREE, it means that the comparison has
2917 a constant value. What this function returns is an expression for
2918 that value. */
2919
2920tree
2921shorten_compare (location_t loc, tree *op0_ptr, tree *op1_ptr,
2922 tree *restype_ptr, enum tree_code *rescode_ptr)
2923{
2924 tree type;
2925 tree op0 = *op0_ptr;
2926 tree op1 = *op1_ptr;
2927 int unsignedp0, unsignedp1;
2928 int real1, real2;
2929 tree primop0, primop1;
2930 enum tree_code code = *rescode_ptr;
2931
2932 /* Throw away any conversions to wider types
2933 already present in the operands. */
2934
2935 primop0 = c_common_get_narrower (op0, &unsignedp0);
2936 primop1 = c_common_get_narrower (op1, &unsignedp1);
2937
2938 /* If primopN is first sign-extended from primopN's precision to opN's
2939 precision, then zero-extended from opN's precision to
2940 *restype_ptr precision, shortenings might be invalid. */
2941 if (TYPE_PRECISION (TREE_TYPE (primop0))((tree_class_check ((((contains_struct_check ((primop0), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2941, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2941, __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-family/c-common.c"
, 2941, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2941, __FUNCTION__))->type_common.precision)
2942 && 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-family/c-common.c"
, 2942, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2942, __FUNCTION__))->type_common.precision)
< TYPE_PRECISION (*restype_ptr)((tree_class_check ((*restype_ptr), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2942, __FUNCTION__))->type_common.precision)
2943 && !unsignedp0
2944 && TYPE_UNSIGNED (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-family/c-common.c"
, 2944, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2944, __FUNCTION__))->base.u.bits.unsigned_flag)
)
2945 primop0 = op0;
2946 if (TYPE_PRECISION (TREE_TYPE (primop1))((tree_class_check ((((contains_struct_check ((primop1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2946, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2946, __FUNCTION__))->type_common.precision)
< TYPE_PRECISION (TREE_TYPE (op1))((tree_class_check ((((contains_struct_check ((op1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2946, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2946, __FUNCTION__))->type_common.precision)
2947 && TYPE_PRECISION (TREE_TYPE (op1))((tree_class_check ((((contains_struct_check ((op1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2947, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2947, __FUNCTION__))->type_common.precision)
< TYPE_PRECISION (*restype_ptr)((tree_class_check ((*restype_ptr), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2947, __FUNCTION__))->type_common.precision)
2948 && !unsignedp1
2949 && TYPE_UNSIGNED (TREE_TYPE (op1))((tree_class_check ((((contains_struct_check ((op1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2949, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2949, __FUNCTION__))->base.u.bits.unsigned_flag)
)
2950 primop1 = op1;
2951
2952 /* Handle the case that OP0 does not *contain* a conversion
2953 but it *requires* conversion to FINAL_TYPE. */
2954
2955 if (op0 == primop0 && TREE_TYPE (op0)((contains_struct_check ((op0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2955, __FUNCTION__))->typed.type)
!= *restype_ptr)
2956 unsignedp0 = TYPE_UNSIGNED (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-family/c-common.c"
, 2956, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2956, __FUNCTION__))->base.u.bits.unsigned_flag)
;
2957 if (op1 == primop1 && TREE_TYPE (op1)((contains_struct_check ((op1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2957, __FUNCTION__))->typed.type)
!= *restype_ptr)
2958 unsignedp1 = TYPE_UNSIGNED (TREE_TYPE (op1))((tree_class_check ((((contains_struct_check ((op1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2958, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2958, __FUNCTION__))->base.u.bits.unsigned_flag)
;
2959
2960 /* If one of the operands must be floated, we cannot optimize. */
2961 real1 = TREE_CODE (TREE_TYPE (primop0))((enum tree_code) (((contains_struct_check ((primop0), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2961, __FUNCTION__))->typed.type))->base.code)
== REAL_TYPE;
2962 real2 = TREE_CODE (TREE_TYPE (primop1))((enum tree_code) (((contains_struct_check ((primop1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2962, __FUNCTION__))->typed.type))->base.code)
== REAL_TYPE;
2963
2964 /* If first arg is constant, swap the args (changing operation
2965 so value is preserved), for canonicalization. Don't do this if
2966 the second arg is 0. */
2967
2968 if (TREE_CONSTANT (primop0)((non_type_check ((primop0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 2968, __FUNCTION__))->base.constant_flag)
2969 && !integer_zerop (primop1) && !real_zerop (primop1)
2970 && !fixed_zerop (primop1))
2971 {
2972 std::swap (primop0, primop1);
2973 std::swap (op0, op1);
2974 *op0_ptr = op0;
2975 *op1_ptr = op1;
2976 std::swap (unsignedp0, unsignedp1);
2977 std::swap (real1, real2);
2978
2979 switch (code)
2980 {
2981 case LT_EXPR:
2982 code = GT_EXPR;
2983 break;
2984 case GT_EXPR:
2985 code = LT_EXPR;
2986 break;
2987 case LE_EXPR:
2988 code = GE_EXPR;
2989 break;
2990 case GE_EXPR:
2991 code = LE_EXPR;
2992 break;
2993 default:
2994 break;
2995 }
2996 *rescode_ptr = code;
2997 }
2998
2999 /* If comparing an integer against a constant more bits wide,
3000 maybe we can deduce a value of 1 or 0 independent of the data.
3001 Or else truncate the constant now
3002 rather than extend the variable at run time.
3003
3004 This is only interesting if the constant is the wider arg.
3005 Also, it is not safe if the constant is unsigned and the
3006 variable arg is signed, since in this case the variable
3007 would be sign-extended and then regarded as unsigned.
3008 Our technique fails in this case because the lowest/highest
3009 possible unsigned results don't follow naturally from the
3010 lowest/highest possible values of the variable operand.
3011 For just EQ_EXPR and NE_EXPR there is another technique that
3012 could be used: see if the constant can be faithfully represented
3013 in the other operand's type, by truncating it and reextending it
3014 and see if that preserves the constant's value. */
3015
3016 if (!real1 && !real2
3017 && TREE_CODE (TREE_TYPE (primop0))((enum tree_code) (((contains_struct_check ((primop0), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3017, __FUNCTION__))->typed.type))->base.code)
!= FIXED_POINT_TYPE
3018 && TREE_CODE (primop1)((enum tree_code) (primop1)->base.code) == INTEGER_CST
3019 && TYPE_PRECISION (TREE_TYPE (primop0))((tree_class_check ((((contains_struct_check ((primop0), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3019, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3019, __FUNCTION__))->type_common.precision)
< TYPE_PRECISION (*restype_ptr)((tree_class_check ((*restype_ptr), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3019, __FUNCTION__))->type_common.precision)
)
3020 {
3021 int min_gt, max_gt, min_lt, max_lt;
3022 tree maxval, minval;
3023 /* 1 if comparison is nominally unsigned. */
3024 int unsignedp = TYPE_UNSIGNED (*restype_ptr)((tree_class_check ((*restype_ptr), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3024, __FUNCTION__))->base.u.bits.unsigned_flag)
;
3025 tree val;
3026
3027 type = c_common_signed_or_unsigned_type (unsignedp0,
3028 TREE_TYPE (primop0)((contains_struct_check ((primop0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3028, __FUNCTION__))->typed.type)
);
3029
3030 maxval = TYPE_MAX_VALUE (type)((tree_check5 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3030, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)
;
3031 minval = TYPE_MIN_VALUE (type)((tree_check5 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3031, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.minval
)
;
3032
3033 if (unsignedp && !unsignedp0)
3034 *restype_ptr = c_common_signed_type (*restype_ptr);
3035
3036 if (TREE_TYPE (primop1)((contains_struct_check ((primop1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3036, __FUNCTION__))->typed.type)
!= *restype_ptr)
3037 {
3038 /* Convert primop1 to target type, but do not introduce
3039 additional overflow. We know primop1 is an int_cst. */
3040 primop1 = force_fit_type (*restype_ptr,
3041 wi::to_wide
3042 (primop1,
3043 TYPE_PRECISION (*restype_ptr)((tree_class_check ((*restype_ptr), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3043, __FUNCTION__))->type_common.precision)
),
3044 0, TREE_OVERFLOW (primop1)((tree_class_check ((primop1), (tcc_constant), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3044, __FUNCTION__))->base.public_flag)
);
3045 }
3046 if (type != *restype_ptr)
3047 {
3048 minval = convert (*restype_ptr, minval);
3049 maxval = convert (*restype_ptr, maxval);
3050 }
3051
3052 min_gt = tree_int_cst_lt (primop1, minval);
3053 max_gt = tree_int_cst_lt (primop1, maxval);
3054 min_lt = tree_int_cst_lt (minval, primop1);
3055 max_lt = tree_int_cst_lt (maxval, primop1);
3056
3057 val = 0;
3058 /* This used to be a switch, but Genix compiler can't handle that. */
3059 if (code == NE_EXPR)
3060 {
3061 if (max_lt || min_gt)
3062 val = truthvalue_true_nodec_global_trees[CTI_TRUTHVALUE_TRUE];
3063 }
3064 else if (code == EQ_EXPR)
3065 {
3066 if (max_lt || min_gt)
3067 val = truthvalue_false_nodec_global_trees[CTI_TRUTHVALUE_FALSE];
3068 }
3069 else if (code == LT_EXPR)
3070 {
3071 if (max_lt)
3072 val = truthvalue_true_nodec_global_trees[CTI_TRUTHVALUE_TRUE];
3073 if (!min_lt)
3074 val = truthvalue_false_nodec_global_trees[CTI_TRUTHVALUE_FALSE];
3075 }
3076 else if (code == GT_EXPR)
3077 {
3078 if (min_gt)
3079 val = truthvalue_true_nodec_global_trees[CTI_TRUTHVALUE_TRUE];
3080 if (!max_gt)
3081 val = truthvalue_false_nodec_global_trees[CTI_TRUTHVALUE_FALSE];
3082 }
3083 else if (code == LE_EXPR)
3084 {
3085 if (!max_gt)
3086 val = truthvalue_true_nodec_global_trees[CTI_TRUTHVALUE_TRUE];
3087 if (min_gt)
3088 val = truthvalue_false_nodec_global_trees[CTI_TRUTHVALUE_FALSE];
3089 }
3090 else if (code == GE_EXPR)
3091 {
3092 if (!min_lt)
3093 val = truthvalue_true_nodec_global_trees[CTI_TRUTHVALUE_TRUE];
3094 if (max_lt)
3095 val = truthvalue_false_nodec_global_trees[CTI_TRUTHVALUE_FALSE];
3096 }
3097
3098 /* If primop0 was sign-extended and unsigned comparison specd,
3099 we did a signed comparison above using the signed type bounds.
3100 But the comparison we output must be unsigned.
3101
3102 Also, for inequalities, VAL is no good; but if the signed
3103 comparison had *any* fixed result, it follows that the
3104 unsigned comparison just tests the sign in reverse
3105 (positive values are LE, negative ones GE).
3106 So we can generate an unsigned comparison
3107 against an extreme value of the signed type. */
3108
3109 if (unsignedp && !unsignedp0)
3110 {
3111 if (val != 0)
3112 switch (code)
3113 {
3114 case LT_EXPR:
3115 case GE_EXPR:
3116 primop1 = TYPE_MIN_VALUE (type)((tree_check5 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3116, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.minval
)
;
3117 val = 0;
3118 break;
3119
3120 case LE_EXPR:
3121 case GT_EXPR:
3122 primop1 = TYPE_MAX_VALUE (type)((tree_check5 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3122, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)
;
3123 val = 0;
3124 break;
3125
3126 default:
3127 break;
3128 }
3129 type = c_common_unsigned_type (type);
3130 }
3131
3132 if (TREE_CODE (primop0)((enum tree_code) (primop0)->base.code) != INTEGER_CST
3133 /* Don't warn if it's from a (non-system) macro. */
3134 && !(from_macro_expansion_at
3135 (expansion_point_location_if_in_system_header
3136 (EXPR_LOCATION (primop0)((((primop0)) && ((tree_code_type[(int) (((enum tree_code
) ((primop0))->base.code))]) >= tcc_reference &&
(tree_code_type[(int) (((enum tree_code) ((primop0))->base
.code))]) <= tcc_expression)) ? (primop0)->exp.locus : (
(location_t) 0))
))))
3137 {
3138 if (val == truthvalue_false_nodec_global_trees[CTI_TRUTHVALUE_FALSE])
3139 warning_at (loc, OPT_Wtype_limits,
3140 "comparison is always false due to limited range of data type");
3141 if (val == truthvalue_true_nodec_global_trees[CTI_TRUTHVALUE_TRUE])
3142 warning_at (loc, OPT_Wtype_limits,
3143 "comparison is always true due to limited range of data type");
3144 }
3145
3146 if (val != 0)
3147 {
3148 /* Don't forget to evaluate PRIMOP0 if it has side effects. */
3149 if (TREE_SIDE_EFFECTS (primop0)((non_type_check ((primop0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3149, __FUNCTION__))->base.side_effects_flag)
)
3150 return build2 (COMPOUND_EXPR, TREE_TYPE (val)((contains_struct_check ((val), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3150, __FUNCTION__))->typed.type)
, primop0, val);
3151 return val;
3152 }
3153
3154 /* Value is not predetermined, but do the comparison
3155 in the type of the operand that is not constant.
3156 TYPE is already properly set. */
3157 }
3158
3159 /* If either arg is decimal float and the other is float, find the
3160 proper common type to use for comparison. */
3161 else if (real1 && real2
3162 && DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (primop0)))(((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check
((((contains_struct_check ((primop0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3162, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3162, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((primop0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3162, __FUNCTION__))->typed.type)) : (((contains_struct_check
((primop0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3162, __FUNCTION__))->typed.type))->type_common.mode)
]) == MODE_DECIMAL_FLOAT)
3163 && DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (primop1)))(((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check
((((contains_struct_check ((primop1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3163, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3163, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((primop1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3163, __FUNCTION__))->typed.type)) : (((contains_struct_check
((primop1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3163, __FUNCTION__))->typed.type))->type_common.mode)
]) == MODE_DECIMAL_FLOAT)
)
3164 type = common_type (TREE_TYPE (primop0)((contains_struct_check ((primop0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3164, __FUNCTION__))->typed.type)
, TREE_TYPE (primop1)((contains_struct_check ((primop1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3164, __FUNCTION__))->typed.type)
);
3165
3166 /* If either arg is decimal float and the other is float, fail. */
3167 else if (real1 && real2
3168 && (DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (primop0)))(((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check
((((contains_struct_check ((primop0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3168, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3168, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((primop0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3168, __FUNCTION__))->typed.type)) : (((contains_struct_check
((primop0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3168, __FUNCTION__))->typed.type))->type_common.mode)
]) == MODE_DECIMAL_FLOAT)
3169 || DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (primop1)))(((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check
((((contains_struct_check ((primop1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3169, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3169, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((primop1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3169, __FUNCTION__))->typed.type)) : (((contains_struct_check
((primop1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3169, __FUNCTION__))->typed.type))->type_common.mode)
]) == MODE_DECIMAL_FLOAT)
))
3170 return NULL_TREE(tree) __null;
3171
3172 else if (real1 && real2
3173 && (TYPE_PRECISION (TREE_TYPE (primop0))((tree_class_check ((((contains_struct_check ((primop0), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3173, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3173, __FUNCTION__))->type_common.precision)
3174 == TYPE_PRECISION (TREE_TYPE (primop1))((tree_class_check ((((contains_struct_check ((primop1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3174, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3174, __FUNCTION__))->type_common.precision)
))
3175 type = TREE_TYPE (primop0)((contains_struct_check ((primop0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3175, __FUNCTION__))->typed.type)
;
3176
3177 /* If args' natural types are both narrower than nominal type
3178 and both extend in the same manner, compare them
3179 in the type of the wider arg.
3180 Otherwise must actually extend both to the nominal
3181 common type lest different ways of extending
3182 alter the result.
3183 (eg, (short)-1 == (unsigned short)-1 should be 0.) */
3184
3185 else if (unsignedp0 == unsignedp1 && real1 == real2
3186 && TYPE_PRECISION (TREE_TYPE (primop0))((tree_class_check ((((contains_struct_check ((primop0), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3186, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3186, __FUNCTION__))->type_common.precision)
< TYPE_PRECISION (*restype_ptr)((tree_class_check ((*restype_ptr), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3186, __FUNCTION__))->type_common.precision)
3187 && TYPE_PRECISION (TREE_TYPE (primop1))((tree_class_check ((((contains_struct_check ((primop1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3187, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3187, __FUNCTION__))->type_common.precision)
< TYPE_PRECISION (*restype_ptr)((tree_class_check ((*restype_ptr), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3187, __FUNCTION__))->type_common.precision)
)
3188 {
3189 type = common_type (TREE_TYPE (primop0)((contains_struct_check ((primop0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3189, __FUNCTION__))->typed.type)
, TREE_TYPE (primop1)((contains_struct_check ((primop1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3189, __FUNCTION__))->typed.type)
);
3190 type = c_common_signed_or_unsigned_type (unsignedp0
3191 || TYPE_UNSIGNED (*restype_ptr)((tree_class_check ((*restype_ptr), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3191, __FUNCTION__))->base.u.bits.unsigned_flag)
,
3192 type);
3193 /* Make sure shorter operand is extended the right way
3194 to match the longer operand. */
3195 primop0
3196 = convert (c_common_signed_or_unsigned_type (unsignedp0,
3197 TREE_TYPE (primop0)((contains_struct_check ((primop0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3197, __FUNCTION__))->typed.type)
),
3198 primop0);
3199 primop1
3200 = convert (c_common_signed_or_unsigned_type (unsignedp1,
3201 TREE_TYPE (primop1)((contains_struct_check ((primop1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3201, __FUNCTION__))->typed.type)
),
3202 primop1);
3203 }
3204 else
3205 {
3206 /* Here we must do the comparison on the nominal type
3207 using the args exactly as we received them. */
3208 type = *restype_ptr;
3209 primop0 = op0;
3210 primop1 = op1;
3211
3212 /* We want to fold unsigned comparisons of >= and < against zero.
3213 For these, we may also issue a warning if we have a non-constant
3214 compared against zero, where the zero was spelled as "0" (rather
3215 than merely folding to it).
3216 If we have at least one constant, then op1 is constant
3217 and we may have a non-constant expression as op0. */
3218 if (!real1 && !real2 && integer_zerop (primop1)
3219 && TYPE_UNSIGNED (*restype_ptr)((tree_class_check ((*restype_ptr), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3219, __FUNCTION__))->base.u.bits.unsigned_flag)
)
3220 {
3221 tree value = NULL_TREE(tree) __null;
3222 /* All unsigned values are >= 0, so we warn. However,
3223 if OP0 is a constant that is >= 0, the signedness of
3224 the comparison isn't an issue, so suppress the
3225 warning. */
3226 tree folded_op0 = fold_for_warn (op0);
3227 bool warn =
3228 warn_type_limitsglobal_options.x_warn_type_limits && !in_system_header_at (loc)
3229 && !(TREE_CODE (folded_op0)((enum tree_code) (folded_op0)->base.code) == INTEGER_CST
3230 && !TREE_OVERFLOW (convert (c_common_signed_type (type),((tree_class_check ((convert (c_common_signed_type (type), folded_op0
)), (tcc_constant), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3231, __FUNCTION__))->base.public_flag)
3231 folded_op0))((tree_class_check ((convert (c_common_signed_type (type), folded_op0
)), (tcc_constant), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3231, __FUNCTION__))->base.public_flag)
)
3232 /* Do not warn for enumeration types. */
3233 && (TREE_CODE (expr_original_type (folded_op0))((enum tree_code) (expr_original_type (folded_op0))->base.
code)
!= ENUMERAL_TYPE);
3234
3235 switch (code)
3236 {
3237 case GE_EXPR:
3238 if (warn)
3239 warning_at (loc, OPT_Wtype_limits,
3240 "comparison of unsigned expression in %<>= 0%> "
3241 "is always true");
3242 value = truthvalue_true_nodec_global_trees[CTI_TRUTHVALUE_TRUE];
3243 break;
3244
3245 case LT_EXPR:
3246 if (warn)
3247 warning_at (loc, OPT_Wtype_limits,
3248 "comparison of unsigned expression in %<< 0%> "
3249 "is always false");
3250 value = truthvalue_false_nodec_global_trees[CTI_TRUTHVALUE_FALSE];
3251 break;
3252
3253 default:
3254 break;
3255 }
3256
3257 if (value != NULL_TREE(tree) __null)
3258 {
3259 /* Don't forget to evaluate PRIMOP0 if it has side effects. */
3260 if (TREE_SIDE_EFFECTS (primop0)((non_type_check ((primop0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3260, __FUNCTION__))->base.side_effects_flag)
)
3261 return build2 (COMPOUND_EXPR, TREE_TYPE (value)((contains_struct_check ((value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3261, __FUNCTION__))->typed.type)
,
3262 primop0, value);
3263 return value;
3264 }
3265 }
3266 }
3267
3268 *op0_ptr = convert (type, primop0);
3269 *op1_ptr = convert (type, primop1);
3270
3271 *restype_ptr = truthvalue_type_nodec_global_trees[CTI_TRUTHVALUE_TYPE];
3272
3273 return NULL_TREE(tree) __null;
3274}
3275
3276/* Return a tree for the sum or difference (RESULTCODE says which)
3277 of pointer PTROP and integer INTOP. */
3278
3279tree
3280pointer_int_sum (location_t loc, enum tree_code resultcode,
3281 tree ptrop, tree intop, bool complain)
3282{
3283 tree size_exp, ret;
3284
3285 /* The result is a pointer of the same type that is being added. */
3286 tree result_type = TREE_TYPE (ptrop)((contains_struct_check ((ptrop), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3286, __FUNCTION__))->typed.type)
;
3287
3288 if (TREE_CODE (TREE_TYPE (result_type))((enum tree_code) (((contains_struct_check ((result_type), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3288, __FUNCTION__))->typed.type))->base.code)
== VOID_TYPE)
3289 {
3290 if (complain && warn_pointer_arithglobal_options.x_warn_pointer_arith)
3291 pedwarn (loc, OPT_Wpointer_arith,
3292 "pointer of type %<void *%> used in arithmetic");
3293 else if (!complain)
3294 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3295 size_exp = integer_one_nodeglobal_trees[TI_INTEGER_ONE];
3296 }
3297 else if (TREE_CODE (TREE_TYPE (result_type))((enum tree_code) (((contains_struct_check ((result_type), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3297, __FUNCTION__))->typed.type))->base.code)
== FUNCTION_TYPE)
3298 {
3299 if (complain && warn_pointer_arithglobal_options.x_warn_pointer_arith)
3300 pedwarn (loc, OPT_Wpointer_arith,
3301 "pointer to a function used in arithmetic");
3302 else if (!complain)
3303 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3304 size_exp = integer_one_nodeglobal_trees[TI_INTEGER_ONE];
3305 }
3306 else if (!verify_type_context (loc, TCTX_POINTER_ARITH,
3307 TREE_TYPE (result_type)((contains_struct_check ((result_type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3307, __FUNCTION__))->typed.type)
))
3308 size_exp = integer_one_nodeglobal_trees[TI_INTEGER_ONE];
3309 else
3310 {
3311 size_exp = size_in_bytes_loc (loc, TREE_TYPE (result_type)((contains_struct_check ((result_type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3311, __FUNCTION__))->typed.type)
);
3312 /* Wrap the pointer expression in a SAVE_EXPR to make sure it
3313 is evaluated first when the size expression may depend
3314 on it for VM types. */
3315 if (TREE_SIDE_EFFECTS (size_exp)((non_type_check ((size_exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3315, __FUNCTION__))->base.side_effects_flag)
3316 && TREE_SIDE_EFFECTS (ptrop)((non_type_check ((ptrop), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3316, __FUNCTION__))->base.side_effects_flag)
3317 && variably_modified_type_p (TREE_TYPE (ptrop)((contains_struct_check ((ptrop), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3317, __FUNCTION__))->typed.type)
, NULL__null))
3318 {
3319 ptrop = save_expr (ptrop);
3320 size_exp = build2 (COMPOUND_EXPR, TREE_TYPE (intop)((contains_struct_check ((intop), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3320, __FUNCTION__))->typed.type)
, ptrop, size_exp);
3321 }
3322 }
3323
3324 /* We are manipulating pointer values, so we don't need to warn
3325 about relying on undefined signed overflow. We disable the
3326 warning here because we use integer types so fold won't know that
3327 they are really pointers. */
3328 fold_defer_overflow_warnings ();
3329
3330 /* If what we are about to multiply by the size of the elements
3331 contains a constant term, apply distributive law
3332 and multiply that constant term separately.
3333 This helps produce common subexpressions. */
3334 if ((TREE_CODE (intop)((enum tree_code) (intop)->base.code) == PLUS_EXPR || TREE_CODE (intop)((enum tree_code) (intop)->base.code) == MINUS_EXPR)
3335 && !TREE_CONSTANT (intop)((non_type_check ((intop), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3335, __FUNCTION__))->base.constant_flag)
3336 && TREE_CONSTANT (TREE_OPERAND (intop, 1))((non_type_check (((*((const_cast<tree*> (tree_operand_check
((intop), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3336, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3336, __FUNCTION__))->base.constant_flag)
3337 && TREE_CONSTANT (size_exp)((non_type_check ((size_exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3337, __FUNCTION__))->base.constant_flag)
3338 /* If the constant comes from pointer subtraction,
3339 skip this optimization--it would cause an error. */
3340 && TREE_CODE (TREE_TYPE (TREE_OPERAND (intop, 0)))((enum tree_code) (((contains_struct_check (((*((const_cast<
tree*> (tree_operand_check ((intop), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3340, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3340, __FUNCTION__))->typed.type))->base.code)
== INTEGER_TYPE
3341 /* If the constant is unsigned, and smaller than the pointer size,
3342 then we must skip this optimization. This is because it could cause
3343 an overflow error if the constant is negative but INTOP is not. */
3344 && (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (intop))((((enum tree_code) (((contains_struct_check ((intop), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3344, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((intop), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3344, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
) ? !global_options.x_flag_wrapv_pointer : (!(any_integral_type_check
((((contains_struct_check ((intop), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3344, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3344, __FUNCTION__))->base.u.bits.unsigned_flag &&
!global_options.x_flag_wrapv && !global_options.x_flag_trapv
))
3345 || (TYPE_PRECISION (TREE_TYPE (intop))((tree_class_check ((((contains_struct_check ((intop), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3345, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3345, __FUNCTION__))->type_common.precision)
3346 == TYPE_PRECISION (TREE_TYPE (ptrop))((tree_class_check ((((contains_struct_check ((ptrop), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3346, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3346, __FUNCTION__))->type_common.precision)
)))
3347 {
3348 enum tree_code subcode = resultcode;
3349 tree int_type = TREE_TYPE (intop)((contains_struct_check ((intop), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3349, __FUNCTION__))->typed.type)
;
3350 if (TREE_CODE (intop)((enum tree_code) (intop)->base.code) == MINUS_EXPR)
3351 subcode = (subcode == PLUS_EXPR ? MINUS_EXPR : PLUS_EXPR);
3352 /* Convert both subexpression types to the type of intop,
3353 because weird cases involving pointer arithmetic
3354 can result in a sum or difference with different type args. */
3355 ptrop = build_binary_op (EXPR_LOCATION (TREE_OPERAND (intop, 1))(((((*((const_cast<tree*> (tree_operand_check ((intop),
(1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3355, __FUNCTION__))))))) && ((tree_code_type[(int)
(((enum tree_code) (((*((const_cast<tree*> (tree_operand_check
((intop), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3355, __FUNCTION__)))))))->base.code))]) >= tcc_reference
&& (tree_code_type[(int) (((enum tree_code) (((*((const_cast
<tree*> (tree_operand_check ((intop), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3355, __FUNCTION__)))))))->base.code))]) <= tcc_expression
)) ? ((*((const_cast<tree*> (tree_operand_check ((intop
), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3355, __FUNCTION__))))))->exp.locus : ((location_t) 0))
,
3356 subcode, ptrop,
3357 convert (int_type, TREE_OPERAND (intop, 1)(*((const_cast<tree*> (tree_operand_check ((intop), (1)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3357, __FUNCTION__)))))
),
3358 true);
3359 intop = convert (int_type, TREE_OPERAND (intop, 0)(*((const_cast<tree*> (tree_operand_check ((intop), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3359, __FUNCTION__)))))
);
3360 }
3361
3362 /* Convert the integer argument to a type the same size as sizetype
3363 so the multiply won't overflow spuriously. */
3364 if (TYPE_PRECISION (TREE_TYPE (intop))((tree_class_check ((((contains_struct_check ((intop), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3364, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3364, __FUNCTION__))->type_common.precision)
!= TYPE_PRECISION (sizetype)((tree_class_check ((sizetype_tab[(int) stk_sizetype]), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3364, __FUNCTION__))->type_common.precision)
3365 || TYPE_UNSIGNED (TREE_TYPE (intop))((tree_class_check ((((contains_struct_check ((intop), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3365, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3365, __FUNCTION__))->base.u.bits.unsigned_flag)
!= TYPE_UNSIGNED (sizetype)((tree_class_check ((sizetype_tab[(int) stk_sizetype]), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3365, __FUNCTION__))->base.u.bits.unsigned_flag)
)
3366 intop = convert (c_common_type_for_size (TYPE_PRECISION (sizetype)((tree_class_check ((sizetype_tab[(int) stk_sizetype]), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3366, __FUNCTION__))->type_common.precision)
,
3367 TYPE_UNSIGNED (sizetype)((tree_class_check ((sizetype_tab[(int) stk_sizetype]), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3367, __FUNCTION__))->base.u.bits.unsigned_flag)
), intop);
3368
3369 /* Replace the integer argument with a suitable product by the object size.
3370 Do this multiplication as signed, then convert to the appropriate type
3371 for the pointer operation and disregard an overflow that occurred only
3372 because of the sign-extension change in the latter conversion. */
3373 {
3374 tree t = fold_build2_loc (loc, MULT_EXPR, TREE_TYPE (intop)((contains_struct_check ((intop), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3374, __FUNCTION__))->typed.type)
, intop,
3375 convert (TREE_TYPE (intop)((contains_struct_check ((intop), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3375, __FUNCTION__))->typed.type)
, size_exp));
3376 intop = convert (sizetypesizetype_tab[(int) stk_sizetype], t);
3377 if (TREE_OVERFLOW_P (intop)((tree_code_type[(int) (((enum tree_code) (intop)->base.code
))] == tcc_constant) && ((tree_class_check ((intop), (
tcc_constant), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3377, __FUNCTION__))->base.public_flag))
&& !TREE_OVERFLOW (t)((tree_class_check ((t), (tcc_constant), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3377, __FUNCTION__))->base.public_flag)
)
3378 intop = wide_int_to_tree (TREE_TYPE (intop)((contains_struct_check ((intop), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3378, __FUNCTION__))->typed.type)
, wi::to_wide (intop));
3379 }
3380
3381 /* Create the sum or difference. */
3382 if (resultcode == MINUS_EXPR)
3383 intop = fold_build1_loc (loc, NEGATE_EXPR, sizetypesizetype_tab[(int) stk_sizetype], intop);
3384
3385 ret = fold_build_pointer_plus_loc (loc, ptrop, intop);
3386
3387 fold_undefer_and_ignore_overflow_warnings ();
3388
3389 return ret;
3390}
3391
3392/* Wrap a C_MAYBE_CONST_EXPR around an expression that is fully folded
3393 and if NON_CONST is known not to be permitted in an evaluated part
3394 of a constant expression. */
3395
3396tree
3397c_wrap_maybe_const (tree expr, bool non_const)
3398{
3399 location_t loc = EXPR_LOCATION (expr)((((expr)) && ((tree_code_type[(int) (((enum tree_code
) ((expr))->base.code))]) >= tcc_reference && (
tree_code_type[(int) (((enum tree_code) ((expr))->base.code
))]) <= tcc_expression)) ? (expr)->exp.locus : ((location_t
) 0))
;
3400
3401 /* This should never be called for C++. */
3402 if (c_dialect_cxx ()((c_language & clk_cxx) != 0))
3403 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3403, __FUNCTION__))
;
3404
3405 /* The result of folding may have a NOP_EXPR to set TREE_NO_WARNING. */
3406 STRIP_TYPE_NOPS (expr)while ((((((enum tree_code) (expr)->base.code)) == NOP_EXPR
|| (((enum tree_code) (expr)->base.code)) == CONVERT_EXPR
) || ((enum tree_code) (expr)->base.code) == NON_LVALUE_EXPR
) && (*((const_cast<tree*> (tree_operand_check (
(expr), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3406, __FUNCTION__))))) != global_trees[TI_ERROR_MARK] &&
(((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3406, __FUNCTION__))->typed.type) == ((contains_struct_check
(((*((const_cast<tree*> (tree_operand_check ((expr), (
0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3406, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3406, __FUNCTION__))->typed.type))) (expr) = (*((const_cast
<tree*> (tree_operand_check ((expr), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3406, __FUNCTION__)))))
;
3407 expr = 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-family/c-common.c"
, 3407, __FUNCTION__))->typed.type)
, NULL__null, expr);
3408 C_MAYBE_CONST_EXPR_NON_CONST (expr)((tree_not_check2 (((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3408, __FUNCTION__, (C_MAYBE_CONST_EXPR)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3408, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)
= non_const;
3409 protected_set_expr_location (expr, loc);
3410
3411 return expr;
3412}
3413
3414/* Return whether EXPR is a declaration whose address can never be NULL.
3415 The address of the first struct member could be NULL only if it were
3416 accessed through a NULL pointer, and such an access would be invalid.
3417 The address of a weak symbol may be null unless it has a definition. */
3418
3419bool
3420decl_with_nonnull_addr_p (const_tree expr)
3421{
3422 if (!DECL_P (expr)(tree_code_type[(int) (((enum tree_code) (expr)->base.code
))] == tcc_declaration)
)
3423 return false;
3424
3425 if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == FIELD_DECL
3426 || TREE_CODE (expr)((enum tree_code) (expr)->base.code) == PARM_DECL
3427 || TREE_CODE (expr)((enum tree_code) (expr)->base.code) == LABEL_DECL)
3428 return true;
3429
3430 if (!VAR_OR_FUNCTION_DECL_P (expr)(((enum tree_code) (expr)->base.code) == VAR_DECL || ((enum
tree_code) (expr)->base.code) == FUNCTION_DECL)
)
3431 return false;
3432
3433 if (!DECL_WEAK (expr)((contains_struct_check ((expr), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3433, __FUNCTION__))->decl_with_vis.weak_flag)
)
3434 /* Ordinary (non-weak) symbols have nonnull addresses. */
3435 return true;
3436
3437 if (DECL_INITIAL (expr)((contains_struct_check ((expr), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3437, __FUNCTION__))->decl_common.initial)
&& DECL_INITIAL (expr)((contains_struct_check ((expr), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3437, __FUNCTION__))->decl_common.initial)
!= error_mark_nodeglobal_trees[TI_ERROR_MARK])
3438 /* Initialized weak symbols have nonnull addresses. */
3439 return true;
3440
3441 if (DECL_EXTERNAL (expr)((contains_struct_check ((expr), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3441, __FUNCTION__))->decl_common.decl_flag_1)
|| !TREE_STATIC (expr)((expr)->base.static_flag))
3442 /* Uninitialized extern weak symbols and weak symbols with no
3443 allocated storage might have a null address. */
3444 return false;
3445
3446 tree attribs = DECL_ATTRIBUTES (expr)((contains_struct_check ((expr), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3446, __FUNCTION__))->decl_common.attributes)
;
3447 if (lookup_attribute ("weakref", attribs))
3448 /* Weakref symbols might have a null address unless their referent
3449 is known not to. Don't bother following weakref targets here. */
3450 return false;
3451
3452 return true;
3453}
3454
3455/* Prepare expr to be an argument of a TRUTH_NOT_EXPR,
3456 or for an `if' or `while' statement or ?..: exp. It should already
3457 have been validated to be of suitable type; otherwise, a bad
3458 diagnostic may result.
3459
3460 The EXPR is located at LOCATION.
3461
3462 This preparation consists of taking the ordinary
3463 representation of an expression expr and producing a valid tree
3464 boolean expression describing whether expr is nonzero. We could
3465 simply always do build_binary_op (NE_EXPR, expr, truthvalue_false_node, 1),
3466 but we optimize comparisons, &&, ||, and !.
3467
3468 The resulting type should always be `truthvalue_type_node'. */
3469
3470tree
3471c_common_truthvalue_conversion (location_t location, tree expr)
3472{
3473 STRIP_ANY_LOCATION_WRAPPER (expr)(expr) = tree_strip_any_location_wrapper ((const_cast<union
tree_node *> (((expr)))))
;
3474 switch (TREE_CODE (expr)((enum tree_code) (expr)->base.code))
3475 {
3476 case EQ_EXPR: case NE_EXPR: case UNEQ_EXPR: case LTGT_EXPR:
3477 case LE_EXPR: case GE_EXPR: case LT_EXPR: case GT_EXPR:
3478 case UNLE_EXPR: case UNGE_EXPR: case UNLT_EXPR: case UNGT_EXPR:
3479 case ORDERED_EXPR: case UNORDERED_EXPR:
3480 if (TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3480, __FUNCTION__))->typed.type)
== truthvalue_type_nodec_global_trees[CTI_TRUTHVALUE_TYPE])
3481 return expr;
3482 expr = build2 (TREE_CODE (expr)((enum tree_code) (expr)->base.code), truthvalue_type_nodec_global_trees[CTI_TRUTHVALUE_TYPE],
3483 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-family/c-common.c"
, 3483, __FUNCTION__)))))
, TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3483, __FUNCTION__)))))
);
3484 goto ret;
3485
3486 case TRUTH_ANDIF_EXPR:
3487 case TRUTH_ORIF_EXPR:
3488 case TRUTH_AND_EXPR:
3489 case TRUTH_OR_EXPR:
3490 case TRUTH_XOR_EXPR:
3491 if (TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3491, __FUNCTION__))->typed.type)
== truthvalue_type_nodec_global_trees[CTI_TRUTHVALUE_TYPE])
3492 return expr;
3493 expr = build2 (TREE_CODE (expr)((enum tree_code) (expr)->base.code), truthvalue_type_nodec_global_trees[CTI_TRUTHVALUE_TYPE],
3494 c_common_truthvalue_conversion (location,
3495 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-family/c-common.c"
, 3495, __FUNCTION__)))))
),
3496 c_common_truthvalue_conversion (location,
3497 TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3497, __FUNCTION__)))))
));
3498 goto ret;
3499
3500 case TRUTH_NOT_EXPR:
3501 if (TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3501, __FUNCTION__))->typed.type)
== truthvalue_type_nodec_global_trees[CTI_TRUTHVALUE_TYPE])
3502 return expr;
3503 expr = build1 (TREE_CODE (expr)((enum tree_code) (expr)->base.code), truthvalue_type_nodec_global_trees[CTI_TRUTHVALUE_TYPE],
3504 c_common_truthvalue_conversion (location,
3505 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-family/c-common.c"
, 3505, __FUNCTION__)))))
));
3506 goto ret;
3507
3508 case ERROR_MARK:
3509 return expr;
3510
3511 case INTEGER_CST:
3512 if (TREE_CODE (TREE_TYPE (expr))((enum tree_code) (((contains_struct_check ((expr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3512, __FUNCTION__))->typed.type))->base.code)
== ENUMERAL_TYPE
3513 && !integer_zerop (expr)
3514 && !integer_onep (expr))
3515 warning_at (location, OPT_Wint_in_bool_context,
3516 "enum constant in boolean context");
3517 return integer_zerop (expr) ? truthvalue_false_nodec_global_trees[CTI_TRUTHVALUE_FALSE]
3518 : truthvalue_true_nodec_global_trees[CTI_TRUTHVALUE_TRUE];
3519
3520 case REAL_CST:
3521 return real_compare (NE_EXPR, &TREE_REAL_CST (expr)(*((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3521, __FUNCTION__, (REAL_CST)))->real_cst.real_cst_ptr)
)
, &dconst0)
3522 ? truthvalue_true_nodec_global_trees[CTI_TRUTHVALUE_TRUE]
3523 : truthvalue_false_nodec_global_trees[CTI_TRUTHVALUE_FALSE];
3524
3525 case FIXED_CST:
3526 return fixed_compare (NE_EXPR, &TREE_FIXED_CST (expr)(*((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3526, __FUNCTION__, (FIXED_CST)))->fixed_cst.fixed_cst_ptr
))
,
3527 &FCONST0 (TYPE_MODE (TREE_TYPE (expr)))fconst0[((((enum tree_code) ((tree_class_check ((((contains_struct_check
((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3527, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3527, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3527, __FUNCTION__))->typed.type)) : (((contains_struct_check
((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3527, __FUNCTION__))->typed.type))->type_common.mode)
- (scalar_mode ((scalar_mode::from_int) E_QQmode))]
)
3528 ? truthvalue_true_nodec_global_trees[CTI_TRUTHVALUE_TRUE]
3529 : truthvalue_false_nodec_global_trees[CTI_TRUTHVALUE_FALSE];
3530
3531 case FUNCTION_DECL:
3532 expr = build_unary_op (location, ADDR_EXPR, expr, false);
3533 /* Fall through. */
3534
3535 case ADDR_EXPR:
3536 {
3537 tree inner = 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-family/c-common.c"
, 3537, __FUNCTION__)))))
;
3538 if (decl_with_nonnull_addr_p (inner)
3539 /* Check both EXPR and INNER for suppression. */
3540 && !warning_suppressed_p (expr, OPT_Waddress)
3541 && !warning_suppressed_p (inner, OPT_Waddress))
3542 {
3543 /* Common Ada programmer's mistake. */
3544 warning_at (location,
3545 OPT_Waddress,
3546 "the address of %qD will always evaluate as %<true%>",
3547 inner);
3548 suppress_warning (inner, OPT_Waddress);
3549 return truthvalue_true_nodec_global_trees[CTI_TRUTHVALUE_TRUE];
3550 }
3551 break;
3552 }
3553
3554 case COMPLEX_EXPR:
3555 expr = build_binary_op (EXPR_LOCATION (expr)((((expr)) && ((tree_code_type[(int) (((enum tree_code
) ((expr))->base.code))]) >= tcc_reference && (
tree_code_type[(int) (((enum tree_code) ((expr))->base.code
))]) <= tcc_expression)) ? (expr)->exp.locus : ((location_t
) 0))
,
3556 (TREE_SIDE_EFFECTS (TREE_OPERAND (expr, 1))((non_type_check (((*((const_cast<tree*> (tree_operand_check
((expr), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3556, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3556, __FUNCTION__))->base.side_effects_flag)
3557 ? TRUTH_OR_EXPR : TRUTH_ORIF_EXPR),
3558 c_common_truthvalue_conversion (location,
3559 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-family/c-common.c"
, 3559, __FUNCTION__)))))
),
3560 c_common_truthvalue_conversion (location,
3561 TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3561, __FUNCTION__)))))
),
3562 false);
3563 goto ret;
3564
3565 case NEGATE_EXPR:
3566 case ABS_EXPR:
3567 case ABSU_EXPR:
3568 case FLOAT_EXPR:
3569 case EXCESS_PRECISION_EXPR:
3570 /* These don't change whether an object is nonzero or zero. */
3571 return c_common_truthvalue_conversion (location, 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-family/c-common.c"
, 3571, __FUNCTION__)))))
);
3572
3573 case LROTATE_EXPR:
3574 case RROTATE_EXPR:
3575 /* These don't change whether an object is zero or nonzero, but
3576 we can't ignore them if their second arg has side-effects. */
3577 if (TREE_SIDE_EFFECTS (TREE_OPERAND (expr, 1))((non_type_check (((*((const_cast<tree*> (tree_operand_check
((expr), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3577, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3577, __FUNCTION__))->base.side_effects_flag)
)
3578 {
3579 expr = build2 (COMPOUND_EXPR, truthvalue_type_nodec_global_trees[CTI_TRUTHVALUE_TYPE],
3580 TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3580, __FUNCTION__)))))
,
3581 c_common_truthvalue_conversion
3582 (location, 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-family/c-common.c"
, 3582, __FUNCTION__)))))
));
3583 goto ret;
3584 }
3585 else
3586 return c_common_truthvalue_conversion (location,
3587 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-family/c-common.c"
, 3587, __FUNCTION__)))))
);
3588
3589 case MULT_EXPR:
3590 warning_at (EXPR_LOCATION (expr)((((expr)) && ((tree_code_type[(int) (((enum tree_code
) ((expr))->base.code))]) >= tcc_reference && (
tree_code_type[(int) (((enum tree_code) ((expr))->base.code
))]) <= tcc_expression)) ? (expr)->exp.locus : ((location_t
) 0))
, OPT_Wint_in_bool_context,
3591 "%<*%> in boolean context, suggest %<&&%> instead");
3592 break;
3593
3594 case LSHIFT_EXPR:
3595 /* We will only warn on signed shifts here, because the majority of
3596 false positive warnings happen in code where unsigned arithmetic
3597 was used in anticipation of a possible overflow.
3598 Furthermore, if we see an unsigned type here we know that the
3599 result of the shift is not subject to integer promotion rules. */
3600 if (TREE_CODE (TREE_TYPE (expr))((enum tree_code) (((contains_struct_check ((expr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3600, __FUNCTION__))->typed.type))->base.code)
== INTEGER_TYPE
3601 && !TYPE_UNSIGNED (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-family/c-common.c"
, 3601, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3601, __FUNCTION__))->base.u.bits.unsigned_flag)
)
3602 warning_at (EXPR_LOCATION (expr)((((expr)) && ((tree_code_type[(int) (((enum tree_code
) ((expr))->base.code))]) >= tcc_reference && (
tree_code_type[(int) (((enum tree_code) ((expr))->base.code
))]) <= tcc_expression)) ? (expr)->exp.locus : ((location_t
) 0))
, OPT_Wint_in_bool_context,
3603 "%<<<%> in boolean context, did you mean %<<%>?");
3604 break;
3605
3606 case COND_EXPR:
3607 if (warn_int_in_bool_contextglobal_options.x_warn_int_in_bool_context
3608 && !from_macro_definition_at (EXPR_LOCATION (expr)((((expr)) && ((tree_code_type[(int) (((enum tree_code
) ((expr))->base.code))]) >= tcc_reference && (
tree_code_type[(int) (((enum tree_code) ((expr))->base.code
))]) <= tcc_expression)) ? (expr)->exp.locus : ((location_t
) 0))
))
3609 {
3610 tree val1 = fold_for_warn (TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3610, __FUNCTION__)))))
);
3611 tree val2 = fold_for_warn (TREE_OPERAND (expr, 2)(*((const_cast<tree*> (tree_operand_check ((expr), (2),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3611, __FUNCTION__)))))
);
3612 if (TREE_CODE (val1)((enum tree_code) (val1)->base.code) == INTEGER_CST
3613 && TREE_CODE (val2)((enum tree_code) (val2)->base.code) == INTEGER_CST
3614 && !integer_zerop (val1)
3615 && !integer_zerop (val2)
3616 && (!integer_onep (val1)
3617 || !integer_onep (val2)))
3618 warning_at (EXPR_LOCATION (expr)((((expr)) && ((tree_code_type[(int) (((enum tree_code
) ((expr))->base.code))]) >= tcc_reference && (
tree_code_type[(int) (((enum tree_code) ((expr))->base.code
))]) <= tcc_expression)) ? (expr)->exp.locus : ((location_t
) 0))
, OPT_Wint_in_bool_context,
3619 "%<?:%> using integer constants in boolean context, "
3620 "the expression will always evaluate to %<true%>");
3621 else if ((TREE_CODE (val1)((enum tree_code) (val1)->base.code) == INTEGER_CST
3622 && !integer_zerop (val1)
3623 && !integer_onep (val1))
3624 || (TREE_CODE (val2)((enum tree_code) (val2)->base.code) == INTEGER_CST
3625 && !integer_zerop (val2)
3626 && !integer_onep (val2)))
3627 warning_at (EXPR_LOCATION (expr)((((expr)) && ((tree_code_type[(int) (((enum tree_code
) ((expr))->base.code))]) >= tcc_reference && (
tree_code_type[(int) (((enum tree_code) ((expr))->base.code
))]) <= tcc_expression)) ? (expr)->exp.locus : ((location_t
) 0))
, OPT_Wint_in_bool_context,
3628 "%<?:%> using integer constants in boolean context");
3629 }
3630 /* Distribute the conversion into the arms of a COND_EXPR. */
3631 if (c_dialect_cxx ()((c_language & clk_cxx) != 0))
3632 /* Avoid premature folding. */
3633 break;
3634 else
3635 {
3636 int w = warn_int_in_bool_contextglobal_options.x_warn_int_in_bool_context;
3637 warn_int_in_bool_contextglobal_options.x_warn_int_in_bool_context = 0;
3638 /* Folding will happen later for C. */
3639 expr = build3 (COND_EXPR, truthvalue_type_nodec_global_trees[CTI_TRUTHVALUE_TYPE],
3640 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-family/c-common.c"
, 3640, __FUNCTION__)))))
,
3641 c_common_truthvalue_conversion (location,
3642 TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3642, __FUNCTION__)))))
),
3643 c_common_truthvalue_conversion (location,
3644 TREE_OPERAND (expr, 2)(*((const_cast<tree*> (tree_operand_check ((expr), (2),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3644, __FUNCTION__)))))
));
3645 warn_int_in_bool_contextglobal_options.x_warn_int_in_bool_context = w;
3646 goto ret;
3647 }
3648
3649 CASE_CONVERTcase NOP_EXPR: case CONVERT_EXPR:
3650 {
3651 tree totype = TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3651, __FUNCTION__))->typed.type)
;
3652 tree fromtype = TREE_TYPE (TREE_OPERAND (expr, 0))((contains_struct_check (((*((const_cast<tree*> (tree_operand_check
((expr), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3652, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3652, __FUNCTION__))->typed.type)
;
3653
3654 if (POINTER_TYPE_P (totype)(((enum tree_code) (totype)->base.code) == POINTER_TYPE ||
((enum tree_code) (totype)->base.code) == REFERENCE_TYPE)
3655 && !c_inhibit_evaluation_warnings
3656 && TREE_CODE (fromtype)((enum tree_code) (fromtype)->base.code) == REFERENCE_TYPE)
3657 {
3658 tree inner = expr;
3659 STRIP_NOPS (inner)(inner) = tree_strip_nop_conversions ((const_cast<union tree_node
*> (((inner)))))
;
3660
3661 if (DECL_P (inner)(tree_code_type[(int) (((enum tree_code) (inner)->base.code
))] == tcc_declaration)
)
3662 warning_at (location,
3663 OPT_Waddress,
3664 "the compiler can assume that the address of "
3665 "%qD will always evaluate to %<true%>",
3666 inner);
3667 }
3668
3669 /* Don't cancel the effect of a CONVERT_EXPR from a REFERENCE_TYPE,
3670 since that affects how `default_conversion' will behave. */
3671 if (TREE_CODE (totype)((enum tree_code) (totype)->base.code) == REFERENCE_TYPE
3672 || TREE_CODE (fromtype)((enum tree_code) (fromtype)->base.code) == REFERENCE_TYPE)
3673 break;
3674 /* Don't strip a conversion from C++0x scoped enum, since they
3675 don't implicitly convert to other types. */
3676 if (TREE_CODE (fromtype)((enum tree_code) (fromtype)->base.code) == ENUMERAL_TYPE
3677 && ENUM_IS_SCOPED (fromtype)((tree_check ((fromtype), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3677, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag)
)
3678 break;
3679 /* If this isn't narrowing the argument, we can ignore it. */
3680 if (TYPE_PRECISION (totype)((tree_class_check ((totype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3680, __FUNCTION__))->type_common.precision)
>= TYPE_PRECISION (fromtype)((tree_class_check ((fromtype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3680, __FUNCTION__))->type_common.precision)
)
3681 {
3682 tree op0 = TREE_OPERAND (expr, 0)(*((const_cast<tree*> (tree_operand_check ((expr), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3682, __FUNCTION__)))))
;
3683 if ((TREE_CODE (fromtype)((enum tree_code) (fromtype)->base.code) == POINTER_TYPE
3684 && TREE_CODE (totype)((enum tree_code) (totype)->base.code) == INTEGER_TYPE)
3685 || warning_suppressed_p (expr, OPT_Waddress))
3686 /* Suppress -Waddress for casts to intptr_t, propagating
3687 any suppression from the enclosing expression to its
3688 operand. */
3689 suppress_warning (op0, OPT_Waddress);
3690 return c_common_truthvalue_conversion (location, op0);
3691 }
3692 }
3693 break;
3694
3695 case MODIFY_EXPR:
3696 if (!warning_suppressed_p (expr, OPT_Wparentheses)
3697 && warn_parenthesesglobal_options.x_warn_parentheses
3698 && warning_at (location, OPT_Wparentheses,
3699 "suggest parentheses around assignment used as "
3700 "truth value"))
3701 suppress_warning (expr, OPT_Wparentheses);
3702 break;
3703
3704 case CONST_DECL:
3705 {
3706 tree folded_expr = fold_for_warn (expr);
3707 if (folded_expr != expr)
3708 return c_common_truthvalue_conversion (location, folded_expr);
3709 }
3710 break;
3711
3712 default:
3713 break;
3714 }
3715
3716 if (TREE_CODE (TREE_TYPE (expr))((enum tree_code) (((contains_struct_check ((expr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3716, __FUNCTION__))->typed.type))->base.code)
== COMPLEX_TYPE)
3717 {
3718 tree t = save_expr (expr);
3719 expr = (build_binary_op
3720 (EXPR_LOCATION (expr)((((expr)) && ((tree_code_type[(int) (((enum tree_code
) ((expr))->base.code))]) >= tcc_reference && (
tree_code_type[(int) (((enum tree_code) ((expr))->base.code
))]) <= tcc_expression)) ? (expr)->exp.locus : ((location_t
) 0))
,
3721 (TREE_SIDE_EFFECTS (expr)((non_type_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3721, __FUNCTION__))->base.side_effects_flag)
3722 ? TRUTH_OR_EXPR : TRUTH_ORIF_EXPR),
3723 c_common_truthvalue_conversion
3724 (location,
3725 build_unary_op (location, REALPART_EXPR, t, false)),
3726 c_common_truthvalue_conversion
3727 (location,
3728 build_unary_op (location, IMAGPART_EXPR, t, false)),
3729 false));
3730 goto ret;
3731 }
3732
3733 if (TREE_CODE (TREE_TYPE (expr))((enum tree_code) (((contains_struct_check ((expr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3733, __FUNCTION__))->typed.type))->base.code)
== FIXED_POINT_TYPE)
3734 {
3735 tree fixed_zero_node = build_fixed (TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3735, __FUNCTION__))->typed.type)
,
3736 FCONST0 (TYPE_MODEfconst0[((((enum tree_code) ((tree_class_check ((((contains_struct_check
((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3737, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3737, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3737, __FUNCTION__))->typed.type)) : (((contains_struct_check
((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3737, __FUNCTION__))->typed.type))->type_common.mode)
- (scalar_mode ((scalar_mode::from_int) E_QQmode))]
3737 (TREE_TYPE (expr)))fconst0[((((enum tree_code) ((tree_class_check ((((contains_struct_check
((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3737, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3737, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3737, __FUNCTION__))->typed.type)) : (((contains_struct_check
((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3737, __FUNCTION__))->typed.type))->type_common.mode)
- (scalar_mode ((scalar_mode::from_int) E_QQmode))]
);
3738 return build_binary_op (location, NE_EXPR, expr, fixed_zero_node, true);
3739 }
3740 else
3741 return build_binary_op (location, NE_EXPR, expr, integer_zero_nodeglobal_trees[TI_INTEGER_ZERO], true);
3742
3743 ret:
3744 protected_set_expr_location (expr, location);
3745 return expr;
3746}
3747
3748static void def_builtin_1 (enum built_in_function fncode,
3749 const char *name,
3750 enum built_in_class fnclass,
3751 tree fntype, tree libtype,
3752 bool both_p, bool fallback_p, bool nonansi_p,
3753 tree fnattrs, bool implicit_p);
3754
3755
3756/* Apply the TYPE_QUALS to the new DECL. */
3757
3758void
3759c_apply_type_quals_to_decl (int type_quals, tree decl)
3760{
3761 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3761, __FUNCTION__))->typed.type)
;
3762
3763 if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3764 return;
3765
3766 if ((type_quals & TYPE_QUAL_CONST)
3767 || (type && TREE_CODE (type)((enum tree_code) (type)->base.code) == REFERENCE_TYPE))
3768 /* We used to check TYPE_NEEDS_CONSTRUCTING here, but now a constexpr
3769 constructor can produce constant init, so rely on cp_finish_decl to
3770 clear TREE_READONLY if the variable has non-constant init. */
3771 TREE_READONLY (decl)((non_type_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3771, __FUNCTION__))->base.readonly_flag)
= 1;
3772 if (type_quals & TYPE_QUAL_VOLATILE)
3773 {
3774 TREE_SIDE_EFFECTS (decl)((non_type_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3774, __FUNCTION__))->base.side_effects_flag)
= 1;
3775 TREE_THIS_VOLATILE (decl)((decl)->base.volatile_flag) = 1;
3776 }
3777 if (type_quals & TYPE_QUAL_RESTRICT)
3778 {
3779 while (type && TREE_CODE (type)((enum tree_code) (type)->base.code) == ARRAY_TYPE)
3780 /* Allow 'restrict' on arrays of pointers.
3781 FIXME currently we just ignore it. */
3782 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3782, __FUNCTION__))->typed.type)
;
3783 if (!type
3784 || !POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || (
(enum tree_code) (type)->base.code) == REFERENCE_TYPE)
3785 || !C_TYPE_OBJECT_OR_INCOMPLETE_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-family/c-common.c"
, 3785, __FUNCTION__))->typed.type))->base.code) == FUNCTION_TYPE
))
)
3786 error ("invalid use of %<restrict%>");
3787 }
3788}
3789
3790/* Return the typed-based alias set for T, which may be an expression
3791 or a type. Return -1 if we don't do anything special. */
3792
3793alias_set_type
3794c_common_get_alias_set (tree t)
3795{
3796 /* For VLAs, use the alias set of the element type rather than the
3797 default of alias set 0 for types compared structurally. */
3798 if (TYPE_P (t)(tree_code_type[(int) (((enum tree_code) (t)->base.code))]
== tcc_type)
&& TYPE_STRUCTURAL_EQUALITY_P (t)(((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3798, __FUNCTION__))->type_common.canonical) == (tree) __null
)
)
3799 {
3800 if (TREE_CODE (t)((enum tree_code) (t)->base.code) == ARRAY_TYPE)
3801 return get_alias_set (TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3801, __FUNCTION__))->typed.type)
);
3802 return -1;
3803 }
3804
3805 /* That's all the expressions we handle specially. */
3806 if (!TYPE_P (t)(tree_code_type[(int) (((enum tree_code) (t)->base.code))]
== tcc_type)
)
3807 return -1;
3808
3809 /* Unlike char, char8_t doesn't alias. */
3810 if (flag_char8_tglobal_options.x_flag_char8_t && t == char8_type_nodec_global_trees[CTI_CHAR8_TYPE])
3811 return -1;
3812
3813 /* The C standard guarantees that any object may be accessed via an
3814 lvalue that has narrow character type (except char8_t). */
3815 if (t == char_type_nodeinteger_types[itk_char]
3816 || t == signed_char_type_nodeinteger_types[itk_signed_char]
3817 || t == unsigned_char_type_nodeinteger_types[itk_unsigned_char])
3818 return 0;
3819
3820 /* The C standard specifically allows aliasing between signed and
3821 unsigned variants of the same type. We treat the signed
3822 variant as canonical. */
3823 if (TREE_CODE (t)((enum tree_code) (t)->base.code) == INTEGER_TYPE && TYPE_UNSIGNED (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3823, __FUNCTION__))->base.u.bits.unsigned_flag)
)
3824 {
3825 tree t1 = c_common_signed_type (t);
3826
3827 /* t1 == t can happen for boolean nodes which are always unsigned. */
3828 if (t1 != t)
3829 return get_alias_set (t1);
3830 }
3831
3832 return -1;
3833}
3834
3835/* Compute the value of 'sizeof (TYPE)' or '__alignof__ (TYPE)', where
3836 the IS_SIZEOF parameter indicates which operator is being applied.
3837 The COMPLAIN flag controls whether we should diagnose possibly
3838 ill-formed constructs or not. LOC is the location of the SIZEOF or
3839 TYPEOF operator. If MIN_ALIGNOF, the least alignment required for
3840 a type in any context should be returned, rather than the normal
3841 alignment for that type. */
3842
3843tree
3844c_sizeof_or_alignof_type (location_t loc,
3845 tree type, bool is_sizeof, bool min_alignof,
3846 int complain)
3847{
3848 const char *op_name;
3849 tree value = NULL__null;
3850 enum tree_code type_code = TREE_CODE (type)((enum tree_code) (type)->base.code);
3851
3852 op_name = is_sizeof ? "sizeof" : "__alignof__";
3853
3854 if (type_code == FUNCTION_TYPE)
3855 {
3856 if (is_sizeof)
3857 {
3858 if (complain && warn_pointer_arithglobal_options.x_warn_pointer_arith)
3859 pedwarn (loc, OPT_Wpointer_arith,
3860 "invalid application of %<sizeof%> to a function type");
3861 else if (!complain)
3862 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3863 value = size_one_nodeglobal_trees[TI_SIZE_ONE];
3864 }
3865 else
3866 {
3867 if (complain)
3868 {
3869 if (c_dialect_cxx ()((c_language & clk_cxx) != 0))
3870 pedwarn (loc, OPT_Wpedantic, "ISO C++ does not permit "
3871 "%<alignof%> applied to a function type");
3872 else
3873 pedwarn (loc, OPT_Wpedantic, "ISO C does not permit "
3874 "%<_Alignof%> applied to a function type");
3875 }
3876 value = size_int (FUNCTION_BOUNDARY / BITS_PER_UNIT)size_int_kind (8 / (8), stk_sizetype);
3877 }
3878 }
3879 else if (type_code == VOID_TYPE || type_code == ERROR_MARK)
3880 {
3881 if (type_code == VOID_TYPE
3882 && complain && warn_pointer_arithglobal_options.x_warn_pointer_arith)
3883 pedwarn (loc, OPT_Wpointer_arith,
3884 "invalid application of %qs to a void type", op_name);
3885 else if (!complain)
3886 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3887 value = size_one_nodeglobal_trees[TI_SIZE_ONE];
3888 }
3889 else if (!COMPLETE_TYPE_P (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3889, __FUNCTION__))->type_common.size) != (tree) __null
)
3890 && (!c_dialect_cxx ()((c_language & clk_cxx) != 0) || is_sizeof || type_code != ARRAY_TYPE))
3891 {
3892 if (complain)
3893 error_at (loc, "invalid application of %qs to incomplete type %qT",
3894 op_name, type);
3895 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3896 }
3897 else if (c_dialect_cxx ()((c_language & clk_cxx) != 0) && type_code == ARRAY_TYPE
3898 && !COMPLETE_TYPE_P (TREE_TYPE (type))(((tree_class_check ((((contains_struct_check ((type), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3898, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3898, __FUNCTION__))->type_common.size) != (tree) __null
)
)
3899 {
3900 if (complain)
3901 error_at (loc, "invalid application of %qs to array type %qT of "
3902 "incomplete element type", op_name, type);
3903 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3904 }
3905 else if (!verify_type_context (loc, is_sizeof ? TCTX_SIZEOF : TCTX_ALIGNOF,
3906 type, !complain))
3907 {
3908 if (!complain)
3909 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3910 value = size_one_nodeglobal_trees[TI_SIZE_ONE];
3911 }
3912 else
3913 {
3914 if (is_sizeof)
3915 /* Convert in case a char is more than one unit. */
3916 value = size_binop_loc (loc, 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-family/c-common.c"
, 3916, __FUNCTION__))->type_common.size_unit)
,
3917 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-family/c-common.c"
, 3917, __FUNCTION__))->type_common.precision) / (8), stk_sizetype
)
3918 / 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-family/c-common.c"
, 3917, __FUNCTION__))->type_common.precision) / (8), stk_sizetype
)
);
3919 else if (min_alignof)
3920 value = size_int (min_align_of_type (type))size_int_kind (min_align_of_type (type), stk_sizetype);
3921 else
3922 value = size_int (TYPE_ALIGN_UNIT (type))size_int_kind (((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3922, __FUNCTION__))->type_common.align) ? ((unsigned)1)
<< (((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3922, __FUNCTION__))->type_common.align) - 1) : 0) / (8)
), stk_sizetype)
;
3923 }
3924
3925 /* VALUE will have the middle-end integer type sizetype.
3926 However, we should really return a value of type `size_t',
3927 which is just a typedef for an ordinary integer type. */
3928 value = fold_convert_loc (loc, size_type_nodeglobal_trees[TI_SIZE_TYPE], value);
3929
3930 return value;
3931}
3932
3933/* Implement the __alignof keyword: Return the minimum required
3934 alignment of EXPR, measured in bytes. For VAR_DECLs,
3935 FUNCTION_DECLs and FIELD_DECLs return DECL_ALIGN (which can be set
3936 from an "aligned" __attribute__ specification). LOC is the
3937 location of the ALIGNOF operator. */
3938
3939tree
3940c_alignof_expr (location_t loc, tree expr)
3941{
3942 tree t;
3943
3944 if (!verify_type_context (loc, TCTX_ALIGNOF, TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3944, __FUNCTION__))->typed.type)
))
3945 t = size_one_nodeglobal_trees[TI_SIZE_ONE];
3946
3947 else if (VAR_OR_FUNCTION_DECL_P (expr)(((enum tree_code) (expr)->base.code) == VAR_DECL || ((enum
tree_code) (expr)->base.code) == FUNCTION_DECL)
)
3948 t = size_int (DECL_ALIGN_UNIT (expr))size_int_kind (((((contains_struct_check ((expr), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3948, __FUNCTION__))->decl_common.align) ? ((unsigned)1)
<< (((contains_struct_check ((expr), (TS_DECL_COMMON),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3948, __FUNCTION__))->decl_common.align) - 1) : 0) / (8)
), stk_sizetype)
;
3949
3950 else if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == COMPONENT_REF
3951 && 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-family/c-common.c"
, 3951, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3951, __FUNCTION__, (FIELD_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3951, __FUNCTION__))->decl_common.lang_flag_4) == 1)
)
3952 {
3953 error_at (loc, "%<__alignof%> applied to a bit-field");
3954 t = size_one_nodeglobal_trees[TI_SIZE_ONE];
3955 }
3956 else if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == COMPONENT_REF
3957 && TREE_CODE (TREE_OPERAND (expr, 1))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((expr), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3957, __FUNCTION__))))))->base.code)
== FIELD_DECL)
3958 t = size_int (DECL_ALIGN_UNIT (TREE_OPERAND (expr, 1)))size_int_kind (((((contains_struct_check (((*((const_cast<
tree*> (tree_operand_check ((expr), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3958, __FUNCTION__)))))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3958, __FUNCTION__))->decl_common.align) ? ((unsigned)1)
<< (((contains_struct_check (((*((const_cast<tree*>
(tree_operand_check ((expr), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3958, __FUNCTION__)))))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3958, __FUNCTION__))->decl_common.align) - 1) : 0) / (8)
), stk_sizetype)
;
3959
3960 else if (INDIRECT_REF_P (expr)(((enum tree_code) (expr)->base.code) == INDIRECT_REF))
3961 {
3962 tree t = 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-family/c-common.c"
, 3962, __FUNCTION__)))))
;
3963 tree best = t;
3964 int bestalign = TYPE_ALIGN (TREE_TYPE (TREE_TYPE (t)))(((tree_class_check ((((contains_struct_check ((((contains_struct_check
((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3964, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3964, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3964, __FUNCTION__))->type_common.align) ? ((unsigned)1)
<< (((tree_class_check ((((contains_struct_check ((((contains_struct_check
((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3964, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3964, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3964, __FUNCTION__))->type_common.align) - 1) : 0)
;
3965
3966 while (CONVERT_EXPR_P (t)((((enum tree_code) (t)->base.code)) == NOP_EXPR || (((enum
tree_code) (t)->base.code)) == CONVERT_EXPR)
3967 && TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0)))((enum tree_code) (((contains_struct_check (((*((const_cast<
tree*> (tree_operand_check ((t), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3967, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3967, __FUNCTION__))->typed.type))->base.code)
== POINTER_TYPE)
3968 {
3969 int thisalign;
3970
3971 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-family/c-common.c"
, 3971, __FUNCTION__)))))
;
3972 thisalign = TYPE_ALIGN (TREE_TYPE (TREE_TYPE (t)))(((tree_class_check ((((contains_struct_check ((((contains_struct_check
((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3972, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3972, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3972, __FUNCTION__))->type_common.align) ? ((unsigned)1)
<< (((tree_class_check ((((contains_struct_check ((((contains_struct_check
((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3972, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3972, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3972, __FUNCTION__))->type_common.align) - 1) : 0)
;
3973 if (thisalign > bestalign)
3974 best = t, bestalign = thisalign;
3975 }
3976 return c_alignof (loc, TREE_TYPE (TREE_TYPE (best)))c_sizeof_or_alignof_type (loc, ((contains_struct_check ((((contains_struct_check
((best), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3976, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3976, __FUNCTION__))->typed.type), false, false, 1)
;
3977 }
3978 else
3979 return c_alignof (loc, TREE_TYPE (expr))c_sizeof_or_alignof_type (loc, ((contains_struct_check ((expr
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 3979, __FUNCTION__))->typed.type), false, false, 1)
;
3980
3981 return fold_convert_loc (loc, size_type_nodeglobal_trees[TI_SIZE_TYPE], t);
3982}
3983
3984/* Handle C and C++ default attributes. */
3985
3986enum built_in_attribute
3987{
3988#define DEF_ATTR_NULL_TREE(ENUM) ENUM,
3989#define DEF_ATTR_INT(ENUM, VALUE) ENUM,
3990#define DEF_ATTR_STRING(ENUM, VALUE)built_in_attributes[(int) ENUM] = build_string (strlen (VALUE
), VALUE);
ENUM,
3991#define DEF_ATTR_IDENT(ENUM, STRING) ENUM,
3992#define DEF_ATTR_TREE_LIST(ENUM, PURPOSE, VALUE, CHAIN) ENUM,
3993#include "builtin-attrs.def"
3994#undef DEF_ATTR_NULL_TREE
3995#undef DEF_ATTR_INT
3996#undef DEF_ATTR_STRING
3997#undef DEF_ATTR_IDENT
3998#undef DEF_ATTR_TREE_LIST
3999 ATTR_LAST
4000};
4001
4002static GTY(()) tree built_in_attributes[(int) ATTR_LAST];
4003
4004static void c_init_attributes (void);
4005
4006enum c_builtin_type
4007{
4008#define DEF_PRIMITIVE_TYPE(NAME, VALUE) NAME,
4009#define DEF_FUNCTION_TYPE_0(NAME, RETURN) NAME,
4010#define DEF_FUNCTION_TYPE_1(NAME, RETURN, ARG1) NAME,
4011#define DEF_FUNCTION_TYPE_2(NAME, RETURN, ARG1, ARG2) NAME,
4012#define DEF_FUNCTION_TYPE_3(NAME, RETURN, ARG1, ARG2, ARG3) NAME,
4013#define DEF_FUNCTION_TYPE_4(NAME, RETURN, ARG1, ARG2, ARG3, ARG4) NAME,
4014#define DEF_FUNCTION_TYPE_5(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) NAME,
4015#define DEF_FUNCTION_TYPE_6(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
4016 ARG6) NAME,
4017#define DEF_FUNCTION_TYPE_7(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
4018 ARG6, ARG7) NAME,
4019#define DEF_FUNCTION_TYPE_8(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
4020 ARG6, ARG7, ARG8) NAME,
4021#define DEF_FUNCTION_TYPE_9(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
4022 ARG6, ARG7, ARG8, ARG9) NAME,
4023#define DEF_FUNCTION_TYPE_10(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
4024 ARG6, ARG7, ARG8, ARG9, ARG10) NAME,
4025#define DEF_FUNCTION_TYPE_11(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
4026 ARG6, ARG7, ARG8, ARG9, ARG10, ARG11) NAME,
4027#define DEF_FUNCTION_TYPE_VAR_0(NAME, RETURN) NAME,
4028#define DEF_FUNCTION_TYPE_VAR_1(NAME, RETURN, ARG1) NAME,
4029#define DEF_FUNCTION_TYPE_VAR_2(NAME, RETURN, ARG1, ARG2) NAME,
4030#define DEF_FUNCTION_TYPE_VAR_3(NAME, RETURN, ARG1, ARG2, ARG3) NAME,
4031#define DEF_FUNCTION_TYPE_VAR_4(NAME, RETURN, ARG1, ARG2, ARG3, ARG4) NAME,
4032#define DEF_FUNCTION_TYPE_VAR_5(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \
4033 NAME,
4034#define DEF_FUNCTION_TYPE_VAR_6(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
4035 ARG6) NAME,
4036#define DEF_FUNCTION_TYPE_VAR_7(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
4037 ARG6, ARG7) NAME,
4038#define DEF_POINTER_TYPE(NAME, TYPE) NAME,
4039#include "builtin-types.def"
4040#undef DEF_PRIMITIVE_TYPE
4041#undef DEF_FUNCTION_TYPE_0
4042#undef DEF_FUNCTION_TYPE_1
4043#undef DEF_FUNCTION_TYPE_2
4044#undef DEF_FUNCTION_TYPE_3
4045#undef DEF_FUNCTION_TYPE_4
4046#undef DEF_FUNCTION_TYPE_5
4047#undef DEF_FUNCTION_TYPE_6
4048#undef DEF_FUNCTION_TYPE_7
4049#undef DEF_FUNCTION_TYPE_8
4050#undef DEF_FUNCTION_TYPE_9
4051#undef DEF_FUNCTION_TYPE_10
4052#undef DEF_FUNCTION_TYPE_11
4053#undef DEF_FUNCTION_TYPE_VAR_0
4054#undef DEF_FUNCTION_TYPE_VAR_1
4055#undef DEF_FUNCTION_TYPE_VAR_2
4056#undef DEF_FUNCTION_TYPE_VAR_3
4057#undef DEF_FUNCTION_TYPE_VAR_4
4058#undef DEF_FUNCTION_TYPE_VAR_5
4059#undef DEF_FUNCTION_TYPE_VAR_6
4060#undef DEF_FUNCTION_TYPE_VAR_7
4061#undef DEF_POINTER_TYPE
4062 BT_LAST
4063};
4064
4065typedef enum c_builtin_type builtin_type;
4066
4067/* A temporary array for c_common_nodes_and_builtins. Used in
4068 communication with def_fn_type. */
4069static tree builtin_types[(int) BT_LAST + 1];
4070
4071/* A helper function for c_common_nodes_and_builtins. Build function type
4072 for DEF with return type RET and N arguments. If VAR is true, then the
4073 function should be variadic after those N arguments.
4074
4075 Takes special care not to ICE if any of the types involved are
4076 error_mark_node, which indicates that said type is not in fact available
4077 (see builtin_type_for_size). In which case the function type as a whole
4078 should be error_mark_node. */
4079
4080static void
4081def_fn_type (builtin_type def, builtin_type ret, bool var, int n, ...)
4082{
4083 tree t;
4084 tree *args = XALLOCAVEC (tree, n)((tree *) __builtin_alloca(sizeof (tree) * (n)));
4085 va_list list;
4086 int i;
4087
4088 va_start (list, n)__builtin_va_start(list, n);
4089 for (i = 0; i < n; ++i)
4090 {
4091 builtin_type a = (builtin_type) va_arg (list, int)__builtin_va_arg(list, int);
4092 t = builtin_types[a];
4093 if (t == error_mark_nodeglobal_trees[TI_ERROR_MARK])
4094 goto egress;
4095 args[i] = t;
4096 }
4097
4098 t = builtin_types[ret];
4099 if (t == error_mark_nodeglobal_trees[TI_ERROR_MARK])
4100 goto egress;
4101 if (var)
4102 t = build_varargs_function_type_array (t, n, args);
4103 else
4104 t = build_function_type_array (t, n, args);
4105
4106 egress:
4107 builtin_types[def] = t;
4108 va_end (list)__builtin_va_end(list);
4109}
4110
4111/* Build builtin functions common to both C and C++ language
4112 frontends. */
4113
4114static void
4115c_define_builtins (tree va_list_ref_type_node, tree va_list_arg_type_node)
4116{
4117#define DEF_PRIMITIVE_TYPE(ENUM, VALUE) \
4118 builtin_types[ENUM] = VALUE;
4119#define DEF_FUNCTION_TYPE_0(ENUM, RETURN) \
4120 def_fn_type (ENUM, RETURN, 0, 0);
4121#define DEF_FUNCTION_TYPE_1(ENUM, RETURN, ARG1) \
4122 def_fn_type (ENUM, RETURN, 0, 1, ARG1);
4123#define DEF_FUNCTION_TYPE_2(ENUM, RETURN, ARG1, ARG2) \
4124 def_fn_type (ENUM, RETURN, 0, 2, ARG1, ARG2);
4125#define DEF_FUNCTION_TYPE_3(ENUM, RETURN, ARG1, ARG2, ARG3) \
4126 def_fn_type (ENUM, RETURN, 0, 3, ARG1, ARG2, ARG3);
4127#define DEF_FUNCTION_TYPE_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \
4128 def_fn_type (ENUM, RETURN, 0, 4, ARG1, ARG2, ARG3, ARG4);
4129#define DEF_FUNCTION_TYPE_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \
4130 def_fn_type (ENUM, RETURN, 0, 5, ARG1, ARG2, ARG3, ARG4, ARG5);
4131#define DEF_FUNCTION_TYPE_6(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
4132 ARG6) \
4133 def_fn_type (ENUM, RETURN, 0, 6, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6);
4134#define DEF_FUNCTION_TYPE_7(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
4135 ARG6, ARG7) \
4136 def_fn_type (ENUM, RETURN, 0, 7, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7);
4137#define DEF_FUNCTION_TYPE_8(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
4138 ARG6, ARG7, ARG8) \
4139 def_fn_type (ENUM, RETURN, 0, 8, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, \
4140 ARG7, ARG8);
4141#define DEF_FUNCTION_TYPE_9(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
4142 ARG6, ARG7, ARG8, ARG9) \
4143 def_fn_type (ENUM, RETURN, 0, 9, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, \
4144 ARG7, ARG8, ARG9);
4145#define DEF_FUNCTION_TYPE_10(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
4146 ARG6, ARG7, ARG8, ARG9, ARG10) \
4147 def_fn_type (ENUM, RETURN, 0, 10, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, \
4148 ARG7, ARG8, ARG9, ARG10);
4149#define DEF_FUNCTION_TYPE_11(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
4150 ARG6, ARG7, ARG8, ARG9, ARG10, ARG11) \
4151 def_fn_type (ENUM, RETURN, 0, 11, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, \
4152 ARG7, ARG8, ARG9, ARG10, ARG11);
4153#define DEF_FUNCTION_TYPE_VAR_0(ENUM, RETURN) \
4154 def_fn_type (ENUM, RETURN, 1, 0);
4155#define DEF_FUNCTION_TYPE_VAR_1(ENUM, RETURN, ARG1) \
4156 def_fn_type (ENUM, RETURN, 1, 1, ARG1);
4157#define DEF_FUNCTION_TYPE_VAR_2(ENUM, RETURN, ARG1, ARG2) \
4158 def_fn_type (ENUM, RETURN, 1, 2, ARG1, ARG2);
4159#define DEF_FUNCTION_TYPE_VAR_3(ENUM, RETURN, ARG1, ARG2, ARG3) \
4160 def_fn_type (ENUM, RETURN, 1, 3, ARG1, ARG2, ARG3);
4161#define DEF_FUNCTION_TYPE_VAR_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \
4162 def_fn_type (ENUM, RETURN, 1, 4, ARG1, ARG2, ARG3, ARG4);
4163#define DEF_FUNCTION_TYPE_VAR_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \
4164 def_fn_type (ENUM, RETURN, 1, 5, ARG1, ARG2, ARG3, ARG4, ARG5);
4165#define DEF_FUNCTION_TYPE_VAR_6(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
4166 ARG6) \
4167 def_fn_type (ENUM, RETURN, 1, 6, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6);
4168#define DEF_FUNCTION_TYPE_VAR_7(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
4169 ARG6, ARG7) \
4170 def_fn_type (ENUM, RETURN, 1, 7, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7);
4171#define DEF_POINTER_TYPE(ENUM, TYPE) \
4172 builtin_types[(int) ENUM] = build_pointer_type (builtin_types[(int) TYPE]);
4173
4174#include "builtin-types.def"
4175
4176#undef DEF_PRIMITIVE_TYPE
4177#undef DEF_FUNCTION_TYPE_0
4178#undef DEF_FUNCTION_TYPE_1
4179#undef DEF_FUNCTION_TYPE_2
4180#undef DEF_FUNCTION_TYPE_3
4181#undef DEF_FUNCTION_TYPE_4
4182#undef DEF_FUNCTION_TYPE_5
4183#undef DEF_FUNCTION_TYPE_6
4184#undef DEF_FUNCTION_TYPE_7
4185#undef DEF_FUNCTION_TYPE_8
4186#undef DEF_FUNCTION_TYPE_9
4187#undef DEF_FUNCTION_TYPE_10
4188#undef DEF_FUNCTION_TYPE_11
4189#undef DEF_FUNCTION_TYPE_VAR_0
4190#undef DEF_FUNCTION_TYPE_VAR_1
4191#undef DEF_FUNCTION_TYPE_VAR_2
4192#undef DEF_FUNCTION_TYPE_VAR_3
4193#undef DEF_FUNCTION_TYPE_VAR_4
4194#undef DEF_FUNCTION_TYPE_VAR_5
4195#undef DEF_FUNCTION_TYPE_VAR_6
4196#undef DEF_FUNCTION_TYPE_VAR_7
4197#undef DEF_POINTER_TYPE
4198 builtin_types[(int) BT_LAST] = NULL_TREE(tree) __null;
4199
4200 c_init_attributes ();
4201
4202#define DEF_BUILTIN(ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P, FALLBACK_P, \
4203 NONANSI_P, ATTRS, IMPLICIT, COND) \
4204 if (NAME && COND) \
4205 def_builtin_1 (ENUM, NAME, CLASS, \
4206 builtin_types[(int) TYPE], \
4207 builtin_types[(int) LIBTYPE], \
4208 BOTH_P, FALLBACK_P, NONANSI_P, \
4209 built_in_attributes[(int) ATTRS], IMPLICIT);
4210#include "builtins.def"
4211
4212 targetm.init_builtins ();
4213
4214 build_common_builtin_nodes ();
4215}
4216
4217/* Like get_identifier, but avoid warnings about null arguments when
4218 the argument may be NULL for targets where GCC lacks stdint.h type
4219 information. */
4220
4221static inline tree
4222c_get_ident (const char *id)
4223{
4224 return get_identifier (id)(__builtin_constant_p (id) ? get_identifier_with_length ((id)
, strlen (id)) : get_identifier (id))
;
4225}
4226
4227/* Build tree nodes and builtin functions common to both C and C++ language
4228 frontends. */
4229
4230void
4231c_common_nodes_and_builtins (void)
4232{
4233 int char8_type_size;
4234 int char16_type_size;
4235 int char32_type_size;
4236 int wchar_type_size;
4237 tree array_domain_type;
4238 tree va_list_ref_type_node;
4239 tree va_list_arg_type_node;
4240 int i;
4241
4242 build_common_tree_nodes (flag_signed_charglobal_options.x_flag_signed_char);
4243
4244 /* Define `int' and `char' first so that dbx will output them first. */
4245 record_builtin_type (RID_INT, NULL__null, integer_type_nodeinteger_types[itk_int]);
4246 record_builtin_type (RID_CHAR, "char", char_type_nodeinteger_types[itk_char]);
4247
4248 /* `signed' is the same as `int'. FIXME: the declarations of "signed",
4249 "unsigned long", "long long unsigned" and "unsigned short" were in C++
4250 but not C. Are the conditionals here needed? */
4251 if (c_dialect_cxx ()((c_language & clk_cxx) != 0))
4252 record_builtin_type (RID_SIGNED, NULL__null, integer_type_nodeinteger_types[itk_int]);
4253 record_builtin_type (RID_LONG, "long int", long_integer_type_nodeinteger_types[itk_long]);
4254 record_builtin_type (RID_UNSIGNED, "unsigned int", unsigned_type_nodeinteger_types[itk_unsigned_int]);
4255 record_builtin_type (RID_MAX, "long unsigned int",
4256 long_unsigned_type_nodeinteger_types[itk_unsigned_long]);
4257
4258 for (i = 0; i < NUM_INT_N_ENTS1; i ++)
4259 {
4260 char name[25];
4261
4262 sprintf (name, "__int%d", int_n_data[i].bitsize);
4263 record_builtin_type ((enum rid)(RID_FIRST_INT_N + i), name,
4264 int_n_trees[i].signed_type);
4265 sprintf (name, "__int%d__", int_n_data[i].bitsize);
4266 record_builtin_type ((enum rid)(RID_FIRST_INT_N + i), name,
4267 int_n_trees[i].signed_type);
4268
4269 sprintf (name, "__int%d unsigned", int_n_data[i].bitsize);
4270 record_builtin_type (RID_MAX, name, int_n_trees[i].unsigned_type);
4271 sprintf (name, "__int%d__ unsigned", int_n_data[i].bitsize);
4272 record_builtin_type (RID_MAX, name, int_n_trees[i].unsigned_type);
4273 }
4274
4275 if (c_dialect_cxx ()((c_language & clk_cxx) != 0))
4276 record_builtin_type (RID_MAX, "unsigned long", long_unsigned_type_nodeinteger_types[itk_unsigned_long]);
4277 record_builtin_type (RID_MAX, "long long int",
4278 long_long_integer_type_nodeinteger_types[itk_long_long]);
4279 record_builtin_type (RID_MAX, "long long unsigned int",
4280 long_long_unsigned_type_nodeinteger_types[itk_unsigned_long_long]);
4281 if (c_dialect_cxx ()((c_language & clk_cxx) != 0))
4282 record_builtin_type (RID_MAX, "long long unsigned",
4283 long_long_unsigned_type_nodeinteger_types[itk_unsigned_long_long]);
4284 record_builtin_type (RID_SHORT, "short int", short_integer_type_nodeinteger_types[itk_short]);
4285 record_builtin_type (RID_MAX, "short unsigned int",
4286 short_unsigned_type_nodeinteger_types[itk_unsigned_short]);
4287 if (c_dialect_cxx ()((c_language & clk_cxx) != 0))
4288 record_builtin_type (RID_MAX, "unsigned short",
4289 short_unsigned_type_nodeinteger_types[itk_unsigned_short]);
4290
4291 /* Define both `signed char' and `unsigned char'. */
4292 record_builtin_type (RID_MAX, "signed char", signed_char_type_nodeinteger_types[itk_signed_char]);
4293 record_builtin_type (RID_MAX, "unsigned char", unsigned_char_type_nodeinteger_types[itk_unsigned_char]);
4294
4295 /* These are types that c_common_type_for_size and
4296 c_common_type_for_mode use. */
4297 lang_hooks.decls.pushdecl (build_decl (UNKNOWN_LOCATION((location_t) 0),
4298 TYPE_DECL, NULL_TREE(tree) __null,
4299 intQI_type_nodeglobal_trees[TI_INTQI_TYPE]));
4300 lang_hooks.decls.pushdecl (build_decl (UNKNOWN_LOCATION((location_t) 0),
4301 TYPE_DECL, NULL_TREE(tree) __null,
4302 intHI_type_nodeglobal_trees[TI_INTHI_TYPE]));
4303 lang_hooks.decls.pushdecl (build_decl (UNKNOWN_LOCATION((location_t) 0),
4304 TYPE_DECL, NULL_TREE(tree) __null,
4305 intSI_type_nodeglobal_trees[TI_INTSI_TYPE]));
4306 lang_hooks.decls.pushdecl (build_decl (UNKNOWN_LOCATION((location_t) 0),
4307 TYPE_DECL, NULL_TREE(tree) __null,
4308 intDI_type_nodeglobal_trees[TI_INTDI_TYPE]));
4309#if HOST_BITS_PER_WIDE_INT64 >= 64
4310 /* Note that this is different than the __int128 type that's part of
4311 the generic __intN support. */
4312 if (targetm.scalar_mode_supported_p (TImode(scalar_int_mode ((scalar_int_mode::from_int) E_TImode))))
4313 lang_hooks.decls.pushdecl (build_decl (UNKNOWN_LOCATION((location_t) 0),
4314 TYPE_DECL,
4315 get_identifier ("__int128_t")(__builtin_constant_p ("__int128_t") ? get_identifier_with_length
(("__int128_t"), strlen ("__int128_t")) : get_identifier ("__int128_t"
))
,
4316 intTI_type_nodeglobal_trees[TI_INTTI_TYPE]));
4317#endif
4318 lang_hooks.decls.pushdecl (build_decl (UNKNOWN_LOCATION((location_t) 0),
4319 TYPE_DECL, NULL_TREE(tree) __null,
4320 unsigned_intQI_type_nodeglobal_trees[TI_UINTQI_TYPE]));
4321 lang_hooks.decls.pushdecl (build_decl (UNKNOWN_LOCATION((location_t) 0),
4322 TYPE_DECL, NULL_TREE(tree) __null,
4323 unsigned_intHI_type_nodeglobal_trees[TI_UINTHI_TYPE]));
4324 lang_hooks.decls.pushdecl (build_decl (UNKNOWN_LOCATION((location_t) 0),
4325 TYPE_DECL, NULL_TREE(tree) __null,
4326 unsigned_intSI_type_nodeglobal_trees[TI_UINTSI_TYPE]));
4327 lang_hooks.decls.pushdecl (build_decl (UNKNOWN_LOCATION((location_t) 0),
4328 TYPE_DECL, NULL_TREE(tree) __null,
4329 unsigned_intDI_type_nodeglobal_trees[TI_UINTDI_TYPE]));
4330#if HOST_BITS_PER_WIDE_INT64 >= 64
4331 if (targetm.scalar_mode_supported_p (TImode(scalar_int_mode ((scalar_int_mode::from_int) E_TImode))))
4332 lang_hooks.decls.pushdecl (build_decl (UNKNOWN_LOCATION((location_t) 0),
4333 TYPE_DECL,
4334 get_identifier ("__uint128_t")(__builtin_constant_p ("__uint128_t") ? get_identifier_with_length
(("__uint128_t"), strlen ("__uint128_t")) : get_identifier (
"__uint128_t"))
,
4335 unsigned_intTI_type_nodeglobal_trees[TI_UINTTI_TYPE]));
4336#endif
4337
4338 /* Create the widest literal types. */
4339 if (targetm.scalar_mode_supported_p (TImode(scalar_int_mode ((scalar_int_mode::from_int) E_TImode))))
4340 {
4341 widest_integer_literal_type_nodec_global_trees[CTI_WIDEST_INT_LIT_TYPE] = intTI_type_nodeglobal_trees[TI_INTTI_TYPE];
4342 widest_unsigned_literal_type_nodec_global_trees[CTI_WIDEST_UINT_LIT_TYPE] = unsigned_intTI_type_nodeglobal_trees[TI_UINTTI_TYPE];
4343 }
4344 else
4345 {
4346 widest_integer_literal_type_nodec_global_trees[CTI_WIDEST_INT_LIT_TYPE] = intDI_type_nodeglobal_trees[TI_INTDI_TYPE];
4347 widest_unsigned_literal_type_nodec_global_trees[CTI_WIDEST_UINT_LIT_TYPE] = unsigned_intDI_type_nodeglobal_trees[TI_UINTDI_TYPE];
4348 }
4349
4350 signed_size_type_nodec_global_trees[CTI_SIGNED_SIZE_TYPE] = c_common_signed_type (size_type_nodeglobal_trees[TI_SIZE_TYPE]);
4351
4352 pid_type_nodeglobal_trees[TI_PID_TYPE] =
4353 TREE_TYPE (identifier_global_value (get_identifier (PID_TYPE)))((contains_struct_check ((identifier_global_value ((__builtin_constant_p
("int") ? get_identifier_with_length (("int"), strlen ("int"
)) : get_identifier ("int")))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4353, __FUNCTION__))->typed.type)
;
4354
4355 record_builtin_type (RID_FLOAT, NULL__null, float_type_nodeglobal_trees[TI_FLOAT_TYPE]);
4356 record_builtin_type (RID_DOUBLE, NULL__null, double_type_nodeglobal_trees[TI_DOUBLE_TYPE]);
4357 record_builtin_type (RID_MAX, "long double", long_double_type_nodeglobal_trees[TI_LONG_DOUBLE_TYPE]);
4358
4359 if (!c_dialect_cxx ()((c_language & clk_cxx) != 0))
4360 for (i = 0; i < NUM_FLOATN_NX_TYPES(TI_FLOATN_NX_TYPE_LAST - TI_FLOATN_NX_TYPE_FIRST + 1); i++)
4361 if (FLOATN_NX_TYPE_NODE (i)global_trees[TI_FLOATN_NX_TYPE_FIRST + (i)] != NULL_TREE(tree) __null)
4362 record_builtin_type ((enum rid) (RID_FLOATN_NX_FIRST + i), NULL__null,
4363 FLOATN_NX_TYPE_NODE (i)global_trees[TI_FLOATN_NX_TYPE_FIRST + (i)]);
4364
4365 /* Only supported decimal floating point extension if the target
4366 actually supports underlying modes. */
4367 if (targetm.scalar_mode_supported_p (SDmode(scalar_float_mode ((scalar_float_mode::from_int) E_SDmode)))
4368 && targetm.scalar_mode_supported_p (DDmode(scalar_float_mode ((scalar_float_mode::from_int) E_DDmode)))
4369 && targetm.scalar_mode_supported_p (TDmode(scalar_float_mode ((scalar_float_mode::from_int) E_TDmode))))
4370 {
4371 record_builtin_type (RID_DFLOAT32, NULL__null, dfloat32_type_nodeglobal_trees[TI_DFLOAT32_TYPE]);
4372 record_builtin_type (RID_DFLOAT64, NULL__null, dfloat64_type_nodeglobal_trees[TI_DFLOAT64_TYPE]);
4373 record_builtin_type (RID_DFLOAT128, NULL__null, dfloat128_type_nodeglobal_trees[TI_DFLOAT128_TYPE]);
4374 }
4375
4376 if (targetm.fixed_point_supported_p ())
4377 {
4378 record_builtin_type (RID_MAX, "short _Fract", short_fract_type_nodeglobal_trees[TI_SFRACT_TYPE]);
4379 record_builtin_type (RID_FRACT, NULL__null, fract_type_nodeglobal_trees[TI_FRACT_TYPE]);
4380 record_builtin_type (RID_MAX, "long _Fract", long_fract_type_nodeglobal_trees[TI_LFRACT_TYPE]);
4381 record_builtin_type (RID_MAX, "long long _Fract",
4382 long_long_fract_type_nodeglobal_trees[TI_LLFRACT_TYPE]);
4383 record_builtin_type (RID_MAX, "unsigned short _Fract",
4384 unsigned_short_fract_type_nodeglobal_trees[TI_USFRACT_TYPE]);
4385 record_builtin_type (RID_MAX, "unsigned _Fract",
4386 unsigned_fract_type_nodeglobal_trees[TI_UFRACT_TYPE]);
4387 record_builtin_type (RID_MAX, "unsigned long _Fract",
4388 unsigned_long_fract_type_nodeglobal_trees[TI_ULFRACT_TYPE]);
4389 record_builtin_type (RID_MAX, "unsigned long long _Fract",
4390 unsigned_long_long_fract_type_nodeglobal_trees[TI_ULLFRACT_TYPE]);
4391 record_builtin_type (RID_MAX, "_Sat short _Fract",
4392 sat_short_fract_type_nodeglobal_trees[TI_SAT_SFRACT_TYPE]);
4393 record_builtin_type (RID_MAX, "_Sat _Fract", sat_fract_type_nodeglobal_trees[TI_SAT_FRACT_TYPE]);
4394 record_builtin_type (RID_MAX, "_Sat long _Fract",
4395 sat_long_fract_type_nodeglobal_trees[TI_SAT_LFRACT_TYPE]);
4396 record_builtin_type (RID_MAX, "_Sat long long _Fract",
4397 sat_long_long_fract_type_nodeglobal_trees[TI_SAT_LLFRACT_TYPE]);
4398 record_builtin_type (RID_MAX, "_Sat unsigned short _Fract",
4399 sat_unsigned_short_fract_type_nodeglobal_trees[TI_SAT_USFRACT_TYPE]);
4400 record_builtin_type (RID_MAX, "_Sat unsigned _Fract",
4401 sat_unsigned_fract_type_nodeglobal_trees[TI_SAT_UFRACT_TYPE]);
4402 record_builtin_type (RID_MAX, "_Sat unsigned long _Fract",
4403 sat_unsigned_long_fract_type_nodeglobal_trees[TI_SAT_ULFRACT_TYPE]);
4404 record_builtin_type (RID_MAX, "_Sat unsigned long long _Fract",
4405 sat_unsigned_long_long_fract_type_nodeglobal_trees[TI_SAT_ULLFRACT_TYPE]);
4406 record_builtin_type (RID_MAX, "short _Accum", short_accum_type_nodeglobal_trees[TI_SACCUM_TYPE]);
4407 record_builtin_type (RID_ACCUM, NULL__null, accum_type_nodeglobal_trees[TI_ACCUM_TYPE]);
4408 record_builtin_type (RID_MAX, "long _Accum", long_accum_type_nodeglobal_trees[TI_LACCUM_TYPE]);
4409 record_builtin_type (RID_MAX, "long long _Accum",
4410 long_long_accum_type_nodeglobal_trees[TI_LLACCUM_TYPE]);
4411 record_builtin_type (RID_MAX, "unsigned short _Accum",
4412 unsigned_short_accum_type_nodeglobal_trees[TI_USACCUM_TYPE]);
4413 record_builtin_type (RID_MAX, "unsigned _Accum",
4414 unsigned_accum_type_nodeglobal_trees[TI_UACCUM_TYPE]);
4415 record_builtin_type (RID_MAX, "unsigned long _Accum",
4416 unsigned_long_accum_type_nodeglobal_trees[TI_ULACCUM_TYPE]);
4417 record_builtin_type (RID_MAX, "unsigned long long _Accum",
4418 unsigned_long_long_accum_type_nodeglobal_trees[TI_ULLACCUM_TYPE]);
4419 record_builtin_type (RID_MAX, "_Sat short _Accum",
4420 sat_short_accum_type_nodeglobal_trees[TI_SAT_SACCUM_TYPE]);
4421 record_builtin_type (RID_MAX, "_Sat _Accum", sat_accum_type_nodeglobal_trees[TI_SAT_ACCUM_TYPE]);
4422 record_builtin_type (RID_MAX, "_Sat long _Accum",
4423 sat_long_accum_type_nodeglobal_trees[TI_SAT_LACCUM_TYPE]);
4424 record_builtin_type (RID_MAX, "_Sat long long _Accum",
4425 sat_long_long_accum_type_nodeglobal_trees[TI_SAT_LLACCUM_TYPE]);
4426 record_builtin_type (RID_MAX, "_Sat unsigned short _Accum",
4427 sat_unsigned_short_accum_type_nodeglobal_trees[TI_SAT_USACCUM_TYPE]);
4428 record_builtin_type (RID_MAX, "_Sat unsigned _Accum",
4429 sat_unsigned_accum_type_nodeglobal_trees[TI_SAT_UACCUM_TYPE]);
4430 record_builtin_type (RID_MAX, "_Sat unsigned long _Accum",
4431 sat_unsigned_long_accum_type_nodeglobal_trees[TI_SAT_ULACCUM_TYPE]);
4432 record_builtin_type (RID_MAX, "_Sat unsigned long long _Accum",
4433 sat_unsigned_long_long_accum_type_nodeglobal_trees[TI_SAT_ULLACCUM_TYPE]);
4434
4435 }
4436
4437 lang_hooks.decls.pushdecl (build_decl (UNKNOWN_LOCATION((location_t) 0),
4438 TYPE_DECL,
4439 get_identifier ("complex int")(__builtin_constant_p ("complex int") ? get_identifier_with_length
(("complex int"), strlen ("complex int")) : get_identifier (
"complex int"))
,
4440 complex_integer_type_nodeglobal_trees[TI_COMPLEX_INTEGER_TYPE]));
4441 lang_hooks.decls.pushdecl (build_decl (UNKNOWN_LOCATION((location_t) 0),
4442 TYPE_DECL,
4443 get_identifier ("complex float")(__builtin_constant_p ("complex float") ? get_identifier_with_length
(("complex float"), strlen ("complex float")) : get_identifier
("complex float"))
,
4444 complex_float_type_nodeglobal_trees[TI_COMPLEX_FLOAT_TYPE]));
4445 lang_hooks.decls.pushdecl (build_decl (UNKNOWN_LOCATION((location_t) 0),
4446 TYPE_DECL,
4447 get_identifier ("complex double")(__builtin_constant_p ("complex double") ? get_identifier_with_length
(("complex double"), strlen ("complex double")) : get_identifier
("complex double"))
,
4448 complex_double_type_nodeglobal_trees[TI_COMPLEX_DOUBLE_TYPE]));
4449 lang_hooks.decls.pushdecl
4450 (build_decl (UNKNOWN_LOCATION((location_t) 0),
4451 TYPE_DECL, get_identifier ("complex long double")(__builtin_constant_p ("complex long double") ? get_identifier_with_length
(("complex long double"), strlen ("complex long double")) : get_identifier
("complex long double"))
,
4452 complex_long_double_type_nodeglobal_trees[TI_COMPLEX_LONG_DOUBLE_TYPE]));
4453
4454 if (!c_dialect_cxx ()((c_language & clk_cxx) != 0))
4455 for (i = 0; i < NUM_FLOATN_NX_TYPES(TI_FLOATN_NX_TYPE_LAST - TI_FLOATN_NX_TYPE_FIRST + 1); i++)
4456 if (COMPLEX_FLOATN_NX_TYPE_NODE (i)global_trees[TI_COMPLEX_FLOATN_NX_TYPE_FIRST + (i)] != NULL_TREE(tree) __null)
4457 {
4458 char buf[30];
4459 sprintf (buf, "complex _Float%d%s", floatn_nx_types[i].n,
4460 floatn_nx_types[i].extended ? "x" : "");
4461 lang_hooks.decls.pushdecl
4462 (build_decl (UNKNOWN_LOCATION((location_t) 0),
4463 TYPE_DECL,
4464 get_identifier (buf)(__builtin_constant_p (buf) ? get_identifier_with_length ((buf
), strlen (buf)) : get_identifier (buf))
,
4465 COMPLEX_FLOATN_NX_TYPE_NODE (i)global_trees[TI_COMPLEX_FLOATN_NX_TYPE_FIRST + (i)]));
4466 }
4467
4468 /* Make fileptr_type_node a distinct void * type until
4469 FILE type is defined. Likewise for const struct tm*. */
4470 for (unsigned i = 0;
4471 i < sizeof (builtin_structptr_types) / sizeof (builtin_structptr_type);
4472 ++i)
4473 builtin_structptr_types[i].node
4474 = build_variant_type_copy (builtin_structptr_types[i].base);
4475
4476 record_builtin_type (RID_VOID, NULL__null, void_type_nodeglobal_trees[TI_VOID_TYPE]);
4477
4478 /* Set the TYPE_NAME for any variants that were built before
4479 record_builtin_type gave names to the built-in types. */
4480 {
4481 tree void_name = TYPE_NAME (void_type_node)((tree_class_check ((global_trees[TI_VOID_TYPE]), (tcc_type),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4481, __FUNCTION__))->type_common.name)
;
4482 TYPE_NAME (void_type_node)((tree_class_check ((global_trees[TI_VOID_TYPE]), (tcc_type),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4482, __FUNCTION__))->type_common.name)
= NULL_TREE(tree) __null;
4483 TYPE_NAME (build_qualified_type (void_type_node, TYPE_QUAL_CONST))((tree_class_check ((build_qualified_type (global_trees[TI_VOID_TYPE
], TYPE_QUAL_CONST)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4483, __FUNCTION__))->type_common.name)
4484 = void_name;
4485 TYPE_NAME (void_type_node)((tree_class_check ((global_trees[TI_VOID_TYPE]), (tcc_type),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4485, __FUNCTION__))->type_common.name)
= void_name;
4486 }
4487
4488 void_list_nodeglobal_trees[TI_VOID_LIST_NODE] = build_void_list_node ();
4489
4490 /* Make a type to be the domain of a few array types
4491 whose domains don't really matter.
4492 200 is small enough that it always fits in size_t
4493 and large enough that it can hold most function names for the
4494 initializations of __FUNCTION__ and __PRETTY_FUNCTION__. */
4495 array_domain_type = build_index_type (size_int (200)size_int_kind (200, stk_sizetype));
4496
4497 /* Make a type for arrays of characters.
4498 With luck nothing will ever really depend on the length of this
4499 array type. */
4500 char_array_type_nodec_global_trees[CTI_CHAR_ARRAY_TYPE]
4501 = build_array_type (char_type_nodeinteger_types[itk_char], array_domain_type);
4502
4503 string_type_nodec_global_trees[CTI_STRING_TYPE] = build_pointer_type (char_type_nodeinteger_types[itk_char]);
4504 const_string_type_nodec_global_trees[CTI_CONST_STRING_TYPE]
4505 = build_pointer_type (build_qualified_type
4506 (char_type_nodeinteger_types[itk_char], TYPE_QUAL_CONST));
4507
4508 /* This is special for C++ so functions can be overloaded. */
4509 wchar_type_nodec_global_trees[CTI_WCHAR_TYPE] = get_identifier (MODIFIED_WCHAR_TYPE)(__builtin_constant_p ((global_options.x_flag_short_wchar ? "short unsigned int"
: (((global_options.x_ix86_isa_flags & (1UL << 4))
!= 0) ? "int" : "long int"))) ? get_identifier_with_length (
((global_options.x_flag_short_wchar ? "short unsigned int" : (
((global_options.x_ix86_isa_flags & (1UL << 4)) != 0
) ? "int" : "long int"))), strlen ((global_options.x_flag_short_wchar
? "short unsigned int" : (((global_options.x_ix86_isa_flags &
(1UL << 4)) != 0) ? "int" : "long int")))) : get_identifier
((global_options.x_flag_short_wchar ? "short unsigned int" :
(((global_options.x_ix86_isa_flags & (1UL << 4)) !=
0) ? "int" : "long int"))))
;
4510 wchar_type_nodec_global_trees[CTI_WCHAR_TYPE] = TREE_TYPE (identifier_global_value (wchar_type_node))((contains_struct_check ((identifier_global_value (c_global_trees
[CTI_WCHAR_TYPE])), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4510, __FUNCTION__))->typed.type)
;
4511 wchar_type_size = TYPE_PRECISION (wchar_type_node)((tree_class_check ((c_global_trees[CTI_WCHAR_TYPE]), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4511, __FUNCTION__))->type_common.precision)
;
4512 underlying_wchar_type_nodec_global_trees[CTI_UNDERLYING_WCHAR_TYPE] = wchar_type_nodec_global_trees[CTI_WCHAR_TYPE];
4513 if (c_dialect_cxx ()((c_language & clk_cxx) != 0))
4514 {
4515 if (TYPE_UNSIGNED (wchar_type_node)((tree_class_check ((c_global_trees[CTI_WCHAR_TYPE]), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4515, __FUNCTION__))->base.u.bits.unsigned_flag)
)
4516 wchar_type_nodec_global_trees[CTI_WCHAR_TYPE] = make_unsigned_type (wchar_type_size);
4517 else
4518 wchar_type_nodec_global_trees[CTI_WCHAR_TYPE] = make_signed_type (wchar_type_size);
4519 record_builtin_type (RID_WCHAR, "wchar_t", wchar_type_nodec_global_trees[CTI_WCHAR_TYPE]);
4520 }
4521
4522 /* This is for wide string constants. */
4523 wchar_array_type_nodec_global_trees[CTI_WCHAR_ARRAY_TYPE]
4524 = build_array_type (wchar_type_nodec_global_trees[CTI_WCHAR_TYPE], array_domain_type);
4525
4526 /* Define 'char8_t'. */
4527 char8_type_nodec_global_trees[CTI_CHAR8_TYPE] = get_identifier (CHAR8_TYPE)(__builtin_constant_p ("unsigned char") ? get_identifier_with_length
(("unsigned char"), strlen ("unsigned char")) : get_identifier
("unsigned char"))
;
4528 char8_type_nodec_global_trees[CTI_CHAR8_TYPE] = TREE_TYPE (identifier_global_value (char8_type_node))((contains_struct_check ((identifier_global_value (c_global_trees
[CTI_CHAR8_TYPE])), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4528, __FUNCTION__))->typed.type)
;
4529 char8_type_size = TYPE_PRECISION (char8_type_node)((tree_class_check ((c_global_trees[CTI_CHAR8_TYPE]), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4529, __FUNCTION__))->type_common.precision)
;
4530 if (c_dialect_cxx ()((c_language & clk_cxx) != 0))
4531 {
4532 char8_type_nodec_global_trees[CTI_CHAR8_TYPE] = make_unsigned_type (char8_type_size);
4533
4534 if (flag_char8_tglobal_options.x_flag_char8_t)
4535 record_builtin_type (RID_CHAR8, "char8_t", char8_type_nodec_global_trees[CTI_CHAR8_TYPE]);
4536 }
4537
4538 /* This is for UTF-8 string constants. */
4539 char8_array_type_nodec_global_trees[CTI_CHAR8_ARRAY_TYPE]
4540 = build_array_type (char8_type_nodec_global_trees[CTI_CHAR8_TYPE], array_domain_type);
4541
4542 /* Define 'char16_t'. */
4543 char16_type_nodec_global_trees[CTI_CHAR16_TYPE] = get_identifier (CHAR16_TYPE)(__builtin_constant_p ("short unsigned int") ? get_identifier_with_length
(("short unsigned int"), strlen ("short unsigned int")) : get_identifier
("short unsigned int"))
;
4544 char16_type_nodec_global_trees[CTI_CHAR16_TYPE] = TREE_TYPE (identifier_global_value (char16_type_node))((contains_struct_check ((identifier_global_value (c_global_trees
[CTI_CHAR16_TYPE])), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4544, __FUNCTION__))->typed.type)
;
4545 char16_type_size = TYPE_PRECISION (char16_type_node)((tree_class_check ((c_global_trees[CTI_CHAR16_TYPE]), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4545, __FUNCTION__))->type_common.precision)
;
4546 if (c_dialect_cxx ()((c_language & clk_cxx) != 0))
4547 {
4548 char16_type_nodec_global_trees[CTI_CHAR16_TYPE] = make_unsigned_type (char16_type_size);
4549
4550 if (cxx_dialect >= cxx11)
4551 record_builtin_type (RID_CHAR16, "char16_t", char16_type_nodec_global_trees[CTI_CHAR16_TYPE]);
4552 }
4553
4554 /* This is for UTF-16 string constants. */
4555 char16_array_type_nodec_global_trees[CTI_CHAR16_ARRAY_TYPE]
4556 = build_array_type (char16_type_nodec_global_trees[CTI_CHAR16_TYPE], array_domain_type);
4557
4558 /* Define 'char32_t'. */
4559 char32_type_nodec_global_trees[CTI_CHAR32_TYPE] = get_identifier (CHAR32_TYPE)(__builtin_constant_p ("unsigned int") ? get_identifier_with_length
(("unsigned int"), strlen ("unsigned int")) : get_identifier
("unsigned int"))
;
4560 char32_type_nodec_global_trees[CTI_CHAR32_TYPE] = TREE_TYPE (identifier_global_value (char32_type_node))((contains_struct_check ((identifier_global_value (c_global_trees
[CTI_CHAR32_TYPE])), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4560, __FUNCTION__))->typed.type)
;
4561 char32_type_size = TYPE_PRECISION (char32_type_node)((tree_class_check ((c_global_trees[CTI_CHAR32_TYPE]), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4561, __FUNCTION__))->type_common.precision)
;
4562 if (c_dialect_cxx ()((c_language & clk_cxx) != 0))
4563 {
4564 char32_type_nodec_global_trees[CTI_CHAR32_TYPE] = make_unsigned_type (char32_type_size);
4565
4566 if (cxx_dialect >= cxx11)
4567 record_builtin_type (RID_CHAR32, "char32_t", char32_type_nodec_global_trees[CTI_CHAR32_TYPE]);
4568 }
4569
4570 /* This is for UTF-32 string constants. */
4571 char32_array_type_nodec_global_trees[CTI_CHAR32_ARRAY_TYPE]
4572 = build_array_type (char32_type_nodec_global_trees[CTI_CHAR32_TYPE], array_domain_type);
4573
4574 wint_type_nodec_global_trees[CTI_WINT_TYPE] =
4575 TREE_TYPE (identifier_global_value (get_identifier (WINT_TYPE)))((contains_struct_check ((identifier_global_value ((__builtin_constant_p
("unsigned int") ? get_identifier_with_length (("unsigned int"
), strlen ("unsigned int")) : get_identifier ("unsigned int")
))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4575, __FUNCTION__))->typed.type)
;
4576
4577 intmax_type_nodec_global_trees[CTI_INTMAX_TYPE] =
4578 TREE_TYPE (identifier_global_value (get_identifier (INTMAX_TYPE)))((contains_struct_check ((identifier_global_value ((__builtin_constant_p
(((32 == 64) ? "int" : (((((global_options.x_ix86_isa_flags &
(1UL << 58)) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags
& (1UL << 1)) != 0) ? 8 : 4))) == 64) ? "long int"
: "long long int"))) ? get_identifier_with_length ((((32 == 64
) ? "int" : (((((global_options.x_ix86_isa_flags & (1UL <<
58)) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags &
(1UL << 1)) != 0) ? 8 : 4))) == 64) ? "long int" : "long long int"
))), strlen (((32 == 64) ? "int" : (((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) ==
64) ? "long int" : "long long int")))) : get_identifier (((32
== 64) ? "int" : (((((global_options.x_ix86_isa_flags & (
1UL << 58)) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags
& (1UL << 1)) != 0) ? 8 : 4))) == 64) ? "long int"
: "long long int")))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4578, __FUNCTION__))->typed.type)
;
4579 uintmax_type_nodec_global_trees[CTI_UINTMAX_TYPE] =
4580 TREE_TYPE (identifier_global_value (get_identifier (UINTMAX_TYPE)))((contains_struct_check ((identifier_global_value ((__builtin_constant_p
(((32 == 64) ? "unsigned int" : (((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) ==
64) ? "long unsigned int" : "long long unsigned int"))) ? get_identifier_with_length
((((32 == 64) ? "unsigned int" : (((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) ==
64) ? "long unsigned int" : "long long unsigned int"))), strlen
(((32 == 64) ? "unsigned int" : (((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) ==
64) ? "long unsigned int" : "long long unsigned int")))) : get_identifier
(((32 == 64) ? "unsigned int" : (((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) ==
64) ? "long unsigned int" : "long long unsigned int")))))), (
TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4580, __FUNCTION__))->typed.type)
;
4581
4582 if (SIG_ATOMIC_TYPE"int")
4583 sig_atomic_type_nodec_global_trees[CTI_SIG_ATOMIC_TYPE] =
4584 TREE_TYPE (identifier_global_value (c_get_ident (SIG_ATOMIC_TYPE)))((contains_struct_check ((identifier_global_value (c_get_ident
("int"))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4584, __FUNCTION__))->typed.type)
;
4585 if (INT8_TYPE"signed char")
4586 int8_type_nodec_global_trees[CTI_INT8_TYPE] =
4587 TREE_TYPE (identifier_global_value (c_get_ident (INT8_TYPE)))((contains_struct_check ((identifier_global_value (c_get_ident
("signed char"))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4587, __FUNCTION__))->typed.type)
;
4588 if (INT16_TYPE"short int")
4589 int16_type_nodec_global_trees[CTI_INT16_TYPE] =
4590 TREE_TYPE (identifier_global_value (c_get_ident (INT16_TYPE)))((contains_struct_check ((identifier_global_value (c_get_ident
("short int"))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4590, __FUNCTION__))->typed.type)
;
4591 if (INT32_TYPE"int")
4592 int32_type_nodec_global_trees[CTI_INT32_TYPE] =
4593 TREE_TYPE (identifier_global_value (c_get_ident (INT32_TYPE)))((contains_struct_check ((identifier_global_value (c_get_ident
("int"))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4593, __FUNCTION__))->typed.type)
;
4594 if (INT64_TYPE((((global_options.x_ix86_isa_flags & (1UL << 58)) !=
0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags & (1UL
<< 1)) != 0) ? 8 : 4))) == 64 ? "long int" : "long long int"
)
)
4595 int64_type_nodec_global_trees[CTI_INT64_TYPE] =
4596 TREE_TYPE (identifier_global_value (c_get_ident (INT64_TYPE)))((contains_struct_check ((identifier_global_value (c_get_ident
(((((global_options.x_ix86_isa_flags & (1UL << 58)
) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags &
(1UL << 1)) != 0) ? 8 : 4))) == 64 ? "long int" : "long long int"
)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4596, __FUNCTION__))->typed.type)
;
4597 if (UINT8_TYPE"unsigned char")
4598 uint8_type_nodec_global_trees[CTI_UINT8_TYPE] =
4599 TREE_TYPE (identifier_global_value (c_get_ident (UINT8_TYPE)))((contains_struct_check ((identifier_global_value (c_get_ident
("unsigned char"))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4599, __FUNCTION__))->typed.type)
;
4600 if (UINT16_TYPE"short unsigned int")
4601 c_uint16_type_nodec_global_trees[CTI_UINT16_TYPE] = uint16_type_nodeglobal_trees[TI_UINT16_TYPE] =
4602 TREE_TYPE (identifier_global_value (c_get_ident (UINT16_TYPE)))((contains_struct_check ((identifier_global_value (c_get_ident
("short unsigned int"))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4602, __FUNCTION__))->typed.type)
;
4603 if (UINT32_TYPE"unsigned int")
4604 c_uint32_type_nodec_global_trees[CTI_UINT32_TYPE] = uint32_type_nodeglobal_trees[TI_UINT32_TYPE] =
4605 TREE_TYPE (identifier_global_value (c_get_ident (UINT32_TYPE)))((contains_struct_check ((identifier_global_value (c_get_ident
("unsigned int"))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4605, __FUNCTION__))->typed.type)
;
4606 if (UINT64_TYPE((((global_options.x_ix86_isa_flags & (1UL << 58)) !=
0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags & (1UL
<< 1)) != 0) ? 8 : 4))) == 64 ? "long unsigned int" : "long long unsigned int"
)
)
4607 c_uint64_type_nodec_global_trees[CTI_UINT64_TYPE] = uint64_type_nodeglobal_trees[TI_UINT64_TYPE] =
4608 TREE_TYPE (identifier_global_value (c_get_ident (UINT64_TYPE)))((contains_struct_check ((identifier_global_value (c_get_ident
(((((global_options.x_ix86_isa_flags & (1UL << 58)
) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags &
(1UL << 1)) != 0) ? 8 : 4))) == 64 ? "long unsigned int"
: "long long unsigned int")))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4608, __FUNCTION__))->typed.type)
;
4609 if (INT_LEAST8_TYPE"signed char")
4610 int_least8_type_nodec_global_trees[CTI_INT_LEAST8_TYPE] =
4611 TREE_TYPE (identifier_global_value (c_get_ident (INT_LEAST8_TYPE)))((contains_struct_check ((identifier_global_value (c_get_ident
("signed char"))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4611, __FUNCTION__))->typed.type)
;
4612 if (INT_LEAST16_TYPE"short int")
4613 int_least16_type_nodec_global_trees[CTI_INT_LEAST16_TYPE] =
4614 TREE_TYPE (identifier_global_value (c_get_ident (INT_LEAST16_TYPE)))((contains_struct_check ((identifier_global_value (c_get_ident
("short int"))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4614, __FUNCTION__))->typed.type)
;
4615 if (INT_LEAST32_TYPE"int")
4616 int_least32_type_nodec_global_trees[CTI_INT_LEAST32_TYPE] =
4617 TREE_TYPE (identifier_global_value (c_get_ident (INT_LEAST32_TYPE)))((contains_struct_check ((identifier_global_value (c_get_ident
("int"))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4617, __FUNCTION__))->typed.type)
;
4618 if (INT_LEAST64_TYPE((((global_options.x_ix86_isa_flags & (1UL << 58)) !=
0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags & (1UL
<< 1)) != 0) ? 8 : 4))) == 64 ? "long int" : "long long int"
)
)
4619 int_least64_type_nodec_global_trees[CTI_INT_LEAST64_TYPE] =
4620 TREE_TYPE (identifier_global_value (c_get_ident (INT_LEAST64_TYPE)))((contains_struct_check ((identifier_global_value (c_get_ident
(((((global_options.x_ix86_isa_flags & (1UL << 58)
) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags &
(1UL << 1)) != 0) ? 8 : 4))) == 64 ? "long int" : "long long int"
)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4620, __FUNCTION__))->typed.type)
;
4621 if (UINT_LEAST8_TYPE"unsigned char")
4622 uint_least8_type_nodec_global_trees[CTI_UINT_LEAST8_TYPE] =
4623 TREE_TYPE (identifier_global_value (c_get_ident (UINT_LEAST8_TYPE)))((contains_struct_check ((identifier_global_value (c_get_ident
("unsigned char"))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4623, __FUNCTION__))->typed.type)
;
4624 if (UINT_LEAST16_TYPE"short unsigned int")
4625 uint_least16_type_nodec_global_trees[CTI_UINT_LEAST16_TYPE] =
4626 TREE_TYPE (identifier_global_value (c_get_ident (UINT_LEAST16_TYPE)))((contains_struct_check ((identifier_global_value (c_get_ident
("short unsigned int"))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4626, __FUNCTION__))->typed.type)
;
4627 if (UINT_LEAST32_TYPE"unsigned int")
4628 uint_least32_type_nodec_global_trees[CTI_UINT_LEAST32_TYPE] =
4629 TREE_TYPE (identifier_global_value (c_get_ident (UINT_LEAST32_TYPE)))((contains_struct_check ((identifier_global_value (c_get_ident
("unsigned int"))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4629, __FUNCTION__))->typed.type)
;
4630 if (UINT_LEAST64_TYPE((((global_options.x_ix86_isa_flags & (1UL << 58)) !=
0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags & (1UL
<< 1)) != 0) ? 8 : 4))) == 64 ? "long unsigned int" : "long long unsigned int"
)
)
4631 uint_least64_type_nodec_global_trees[CTI_UINT_LEAST64_TYPE] =
4632 TREE_TYPE (identifier_global_value (c_get_ident (UINT_LEAST64_TYPE)))((contains_struct_check ((identifier_global_value (c_get_ident
(((((global_options.x_ix86_isa_flags & (1UL << 58)
) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags &
(1UL << 1)) != 0) ? 8 : 4))) == 64 ? "long unsigned int"
: "long long unsigned int")))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4632, __FUNCTION__))->typed.type)
;
4633 if (INT_FAST8_TYPE"signed char")
4634 int_fast8_type_nodec_global_trees[CTI_INT_FAST8_TYPE] =
4635 TREE_TYPE (identifier_global_value (c_get_ident (INT_FAST8_TYPE)))((contains_struct_check ((identifier_global_value (c_get_ident
("signed char"))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4635, __FUNCTION__))->typed.type)
;
4636 if (INT_FAST16_TYPE((((global_options.x_ix86_isa_flags & (1UL << 58)) !=
0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags & (1UL
<< 1)) != 0) ? 8 : 4))) == 64 && !(global_options
.x_linux_libc == 4) ? "long int" : "int")
)
4637 int_fast16_type_nodec_global_trees[CTI_INT_FAST16_TYPE] =
4638 TREE_TYPE (identifier_global_value (c_get_ident (INT_FAST16_TYPE)))((contains_struct_check ((identifier_global_value (c_get_ident
(((((global_options.x_ix86_isa_flags & (1UL << 58)
) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags &
(1UL << 1)) != 0) ? 8 : 4))) == 64 && !(global_options
.x_linux_libc == 4) ? "long int" : "int")))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4638, __FUNCTION__))->typed.type)
;
4639 if (INT_FAST32_TYPE((((global_options.x_ix86_isa_flags & (1UL << 58)) !=
0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags & (1UL
<< 1)) != 0) ? 8 : 4))) == 64 && !(global_options
.x_linux_libc == 4) ? "long int" : "int")
)
4640 int_fast32_type_nodec_global_trees[CTI_INT_FAST32_TYPE] =
4641 TREE_TYPE (identifier_global_value (c_get_ident (INT_FAST32_TYPE)))((contains_struct_check ((identifier_global_value (c_get_ident
(((((global_options.x_ix86_isa_flags & (1UL << 58)
) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags &
(1UL << 1)) != 0) ? 8 : 4))) == 64 && !(global_options
.x_linux_libc == 4) ? "long int" : "int")))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.c"
, 4641, __FUNCTION__))->typed.type)
;
4642 if (INT_FAST64_TYPE((((global_options.x_ix86_isa_flags & (1UL << 58)) !=
0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags & (1UL
<< 1)) != 0) ? 8 : 4))) == 64 ? "long int" : "long long int"
)
)
4643 int_fast64_type_nodec_global_trees[CTI_INT_FAST64_TYPE] =