Bug Summary

File:build/gcc/c-family/c-common.cc
Warning:line 8367, column 5
Called C++ object pointer is null

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-suse-linux -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name c-common.cc -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 -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/buildworker/marxinbox-gcc-clang-static-analyzer/objdir/gcc -resource-dir /usr/lib64/clang/15.0.7 -D IN_GCC_FRONTEND -D IN_GCC_FRONTEND -D IN_GCC -D HAVE_CONFIG_H -I . -I c-family -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../include -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libcpp/include -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libcody -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libdecnumber -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libdecnumber/bid -I ../libdecnumber -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libbacktrace -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13 -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13/x86_64-suse-linux -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13/backward -internal-isystem /usr/lib64/clang/15.0.7/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-narrowing -Wwrite-strings -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fdeprecated-macro -fdebug-compilation-dir=/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 /buildworker/marxinbox-gcc-clang-static-analyzer/objdir/clang-static-analyzer/2023-03-27-141847-20772-1/report-Npbysf.plist -x c++ /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.cc

/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/c-family/c-common.cc

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