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