File: | build/gcc/wide-int.h |
Warning: | line 1160, column 57 The right operand of '>' is a garbage value |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | /* Lowering pass for OMP directives. Converts OMP directives into explicit |
2 | calls to the runtime library (libgomp), data marshalling to implement data |
3 | sharing and copying clauses, offloading to accelerators, and more. |
4 | |
5 | Contributed by Diego Novillo <dnovillo@redhat.com> |
6 | |
7 | Copyright (C) 2005-2021 Free Software Foundation, Inc. |
8 | |
9 | This file is part of GCC. |
10 | |
11 | GCC is free software; you can redistribute it and/or modify it under |
12 | the terms of the GNU General Public License as published by the Free |
13 | Software Foundation; either version 3, or (at your option) any later |
14 | version. |
15 | |
16 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY |
17 | WARRANTY; without even the implied warranty of MERCHANTABILITY or |
18 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
19 | for more details. |
20 | |
21 | You should have received a copy of the GNU General Public License |
22 | along with GCC; see the file COPYING3. If not see |
23 | <http://www.gnu.org/licenses/>. */ |
24 | |
25 | #include "config.h" |
26 | #include "system.h" |
27 | #include "coretypes.h" |
28 | #include "backend.h" |
29 | #include "target.h" |
30 | #include "tree.h" |
31 | #include "gimple.h" |
32 | #include "tree-pass.h" |
33 | #include "ssa.h" |
34 | #include "cgraph.h" |
35 | #include "pretty-print.h" |
36 | #include "diagnostic-core.h" |
37 | #include "fold-const.h" |
38 | #include "stor-layout.h" |
39 | #include "internal-fn.h" |
40 | #include "gimple-fold.h" |
41 | #include "gimplify.h" |
42 | #include "gimple-iterator.h" |
43 | #include "gimplify-me.h" |
44 | #include "gimple-walk.h" |
45 | #include "tree-iterator.h" |
46 | #include "tree-inline.h" |
47 | #include "langhooks.h" |
48 | #include "tree-dfa.h" |
49 | #include "tree-ssa.h" |
50 | #include "splay-tree.h" |
51 | #include "omp-general.h" |
52 | #include "omp-low.h" |
53 | #include "gimple-low.h" |
54 | #include "alloc-pool.h" |
55 | #include "symbol-summary.h" |
56 | #include "tree-nested.h" |
57 | #include "context.h" |
58 | #include "gomp-constants.h" |
59 | #include "gimple-pretty-print.h" |
60 | #include "stringpool.h" |
61 | #include "attribs.h" |
62 | |
63 | /* Lowering of OMP parallel and workshare constructs proceeds in two |
64 | phases. The first phase scans the function looking for OMP statements |
65 | and then for variables that must be replaced to satisfy data sharing |
66 | clauses. The second phase expands code for the constructs, as well as |
67 | re-gimplifying things when variables have been replaced with complex |
68 | expressions. |
69 | |
70 | Final code generation is done by pass_expand_omp. The flowgraph is |
71 | scanned for regions which are then moved to a new |
72 | function, to be invoked by the thread library, or offloaded. */ |
73 | |
74 | /* Context structure. Used to store information about each parallel |
75 | directive in the code. */ |
76 | |
77 | struct omp_context |
78 | { |
79 | /* This field must be at the beginning, as we do "inheritance": Some |
80 | callback functions for tree-inline.c (e.g., omp_copy_decl) |
81 | receive a copy_body_data pointer that is up-casted to an |
82 | omp_context pointer. */ |
83 | copy_body_data cb; |
84 | |
85 | /* The tree of contexts corresponding to the encountered constructs. */ |
86 | struct omp_context *outer; |
87 | gimple *stmt; |
88 | |
89 | /* Map variables to fields in a structure that allows communication |
90 | between sending and receiving threads. */ |
91 | splay_tree field_map; |
92 | tree record_type; |
93 | tree sender_decl; |
94 | tree receiver_decl; |
95 | |
96 | /* These are used just by task contexts, if task firstprivate fn is |
97 | needed. srecord_type is used to communicate from the thread |
98 | that encountered the task construct to task firstprivate fn, |
99 | record_type is allocated by GOMP_task, initialized by task firstprivate |
100 | fn and passed to the task body fn. */ |
101 | splay_tree sfield_map; |
102 | tree srecord_type; |
103 | |
104 | /* A chain of variables to add to the top-level block surrounding the |
105 | construct. In the case of a parallel, this is in the child function. */ |
106 | tree block_vars; |
107 | |
108 | /* Label to which GOMP_cancel{,llation_point} and explicit and implicit |
109 | barriers should jump to during omplower pass. */ |
110 | tree cancel_label; |
111 | |
112 | /* The sibling GIMPLE_OMP_FOR simd with _simt_ clause or NULL |
113 | otherwise. */ |
114 | gimple *simt_stmt; |
115 | |
116 | /* For task reductions registered in this context, a vector containing |
117 | the length of the private copies block (if constant, otherwise NULL) |
118 | and then offsets (if constant, otherwise NULL) for each entry. */ |
119 | vec<tree> task_reductions; |
120 | |
121 | /* A hash map from the reduction clauses to the registered array |
122 | elts. */ |
123 | hash_map<tree, unsigned> *task_reduction_map; |
124 | |
125 | /* And a hash map from the lastprivate(conditional:) variables to their |
126 | corresponding tracking loop iteration variables. */ |
127 | hash_map<tree, tree> *lastprivate_conditional_map; |
128 | |
129 | /* And a hash map from the allocate variables to their corresponding |
130 | allocators. */ |
131 | hash_map<tree, tree> *allocate_map; |
132 | |
133 | /* A tree_list of the reduction clauses in this context. This is |
134 | only used for checking the consistency of OpenACC reduction |
135 | clauses in scan_omp_for and is not guaranteed to contain a valid |
136 | value outside of this function. */ |
137 | tree local_reduction_clauses; |
138 | |
139 | /* A tree_list of the reduction clauses in outer contexts. This is |
140 | only used for checking the consistency of OpenACC reduction |
141 | clauses in scan_omp_for and is not guaranteed to contain a valid |
142 | value outside of this function. */ |
143 | tree outer_reduction_clauses; |
144 | |
145 | /* Nesting depth of this context. Used to beautify error messages re |
146 | invalid gotos. The outermost ctx is depth 1, with depth 0 being |
147 | reserved for the main body of the function. */ |
148 | int depth; |
149 | |
150 | /* True if this parallel directive is nested within another. */ |
151 | bool is_nested; |
152 | |
153 | /* True if this construct can be cancelled. */ |
154 | bool cancellable; |
155 | |
156 | /* True if lower_omp_1 should look up lastprivate conditional in parent |
157 | context. */ |
158 | bool combined_into_simd_safelen1; |
159 | |
160 | /* True if there is nested scan context with inclusive clause. */ |
161 | bool scan_inclusive; |
162 | |
163 | /* True if there is nested scan context with exclusive clause. */ |
164 | bool scan_exclusive; |
165 | |
166 | /* True in the second simd loop of for simd with inscan reductions. */ |
167 | bool for_simd_scan_phase; |
168 | |
169 | /* True if there is order(concurrent) clause on the construct. */ |
170 | bool order_concurrent; |
171 | |
172 | /* True if there is bind clause on the construct (i.e. a loop construct). */ |
173 | bool loop_p; |
174 | }; |
175 | |
176 | static splay_tree all_contexts; |
177 | static int taskreg_nesting_level; |
178 | static int target_nesting_level; |
179 | static bitmap task_shared_vars; |
180 | static bitmap global_nonaddressable_vars; |
181 | static vec<omp_context *> taskreg_contexts; |
182 | |
183 | static void scan_omp (gimple_seq *, omp_context *); |
184 | static tree scan_omp_1_op (tree *, int *, void *); |
185 | |
186 | #define WALK_SUBSTMTScase GIMPLE_BIND: case GIMPLE_TRY: case GIMPLE_CATCH: case GIMPLE_EH_FILTER : case GIMPLE_TRANSACTION: *handled_ops_p = false; break; \ |
187 | case GIMPLE_BIND: \ |
188 | case GIMPLE_TRY: \ |
189 | case GIMPLE_CATCH: \ |
190 | case GIMPLE_EH_FILTER: \ |
191 | case GIMPLE_TRANSACTION: \ |
192 | /* The sub-statements for these should be walked. */ \ |
193 | *handled_ops_p = false; \ |
194 | break; |
195 | |
196 | /* Return whether CTX represents an OpenACC 'parallel' or 'serial' construct. |
197 | (This doesn't include OpenACC 'kernels' decomposed parts.) */ |
198 | |
199 | static bool |
200 | is_oacc_parallel_or_serial (omp_context *ctx) |
201 | { |
202 | enum gimple_code outer_type = gimple_code (ctx->stmt); |
203 | return ((outer_type == GIMPLE_OMP_TARGET) |
204 | && ((gimple_omp_target_kind (ctx->stmt) |
205 | == GF_OMP_TARGET_KIND_OACC_PARALLEL) |
206 | || (gimple_omp_target_kind (ctx->stmt) |
207 | == GF_OMP_TARGET_KIND_OACC_SERIAL))); |
208 | } |
209 | |
210 | /* Return whether CTX represents an OpenACC 'kernels' construct. |
211 | (This doesn't include OpenACC 'kernels' decomposed parts.) */ |
212 | |
213 | static bool |
214 | is_oacc_kernels (omp_context *ctx) |
215 | { |
216 | enum gimple_code outer_type = gimple_code (ctx->stmt); |
217 | return ((outer_type == GIMPLE_OMP_TARGET) |
218 | && (gimple_omp_target_kind (ctx->stmt) |
219 | == GF_OMP_TARGET_KIND_OACC_KERNELS)); |
220 | } |
221 | |
222 | /* Return whether CTX represents an OpenACC 'kernels' decomposed part. */ |
223 | |
224 | static bool |
225 | is_oacc_kernels_decomposed_part (omp_context *ctx) |
226 | { |
227 | enum gimple_code outer_type = gimple_code (ctx->stmt); |
228 | return ((outer_type == GIMPLE_OMP_TARGET) |
229 | && ((gimple_omp_target_kind (ctx->stmt) |
230 | == GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED) |
231 | || (gimple_omp_target_kind (ctx->stmt) |
232 | == GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE) |
233 | || (gimple_omp_target_kind (ctx->stmt) |
234 | == GF_OMP_TARGET_KIND_OACC_DATA_KERNELS))); |
235 | } |
236 | |
237 | /* Return true if STMT corresponds to an OpenMP target region. */ |
238 | static bool |
239 | is_omp_target (gimple *stmt) |
240 | { |
241 | if (gimple_code (stmt) == GIMPLE_OMP_TARGET) |
242 | { |
243 | int kind = gimple_omp_target_kind (stmt); |
244 | return (kind == GF_OMP_TARGET_KIND_REGION |
245 | || kind == GF_OMP_TARGET_KIND_DATA |
246 | || kind == GF_OMP_TARGET_KIND_ENTER_DATA |
247 | || kind == GF_OMP_TARGET_KIND_EXIT_DATA); |
248 | } |
249 | return false; |
250 | } |
251 | |
252 | /* If DECL is the artificial dummy VAR_DECL created for non-static |
253 | data member privatization, return the underlying "this" parameter, |
254 | otherwise return NULL. */ |
255 | |
256 | tree |
257 | omp_member_access_dummy_var (tree decl) |
258 | { |
259 | if (!VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) |
260 | || !DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 260, __FUNCTION__))->decl_common.artificial_flag) |
261 | || !DECL_IGNORED_P (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 261, __FUNCTION__))->decl_common.ignored_flag) |
262 | || !DECL_HAS_VALUE_EXPR_P (decl)((tree_check3 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 262, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL))) ->decl_common.decl_flag_2) |
263 | || !lang_hooks.decls.omp_disregard_value_expr (decl, false)) |
264 | return NULL_TREE(tree) nullptr; |
265 | |
266 | tree v = DECL_VALUE_EXPR (decl)(decl_value_expr_lookup ((contains_struct_check ((decl), (TS_DECL_WRTL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 266, __FUNCTION__)))); |
267 | if (TREE_CODE (v)((enum tree_code) (v)->base.code) != COMPONENT_REF) |
268 | return NULL_TREE(tree) nullptr; |
269 | |
270 | while (1) |
271 | switch (TREE_CODE (v)((enum tree_code) (v)->base.code)) |
272 | { |
273 | case COMPONENT_REF: |
274 | case MEM_REF: |
275 | case INDIRECT_REF: |
276 | CASE_CONVERTcase NOP_EXPR: case CONVERT_EXPR: |
277 | case POINTER_PLUS_EXPR: |
278 | v = TREE_OPERAND (v, 0)(*((const_cast<tree*> (tree_operand_check ((v), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 278, __FUNCTION__))))); |
279 | continue; |
280 | case PARM_DECL: |
281 | if (DECL_CONTEXT (v)((contains_struct_check ((v), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 281, __FUNCTION__))->decl_minimal.context) == current_function_decl |
282 | && DECL_ARTIFICIAL (v)((contains_struct_check ((v), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 282, __FUNCTION__))->decl_common.artificial_flag) |
283 | && TREE_CODE (TREE_TYPE (v))((enum tree_code) (((contains_struct_check ((v), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 283, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE) |
284 | return v; |
285 | return NULL_TREE(tree) nullptr; |
286 | default: |
287 | return NULL_TREE(tree) nullptr; |
288 | } |
289 | } |
290 | |
291 | /* Helper for unshare_and_remap, called through walk_tree. */ |
292 | |
293 | static tree |
294 | unshare_and_remap_1 (tree *tp, int *walk_subtrees, void *data) |
295 | { |
296 | tree *pair = (tree *) data; |
297 | if (*tp == pair[0]) |
298 | { |
299 | *tp = unshare_expr (pair[1]); |
300 | *walk_subtrees = 0; |
301 | } |
302 | else if (IS_TYPE_OR_DECL_P (*tp)((tree_code_type[(int) (((enum tree_code) (*tp)->base.code ))] == tcc_type) || (tree_code_type[(int) (((enum tree_code) ( *tp)->base.code))] == tcc_declaration))) |
303 | *walk_subtrees = 0; |
304 | return NULL_TREE(tree) nullptr; |
305 | } |
306 | |
307 | /* Return unshare_expr (X) with all occurrences of FROM |
308 | replaced with TO. */ |
309 | |
310 | static tree |
311 | unshare_and_remap (tree x, tree from, tree to) |
312 | { |
313 | tree pair[2] = { from, to }; |
314 | x = unshare_expr (x); |
315 | walk_tree (&x, unshare_and_remap_1, pair, NULL)walk_tree_1 (&x, unshare_and_remap_1, pair, nullptr, nullptr ); |
316 | return x; |
317 | } |
318 | |
319 | /* Convenience function for calling scan_omp_1_op on tree operands. */ |
320 | |
321 | static inline tree |
322 | scan_omp_op (tree *tp, omp_context *ctx) |
323 | { |
324 | struct walk_stmt_info wi; |
325 | |
326 | memset (&wi, 0, sizeof (wi)); |
327 | wi.info = ctx; |
328 | wi.want_locations = true; |
329 | |
330 | return walk_tree (tp, scan_omp_1_op, &wi, NULL)walk_tree_1 (tp, scan_omp_1_op, &wi, nullptr, nullptr); |
331 | } |
332 | |
333 | static void lower_omp (gimple_seq *, omp_context *); |
334 | static tree lookup_decl_in_outer_ctx (tree, omp_context *); |
335 | static tree maybe_lookup_decl_in_outer_ctx (tree, omp_context *); |
336 | |
337 | /* Return true if CTX is for an omp parallel. */ |
338 | |
339 | static inline bool |
340 | is_parallel_ctx (omp_context *ctx) |
341 | { |
342 | return gimple_code (ctx->stmt) == GIMPLE_OMP_PARALLEL; |
343 | } |
344 | |
345 | |
346 | /* Return true if CTX is for an omp task. */ |
347 | |
348 | static inline bool |
349 | is_task_ctx (omp_context *ctx) |
350 | { |
351 | return gimple_code (ctx->stmt) == GIMPLE_OMP_TASK; |
352 | } |
353 | |
354 | |
355 | /* Return true if CTX is for an omp taskloop. */ |
356 | |
357 | static inline bool |
358 | is_taskloop_ctx (omp_context *ctx) |
359 | { |
360 | return gimple_code (ctx->stmt) == GIMPLE_OMP_FOR |
361 | && gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_KIND_TASKLOOP; |
362 | } |
363 | |
364 | |
365 | /* Return true if CTX is for a host omp teams. */ |
366 | |
367 | static inline bool |
368 | is_host_teams_ctx (omp_context *ctx) |
369 | { |
370 | return gimple_code (ctx->stmt) == GIMPLE_OMP_TEAMS |
371 | && gimple_omp_teams_host (as_a <gomp_teams *> (ctx->stmt)); |
372 | } |
373 | |
374 | /* Return true if CTX is for an omp parallel or omp task or host omp teams |
375 | (the last one is strictly not a task region in OpenMP speak, but we |
376 | need to treat it similarly). */ |
377 | |
378 | static inline bool |
379 | is_taskreg_ctx (omp_context *ctx) |
380 | { |
381 | return is_parallel_ctx (ctx) || is_task_ctx (ctx) || is_host_teams_ctx (ctx); |
382 | } |
383 | |
384 | /* Return true if EXPR is variable sized. */ |
385 | |
386 | static inline bool |
387 | is_variable_sized (const_tree expr) |
388 | { |
389 | return !TREE_CONSTANT (TYPE_SIZE_UNIT (TREE_TYPE (expr)))((non_type_check ((((tree_class_check ((((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 389, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 389, __FUNCTION__))->type_common.size_unit)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 389, __FUNCTION__))->base.constant_flag); |
390 | } |
391 | |
392 | /* Lookup variables. The "maybe" form |
393 | allows for the variable form to not have been entered, otherwise we |
394 | assert that the variable must have been entered. */ |
395 | |
396 | static inline tree |
397 | lookup_decl (tree var, omp_context *ctx) |
398 | { |
399 | tree *n = ctx->cb.decl_map->get (var); |
400 | return *n; |
401 | } |
402 | |
403 | static inline tree |
404 | maybe_lookup_decl (const_tree var, omp_context *ctx) |
405 | { |
406 | tree *n = ctx->cb.decl_map->get (const_cast<tree> (var)); |
407 | return n ? *n : NULL_TREE(tree) nullptr; |
408 | } |
409 | |
410 | static inline tree |
411 | lookup_field (tree var, omp_context *ctx) |
412 | { |
413 | splay_tree_node n; |
414 | n = splay_tree_lookup (ctx->field_map, (splay_tree_key) var); |
415 | return (tree) n->value; |
416 | } |
417 | |
418 | static inline tree |
419 | lookup_sfield (splay_tree_key key, omp_context *ctx) |
420 | { |
421 | splay_tree_node n; |
422 | n = splay_tree_lookup (ctx->sfield_map |
423 | ? ctx->sfield_map : ctx->field_map, key); |
424 | return (tree) n->value; |
425 | } |
426 | |
427 | static inline tree |
428 | lookup_sfield (tree var, omp_context *ctx) |
429 | { |
430 | return lookup_sfield ((splay_tree_key) var, ctx); |
431 | } |
432 | |
433 | static inline tree |
434 | maybe_lookup_field (splay_tree_key key, omp_context *ctx) |
435 | { |
436 | splay_tree_node n; |
437 | n = splay_tree_lookup (ctx->field_map, key); |
438 | return n ? (tree) n->value : NULL_TREE(tree) nullptr; |
439 | } |
440 | |
441 | static inline tree |
442 | maybe_lookup_field (tree var, omp_context *ctx) |
443 | { |
444 | return maybe_lookup_field ((splay_tree_key) var, ctx); |
445 | } |
446 | |
447 | /* Return true if DECL should be copied by pointer. SHARED_CTX is |
448 | the parallel context if DECL is to be shared. */ |
449 | |
450 | static bool |
451 | use_pointer_for_field (tree decl, omp_context *shared_ctx) |
452 | { |
453 | if (AGGREGATE_TYPE_P (TREE_TYPE (decl))(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 453, __FUNCTION__))->typed.type))->base.code) == ARRAY_TYPE || (((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 453, __FUNCTION__))->typed.type))->base.code) == RECORD_TYPE || ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 453, __FUNCTION__))->typed.type))->base.code) == UNION_TYPE || ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 453, __FUNCTION__))->typed.type))->base.code) == QUAL_UNION_TYPE )) |
454 | || TYPE_ATOMIC (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 454, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 454, __FUNCTION__))->base.u.bits.atomic_flag)) |
455 | return true; |
456 | |
457 | /* We can only use copy-in/copy-out semantics for shared variables |
458 | when we know the value is not accessible from an outer scope. */ |
459 | if (shared_ctx) |
460 | { |
461 | gcc_assert (!is_gimple_omp_oacc (shared_ctx->stmt))((void)(!(!is_gimple_omp_oacc (shared_ctx->stmt)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 461, __FUNCTION__), 0 : 0)); |
462 | |
463 | /* ??? Trivially accessible from anywhere. But why would we even |
464 | be passing an address in this case? Should we simply assert |
465 | this to be false, or should we have a cleanup pass that removes |
466 | these from the list of mappings? */ |
467 | if (is_global_var (maybe_lookup_decl_in_outer_ctx (decl, shared_ctx))) |
468 | return true; |
469 | |
470 | /* For variables with DECL_HAS_VALUE_EXPR_P set, we cannot tell |
471 | without analyzing the expression whether or not its location |
472 | is accessible to anyone else. In the case of nested parallel |
473 | regions it certainly may be. */ |
474 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != RESULT_DECL && DECL_HAS_VALUE_EXPR_P (decl)((tree_check3 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 474, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL))) ->decl_common.decl_flag_2)) |
475 | return true; |
476 | |
477 | /* Do not use copy-in/copy-out for variables that have their |
478 | address taken. */ |
479 | if (is_global_var (decl)) |
480 | { |
481 | /* For file scope vars, track whether we've seen them as |
482 | non-addressable initially and in that case, keep the same |
483 | answer for the duration of the pass, even when they are made |
484 | addressable later on e.g. through reduction expansion. Global |
485 | variables which weren't addressable before the pass will not |
486 | have their privatized copies address taken. See PR91216. */ |
487 | if (!TREE_ADDRESSABLE (decl)((decl)->base.addressable_flag)) |
488 | { |
489 | if (!global_nonaddressable_vars) |
490 | global_nonaddressable_vars = BITMAP_ALLOCbitmap_alloc (NULLnullptr); |
491 | bitmap_set_bit (global_nonaddressable_vars, DECL_UID (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 491, __FUNCTION__))->decl_minimal.uid)); |
492 | } |
493 | else if (!global_nonaddressable_vars |
494 | || !bitmap_bit_p (global_nonaddressable_vars, |
495 | DECL_UID (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 495, __FUNCTION__))->decl_minimal.uid))) |
496 | return true; |
497 | } |
498 | else if (TREE_ADDRESSABLE (decl)((decl)->base.addressable_flag)) |
499 | return true; |
500 | |
501 | /* lower_send_shared_vars only uses copy-in, but not copy-out |
502 | for these. */ |
503 | if (TREE_READONLY (decl)((non_type_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 503, __FUNCTION__))->base.readonly_flag) |
504 | || ((TREE_CODE (decl)((enum tree_code) (decl)->base.code) == RESULT_DECL |
505 | || TREE_CODE (decl)((enum tree_code) (decl)->base.code) == PARM_DECL) |
506 | && DECL_BY_REFERENCE (decl)((tree_check3 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 506, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL))) ->decl_common.decl_by_reference_flag))) |
507 | return false; |
508 | |
509 | /* Disallow copy-in/out in nested parallel if |
510 | decl is shared in outer parallel, otherwise |
511 | each thread could store the shared variable |
512 | in its own copy-in location, making the |
513 | variable no longer really shared. */ |
514 | if (shared_ctx->is_nested) |
515 | { |
516 | omp_context *up; |
517 | |
518 | for (up = shared_ctx->outer; up; up = up->outer) |
519 | if ((is_taskreg_ctx (up) |
520 | || (gimple_code (up->stmt) == GIMPLE_OMP_TARGET |
521 | && is_gimple_omp_offloaded (up->stmt))) |
522 | && maybe_lookup_decl (decl, up)) |
523 | break; |
524 | |
525 | if (up) |
526 | { |
527 | tree c; |
528 | |
529 | if (gimple_code (up->stmt) == GIMPLE_OMP_TARGET) |
530 | { |
531 | for (c = gimple_omp_target_clauses (up->stmt); |
532 | c; c = OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 532, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 532, __FUNCTION__))->common.chain)) |
533 | if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 533, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_MAP |
534 | && OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 534, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 534, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 534, __FUNCTION__))) == decl) |
535 | break; |
536 | } |
537 | else |
538 | for (c = gimple_omp_taskreg_clauses (up->stmt); |
539 | c; c = OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 539, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 539, __FUNCTION__))->common.chain)) |
540 | if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 540, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_SHARED |
541 | && OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 541, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 541, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 541, __FUNCTION__))) == decl) |
542 | break; |
543 | |
544 | if (c) |
545 | goto maybe_mark_addressable_and_ret; |
546 | } |
547 | } |
548 | |
549 | /* For tasks avoid using copy-in/out. As tasks can be |
550 | deferred or executed in different thread, when GOMP_task |
551 | returns, the task hasn't necessarily terminated. */ |
552 | if (is_task_ctx (shared_ctx)) |
553 | { |
554 | tree outer; |
555 | maybe_mark_addressable_and_ret: |
556 | outer = maybe_lookup_decl_in_outer_ctx (decl, shared_ctx); |
557 | if (is_gimple_reg (outer) && !omp_member_access_dummy_var (outer)) |
558 | { |
559 | /* Taking address of OUTER in lower_send_shared_vars |
560 | might need regimplification of everything that uses the |
561 | variable. */ |
562 | if (!task_shared_vars) |
563 | task_shared_vars = BITMAP_ALLOCbitmap_alloc (NULLnullptr); |
564 | bitmap_set_bit (task_shared_vars, DECL_UID (outer)((contains_struct_check ((outer), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 564, __FUNCTION__))->decl_minimal.uid)); |
565 | TREE_ADDRESSABLE (outer)((outer)->base.addressable_flag) = 1; |
566 | } |
567 | return true; |
568 | } |
569 | } |
570 | |
571 | return false; |
572 | } |
573 | |
574 | /* Construct a new automatic decl similar to VAR. */ |
575 | |
576 | static tree |
577 | omp_copy_decl_2 (tree var, tree name, tree type, omp_context *ctx) |
578 | { |
579 | tree copy = copy_var_decl (var, name, type); |
580 | |
581 | DECL_CONTEXT (copy)((contains_struct_check ((copy), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 581, __FUNCTION__))->decl_minimal.context) = current_function_decl; |
582 | DECL_CHAIN (copy)(((contains_struct_check (((contains_struct_check ((copy), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 582, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 582, __FUNCTION__))->common.chain)) = ctx->block_vars; |
583 | /* If VAR is listed in task_shared_vars, it means it wasn't |
584 | originally addressable and is just because task needs to take |
585 | it's address. But we don't need to take address of privatizations |
586 | from that var. */ |
587 | if (TREE_ADDRESSABLE (var)((var)->base.addressable_flag) |
588 | && ((task_shared_vars |
589 | && bitmap_bit_p (task_shared_vars, DECL_UID (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 589, __FUNCTION__))->decl_minimal.uid))) |
590 | || (global_nonaddressable_vars |
591 | && bitmap_bit_p (global_nonaddressable_vars, DECL_UID (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 591, __FUNCTION__))->decl_minimal.uid))))) |
592 | TREE_ADDRESSABLE (copy)((copy)->base.addressable_flag) = 0; |
593 | ctx->block_vars = copy; |
594 | |
595 | return copy; |
596 | } |
597 | |
598 | static tree |
599 | omp_copy_decl_1 (tree var, omp_context *ctx) |
600 | { |
601 | return omp_copy_decl_2 (var, DECL_NAME (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 601, __FUNCTION__))->decl_minimal.name), TREE_TYPE (var)((contains_struct_check ((var), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 601, __FUNCTION__))->typed.type), ctx); |
602 | } |
603 | |
604 | /* Build COMPONENT_REF and set TREE_THIS_VOLATILE and TREE_READONLY on it |
605 | as appropriate. */ |
606 | static tree |
607 | omp_build_component_ref (tree obj, tree field) |
608 | { |
609 | tree ret = build3 (COMPONENT_REF, TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 609, __FUNCTION__))->typed.type), obj, field, NULLnullptr); |
610 | if (TREE_THIS_VOLATILE (field)((field)->base.volatile_flag)) |
611 | TREE_THIS_VOLATILE (ret)((ret)->base.volatile_flag) |= 1; |
612 | if (TREE_READONLY (field)((non_type_check ((field), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 612, __FUNCTION__))->base.readonly_flag)) |
613 | TREE_READONLY (ret)((non_type_check ((ret), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 613, __FUNCTION__))->base.readonly_flag) |= 1; |
614 | return ret; |
615 | } |
616 | |
617 | /* Build tree nodes to access the field for VAR on the receiver side. */ |
618 | |
619 | static tree |
620 | build_receiver_ref (tree var, bool by_ref, omp_context *ctx) |
621 | { |
622 | tree x, field = lookup_field (var, ctx); |
623 | |
624 | /* If the receiver record type was remapped in the child function, |
625 | remap the field into the new record type. */ |
626 | x = maybe_lookup_field (field, ctx); |
627 | if (x != NULLnullptr) |
628 | field = x; |
629 | |
630 | x = build_simple_mem_ref (ctx->receiver_decl)build_simple_mem_ref_loc (((location_t) 0), ctx->receiver_decl ); |
631 | TREE_THIS_NOTRAP (x)((tree_check5 ((x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 631, __FUNCTION__, (INDIRECT_REF), (MEM_REF), (TARGET_MEM_REF ), (ARRAY_REF), (ARRAY_RANGE_REF)))->base.nothrow_flag) = 1; |
632 | x = omp_build_component_ref (x, field); |
633 | if (by_ref) |
634 | { |
635 | x = build_simple_mem_ref (x)build_simple_mem_ref_loc (((location_t) 0), x); |
636 | TREE_THIS_NOTRAP (x)((tree_check5 ((x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 636, __FUNCTION__, (INDIRECT_REF), (MEM_REF), (TARGET_MEM_REF ), (ARRAY_REF), (ARRAY_RANGE_REF)))->base.nothrow_flag) = 1; |
637 | } |
638 | |
639 | return x; |
640 | } |
641 | |
642 | /* Build tree nodes to access VAR in the scope outer to CTX. In the case |
643 | of a parallel, this is a component reference; for workshare constructs |
644 | this is some variable. */ |
645 | |
646 | static tree |
647 | build_outer_var_ref (tree var, omp_context *ctx, |
648 | enum omp_clause_code code = OMP_CLAUSE_ERROR) |
649 | { |
650 | tree x; |
651 | omp_context *outer = ctx->outer; |
652 | while (outer && gimple_code (outer->stmt) == GIMPLE_OMP_TASKGROUP) |
653 | outer = outer->outer; |
654 | |
655 | if (is_global_var (maybe_lookup_decl_in_outer_ctx (var, ctx))) |
656 | x = var; |
657 | else if (is_variable_sized (var)) |
658 | { |
659 | x = TREE_OPERAND (DECL_VALUE_EXPR (var), 0)(*((const_cast<tree*> (tree_operand_check (((decl_value_expr_lookup ((contains_struct_check ((var), (TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 659, __FUNCTION__))))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 659, __FUNCTION__))))); |
660 | x = build_outer_var_ref (x, ctx, code); |
661 | x = build_simple_mem_ref (x)build_simple_mem_ref_loc (((location_t) 0), x); |
662 | } |
663 | else if (is_taskreg_ctx (ctx)) |
664 | { |
665 | bool by_ref = use_pointer_for_field (var, NULLnullptr); |
666 | x = build_receiver_ref (var, by_ref, ctx); |
667 | } |
668 | else if ((gimple_code (ctx->stmt) == GIMPLE_OMP_FOR |
669 | && gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_KIND_SIMD) |
670 | || ctx->loop_p |
671 | || (code == OMP_CLAUSE_PRIVATE |
672 | && (gimple_code (ctx->stmt) == GIMPLE_OMP_FOR |
673 | || gimple_code (ctx->stmt) == GIMPLE_OMP_SECTIONS |
674 | || gimple_code (ctx->stmt) == GIMPLE_OMP_SINGLE))) |
675 | { |
676 | /* #pragma omp simd isn't a worksharing construct, and can reference |
677 | even private vars in its linear etc. clauses. |
678 | Similarly for OMP_CLAUSE_PRIVATE with outer ref, that can refer |
679 | to private vars in all worksharing constructs. */ |
680 | x = NULL_TREE(tree) nullptr; |
681 | if (outer && is_taskreg_ctx (outer)) |
682 | x = lookup_decl (var, outer); |
683 | else if (outer) |
684 | x = maybe_lookup_decl_in_outer_ctx (var, ctx); |
685 | if (x == NULL_TREE(tree) nullptr) |
686 | x = var; |
687 | } |
688 | else if (code == OMP_CLAUSE_LASTPRIVATE && is_taskloop_ctx (ctx)) |
689 | { |
690 | gcc_assert (outer)((void)(!(outer) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 690, __FUNCTION__), 0 : 0)); |
691 | splay_tree_node n |
692 | = splay_tree_lookup (outer->field_map, |
693 | (splay_tree_key) &DECL_UID (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 693, __FUNCTION__))->decl_minimal.uid)); |
694 | if (n == NULLnullptr) |
695 | { |
696 | if (is_global_var (maybe_lookup_decl_in_outer_ctx (var, outer))) |
697 | x = var; |
698 | else |
699 | x = lookup_decl (var, outer); |
700 | } |
701 | else |
702 | { |
703 | tree field = (tree) n->value; |
704 | /* If the receiver record type was remapped in the child function, |
705 | remap the field into the new record type. */ |
706 | x = maybe_lookup_field (field, outer); |
707 | if (x != NULLnullptr) |
708 | field = x; |
709 | |
710 | x = build_simple_mem_ref (outer->receiver_decl)build_simple_mem_ref_loc (((location_t) 0), outer->receiver_decl ); |
711 | x = omp_build_component_ref (x, field); |
712 | if (use_pointer_for_field (var, outer)) |
713 | x = build_simple_mem_ref (x)build_simple_mem_ref_loc (((location_t) 0), x); |
714 | } |
715 | } |
716 | else if (outer) |
717 | x = lookup_decl (var, outer); |
718 | else if (omp_is_reference (var)) |
719 | /* This can happen with orphaned constructs. If var is reference, it is |
720 | possible it is shared and as such valid. */ |
721 | x = var; |
722 | else if (omp_member_access_dummy_var (var)) |
723 | x = var; |
724 | else |
725 | gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 725, __FUNCTION__)); |
726 | |
727 | if (x == var) |
728 | { |
729 | tree t = omp_member_access_dummy_var (var); |
730 | if (t) |
731 | { |
732 | x = DECL_VALUE_EXPR (var)(decl_value_expr_lookup ((contains_struct_check ((var), (TS_DECL_WRTL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 732, __FUNCTION__)))); |
733 | tree o = maybe_lookup_decl_in_outer_ctx (t, ctx); |
734 | if (o != t) |
735 | x = unshare_and_remap (x, t, o); |
736 | else |
737 | x = unshare_expr (x); |
738 | } |
739 | } |
740 | |
741 | if (omp_is_reference (var)) |
742 | x = build_simple_mem_ref (x)build_simple_mem_ref_loc (((location_t) 0), x); |
743 | |
744 | return x; |
745 | } |
746 | |
747 | /* Build tree nodes to access the field for VAR on the sender side. */ |
748 | |
749 | static tree |
750 | build_sender_ref (splay_tree_key key, omp_context *ctx) |
751 | { |
752 | tree field = lookup_sfield (key, ctx); |
753 | return omp_build_component_ref (ctx->sender_decl, field); |
754 | } |
755 | |
756 | static tree |
757 | build_sender_ref (tree var, omp_context *ctx) |
758 | { |
759 | return build_sender_ref ((splay_tree_key) var, ctx); |
760 | } |
761 | |
762 | /* Add a new field for VAR inside the structure CTX->SENDER_DECL. If |
763 | BASE_POINTERS_RESTRICT, declare the field with restrict. */ |
764 | |
765 | static void |
766 | install_var_field (tree var, bool by_ref, int mask, omp_context *ctx) |
767 | { |
768 | tree field, type, sfield = NULL_TREE(tree) nullptr; |
769 | splay_tree_key key = (splay_tree_key) var; |
770 | |
771 | if ((mask & 16) != 0) |
772 | { |
773 | key = (splay_tree_key) &DECL_NAME (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 773, __FUNCTION__))->decl_minimal.name); |
774 | gcc_checking_assert (key != (splay_tree_key) var)((void)(!(key != (splay_tree_key) var) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 774, __FUNCTION__), 0 : 0)); |
775 | } |
776 | if ((mask & 8) != 0) |
777 | { |
778 | key = (splay_tree_key) &DECL_UID (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 778, __FUNCTION__))->decl_minimal.uid); |
779 | gcc_checking_assert (key != (splay_tree_key) var)((void)(!(key != (splay_tree_key) var) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 779, __FUNCTION__), 0 : 0)); |
780 | } |
781 | gcc_assert ((mask & 1) == 0((void)(!((mask & 1) == 0 || !splay_tree_lookup (ctx-> field_map, key)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 782, __FUNCTION__), 0 : 0)) |
782 | || !splay_tree_lookup (ctx->field_map, key))((void)(!((mask & 1) == 0 || !splay_tree_lookup (ctx-> field_map, key)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 782, __FUNCTION__), 0 : 0)); |
783 | gcc_assert ((mask & 2) == 0 || !ctx->sfield_map((void)(!((mask & 2) == 0 || !ctx->sfield_map || !splay_tree_lookup (ctx->sfield_map, key)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 784, __FUNCTION__), 0 : 0)) |
784 | || !splay_tree_lookup (ctx->sfield_map, key))((void)(!((mask & 2) == 0 || !ctx->sfield_map || !splay_tree_lookup (ctx->sfield_map, key)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 784, __FUNCTION__), 0 : 0)); |
785 | gcc_assert ((mask & 3) == 3((void)(!((mask & 3) == 3 || !is_gimple_omp_oacc (ctx-> stmt)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 786, __FUNCTION__), 0 : 0)) |
786 | || !is_gimple_omp_oacc (ctx->stmt))((void)(!((mask & 3) == 3 || !is_gimple_omp_oacc (ctx-> stmt)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 786, __FUNCTION__), 0 : 0)); |
787 | |
788 | type = TREE_TYPE (var)((contains_struct_check ((var), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 788, __FUNCTION__))->typed.type); |
789 | if ((mask & 16) != 0) |
790 | type = lang_hooks.decls.omp_array_data (var, true); |
791 | |
792 | /* Prevent redeclaring the var in the split-off function with a restrict |
793 | pointer type. Note that we only clear type itself, restrict qualifiers in |
794 | the pointed-to type will be ignored by points-to analysis. */ |
795 | if (POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || ( (enum tree_code) (type)->base.code) == REFERENCE_TYPE) |
796 | && TYPE_RESTRICT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 796, __FUNCTION__))->type_common.restrict_flag)) |
797 | type = build_qualified_type (type, TYPE_QUALS (type)((int) ((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 797, __FUNCTION__))->base.readonly_flag) * TYPE_QUAL_CONST ) | (((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 797, __FUNCTION__))->base.volatile_flag) * TYPE_QUAL_VOLATILE ) | (((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 797, __FUNCTION__))->base.u.bits.atomic_flag) * TYPE_QUAL_ATOMIC ) | (((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 797, __FUNCTION__))->type_common.restrict_flag) * TYPE_QUAL_RESTRICT ) | (((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 797, __FUNCTION__))->base.u.bits.address_space) & 0xFF ) << 8)))) & ~TYPE_QUAL_RESTRICT); |
798 | |
799 | if (mask & 4) |
800 | { |
801 | gcc_assert (TREE_CODE (type) == ARRAY_TYPE)((void)(!(((enum tree_code) (type)->base.code) == ARRAY_TYPE ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 801, __FUNCTION__), 0 : 0)); |
802 | type = build_pointer_type (build_pointer_type (type)); |
803 | } |
804 | else if (by_ref) |
805 | type = build_pointer_type (type); |
806 | else if ((mask & (32 | 3)) == 1 && omp_is_reference (var)) |
807 | type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 807, __FUNCTION__))->typed.type); |
808 | |
809 | field = build_decl (DECL_SOURCE_LOCATION (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 809, __FUNCTION__))->decl_minimal.locus), |
810 | FIELD_DECL, DECL_NAME (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 810, __FUNCTION__))->decl_minimal.name), type); |
811 | |
812 | /* Remember what variable this field was created for. This does have a |
813 | side effect of making dwarf2out ignore this member, so for helpful |
814 | debugging we clear it later in delete_omp_context. */ |
815 | DECL_ABSTRACT_ORIGIN (field)((contains_struct_check ((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 815, __FUNCTION__))->decl_common.abstract_origin) = var; |
816 | if ((mask & 16) == 0 && type == TREE_TYPE (var)((contains_struct_check ((var), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 816, __FUNCTION__))->typed.type)) |
817 | { |
818 | SET_DECL_ALIGN (field, DECL_ALIGN (var))(((contains_struct_check ((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 818, __FUNCTION__))->decl_common.align) = ffs_hwi ((((contains_struct_check ((var), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 818, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((var), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 818, __FUNCTION__))->decl_common.align) - 1) : 0))); |
819 | DECL_USER_ALIGN (field)((contains_struct_check ((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 819, __FUNCTION__))->base.u.bits.user_align) = DECL_USER_ALIGN (var)((contains_struct_check ((var), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 819, __FUNCTION__))->base.u.bits.user_align); |
820 | TREE_THIS_VOLATILE (field)((field)->base.volatile_flag) = TREE_THIS_VOLATILE (var)((var)->base.volatile_flag); |
821 | } |
822 | else |
823 | SET_DECL_ALIGN (field, TYPE_ALIGN (type))(((contains_struct_check ((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 823, __FUNCTION__))->decl_common.align) = ffs_hwi (((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 823, __FUNCTION__))->type_common.align ? ((unsigned)1) << ((type)->type_common.align - 1) : 0))); |
824 | |
825 | if ((mask & 3) == 3) |
826 | { |
827 | insert_field_into_struct (ctx->record_type, field); |
828 | if (ctx->srecord_type) |
829 | { |
830 | sfield = build_decl (DECL_SOURCE_LOCATION (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 830, __FUNCTION__))->decl_minimal.locus), |
831 | FIELD_DECL, DECL_NAME (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 831, __FUNCTION__))->decl_minimal.name), type); |
832 | DECL_ABSTRACT_ORIGIN (sfield)((contains_struct_check ((sfield), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 832, __FUNCTION__))->decl_common.abstract_origin) = var; |
833 | SET_DECL_ALIGN (sfield, DECL_ALIGN (field))(((contains_struct_check ((sfield), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 833, __FUNCTION__))->decl_common.align) = ffs_hwi ((((contains_struct_check ((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 833, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 833, __FUNCTION__))->decl_common.align) - 1) : 0))); |
834 | DECL_USER_ALIGN (sfield)((contains_struct_check ((sfield), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 834, __FUNCTION__))->base.u.bits.user_align) = DECL_USER_ALIGN (field)((contains_struct_check ((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 834, __FUNCTION__))->base.u.bits.user_align); |
835 | TREE_THIS_VOLATILE (sfield)((sfield)->base.volatile_flag) = TREE_THIS_VOLATILE (field)((field)->base.volatile_flag); |
836 | insert_field_into_struct (ctx->srecord_type, sfield); |
837 | } |
838 | } |
839 | else |
840 | { |
841 | if (ctx->srecord_type == NULL_TREE(tree) nullptr) |
842 | { |
843 | tree t; |
844 | |
845 | ctx->srecord_type = lang_hooks.types.make_type (RECORD_TYPE); |
846 | ctx->sfield_map = splay_tree_new (splay_tree_compare_pointers, 0, 0); |
847 | for (t = TYPE_FIELDS (ctx->record_type)((tree_check3 ((ctx->record_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 847, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); t ; t = TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 847, __FUNCTION__))->common.chain)) |
848 | { |
849 | sfield = build_decl (DECL_SOURCE_LOCATION (t)((contains_struct_check ((t), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 849, __FUNCTION__))->decl_minimal.locus), |
850 | FIELD_DECL, DECL_NAME (t)((contains_struct_check ((t), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 850, __FUNCTION__))->decl_minimal.name), TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 850, __FUNCTION__))->typed.type)); |
851 | DECL_ABSTRACT_ORIGIN (sfield)((contains_struct_check ((sfield), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 851, __FUNCTION__))->decl_common.abstract_origin) = DECL_ABSTRACT_ORIGIN (t)((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 851, __FUNCTION__))->decl_common.abstract_origin); |
852 | insert_field_into_struct (ctx->srecord_type, sfield); |
853 | splay_tree_insert (ctx->sfield_map, |
854 | (splay_tree_key) DECL_ABSTRACT_ORIGIN (t)((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 854, __FUNCTION__))->decl_common.abstract_origin), |
855 | (splay_tree_value) sfield); |
856 | } |
857 | } |
858 | sfield = field; |
859 | insert_field_into_struct ((mask & 1) ? ctx->record_type |
860 | : ctx->srecord_type, field); |
861 | } |
862 | |
863 | if (mask & 1) |
864 | splay_tree_insert (ctx->field_map, key, (splay_tree_value) field); |
865 | if ((mask & 2) && ctx->sfield_map) |
866 | splay_tree_insert (ctx->sfield_map, key, (splay_tree_value) sfield); |
867 | } |
868 | |
869 | static tree |
870 | install_var_local (tree var, omp_context *ctx) |
871 | { |
872 | tree new_var = omp_copy_decl_1 (var, ctx); |
873 | insert_decl_map (&ctx->cb, var, new_var); |
874 | return new_var; |
875 | } |
876 | |
877 | /* Adjust the replacement for DECL in CTX for the new context. This means |
878 | copying the DECL_VALUE_EXPR, and fixing up the type. */ |
879 | |
880 | static void |
881 | fixup_remapped_decl (tree decl, omp_context *ctx, bool private_debug) |
882 | { |
883 | tree new_decl, size; |
884 | |
885 | new_decl = lookup_decl (decl, ctx); |
886 | |
887 | TREE_TYPE (new_decl)((contains_struct_check ((new_decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 887, __FUNCTION__))->typed.type) = remap_type (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 887, __FUNCTION__))->typed.type), &ctx->cb); |
888 | |
889 | if ((!TREE_CONSTANT (DECL_SIZE (new_decl))((non_type_check ((((contains_struct_check ((new_decl), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 889, __FUNCTION__))->decl_common.size)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 889, __FUNCTION__))->base.constant_flag) || private_debug) |
890 | && DECL_HAS_VALUE_EXPR_P (decl)((tree_check3 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 890, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL))) ->decl_common.decl_flag_2)) |
891 | { |
892 | tree ve = DECL_VALUE_EXPR (decl)(decl_value_expr_lookup ((contains_struct_check ((decl), (TS_DECL_WRTL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 892, __FUNCTION__)))); |
893 | walk_tree (&ve, copy_tree_body_r, &ctx->cb, NULL)walk_tree_1 (&ve, copy_tree_body_r, &ctx->cb, nullptr , nullptr); |
894 | SET_DECL_VALUE_EXPR (new_decl, ve)(decl_value_expr_insert ((contains_struct_check ((new_decl), ( TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 894, __FUNCTION__)), ve)); |
895 | DECL_HAS_VALUE_EXPR_P (new_decl)((tree_check3 ((new_decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 895, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL))) ->decl_common.decl_flag_2) = 1; |
896 | } |
897 | |
898 | if (!TREE_CONSTANT (DECL_SIZE (new_decl))((non_type_check ((((contains_struct_check ((new_decl), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 898, __FUNCTION__))->decl_common.size)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 898, __FUNCTION__))->base.constant_flag)) |
899 | { |
900 | size = remap_decl (DECL_SIZE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 900, __FUNCTION__))->decl_common.size), &ctx->cb); |
901 | if (size == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
902 | size = TYPE_SIZE (TREE_TYPE (new_decl))((tree_class_check ((((contains_struct_check ((new_decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 902, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 902, __FUNCTION__))->type_common.size); |
903 | DECL_SIZE (new_decl)((contains_struct_check ((new_decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 903, __FUNCTION__))->decl_common.size) = size; |
904 | |
905 | size = remap_decl (DECL_SIZE_UNIT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 905, __FUNCTION__))->decl_common.size_unit), &ctx->cb); |
906 | if (size == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
907 | size = TYPE_SIZE_UNIT (TREE_TYPE (new_decl))((tree_class_check ((((contains_struct_check ((new_decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 907, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 907, __FUNCTION__))->type_common.size_unit); |
908 | DECL_SIZE_UNIT (new_decl)((contains_struct_check ((new_decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 908, __FUNCTION__))->decl_common.size_unit) = size; |
909 | } |
910 | } |
911 | |
912 | /* The callback for remap_decl. Search all containing contexts for a |
913 | mapping of the variable; this avoids having to duplicate the splay |
914 | tree ahead of time. We know a mapping doesn't already exist in the |
915 | given context. Create new mappings to implement default semantics. */ |
916 | |
917 | static tree |
918 | omp_copy_decl (tree var, copy_body_data *cb) |
919 | { |
920 | omp_context *ctx = (omp_context *) cb; |
921 | tree new_var; |
922 | |
923 | if (TREE_CODE (var)((enum tree_code) (var)->base.code) == LABEL_DECL) |
924 | { |
925 | if (FORCED_LABEL (var)((tree_check ((var), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 925, __FUNCTION__, (LABEL_DECL)))->base.side_effects_flag ) || DECL_NONLOCAL (var)((contains_struct_check ((var), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 925, __FUNCTION__))->decl_common.nonlocal_flag)) |
926 | return var; |
927 | new_var = create_artificial_label (DECL_SOURCE_LOCATION (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 927, __FUNCTION__))->decl_minimal.locus)); |
928 | DECL_CONTEXT (new_var)((contains_struct_check ((new_var), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 928, __FUNCTION__))->decl_minimal.context) = current_function_decl; |
929 | insert_decl_map (&ctx->cb, var, new_var); |
930 | return new_var; |
931 | } |
932 | |
933 | while (!is_taskreg_ctx (ctx)) |
934 | { |
935 | ctx = ctx->outer; |
936 | if (ctx == NULLnullptr) |
937 | return var; |
938 | new_var = maybe_lookup_decl (var, ctx); |
939 | if (new_var) |
940 | return new_var; |
941 | } |
942 | |
943 | if (is_global_var (var) || decl_function_context (var) != ctx->cb.src_fn) |
944 | return var; |
945 | |
946 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
947 | } |
948 | |
949 | /* Create a new context, with OUTER_CTX being the surrounding context. */ |
950 | |
951 | static omp_context * |
952 | new_omp_context (gimple *stmt, omp_context *outer_ctx) |
953 | { |
954 | omp_context *ctx = XCNEW (omp_context)((omp_context *) xcalloc (1, sizeof (omp_context))); |
955 | |
956 | splay_tree_insert (all_contexts, (splay_tree_key) stmt, |
957 | (splay_tree_value) ctx); |
958 | ctx->stmt = stmt; |
959 | |
960 | if (outer_ctx) |
961 | { |
962 | ctx->outer = outer_ctx; |
963 | ctx->cb = outer_ctx->cb; |
964 | ctx->cb.block = NULLnullptr; |
965 | ctx->depth = outer_ctx->depth + 1; |
966 | } |
967 | else |
968 | { |
969 | ctx->cb.src_fn = current_function_decl; |
970 | ctx->cb.dst_fn = current_function_decl; |
971 | ctx->cb.src_node = cgraph_node::get (current_function_decl); |
972 | gcc_checking_assert (ctx->cb.src_node)((void)(!(ctx->cb.src_node) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 972, __FUNCTION__), 0 : 0)); |
973 | ctx->cb.dst_node = ctx->cb.src_node; |
974 | ctx->cb.src_cfun = cfun(cfun + 0); |
975 | ctx->cb.copy_decl = omp_copy_decl; |
976 | ctx->cb.eh_lp_nr = 0; |
977 | ctx->cb.transform_call_graph_edges = CB_CGE_MOVE; |
978 | ctx->cb.adjust_array_error_bounds = true; |
979 | ctx->cb.dont_remap_vla_if_no_change = true; |
980 | ctx->depth = 1; |
981 | } |
982 | |
983 | ctx->cb.decl_map = new hash_map<tree, tree>; |
984 | |
985 | return ctx; |
986 | } |
987 | |
988 | static gimple_seq maybe_catch_exception (gimple_seq); |
989 | |
990 | /* Finalize task copyfn. */ |
991 | |
992 | static void |
993 | finalize_task_copyfn (gomp_task *task_stmt) |
994 | { |
995 | struct function *child_cfun; |
996 | tree child_fn; |
997 | gimple_seq seq = NULLnullptr, new_seq; |
998 | gbind *bind; |
999 | |
1000 | child_fn = gimple_omp_task_copy_fn (task_stmt); |
1001 | if (child_fn == NULL_TREE(tree) nullptr) |
1002 | return; |
1003 | |
1004 | child_cfun = DECL_STRUCT_FUNCTION (child_fn)((tree_check ((child_fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1004, __FUNCTION__, (FUNCTION_DECL)))->function_decl.f); |
1005 | DECL_STRUCT_FUNCTION (child_fn)((tree_check ((child_fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1005, __FUNCTION__, (FUNCTION_DECL)))->function_decl.f)->curr_properties = cfun(cfun + 0)->curr_properties; |
1006 | |
1007 | push_cfun (child_cfun); |
1008 | bind = gimplify_body (child_fn, false); |
1009 | gimple_seq_add_stmt (&seq, bind); |
1010 | new_seq = maybe_catch_exception (seq); |
1011 | if (new_seq != seq) |
1012 | { |
1013 | bind = gimple_build_bind (NULLnullptr, new_seq, NULLnullptr); |
1014 | seq = NULLnullptr; |
1015 | gimple_seq_add_stmt (&seq, bind); |
1016 | } |
1017 | gimple_set_body (child_fn, seq); |
1018 | pop_cfun (); |
1019 | |
1020 | /* Inform the callgraph about the new function. */ |
1021 | cgraph_node *node = cgraph_node::get_create (child_fn); |
1022 | node->parallelized_function = 1; |
1023 | cgraph_node::add_new_function (child_fn, false); |
1024 | } |
1025 | |
1026 | /* Destroy a omp_context data structures. Called through the splay tree |
1027 | value delete callback. */ |
1028 | |
1029 | static void |
1030 | delete_omp_context (splay_tree_value value) |
1031 | { |
1032 | omp_context *ctx = (omp_context *) value; |
1033 | |
1034 | delete ctx->cb.decl_map; |
1035 | |
1036 | if (ctx->field_map) |
1037 | splay_tree_delete (ctx->field_map); |
1038 | if (ctx->sfield_map) |
1039 | splay_tree_delete (ctx->sfield_map); |
1040 | |
1041 | /* We hijacked DECL_ABSTRACT_ORIGIN earlier. We need to clear it before |
1042 | it produces corrupt debug information. */ |
1043 | if (ctx->record_type) |
1044 | { |
1045 | tree t; |
1046 | for (t = TYPE_FIELDS (ctx->record_type)((tree_check3 ((ctx->record_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1046, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); t ; t = DECL_CHAIN (t)(((contains_struct_check (((contains_struct_check ((t), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1046, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1046, __FUNCTION__))->common.chain))) |
1047 | DECL_ABSTRACT_ORIGIN (t)((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1047, __FUNCTION__))->decl_common.abstract_origin) = NULLnullptr; |
1048 | } |
1049 | if (ctx->srecord_type) |
1050 | { |
1051 | tree t; |
1052 | for (t = TYPE_FIELDS (ctx->srecord_type)((tree_check3 ((ctx->srecord_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1052, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); t ; t = DECL_CHAIN (t)(((contains_struct_check (((contains_struct_check ((t), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1052, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1052, __FUNCTION__))->common.chain))) |
1053 | DECL_ABSTRACT_ORIGIN (t)((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1053, __FUNCTION__))->decl_common.abstract_origin) = NULLnullptr; |
1054 | } |
1055 | |
1056 | if (is_task_ctx (ctx)) |
1057 | finalize_task_copyfn (as_a <gomp_task *> (ctx->stmt)); |
1058 | |
1059 | if (ctx->task_reduction_map) |
1060 | { |
1061 | ctx->task_reductions.release (); |
1062 | delete ctx->task_reduction_map; |
1063 | } |
1064 | |
1065 | delete ctx->lastprivate_conditional_map; |
1066 | delete ctx->allocate_map; |
1067 | |
1068 | XDELETE (ctx)free ((void*) (ctx)); |
1069 | } |
1070 | |
1071 | /* Fix up RECEIVER_DECL with a type that has been remapped to the child |
1072 | context. */ |
1073 | |
1074 | static void |
1075 | fixup_child_record_type (omp_context *ctx) |
1076 | { |
1077 | tree f, type = ctx->record_type; |
1078 | |
1079 | if (!ctx->receiver_decl) |
1080 | return; |
1081 | /* ??? It isn't sufficient to just call remap_type here, because |
1082 | variably_modified_type_p doesn't work the way we expect for |
1083 | record types. Testing each field for whether it needs remapping |
1084 | and creating a new record by hand works, however. */ |
1085 | for (f = TYPE_FIELDS (type)((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1085, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); f ; f = DECL_CHAIN (f)(((contains_struct_check (((contains_struct_check ((f), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1085, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1085, __FUNCTION__))->common.chain))) |
1086 | if (variably_modified_type_p (TREE_TYPE (f)((contains_struct_check ((f), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1086, __FUNCTION__))->typed.type), ctx->cb.src_fn)) |
1087 | break; |
1088 | if (f) |
1089 | { |
1090 | tree name, new_fields = NULLnullptr; |
1091 | |
1092 | type = lang_hooks.types.make_type (RECORD_TYPE); |
1093 | name = DECL_NAME (TYPE_NAME (ctx->record_type))((contains_struct_check ((((tree_class_check ((ctx->record_type ), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1093, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1093, __FUNCTION__))->decl_minimal.name); |
1094 | name = build_decl (DECL_SOURCE_LOCATION (ctx->receiver_decl)((contains_struct_check ((ctx->receiver_decl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1094, __FUNCTION__))->decl_minimal.locus), |
1095 | TYPE_DECL, name, type); |
1096 | TYPE_NAME (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1096, __FUNCTION__))->type_common.name) = name; |
1097 | |
1098 | for (f = TYPE_FIELDS (ctx->record_type)((tree_check3 ((ctx->record_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1098, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); f ; f = DECL_CHAIN (f)(((contains_struct_check (((contains_struct_check ((f), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1098, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1098, __FUNCTION__))->common.chain))) |
1099 | { |
1100 | tree new_f = copy_node (f); |
1101 | DECL_CONTEXT (new_f)((contains_struct_check ((new_f), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1101, __FUNCTION__))->decl_minimal.context) = type; |
1102 | TREE_TYPE (new_f)((contains_struct_check ((new_f), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1102, __FUNCTION__))->typed.type) = remap_type (TREE_TYPE (f)((contains_struct_check ((f), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1102, __FUNCTION__))->typed.type), &ctx->cb); |
1103 | DECL_CHAIN (new_f)(((contains_struct_check (((contains_struct_check ((new_f), ( TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1103, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1103, __FUNCTION__))->common.chain)) = new_fields; |
1104 | walk_tree (&DECL_SIZE (new_f), copy_tree_body_r, &ctx->cb, NULL)walk_tree_1 (&((contains_struct_check ((new_f), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1104, __FUNCTION__))->decl_common.size), copy_tree_body_r , &ctx->cb, nullptr, nullptr); |
1105 | walk_tree (&DECL_SIZE_UNIT (new_f), copy_tree_body_r,walk_tree_1 (&((contains_struct_check ((new_f), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1105, __FUNCTION__))->decl_common.size_unit), copy_tree_body_r , &ctx->cb, nullptr, nullptr) |
1106 | &ctx->cb, NULL)walk_tree_1 (&((contains_struct_check ((new_f), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1105, __FUNCTION__))->decl_common.size_unit), copy_tree_body_r , &ctx->cb, nullptr, nullptr); |
1107 | walk_tree (&DECL_FIELD_OFFSET (new_f), copy_tree_body_r,walk_tree_1 (&((tree_check ((new_f), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1107, __FUNCTION__, (FIELD_DECL)))->field_decl.offset), copy_tree_body_r , &ctx->cb, nullptr, nullptr) |
1108 | &ctx->cb, NULL)walk_tree_1 (&((tree_check ((new_f), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1107, __FUNCTION__, (FIELD_DECL)))->field_decl.offset), copy_tree_body_r , &ctx->cb, nullptr, nullptr); |
1109 | new_fields = new_f; |
1110 | |
1111 | /* Arrange to be able to look up the receiver field |
1112 | given the sender field. */ |
1113 | splay_tree_insert (ctx->field_map, (splay_tree_key) f, |
1114 | (splay_tree_value) new_f); |
1115 | } |
1116 | TYPE_FIELDS (type)((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1116, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values) = nreverse (new_fields); |
1117 | layout_type (type); |
1118 | } |
1119 | |
1120 | /* In a target region we never modify any of the pointers in *.omp_data_i, |
1121 | so attempt to help the optimizers. */ |
1122 | if (is_gimple_omp_offloaded (ctx->stmt)) |
1123 | type = build_qualified_type (type, TYPE_QUAL_CONST); |
1124 | |
1125 | TREE_TYPE (ctx->receiver_decl)((contains_struct_check ((ctx->receiver_decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1125, __FUNCTION__))->typed.type) |
1126 | = build_qualified_type (build_reference_type (type), TYPE_QUAL_RESTRICT); |
1127 | } |
1128 | |
1129 | /* Instantiate decls as necessary in CTX to satisfy the data sharing |
1130 | specified by CLAUSES. */ |
1131 | |
1132 | static void |
1133 | scan_sharing_clauses (tree clauses, omp_context *ctx) |
1134 | { |
1135 | tree c, decl; |
1136 | bool scan_array_reductions = false; |
1137 | |
1138 | for (c = clauses; c; c = OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1138, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1138, __FUNCTION__))->common.chain)) |
1139 | if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1139, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_ALLOCATE |
1140 | && (OMP_CLAUSE_ALLOCATE_ALLOCATOR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_ALLOCATE ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1140, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1140, __FUNCTION__))) == NULL_TREE(tree) nullptr |
1141 | /* omp_default_mem_alloc is 1 */ |
1142 | || !integer_onep (OMP_CLAUSE_ALLOCATE_ALLOCATOR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_ALLOCATE ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1142, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1142, __FUNCTION__)))))) |
1143 | { |
1144 | if (ctx->allocate_map == NULLnullptr) |
1145 | ctx->allocate_map = new hash_map<tree, tree>; |
1146 | ctx->allocate_map->put (OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1146, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1146, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1146, __FUNCTION__))), |
1147 | OMP_CLAUSE_ALLOCATE_ALLOCATOR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_ALLOCATE ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1147, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1147, __FUNCTION__))) |
1148 | ? OMP_CLAUSE_ALLOCATE_ALLOCATOR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_ALLOCATE ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1148, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1148, __FUNCTION__))) |
1149 | : integer_zero_nodeglobal_trees[TI_INTEGER_ZERO]); |
1150 | } |
1151 | |
1152 | for (c = clauses; c; c = OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1152, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1152, __FUNCTION__))->common.chain)) |
1153 | { |
1154 | bool by_ref; |
1155 | |
1156 | switch (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1156, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code) |
1157 | { |
1158 | case OMP_CLAUSE_PRIVATE: |
1159 | decl = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1159, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1159, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1159, __FUNCTION__))); |
1160 | if (OMP_CLAUSE_PRIVATE_OUTER_REF (c)(((omp_clause_subcode_check ((c), (OMP_CLAUSE_PRIVATE), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1160, __FUNCTION__)))->base.private_flag)) |
1161 | goto do_private; |
1162 | else if (!is_variable_sized (decl)) |
1163 | install_var_local (decl, ctx); |
1164 | break; |
1165 | |
1166 | case OMP_CLAUSE_SHARED: |
1167 | decl = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1167, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1167, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1167, __FUNCTION__))); |
1168 | if (ctx->allocate_map && ctx->allocate_map->get (decl)) |
1169 | ctx->allocate_map->remove (decl); |
1170 | /* Ignore shared directives in teams construct inside of |
1171 | target construct. */ |
1172 | if (gimple_code (ctx->stmt) == GIMPLE_OMP_TEAMS |
1173 | && !is_host_teams_ctx (ctx)) |
1174 | { |
1175 | /* Global variables don't need to be copied, |
1176 | the receiver side will use them directly. */ |
1177 | tree odecl = maybe_lookup_decl_in_outer_ctx (decl, ctx); |
1178 | if (is_global_var (odecl)) |
1179 | break; |
1180 | insert_decl_map (&ctx->cb, decl, odecl); |
1181 | break; |
1182 | } |
1183 | gcc_assert (is_taskreg_ctx (ctx))((void)(!(is_taskreg_ctx (ctx)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1183, __FUNCTION__), 0 : 0)); |
1184 | gcc_assert (!COMPLETE_TYPE_P (TREE_TYPE (decl))((void)(!(!(((tree_class_check ((((contains_struct_check ((decl ), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1184, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1184, __FUNCTION__))->type_common.size) != (tree) nullptr ) || !is_variable_sized (decl)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1185, __FUNCTION__), 0 : 0)) |
1185 | || !is_variable_sized (decl))((void)(!(!(((tree_class_check ((((contains_struct_check ((decl ), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1184, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1184, __FUNCTION__))->type_common.size) != (tree) nullptr ) || !is_variable_sized (decl)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1185, __FUNCTION__), 0 : 0)); |
1186 | /* Global variables don't need to be copied, |
1187 | the receiver side will use them directly. */ |
1188 | if (is_global_var (maybe_lookup_decl_in_outer_ctx (decl, ctx))) |
1189 | break; |
1190 | if (OMP_CLAUSE_SHARED_FIRSTPRIVATE (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_SHARED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1190, __FUNCTION__))->base.public_flag)) |
1191 | { |
1192 | use_pointer_for_field (decl, ctx); |
1193 | break; |
1194 | } |
1195 | by_ref = use_pointer_for_field (decl, NULLnullptr); |
1196 | if ((! TREE_READONLY (decl)((non_type_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1196, __FUNCTION__))->base.readonly_flag) && !OMP_CLAUSE_SHARED_READONLY (c)(((omp_clause_subcode_check ((c), (OMP_CLAUSE_SHARED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1196, __FUNCTION__)))->base.private_flag)) |
1197 | || TREE_ADDRESSABLE (decl)((decl)->base.addressable_flag) |
1198 | || by_ref |
1199 | || omp_is_reference (decl)) |
1200 | { |
1201 | by_ref = use_pointer_for_field (decl, ctx); |
1202 | install_var_field (decl, by_ref, 3, ctx); |
1203 | install_var_local (decl, ctx); |
1204 | break; |
1205 | } |
1206 | /* We don't need to copy const scalar vars back. */ |
1207 | OMP_CLAUSE_SET_CODE (c, OMP_CLAUSE_FIRSTPRIVATE)(((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1207, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code = ( OMP_CLAUSE_FIRSTPRIVATE)); |
1208 | goto do_private; |
1209 | |
1210 | case OMP_CLAUSE_REDUCTION: |
1211 | /* Collect 'reduction' clauses on OpenACC compute construct. */ |
1212 | if (is_gimple_omp_oacc (ctx->stmt) |
1213 | && is_gimple_omp_offloaded (ctx->stmt)) |
1214 | { |
1215 | /* No 'reduction' clauses on OpenACC 'kernels'. */ |
1216 | gcc_checking_assert (!is_oacc_kernels (ctx))((void)(!(!is_oacc_kernels (ctx)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1216, __FUNCTION__), 0 : 0)); |
1217 | /* Likewise, on OpenACC 'kernels' decomposed parts. */ |
1218 | gcc_checking_assert (!is_oacc_kernels_decomposed_part (ctx))((void)(!(!is_oacc_kernels_decomposed_part (ctx)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1218, __FUNCTION__), 0 : 0)); |
1219 | |
1220 | ctx->local_reduction_clauses |
1221 | = tree_cons (NULLnullptr, c, ctx->local_reduction_clauses); |
1222 | } |
1223 | /* FALLTHRU */ |
1224 | |
1225 | case OMP_CLAUSE_IN_REDUCTION: |
1226 | decl = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1226, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1226, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1226, __FUNCTION__))); |
1227 | if (ctx->allocate_map |
1228 | && ((OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1228, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_REDUCTION |
1229 | && (OMP_CLAUSE_REDUCTION_INSCAN (c)(((omp_clause_subcode_check ((c), (OMP_CLAUSE_REDUCTION), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1229, __FUNCTION__)))->base.private_flag) |
1230 | || OMP_CLAUSE_REDUCTION_TASK (c)(((omp_clause_subcode_check ((c), (OMP_CLAUSE_REDUCTION), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1230, __FUNCTION__)))->base.protected_flag))) |
1231 | || is_task_ctx (ctx))) |
1232 | { |
1233 | /* For now. */ |
1234 | if (ctx->allocate_map->get (decl)) |
1235 | ctx->allocate_map->remove (decl); |
1236 | } |
1237 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == MEM_REF) |
1238 | { |
1239 | tree t = TREE_OPERAND (decl, 0)(*((const_cast<tree*> (tree_operand_check ((decl), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1239, __FUNCTION__))))); |
1240 | if (TREE_CODE (t)((enum tree_code) (t)->base.code) == POINTER_PLUS_EXPR) |
1241 | 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/omp-low.c" , 1241, __FUNCTION__))))); |
1242 | if (TREE_CODE (t)((enum tree_code) (t)->base.code) == INDIRECT_REF |
1243 | || TREE_CODE (t)((enum tree_code) (t)->base.code) == ADDR_EXPR) |
1244 | 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/omp-low.c" , 1244, __FUNCTION__))))); |
1245 | install_var_local (t, ctx); |
1246 | if (is_taskreg_ctx (ctx) |
1247 | && (!is_global_var (maybe_lookup_decl_in_outer_ctx (t, ctx)) |
1248 | || (is_task_ctx (ctx) |
1249 | && (TREE_CODE (TREE_TYPE (t))((enum tree_code) (((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1249, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE |
1250 | || (TREE_CODE (TREE_TYPE (t))((enum tree_code) (((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1250, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE |
1251 | && (TREE_CODE (TREE_TYPE (TREE_TYPE (t)))((enum tree_code) (((contains_struct_check ((((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1251, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1251, __FUNCTION__))->typed.type))->base.code) |
1252 | == POINTER_TYPE))))) |
1253 | && !is_variable_sized (t) |
1254 | && (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1254, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code != OMP_CLAUSE_REDUCTION |
1255 | || (!OMP_CLAUSE_REDUCTION_TASK (c)(((omp_clause_subcode_check ((c), (OMP_CLAUSE_REDUCTION), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1255, __FUNCTION__)))->base.protected_flag) |
1256 | && !is_task_ctx (ctx)))) |
1257 | { |
1258 | by_ref = use_pointer_for_field (t, NULLnullptr); |
1259 | if (is_task_ctx (ctx) |
1260 | && TREE_CODE (TREE_TYPE (t))((enum tree_code) (((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1260, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE |
1261 | && TREE_CODE (TREE_TYPE (TREE_TYPE (t)))((enum tree_code) (((contains_struct_check ((((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1261, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1261, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE) |
1262 | { |
1263 | install_var_field (t, false, 1, ctx); |
1264 | install_var_field (t, by_ref, 2, ctx); |
1265 | } |
1266 | else |
1267 | install_var_field (t, by_ref, 3, ctx); |
1268 | } |
1269 | break; |
1270 | } |
1271 | if (is_task_ctx (ctx) |
1272 | || (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1272, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_REDUCTION |
1273 | && OMP_CLAUSE_REDUCTION_TASK (c)(((omp_clause_subcode_check ((c), (OMP_CLAUSE_REDUCTION), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1273, __FUNCTION__)))->base.protected_flag) |
1274 | && is_parallel_ctx (ctx))) |
1275 | { |
1276 | /* Global variables don't need to be copied, |
1277 | the receiver side will use them directly. */ |
1278 | if (!is_global_var (maybe_lookup_decl_in_outer_ctx (decl, ctx))) |
1279 | { |
1280 | by_ref = use_pointer_for_field (decl, ctx); |
1281 | if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1281, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_IN_REDUCTION) |
1282 | install_var_field (decl, by_ref, 3, ctx); |
1283 | } |
1284 | install_var_local (decl, ctx); |
1285 | break; |
1286 | } |
1287 | if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1287, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_REDUCTION |
1288 | && OMP_CLAUSE_REDUCTION_TASK (c)(((omp_clause_subcode_check ((c), (OMP_CLAUSE_REDUCTION), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1288, __FUNCTION__)))->base.protected_flag)) |
1289 | { |
1290 | install_var_local (decl, ctx); |
1291 | break; |
1292 | } |
1293 | goto do_private; |
1294 | |
1295 | case OMP_CLAUSE_LASTPRIVATE: |
1296 | /* Let the corresponding firstprivate clause create |
1297 | the variable. */ |
1298 | if (OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_LASTPRIVATE), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1298, __FUNCTION__))->base.public_flag)) |
1299 | break; |
1300 | /* FALLTHRU */ |
1301 | |
1302 | case OMP_CLAUSE_FIRSTPRIVATE: |
1303 | case OMP_CLAUSE_LINEAR: |
1304 | decl = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1304, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1304, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1304, __FUNCTION__))); |
1305 | do_private: |
1306 | if ((OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1306, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_FIRSTPRIVATE |
1307 | || OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1307, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_IS_DEVICE_PTR) |
1308 | && is_gimple_omp_offloaded (ctx->stmt)) |
1309 | { |
1310 | if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1310, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_FIRSTPRIVATE) |
1311 | install_var_field (decl, !omp_is_reference (decl), 3, ctx); |
1312 | else if (TREE_CODE (TREE_TYPE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1312, __FUNCTION__))->typed.type))->base.code) == ARRAY_TYPE) |
1313 | install_var_field (decl, true, 3, ctx); |
1314 | else |
1315 | install_var_field (decl, false, 3, ctx); |
1316 | } |
1317 | if (is_variable_sized (decl)) |
1318 | { |
1319 | if (is_task_ctx (ctx)) |
1320 | { |
1321 | if (ctx->allocate_map |
1322 | && OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1322, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_FIRSTPRIVATE) |
1323 | { |
1324 | /* For now. */ |
1325 | if (ctx->allocate_map->get (decl)) |
1326 | ctx->allocate_map->remove (decl); |
1327 | } |
1328 | install_var_field (decl, false, 1, ctx); |
1329 | } |
1330 | break; |
1331 | } |
1332 | else if (is_taskreg_ctx (ctx)) |
1333 | { |
1334 | bool global |
1335 | = is_global_var (maybe_lookup_decl_in_outer_ctx (decl, ctx)); |
1336 | by_ref = use_pointer_for_field (decl, NULLnullptr); |
1337 | |
1338 | if (is_task_ctx (ctx) |
1339 | && (global || by_ref || omp_is_reference (decl))) |
1340 | { |
1341 | if (ctx->allocate_map |
1342 | && ctx->allocate_map->get (decl)) |
1343 | install_var_field (decl, by_ref, 32 | 1, ctx); |
1344 | else |
1345 | install_var_field (decl, false, 1, ctx); |
1346 | if (!global) |
1347 | install_var_field (decl, by_ref, 2, ctx); |
1348 | } |
1349 | else if (!global) |
1350 | install_var_field (decl, by_ref, 3, ctx); |
1351 | } |
1352 | install_var_local (decl, ctx); |
1353 | break; |
1354 | |
1355 | case OMP_CLAUSE_USE_DEVICE_PTR: |
1356 | case OMP_CLAUSE_USE_DEVICE_ADDR: |
1357 | decl = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1357, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1357, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1357, __FUNCTION__))); |
1358 | |
1359 | /* Fortran array descriptors. */ |
1360 | if (lang_hooks.decls.omp_array_data (decl, true)) |
1361 | install_var_field (decl, false, 19, ctx); |
1362 | else if ((OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1362, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_USE_DEVICE_ADDR |
1363 | && !omp_is_reference (decl) |
1364 | && !omp_is_allocatable_or_ptr (decl)) |
1365 | || TREE_CODE (TREE_TYPE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1365, __FUNCTION__))->typed.type))->base.code) == ARRAY_TYPE) |
1366 | install_var_field (decl, true, 11, ctx); |
1367 | else |
1368 | install_var_field (decl, false, 11, ctx); |
1369 | if (DECL_SIZE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1369, __FUNCTION__))->decl_common.size) |
1370 | && TREE_CODE (DECL_SIZE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1370, __FUNCTION__))->decl_common.size))->base.code) != INTEGER_CST) |
1371 | { |
1372 | tree decl2 = DECL_VALUE_EXPR (decl)(decl_value_expr_lookup ((contains_struct_check ((decl), (TS_DECL_WRTL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1372, __FUNCTION__)))); |
1373 | gcc_assert (TREE_CODE (decl2) == INDIRECT_REF)((void)(!(((enum tree_code) (decl2)->base.code) == INDIRECT_REF ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1373, __FUNCTION__), 0 : 0)); |
1374 | decl2 = TREE_OPERAND (decl2, 0)(*((const_cast<tree*> (tree_operand_check ((decl2), (0) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1374, __FUNCTION__))))); |
1375 | gcc_assert (DECL_P (decl2))((void)(!((tree_code_type[(int) (((enum tree_code) (decl2)-> base.code))] == tcc_declaration)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1375, __FUNCTION__), 0 : 0)); |
1376 | install_var_local (decl2, ctx); |
1377 | } |
1378 | install_var_local (decl, ctx); |
1379 | break; |
1380 | |
1381 | case OMP_CLAUSE_IS_DEVICE_PTR: |
1382 | decl = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1382, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1382, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1382, __FUNCTION__))); |
1383 | goto do_private; |
1384 | |
1385 | case OMP_CLAUSE__LOOPTEMP_: |
1386 | case OMP_CLAUSE__REDUCTEMP_: |
1387 | gcc_assert (is_taskreg_ctx (ctx))((void)(!(is_taskreg_ctx (ctx)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1387, __FUNCTION__), 0 : 0)); |
1388 | decl = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1388, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1388, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1388, __FUNCTION__))); |
1389 | install_var_field (decl, false, 3, ctx); |
1390 | install_var_local (decl, ctx); |
1391 | break; |
1392 | |
1393 | case OMP_CLAUSE_COPYPRIVATE: |
1394 | case OMP_CLAUSE_COPYIN: |
1395 | decl = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1395, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1395, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1395, __FUNCTION__))); |
1396 | by_ref = use_pointer_for_field (decl, NULLnullptr); |
1397 | install_var_field (decl, by_ref, 3, ctx); |
1398 | break; |
1399 | |
1400 | case OMP_CLAUSE_FINAL: |
1401 | case OMP_CLAUSE_IF: |
1402 | case OMP_CLAUSE_NUM_THREADS: |
1403 | case OMP_CLAUSE_NUM_TEAMS: |
1404 | case OMP_CLAUSE_THREAD_LIMIT: |
1405 | case OMP_CLAUSE_DEVICE: |
1406 | case OMP_CLAUSE_SCHEDULE: |
1407 | case OMP_CLAUSE_DIST_SCHEDULE: |
1408 | case OMP_CLAUSE_DEPEND: |
1409 | case OMP_CLAUSE_PRIORITY: |
1410 | case OMP_CLAUSE_GRAINSIZE: |
1411 | case OMP_CLAUSE_NUM_TASKS: |
1412 | case OMP_CLAUSE_NUM_GANGS: |
1413 | case OMP_CLAUSE_NUM_WORKERS: |
1414 | case OMP_CLAUSE_VECTOR_LENGTH: |
1415 | if (ctx->outer) |
1416 | scan_omp_op (&OMP_CLAUSE_OPERAND (c, 0)(*(omp_clause_elt_check ((c), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1416, __FUNCTION__))), ctx->outer); |
1417 | break; |
1418 | |
1419 | case OMP_CLAUSE_TO: |
1420 | case OMP_CLAUSE_FROM: |
1421 | case OMP_CLAUSE_MAP: |
1422 | if (ctx->outer) |
1423 | scan_omp_op (&OMP_CLAUSE_SIZE (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1423, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_ ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1423, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1423, __FUNCTION__))), ctx->outer); |
1424 | decl = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1424, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1424, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1424, __FUNCTION__))); |
1425 | /* Global variables with "omp declare target" attribute |
1426 | don't need to be copied, the receiver side will use them |
1427 | directly. However, global variables with "omp declare target link" |
1428 | attribute need to be copied. Or when ALWAYS modifier is used. */ |
1429 | if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1429, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_MAP |
1430 | && DECL_P (decl)(tree_code_type[(int) (((enum tree_code) (decl)->base.code ))] == tcc_declaration) |
1431 | && ((OMP_CLAUSE_MAP_KIND (c)((enum gomp_map_kind) (omp_clause_subcode_check ((c), (OMP_CLAUSE_MAP ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1431, __FUNCTION__))->omp_clause.subcode.map_kind) != GOMP_MAP_FIRSTPRIVATE_POINTER |
1432 | && (OMP_CLAUSE_MAP_KIND (c)((enum gomp_map_kind) (omp_clause_subcode_check ((c), (OMP_CLAUSE_MAP ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1432, __FUNCTION__))->omp_clause.subcode.map_kind) |
1433 | != GOMP_MAP_FIRSTPRIVATE_REFERENCE) |
1434 | && OMP_CLAUSE_MAP_KIND (c)((enum gomp_map_kind) (omp_clause_subcode_check ((c), (OMP_CLAUSE_MAP ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1434, __FUNCTION__))->omp_clause.subcode.map_kind) != GOMP_MAP_ATTACH |
1435 | && OMP_CLAUSE_MAP_KIND (c)((enum gomp_map_kind) (omp_clause_subcode_check ((c), (OMP_CLAUSE_MAP ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1435, __FUNCTION__))->omp_clause.subcode.map_kind) != GOMP_MAP_DETACH) |
1436 | || TREE_CODE (TREE_TYPE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1436, __FUNCTION__))->typed.type))->base.code) == ARRAY_TYPE) |
1437 | && OMP_CLAUSE_MAP_KIND (c)((enum gomp_map_kind) (omp_clause_subcode_check ((c), (OMP_CLAUSE_MAP ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1437, __FUNCTION__))->omp_clause.subcode.map_kind) != GOMP_MAP_ALWAYS_TO |
1438 | && OMP_CLAUSE_MAP_KIND (c)((enum gomp_map_kind) (omp_clause_subcode_check ((c), (OMP_CLAUSE_MAP ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1438, __FUNCTION__))->omp_clause.subcode.map_kind) != GOMP_MAP_ALWAYS_FROM |
1439 | && OMP_CLAUSE_MAP_KIND (c)((enum gomp_map_kind) (omp_clause_subcode_check ((c), (OMP_CLAUSE_MAP ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1439, __FUNCTION__))->omp_clause.subcode.map_kind) != GOMP_MAP_ALWAYS_TOFROM |
1440 | && OMP_CLAUSE_MAP_KIND (c)((enum gomp_map_kind) (omp_clause_subcode_check ((c), (OMP_CLAUSE_MAP ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1440, __FUNCTION__))->omp_clause.subcode.map_kind) != GOMP_MAP_TO_PSET |
1441 | && is_global_var (maybe_lookup_decl_in_outer_ctx (decl, ctx)) |
1442 | && varpool_node::get_create (decl)->offloadable |
1443 | && !lookup_attribute ("omp declare target link", |
1444 | DECL_ATTRIBUTES (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1444, __FUNCTION__))->decl_common.attributes))) |
1445 | break; |
1446 | if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1446, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_MAP |
1447 | && OMP_CLAUSE_MAP_KIND (c)((enum gomp_map_kind) (omp_clause_subcode_check ((c), (OMP_CLAUSE_MAP ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1447, __FUNCTION__))->omp_clause.subcode.map_kind) == GOMP_MAP_POINTER) |
1448 | { |
1449 | /* Ignore GOMP_MAP_POINTER kind for arrays in regions that are |
1450 | not offloaded; there is nothing to map for those. */ |
1451 | if (!is_gimple_omp_offloaded (ctx->stmt) |
1452 | && !POINTER_TYPE_P (TREE_TYPE (decl))(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1452, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE || ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1452, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE ) |
1453 | && !OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1453, __FUNCTION__))->base.public_flag)) |
1454 | break; |
1455 | } |
1456 | if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1456, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_MAP |
1457 | && DECL_P (decl)(tree_code_type[(int) (((enum tree_code) (decl)->base.code ))] == tcc_declaration) |
1458 | && (OMP_CLAUSE_MAP_KIND (c)((enum gomp_map_kind) (omp_clause_subcode_check ((c), (OMP_CLAUSE_MAP ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1458, __FUNCTION__))->omp_clause.subcode.map_kind) == GOMP_MAP_ATTACH |
1459 | || OMP_CLAUSE_MAP_KIND (c)((enum gomp_map_kind) (omp_clause_subcode_check ((c), (OMP_CLAUSE_MAP ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1459, __FUNCTION__))->omp_clause.subcode.map_kind) == GOMP_MAP_DETACH) |
1460 | && is_omp_target (ctx->stmt)) |
1461 | { |
1462 | /* If this is an offloaded region, an attach operation should |
1463 | only exist when the pointer variable is mapped in a prior |
1464 | clause. */ |
1465 | if (is_gimple_omp_offloaded (ctx->stmt)) |
1466 | gcc_assert((void)(!(maybe_lookup_decl (decl, ctx) || (is_global_var (maybe_lookup_decl_in_outer_ctx (decl, ctx)) && lookup_attribute ("omp declare target" , ((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1470, __FUNCTION__))->decl_common.attributes)))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1470, __FUNCTION__), 0 : 0)) |
1467 | (maybe_lookup_decl (decl, ctx)((void)(!(maybe_lookup_decl (decl, ctx) || (is_global_var (maybe_lookup_decl_in_outer_ctx (decl, ctx)) && lookup_attribute ("omp declare target" , ((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1470, __FUNCTION__))->decl_common.attributes)))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1470, __FUNCTION__), 0 : 0)) |
1468 | || (is_global_var (maybe_lookup_decl_in_outer_ctx (decl, ctx))((void)(!(maybe_lookup_decl (decl, ctx) || (is_global_var (maybe_lookup_decl_in_outer_ctx (decl, ctx)) && lookup_attribute ("omp declare target" , ((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1470, __FUNCTION__))->decl_common.attributes)))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1470, __FUNCTION__), 0 : 0)) |
1469 | && lookup_attribute ("omp declare target",((void)(!(maybe_lookup_decl (decl, ctx) || (is_global_var (maybe_lookup_decl_in_outer_ctx (decl, ctx)) && lookup_attribute ("omp declare target" , ((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1470, __FUNCTION__))->decl_common.attributes)))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1470, __FUNCTION__), 0 : 0)) |
1470 | DECL_ATTRIBUTES (decl))))((void)(!(maybe_lookup_decl (decl, ctx) || (is_global_var (maybe_lookup_decl_in_outer_ctx (decl, ctx)) && lookup_attribute ("omp declare target" , ((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1470, __FUNCTION__))->decl_common.attributes)))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1470, __FUNCTION__), 0 : 0)); |
1471 | |
1472 | /* By itself, attach/detach is generated as part of pointer |
1473 | variable mapping and should not create new variables in the |
1474 | offloaded region, however sender refs for it must be created |
1475 | for its address to be passed to the runtime. */ |
1476 | tree field |
1477 | = build_decl (OMP_CLAUSE_LOCATION (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1477, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.locus, |
1478 | FIELD_DECL, NULL_TREE(tree) nullptr, ptr_type_nodeglobal_trees[TI_PTR_TYPE]); |
1479 | SET_DECL_ALIGN (field, TYPE_ALIGN (ptr_type_node))(((contains_struct_check ((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1479, __FUNCTION__))->decl_common.align) = ffs_hwi (((tree_class_check ((global_trees[TI_PTR_TYPE]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1479, __FUNCTION__))->type_common.align ? ((unsigned)1) << ((global_trees[TI_PTR_TYPE])->type_common.align - 1) : 0) )); |
1480 | insert_field_into_struct (ctx->record_type, field); |
1481 | /* To not clash with a map of the pointer variable itself, |
1482 | attach/detach maps have their field looked up by the *clause* |
1483 | tree expression, not the decl. */ |
1484 | gcc_assert (!splay_tree_lookup (ctx->field_map,((void)(!(!splay_tree_lookup (ctx->field_map, (splay_tree_key ) c)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1485, __FUNCTION__), 0 : 0)) |
1485 | (splay_tree_key) c))((void)(!(!splay_tree_lookup (ctx->field_map, (splay_tree_key ) c)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1485, __FUNCTION__), 0 : 0)); |
1486 | splay_tree_insert (ctx->field_map, (splay_tree_key) c, |
1487 | (splay_tree_value) field); |
1488 | break; |
1489 | } |
1490 | if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1490, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_MAP |
1491 | && (OMP_CLAUSE_MAP_KIND (c)((enum gomp_map_kind) (omp_clause_subcode_check ((c), (OMP_CLAUSE_MAP ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1491, __FUNCTION__))->omp_clause.subcode.map_kind) == GOMP_MAP_FIRSTPRIVATE_POINTER |
1492 | || (OMP_CLAUSE_MAP_KIND (c)((enum gomp_map_kind) (omp_clause_subcode_check ((c), (OMP_CLAUSE_MAP ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1492, __FUNCTION__))->omp_clause.subcode.map_kind) |
1493 | == GOMP_MAP_FIRSTPRIVATE_REFERENCE))) |
1494 | { |
1495 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == COMPONENT_REF |
1496 | || (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == INDIRECT_REF |
1497 | && TREE_CODE (TREE_OPERAND (decl, 0))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check ((decl), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1497, __FUNCTION__))))))->base.code) == COMPONENT_REF |
1498 | && (TREE_CODE (TREE_TYPE (TREE_OPERAND (decl, 0)))((enum tree_code) (((contains_struct_check (((*((const_cast< tree*> (tree_operand_check ((decl), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1498, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1498, __FUNCTION__))->typed.type))->base.code) |
1499 | == REFERENCE_TYPE))) |
1500 | break; |
1501 | if (DECL_SIZE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1501, __FUNCTION__))->decl_common.size) |
1502 | && TREE_CODE (DECL_SIZE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1502, __FUNCTION__))->decl_common.size))->base.code) != INTEGER_CST) |
1503 | { |
1504 | tree decl2 = DECL_VALUE_EXPR (decl)(decl_value_expr_lookup ((contains_struct_check ((decl), (TS_DECL_WRTL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1504, __FUNCTION__)))); |
1505 | gcc_assert (TREE_CODE (decl2) == INDIRECT_REF)((void)(!(((enum tree_code) (decl2)->base.code) == INDIRECT_REF ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1505, __FUNCTION__), 0 : 0)); |
1506 | decl2 = TREE_OPERAND (decl2, 0)(*((const_cast<tree*> (tree_operand_check ((decl2), (0) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1506, __FUNCTION__))))); |
1507 | gcc_assert (DECL_P (decl2))((void)(!((tree_code_type[(int) (((enum tree_code) (decl2)-> base.code))] == tcc_declaration)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1507, __FUNCTION__), 0 : 0)); |
1508 | install_var_local (decl2, ctx); |
1509 | } |
1510 | install_var_local (decl, ctx); |
1511 | break; |
1512 | } |
1513 | if (DECL_P (decl)(tree_code_type[(int) (((enum tree_code) (decl)->base.code ))] == tcc_declaration)) |
1514 | { |
1515 | if (DECL_SIZE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1515, __FUNCTION__))->decl_common.size) |
1516 | && TREE_CODE (DECL_SIZE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1516, __FUNCTION__))->decl_common.size))->base.code) != INTEGER_CST) |
1517 | { |
1518 | tree decl2 = DECL_VALUE_EXPR (decl)(decl_value_expr_lookup ((contains_struct_check ((decl), (TS_DECL_WRTL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1518, __FUNCTION__)))); |
1519 | gcc_assert (TREE_CODE (decl2) == INDIRECT_REF)((void)(!(((enum tree_code) (decl2)->base.code) == INDIRECT_REF ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1519, __FUNCTION__), 0 : 0)); |
1520 | decl2 = TREE_OPERAND (decl2, 0)(*((const_cast<tree*> (tree_operand_check ((decl2), (0) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1520, __FUNCTION__))))); |
1521 | gcc_assert (DECL_P (decl2))((void)(!((tree_code_type[(int) (((enum tree_code) (decl2)-> base.code))] == tcc_declaration)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1521, __FUNCTION__), 0 : 0)); |
1522 | install_var_field (decl2, true, 3, ctx); |
1523 | install_var_local (decl2, ctx); |
1524 | install_var_local (decl, ctx); |
1525 | } |
1526 | else |
1527 | { |
1528 | if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1528, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_MAP |
1529 | && OMP_CLAUSE_MAP_KIND (c)((enum gomp_map_kind) (omp_clause_subcode_check ((c), (OMP_CLAUSE_MAP ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1529, __FUNCTION__))->omp_clause.subcode.map_kind) == GOMP_MAP_POINTER |
1530 | && !OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1530, __FUNCTION__))->base.public_flag) |
1531 | && TREE_CODE (TREE_TYPE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1531, __FUNCTION__))->typed.type))->base.code) == ARRAY_TYPE) |
1532 | install_var_field (decl, true, 7, ctx); |
1533 | else |
1534 | install_var_field (decl, true, 3, ctx); |
1535 | if (is_gimple_omp_offloaded (ctx->stmt) |
1536 | && !OMP_CLAUSE_MAP_IN_REDUCTION (c)(((omp_clause_subcode_check ((c), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1536, __FUNCTION__)))->base.private_flag)) |
1537 | install_var_local (decl, ctx); |
1538 | } |
1539 | } |
1540 | else |
1541 | { |
1542 | tree base = get_base_address (decl); |
1543 | tree nc = OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1543, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1543, __FUNCTION__))->common.chain); |
1544 | if (DECL_P (base)(tree_code_type[(int) (((enum tree_code) (base)->base.code ))] == tcc_declaration) |
1545 | && nc != NULL_TREE(tree) nullptr |
1546 | && OMP_CLAUSE_CODE (nc)((tree_check ((nc), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1546, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_MAP |
1547 | && OMP_CLAUSE_DECL (nc)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((nc), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1547, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1547, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1547, __FUNCTION__))) == base |
1548 | && OMP_CLAUSE_MAP_KIND (nc)((enum gomp_map_kind) (omp_clause_subcode_check ((nc), (OMP_CLAUSE_MAP ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1548, __FUNCTION__))->omp_clause.subcode.map_kind) == GOMP_MAP_POINTER |
1549 | && integer_zerop (OMP_CLAUSE_SIZE (nc)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((nc), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1549, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_ ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1549, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1549, __FUNCTION__))))) |
1550 | { |
1551 | OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1551, __FUNCTION__))->base.public_flag) = 1; |
1552 | OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION (nc)((omp_clause_subcode_check ((nc), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1552, __FUNCTION__))->base.public_flag) = 1; |
1553 | } |
1554 | else |
1555 | { |
1556 | if (ctx->outer) |
1557 | { |
1558 | scan_omp_op (&OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1558, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1558, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1558, __FUNCTION__))), ctx->outer); |
1559 | decl = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1559, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1559, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1559, __FUNCTION__))); |
1560 | } |
1561 | gcc_assert (!splay_tree_lookup (ctx->field_map,((void)(!(!splay_tree_lookup (ctx->field_map, (splay_tree_key ) decl)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1562, __FUNCTION__), 0 : 0)) |
1562 | (splay_tree_key) decl))((void)(!(!splay_tree_lookup (ctx->field_map, (splay_tree_key ) decl)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1562, __FUNCTION__), 0 : 0)); |
1563 | tree field |
1564 | = build_decl (OMP_CLAUSE_LOCATION (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1564, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.locus, |
1565 | FIELD_DECL, NULL_TREE(tree) nullptr, ptr_type_nodeglobal_trees[TI_PTR_TYPE]); |
1566 | SET_DECL_ALIGN (field, TYPE_ALIGN (ptr_type_node))(((contains_struct_check ((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1566, __FUNCTION__))->decl_common.align) = ffs_hwi (((tree_class_check ((global_trees[TI_PTR_TYPE]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1566, __FUNCTION__))->type_common.align ? ((unsigned)1) << ((global_trees[TI_PTR_TYPE])->type_common.align - 1) : 0) )); |
1567 | insert_field_into_struct (ctx->record_type, field); |
1568 | splay_tree_insert (ctx->field_map, (splay_tree_key) decl, |
1569 | (splay_tree_value) field); |
1570 | } |
1571 | } |
1572 | break; |
1573 | |
1574 | case OMP_CLAUSE_ORDER: |
1575 | ctx->order_concurrent = true; |
1576 | break; |
1577 | |
1578 | case OMP_CLAUSE_BIND: |
1579 | ctx->loop_p = true; |
1580 | break; |
1581 | |
1582 | case OMP_CLAUSE_NOWAIT: |
1583 | case OMP_CLAUSE_ORDERED: |
1584 | case OMP_CLAUSE_COLLAPSE: |
1585 | case OMP_CLAUSE_UNTIED: |
1586 | case OMP_CLAUSE_MERGEABLE: |
1587 | case OMP_CLAUSE_PROC_BIND: |
1588 | case OMP_CLAUSE_SAFELEN: |
1589 | case OMP_CLAUSE_SIMDLEN: |
1590 | case OMP_CLAUSE_THREADS: |
1591 | case OMP_CLAUSE_SIMD: |
1592 | case OMP_CLAUSE_NOGROUP: |
1593 | case OMP_CLAUSE_DEFAULTMAP: |
1594 | case OMP_CLAUSE_ASYNC: |
1595 | case OMP_CLAUSE_WAIT: |
1596 | case OMP_CLAUSE_GANG: |
1597 | case OMP_CLAUSE_WORKER: |
1598 | case OMP_CLAUSE_VECTOR: |
1599 | case OMP_CLAUSE_INDEPENDENT: |
1600 | case OMP_CLAUSE_AUTO: |
1601 | case OMP_CLAUSE_SEQ: |
1602 | case OMP_CLAUSE_TILE: |
1603 | case OMP_CLAUSE__SIMT_: |
1604 | case OMP_CLAUSE_DEFAULT: |
1605 | case OMP_CLAUSE_NONTEMPORAL: |
1606 | case OMP_CLAUSE_IF_PRESENT: |
1607 | case OMP_CLAUSE_FINALIZE: |
1608 | case OMP_CLAUSE_TASK_REDUCTION: |
1609 | case OMP_CLAUSE_ALLOCATE: |
1610 | break; |
1611 | |
1612 | case OMP_CLAUSE_ALIGNED: |
1613 | decl = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1613, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1613, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1613, __FUNCTION__))); |
1614 | if (is_global_var (decl) |
1615 | && TREE_CODE (TREE_TYPE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1615, __FUNCTION__))->typed.type))->base.code) == ARRAY_TYPE) |
1616 | install_var_local (decl, ctx); |
1617 | break; |
1618 | |
1619 | case OMP_CLAUSE__CONDTEMP_: |
1620 | decl = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1620, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1620, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1620, __FUNCTION__))); |
1621 | if (is_parallel_ctx (ctx)) |
1622 | { |
1623 | install_var_field (decl, false, 3, ctx); |
1624 | install_var_local (decl, ctx); |
1625 | } |
1626 | else if (gimple_code (ctx->stmt) == GIMPLE_OMP_FOR |
1627 | && gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_KIND_SIMD |
1628 | && !OMP_CLAUSE__CONDTEMP__ITER (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE__CONDTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1628, __FUNCTION__))->base.public_flag)) |
1629 | install_var_local (decl, ctx); |
1630 | break; |
1631 | |
1632 | case OMP_CLAUSE__CACHE_: |
1633 | default: |
1634 | gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1634, __FUNCTION__)); |
1635 | } |
1636 | } |
1637 | |
1638 | for (c = clauses; c; c = OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1638, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1638, __FUNCTION__))->common.chain)) |
1639 | { |
1640 | switch (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1640, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code) |
1641 | { |
1642 | case OMP_CLAUSE_LASTPRIVATE: |
1643 | /* Let the corresponding firstprivate clause create |
1644 | the variable. */ |
1645 | if (OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1645, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.gimple_reduction_init) |
1646 | scan_array_reductions = true; |
1647 | if (OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_LASTPRIVATE), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1647, __FUNCTION__))->base.public_flag)) |
1648 | break; |
1649 | /* FALLTHRU */ |
1650 | |
1651 | case OMP_CLAUSE_FIRSTPRIVATE: |
1652 | case OMP_CLAUSE_PRIVATE: |
1653 | case OMP_CLAUSE_LINEAR: |
1654 | case OMP_CLAUSE_IS_DEVICE_PTR: |
1655 | decl = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1655, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1655, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1655, __FUNCTION__))); |
1656 | if (is_variable_sized (decl)) |
1657 | { |
1658 | if ((OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1658, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_FIRSTPRIVATE |
1659 | || OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1659, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_IS_DEVICE_PTR) |
1660 | && is_gimple_omp_offloaded (ctx->stmt)) |
1661 | { |
1662 | tree decl2 = DECL_VALUE_EXPR (decl)(decl_value_expr_lookup ((contains_struct_check ((decl), (TS_DECL_WRTL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1662, __FUNCTION__)))); |
1663 | gcc_assert (TREE_CODE (decl2) == INDIRECT_REF)((void)(!(((enum tree_code) (decl2)->base.code) == INDIRECT_REF ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1663, __FUNCTION__), 0 : 0)); |
1664 | decl2 = TREE_OPERAND (decl2, 0)(*((const_cast<tree*> (tree_operand_check ((decl2), (0) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1664, __FUNCTION__))))); |
1665 | gcc_assert (DECL_P (decl2))((void)(!((tree_code_type[(int) (((enum tree_code) (decl2)-> base.code))] == tcc_declaration)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1665, __FUNCTION__), 0 : 0)); |
1666 | install_var_local (decl2, ctx); |
1667 | fixup_remapped_decl (decl2, ctx, false); |
1668 | } |
1669 | install_var_local (decl, ctx); |
1670 | } |
1671 | fixup_remapped_decl (decl, ctx, |
1672 | OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1672, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_PRIVATE |
1673 | && OMP_CLAUSE_PRIVATE_DEBUG (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_PRIVATE), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1673, __FUNCTION__))->base.public_flag)); |
1674 | if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1674, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_LINEAR |
1675 | && OMP_CLAUSE_LINEAR_GIMPLE_SEQ (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1675, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.gimple_reduction_init) |
1676 | scan_array_reductions = true; |
1677 | break; |
1678 | |
1679 | case OMP_CLAUSE_REDUCTION: |
1680 | case OMP_CLAUSE_IN_REDUCTION: |
1681 | decl = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1681, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1681, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1681, __FUNCTION__))); |
1682 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != MEM_REF) |
1683 | { |
1684 | if (is_variable_sized (decl)) |
1685 | install_var_local (decl, ctx); |
1686 | fixup_remapped_decl (decl, ctx, false); |
1687 | } |
1688 | if (OMP_CLAUSE_REDUCTION_PLACEHOLDER (c)(*(omp_clause_elt_check (((omp_clause_range_check ((c), (OMP_CLAUSE_REDUCTION ), (OMP_CLAUSE_IN_REDUCTION), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1688, __FUNCTION__))), (3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1688, __FUNCTION__)))) |
1689 | scan_array_reductions = true; |
1690 | break; |
1691 | |
1692 | case OMP_CLAUSE_TASK_REDUCTION: |
1693 | if (OMP_CLAUSE_REDUCTION_PLACEHOLDER (c)(*(omp_clause_elt_check (((omp_clause_range_check ((c), (OMP_CLAUSE_REDUCTION ), (OMP_CLAUSE_IN_REDUCTION), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1693, __FUNCTION__))), (3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1693, __FUNCTION__)))) |
1694 | scan_array_reductions = true; |
1695 | break; |
1696 | |
1697 | case OMP_CLAUSE_SHARED: |
1698 | /* Ignore shared directives in teams construct inside of |
1699 | target construct. */ |
1700 | if (gimple_code (ctx->stmt) == GIMPLE_OMP_TEAMS |
1701 | && !is_host_teams_ctx (ctx)) |
1702 | break; |
1703 | decl = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1703, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1703, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1703, __FUNCTION__))); |
1704 | if (is_global_var (maybe_lookup_decl_in_outer_ctx (decl, ctx))) |
1705 | break; |
1706 | if (OMP_CLAUSE_SHARED_FIRSTPRIVATE (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_SHARED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1706, __FUNCTION__))->base.public_flag)) |
1707 | { |
1708 | if (is_global_var (maybe_lookup_decl_in_outer_ctx (decl, |
1709 | ctx->outer))) |
1710 | break; |
1711 | bool by_ref = use_pointer_for_field (decl, ctx); |
1712 | install_var_field (decl, by_ref, 11, ctx); |
1713 | break; |
1714 | } |
1715 | fixup_remapped_decl (decl, ctx, false); |
1716 | break; |
1717 | |
1718 | case OMP_CLAUSE_MAP: |
1719 | if (!is_gimple_omp_offloaded (ctx->stmt)) |
1720 | break; |
1721 | decl = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1721, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1721, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1721, __FUNCTION__))); |
1722 | if (DECL_P (decl)(tree_code_type[(int) (((enum tree_code) (decl)->base.code ))] == tcc_declaration) |
1723 | && ((OMP_CLAUSE_MAP_KIND (c)((enum gomp_map_kind) (omp_clause_subcode_check ((c), (OMP_CLAUSE_MAP ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1723, __FUNCTION__))->omp_clause.subcode.map_kind) != GOMP_MAP_FIRSTPRIVATE_POINTER |
1724 | && (OMP_CLAUSE_MAP_KIND (c)((enum gomp_map_kind) (omp_clause_subcode_check ((c), (OMP_CLAUSE_MAP ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1724, __FUNCTION__))->omp_clause.subcode.map_kind) |
1725 | != GOMP_MAP_FIRSTPRIVATE_REFERENCE)) |
1726 | || TREE_CODE (TREE_TYPE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1726, __FUNCTION__))->typed.type))->base.code) == ARRAY_TYPE) |
1727 | && is_global_var (maybe_lookup_decl_in_outer_ctx (decl, ctx)) |
1728 | && varpool_node::get_create (decl)->offloadable) |
1729 | break; |
1730 | if ((OMP_CLAUSE_MAP_KIND (c)((enum gomp_map_kind) (omp_clause_subcode_check ((c), (OMP_CLAUSE_MAP ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1730, __FUNCTION__))->omp_clause.subcode.map_kind) == GOMP_MAP_ATTACH |
1731 | || OMP_CLAUSE_MAP_KIND (c)((enum gomp_map_kind) (omp_clause_subcode_check ((c), (OMP_CLAUSE_MAP ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1731, __FUNCTION__))->omp_clause.subcode.map_kind) == GOMP_MAP_DETACH) |
1732 | && is_omp_target (ctx->stmt) |
1733 | && !is_gimple_omp_offloaded (ctx->stmt)) |
1734 | break; |
1735 | if (DECL_P (decl)(tree_code_type[(int) (((enum tree_code) (decl)->base.code ))] == tcc_declaration)) |
1736 | { |
1737 | if ((OMP_CLAUSE_MAP_KIND (c)((enum gomp_map_kind) (omp_clause_subcode_check ((c), (OMP_CLAUSE_MAP ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1737, __FUNCTION__))->omp_clause.subcode.map_kind) == GOMP_MAP_POINTER |
1738 | || OMP_CLAUSE_MAP_KIND (c)((enum gomp_map_kind) (omp_clause_subcode_check ((c), (OMP_CLAUSE_MAP ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1738, __FUNCTION__))->omp_clause.subcode.map_kind) == GOMP_MAP_FIRSTPRIVATE_POINTER) |
1739 | && TREE_CODE (TREE_TYPE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1739, __FUNCTION__))->typed.type))->base.code) == ARRAY_TYPE |
1740 | && !COMPLETE_TYPE_P (TREE_TYPE (decl))(((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1740, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1740, __FUNCTION__))->type_common.size) != (tree) nullptr )) |
1741 | { |
1742 | tree new_decl = lookup_decl (decl, ctx); |
1743 | TREE_TYPE (new_decl)((contains_struct_check ((new_decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1743, __FUNCTION__))->typed.type) |
1744 | = remap_type (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1744, __FUNCTION__))->typed.type), &ctx->cb); |
1745 | } |
1746 | else if (DECL_SIZE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1746, __FUNCTION__))->decl_common.size) |
1747 | && TREE_CODE (DECL_SIZE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1747, __FUNCTION__))->decl_common.size))->base.code) != INTEGER_CST) |
1748 | { |
1749 | tree decl2 = DECL_VALUE_EXPR (decl)(decl_value_expr_lookup ((contains_struct_check ((decl), (TS_DECL_WRTL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1749, __FUNCTION__)))); |
1750 | gcc_assert (TREE_CODE (decl2) == INDIRECT_REF)((void)(!(((enum tree_code) (decl2)->base.code) == INDIRECT_REF ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1750, __FUNCTION__), 0 : 0)); |
1751 | decl2 = TREE_OPERAND (decl2, 0)(*((const_cast<tree*> (tree_operand_check ((decl2), (0) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1751, __FUNCTION__))))); |
1752 | gcc_assert (DECL_P (decl2))((void)(!((tree_code_type[(int) (((enum tree_code) (decl2)-> base.code))] == tcc_declaration)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1752, __FUNCTION__), 0 : 0)); |
1753 | fixup_remapped_decl (decl2, ctx, false); |
1754 | fixup_remapped_decl (decl, ctx, true); |
1755 | } |
1756 | else |
1757 | fixup_remapped_decl (decl, ctx, false); |
1758 | } |
1759 | break; |
1760 | |
1761 | case OMP_CLAUSE_COPYPRIVATE: |
1762 | case OMP_CLAUSE_COPYIN: |
1763 | case OMP_CLAUSE_DEFAULT: |
1764 | case OMP_CLAUSE_IF: |
1765 | case OMP_CLAUSE_NUM_THREADS: |
1766 | case OMP_CLAUSE_NUM_TEAMS: |
1767 | case OMP_CLAUSE_THREAD_LIMIT: |
1768 | case OMP_CLAUSE_DEVICE: |
1769 | case OMP_CLAUSE_SCHEDULE: |
1770 | case OMP_CLAUSE_DIST_SCHEDULE: |
1771 | case OMP_CLAUSE_NOWAIT: |
1772 | case OMP_CLAUSE_ORDERED: |
1773 | case OMP_CLAUSE_COLLAPSE: |
1774 | case OMP_CLAUSE_UNTIED: |
1775 | case OMP_CLAUSE_FINAL: |
1776 | case OMP_CLAUSE_MERGEABLE: |
1777 | case OMP_CLAUSE_PROC_BIND: |
1778 | case OMP_CLAUSE_SAFELEN: |
1779 | case OMP_CLAUSE_SIMDLEN: |
1780 | case OMP_CLAUSE_ALIGNED: |
1781 | case OMP_CLAUSE_DEPEND: |
1782 | case OMP_CLAUSE_ALLOCATE: |
1783 | case OMP_CLAUSE__LOOPTEMP_: |
1784 | case OMP_CLAUSE__REDUCTEMP_: |
1785 | case OMP_CLAUSE_TO: |
1786 | case OMP_CLAUSE_FROM: |
1787 | case OMP_CLAUSE_PRIORITY: |
1788 | case OMP_CLAUSE_GRAINSIZE: |
1789 | case OMP_CLAUSE_NUM_TASKS: |
1790 | case OMP_CLAUSE_THREADS: |
1791 | case OMP_CLAUSE_SIMD: |
1792 | case OMP_CLAUSE_NOGROUP: |
1793 | case OMP_CLAUSE_DEFAULTMAP: |
1794 | case OMP_CLAUSE_ORDER: |
1795 | case OMP_CLAUSE_BIND: |
1796 | case OMP_CLAUSE_USE_DEVICE_PTR: |
1797 | case OMP_CLAUSE_USE_DEVICE_ADDR: |
1798 | case OMP_CLAUSE_NONTEMPORAL: |
1799 | case OMP_CLAUSE_ASYNC: |
1800 | case OMP_CLAUSE_WAIT: |
1801 | case OMP_CLAUSE_NUM_GANGS: |
1802 | case OMP_CLAUSE_NUM_WORKERS: |
1803 | case OMP_CLAUSE_VECTOR_LENGTH: |
1804 | case OMP_CLAUSE_GANG: |
1805 | case OMP_CLAUSE_WORKER: |
1806 | case OMP_CLAUSE_VECTOR: |
1807 | case OMP_CLAUSE_INDEPENDENT: |
1808 | case OMP_CLAUSE_AUTO: |
1809 | case OMP_CLAUSE_SEQ: |
1810 | case OMP_CLAUSE_TILE: |
1811 | case OMP_CLAUSE__SIMT_: |
1812 | case OMP_CLAUSE_IF_PRESENT: |
1813 | case OMP_CLAUSE_FINALIZE: |
1814 | case OMP_CLAUSE__CONDTEMP_: |
1815 | break; |
1816 | |
1817 | case OMP_CLAUSE__CACHE_: |
1818 | default: |
1819 | gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1819, __FUNCTION__)); |
1820 | } |
1821 | } |
1822 | |
1823 | gcc_checking_assert (!scan_array_reductions((void)(!(!scan_array_reductions || !is_gimple_omp_oacc (ctx-> stmt)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1824, __FUNCTION__), 0 : 0)) |
1824 | || !is_gimple_omp_oacc (ctx->stmt))((void)(!(!scan_array_reductions || !is_gimple_omp_oacc (ctx-> stmt)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1824, __FUNCTION__), 0 : 0)); |
1825 | if (scan_array_reductions) |
1826 | { |
1827 | for (c = clauses; c; c = OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1827, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1827, __FUNCTION__))->common.chain)) |
1828 | if ((OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1828, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_REDUCTION |
1829 | || OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1829, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_IN_REDUCTION |
1830 | || OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1830, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_TASK_REDUCTION) |
1831 | && OMP_CLAUSE_REDUCTION_PLACEHOLDER (c)(*(omp_clause_elt_check (((omp_clause_range_check ((c), (OMP_CLAUSE_REDUCTION ), (OMP_CLAUSE_IN_REDUCTION), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1831, __FUNCTION__))), (3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1831, __FUNCTION__)))) |
1832 | { |
1833 | scan_omp (&OMP_CLAUSE_REDUCTION_GIMPLE_INIT (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1833, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.gimple_reduction_init, ctx); |
1834 | scan_omp (&OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1834, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.gimple_reduction_merge, ctx); |
1835 | } |
1836 | else if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1836, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_LASTPRIVATE |
1837 | && OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1837, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.gimple_reduction_init) |
1838 | scan_omp (&OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1838, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.gimple_reduction_init, ctx); |
1839 | else if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1839, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_LINEAR |
1840 | && OMP_CLAUSE_LINEAR_GIMPLE_SEQ (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1840, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.gimple_reduction_init) |
1841 | scan_omp (&OMP_CLAUSE_LINEAR_GIMPLE_SEQ (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1841, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.gimple_reduction_init, ctx); |
1842 | } |
1843 | } |
1844 | |
1845 | /* Create a new name for omp child function. Returns an identifier. */ |
1846 | |
1847 | static tree |
1848 | create_omp_child_function_name (bool task_copy) |
1849 | { |
1850 | return clone_function_name_numbered (current_function_decl, |
1851 | task_copy ? "_omp_cpyfn" : "_omp_fn"); |
1852 | } |
1853 | |
1854 | /* Return true if CTX may belong to offloaded code: either if current function |
1855 | is offloaded, or any enclosing context corresponds to a target region. */ |
1856 | |
1857 | static bool |
1858 | omp_maybe_offloaded_ctx (omp_context *ctx) |
1859 | { |
1860 | if (cgraph_node::get (current_function_decl)->offloadable) |
1861 | return true; |
1862 | for (; ctx; ctx = ctx->outer) |
1863 | if (is_gimple_omp_offloaded (ctx->stmt)) |
1864 | return true; |
1865 | return false; |
1866 | } |
1867 | |
1868 | /* Build a decl for the omp child function. It'll not contain a body |
1869 | yet, just the bare decl. */ |
1870 | |
1871 | static void |
1872 | create_omp_child_function (omp_context *ctx, bool task_copy) |
1873 | { |
1874 | tree decl, type, name, t; |
1875 | |
1876 | name = create_omp_child_function_name (task_copy); |
1877 | if (task_copy) |
1878 | type = build_function_type_list (void_type_nodeglobal_trees[TI_VOID_TYPE], ptr_type_nodeglobal_trees[TI_PTR_TYPE], |
1879 | ptr_type_nodeglobal_trees[TI_PTR_TYPE], NULL_TREE(tree) nullptr); |
1880 | else |
1881 | type = build_function_type_list (void_type_nodeglobal_trees[TI_VOID_TYPE], ptr_type_nodeglobal_trees[TI_PTR_TYPE], NULL_TREE(tree) nullptr); |
1882 | |
1883 | decl = build_decl (gimple_location (ctx->stmt), FUNCTION_DECL, name, type); |
1884 | |
1885 | gcc_checking_assert (!is_gimple_omp_oacc (ctx->stmt)((void)(!(!is_gimple_omp_oacc (ctx->stmt) || !task_copy) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1886, __FUNCTION__), 0 : 0)) |
1886 | || !task_copy)((void)(!(!is_gimple_omp_oacc (ctx->stmt) || !task_copy) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1886, __FUNCTION__), 0 : 0)); |
1887 | if (!task_copy) |
1888 | ctx->cb.dst_fn = decl; |
1889 | else |
1890 | gimple_omp_task_set_copy_fn (ctx->stmt, decl); |
1891 | |
1892 | TREE_STATIC (decl)((decl)->base.static_flag) = 1; |
1893 | TREE_USED (decl)((decl)->base.used_flag) = 1; |
1894 | DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1894, __FUNCTION__))->decl_common.artificial_flag) = 1; |
1895 | DECL_IGNORED_P (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1895, __FUNCTION__))->decl_common.ignored_flag) = 0; |
1896 | TREE_PUBLIC (decl)((decl)->base.public_flag) = 0; |
1897 | DECL_UNINLINABLE (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1897, __FUNCTION__, (FUNCTION_DECL)))->function_decl.uninlinable ) = 1; |
1898 | DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1898, __FUNCTION__))->decl_common.decl_flag_1) = 0; |
1899 | DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1899, __FUNCTION__))->decl_minimal.context) = NULL_TREE(tree) nullptr; |
1900 | DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1900, __FUNCTION__))->decl_common.initial) = make_node (BLOCK); |
1901 | BLOCK_SUPERCONTEXT (DECL_INITIAL (decl))((tree_check ((((contains_struct_check ((decl), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1901, __FUNCTION__))->decl_common.initial)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1901, __FUNCTION__, (BLOCK)))->block.supercontext) = decl; |
1902 | DECL_ATTRIBUTES (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1902, __FUNCTION__))->decl_common.attributes) = DECL_ATTRIBUTES (current_function_decl)((contains_struct_check ((current_function_decl), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1902, __FUNCTION__))->decl_common.attributes); |
1903 | /* Remove omp declare simd attribute from the new attributes. */ |
1904 | if (tree a = lookup_attribute ("omp declare simd", DECL_ATTRIBUTES (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1904, __FUNCTION__))->decl_common.attributes))) |
1905 | { |
1906 | while (tree a2 = lookup_attribute ("omp declare simd", TREE_CHAIN (a)((contains_struct_check ((a), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1906, __FUNCTION__))->common.chain))) |
1907 | a = a2; |
1908 | a = TREE_CHAIN (a)((contains_struct_check ((a), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1908, __FUNCTION__))->common.chain); |
1909 | for (tree *p = &DECL_ATTRIBUTES (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1909, __FUNCTION__))->decl_common.attributes); *p != a;) |
1910 | if (is_attribute_p ("omp declare simd", get_attribute_name (*p))) |
1911 | *p = TREE_CHAIN (*p)((contains_struct_check ((*p), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1911, __FUNCTION__))->common.chain); |
1912 | else |
1913 | { |
1914 | tree chain = TREE_CHAIN (*p)((contains_struct_check ((*p), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1914, __FUNCTION__))->common.chain); |
1915 | *p = copy_node (*p); |
1916 | p = &TREE_CHAIN (*p)((contains_struct_check ((*p), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1916, __FUNCTION__))->common.chain); |
1917 | *p = chain; |
1918 | } |
1919 | } |
1920 | DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1920, __FUNCTION__, (FUNCTION_DECL)))->function_decl.function_specific_optimization ) |
1921 | = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (current_function_decl)((tree_check ((current_function_decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1921, __FUNCTION__, (FUNCTION_DECL)))->function_decl.function_specific_optimization ); |
1922 | DECL_FUNCTION_SPECIFIC_TARGET (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1922, __FUNCTION__, (FUNCTION_DECL)))->function_decl.function_specific_target ) |
1923 | = DECL_FUNCTION_SPECIFIC_TARGET (current_function_decl)((tree_check ((current_function_decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1923, __FUNCTION__, (FUNCTION_DECL)))->function_decl.function_specific_target ); |
1924 | DECL_FUNCTION_VERSIONED (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1924, __FUNCTION__, (FUNCTION_DECL)))->function_decl.versioned_function ) |
1925 | = DECL_FUNCTION_VERSIONED (current_function_decl)((tree_check ((current_function_decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1925, __FUNCTION__, (FUNCTION_DECL)))->function_decl.versioned_function ); |
1926 | |
1927 | if (omp_maybe_offloaded_ctx (ctx)) |
1928 | { |
1929 | cgraph_node::get_create (decl)->offloadable = 1; |
1930 | if (ENABLE_OFFLOADING0) |
1931 | g->have_offload = true; |
1932 | } |
1933 | |
1934 | if (cgraph_node::get_create (decl)->offloadable |
1935 | && !lookup_attribute ("omp declare target", |
1936 | DECL_ATTRIBUTES (current_function_decl)((contains_struct_check ((current_function_decl), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1936, __FUNCTION__))->decl_common.attributes))) |
1937 | { |
1938 | const char *target_attr = (is_gimple_omp_offloaded (ctx->stmt) |
1939 | ? "omp target entrypoint" |
1940 | : "omp declare target"); |
1941 | DECL_ATTRIBUTES (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1941, __FUNCTION__))->decl_common.attributes) |
1942 | = tree_cons (get_identifier (target_attr)(__builtin_constant_p (target_attr) ? get_identifier_with_length ((target_attr), strlen (target_attr)) : get_identifier (target_attr )), |
1943 | NULL_TREE(tree) nullptr, DECL_ATTRIBUTES (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1943, __FUNCTION__))->decl_common.attributes)); |
1944 | } |
1945 | |
1946 | t = build_decl (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1946, __FUNCTION__))->decl_minimal.locus), |
1947 | RESULT_DECL, NULL_TREE(tree) nullptr, void_type_nodeglobal_trees[TI_VOID_TYPE]); |
1948 | DECL_ARTIFICIAL (t)((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1948, __FUNCTION__))->decl_common.artificial_flag) = 1; |
1949 | DECL_IGNORED_P (t)((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1949, __FUNCTION__))->decl_common.ignored_flag) = 1; |
1950 | DECL_CONTEXT (t)((contains_struct_check ((t), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1950, __FUNCTION__))->decl_minimal.context) = decl; |
1951 | DECL_RESULT (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1951, __FUNCTION__, (FUNCTION_DECL)))->decl_non_common.result ) = t; |
1952 | |
1953 | tree data_name = get_identifier (".omp_data_i")(__builtin_constant_p (".omp_data_i") ? get_identifier_with_length ((".omp_data_i"), strlen (".omp_data_i")) : get_identifier ( ".omp_data_i")); |
1954 | t = build_decl (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1954, __FUNCTION__))->decl_minimal.locus), PARM_DECL, data_name, |
1955 | ptr_type_nodeglobal_trees[TI_PTR_TYPE]); |
1956 | DECL_ARTIFICIAL (t)((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1956, __FUNCTION__))->decl_common.artificial_flag) = 1; |
1957 | DECL_NAMELESS (t)((contains_struct_check ((t), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1957, __FUNCTION__))->base.u.bits.nameless_flag) = 1; |
1958 | DECL_ARG_TYPE (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1958, __FUNCTION__, (PARM_DECL)))->decl_common.initial) = ptr_type_nodeglobal_trees[TI_PTR_TYPE]; |
1959 | DECL_CONTEXT (t)((contains_struct_check ((t), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1959, __FUNCTION__))->decl_minimal.context) = current_function_decl; |
1960 | TREE_USED (t)((t)->base.used_flag) = 1; |
1961 | TREE_READONLY (t)((non_type_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1961, __FUNCTION__))->base.readonly_flag) = 1; |
1962 | DECL_ARGUMENTS (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1962, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments ) = t; |
1963 | if (!task_copy) |
1964 | ctx->receiver_decl = t; |
1965 | else |
1966 | { |
1967 | t = build_decl (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1967, __FUNCTION__))->decl_minimal.locus), |
1968 | PARM_DECL, get_identifier (".omp_data_o")(__builtin_constant_p (".omp_data_o") ? get_identifier_with_length ((".omp_data_o"), strlen (".omp_data_o")) : get_identifier ( ".omp_data_o")), |
1969 | ptr_type_nodeglobal_trees[TI_PTR_TYPE]); |
1970 | DECL_ARTIFICIAL (t)((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1970, __FUNCTION__))->decl_common.artificial_flag) = 1; |
1971 | DECL_NAMELESS (t)((contains_struct_check ((t), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1971, __FUNCTION__))->base.u.bits.nameless_flag) = 1; |
1972 | DECL_ARG_TYPE (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1972, __FUNCTION__, (PARM_DECL)))->decl_common.initial) = ptr_type_nodeglobal_trees[TI_PTR_TYPE]; |
1973 | DECL_CONTEXT (t)((contains_struct_check ((t), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1973, __FUNCTION__))->decl_minimal.context) = current_function_decl; |
1974 | TREE_USED (t)((t)->base.used_flag) = 1; |
1975 | TREE_ADDRESSABLE (t)((t)->base.addressable_flag) = 1; |
1976 | DECL_CHAIN (t)(((contains_struct_check (((contains_struct_check ((t), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1976, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1976, __FUNCTION__))->common.chain)) = DECL_ARGUMENTS (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1976, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments ); |
1977 | DECL_ARGUMENTS (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 1977, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments ) = t; |
1978 | } |
1979 | |
1980 | /* Allocate memory for the function structure. The call to |
1981 | allocate_struct_function clobbers CFUN, so we need to restore |
1982 | it afterward. */ |
1983 | push_struct_function (decl); |
1984 | cfun(cfun + 0)->function_end_locus = gimple_location (ctx->stmt); |
1985 | init_tree_ssa (cfun(cfun + 0)); |
1986 | pop_cfun (); |
1987 | } |
1988 | |
1989 | /* Callback for walk_gimple_seq. Check if combined parallel |
1990 | contains gimple_omp_for_combined_into_p OMP_FOR. */ |
1991 | |
1992 | tree |
1993 | omp_find_combined_for (gimple_stmt_iterator *gsi_p, |
1994 | bool *handled_ops_p, |
1995 | struct walk_stmt_info *wi) |
1996 | { |
1997 | gimple *stmt = gsi_stmt (*gsi_p); |
1998 | |
1999 | *handled_ops_p = true; |
2000 | switch (gimple_code (stmt)) |
2001 | { |
2002 | WALK_SUBSTMTScase GIMPLE_BIND: case GIMPLE_TRY: case GIMPLE_CATCH: case GIMPLE_EH_FILTER : case GIMPLE_TRANSACTION: *handled_ops_p = false; break;; |
2003 | |
2004 | case GIMPLE_OMP_FOR: |
2005 | if (gimple_omp_for_combined_into_p (stmt) |
2006 | && gimple_omp_for_kind (stmt) |
2007 | == *(const enum gf_mask *) (wi->info)) |
2008 | { |
2009 | wi->info = stmt; |
2010 | return integer_zero_nodeglobal_trees[TI_INTEGER_ZERO]; |
2011 | } |
2012 | break; |
2013 | default: |
2014 | break; |
2015 | } |
2016 | return NULLnullptr; |
2017 | } |
2018 | |
2019 | /* Add _LOOPTEMP_/_REDUCTEMP_ clauses on OpenMP parallel or task. */ |
2020 | |
2021 | static void |
2022 | add_taskreg_looptemp_clauses (enum gf_mask msk, gimple *stmt, |
2023 | omp_context *outer_ctx) |
2024 | { |
2025 | struct walk_stmt_info wi; |
2026 | |
2027 | memset (&wi, 0, sizeof (wi)); |
2028 | wi.val_only = true; |
2029 | wi.info = (void *) &msk; |
2030 | walk_gimple_seq (gimple_omp_body (stmt), omp_find_combined_for, NULLnullptr, &wi); |
2031 | if (wi.info != (void *) &msk) |
2032 | { |
2033 | gomp_for *for_stmt = as_a <gomp_for *> ((gimple *) wi.info); |
2034 | struct omp_for_data fd; |
2035 | omp_extract_for_data (for_stmt, &fd, NULLnullptr); |
2036 | /* We need two temporaries with fd.loop.v type (istart/iend) |
2037 | and then (fd.collapse - 1) temporaries with the same |
2038 | type for count2 ... countN-1 vars if not constant. */ |
2039 | size_t count = 2, i; |
2040 | tree type = fd.iter_type; |
2041 | if (fd.collapse > 1 |
2042 | && TREE_CODE (fd.loop.n2)((enum tree_code) (fd.loop.n2)->base.code) != INTEGER_CST) |
2043 | { |
2044 | count += fd.collapse - 1; |
2045 | /* If there are lastprivate clauses on the inner |
2046 | GIMPLE_OMP_FOR, add one more temporaries for the total number |
2047 | of iterations (product of count1 ... countN-1). */ |
2048 | if (omp_find_clause (gimple_omp_for_clauses (for_stmt), |
2049 | OMP_CLAUSE_LASTPRIVATE) |
2050 | || (msk == GF_OMP_FOR_KIND_FOR |
2051 | && omp_find_clause (gimple_omp_parallel_clauses (stmt), |
2052 | OMP_CLAUSE_LASTPRIVATE))) |
2053 | { |
2054 | tree temp = create_tmp_var (type); |
2055 | tree c = build_omp_clause (UNKNOWN_LOCATION((location_t) 0), |
2056 | OMP_CLAUSE__LOOPTEMP_); |
2057 | insert_decl_map (&outer_ctx->cb, temp, temp); |
2058 | OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2058, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2058, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2058, __FUNCTION__))) = temp; |
2059 | OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2059, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2059, __FUNCTION__))->common.chain) = gimple_omp_taskreg_clauses (stmt); |
2060 | gimple_omp_taskreg_set_clauses (stmt, c); |
2061 | } |
2062 | if (fd.non_rect |
2063 | && fd.last_nonrect == fd.first_nonrect + 1) |
2064 | if (tree v = gimple_omp_for_index (for_stmt, fd.last_nonrect)) |
2065 | if (!TYPE_UNSIGNED (TREE_TYPE (v))((tree_class_check ((((contains_struct_check ((v), (TS_TYPED) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2065, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2065, __FUNCTION__))->base.u.bits.unsigned_flag)) |
2066 | { |
2067 | v = gimple_omp_for_index (for_stmt, fd.first_nonrect); |
2068 | tree type2 = TREE_TYPE (v)((contains_struct_check ((v), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2068, __FUNCTION__))->typed.type); |
2069 | count++; |
2070 | for (i = 0; i < 3; i++) |
2071 | { |
2072 | tree temp = create_tmp_var (type2); |
2073 | tree c = build_omp_clause (UNKNOWN_LOCATION((location_t) 0), |
2074 | OMP_CLAUSE__LOOPTEMP_); |
2075 | insert_decl_map (&outer_ctx->cb, temp, temp); |
2076 | OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2076, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2076, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2076, __FUNCTION__))) = temp; |
2077 | OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2077, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2077, __FUNCTION__))->common.chain) = gimple_omp_taskreg_clauses (stmt); |
2078 | gimple_omp_taskreg_set_clauses (stmt, c); |
2079 | } |
2080 | } |
2081 | } |
2082 | for (i = 0; i < count; i++) |
2083 | { |
2084 | tree temp = create_tmp_var (type); |
2085 | tree c = build_omp_clause (UNKNOWN_LOCATION((location_t) 0), OMP_CLAUSE__LOOPTEMP_); |
2086 | insert_decl_map (&outer_ctx->cb, temp, temp); |
2087 | OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2087, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2087, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2087, __FUNCTION__))) = temp; |
2088 | OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2088, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2088, __FUNCTION__))->common.chain) = gimple_omp_taskreg_clauses (stmt); |
2089 | gimple_omp_taskreg_set_clauses (stmt, c); |
2090 | } |
2091 | } |
2092 | if (msk == GF_OMP_FOR_KIND_TASKLOOP |
2093 | && omp_find_clause (gimple_omp_task_clauses (stmt), |
2094 | OMP_CLAUSE_REDUCTION)) |
2095 | { |
2096 | tree type = build_pointer_type (pointer_sized_int_nodeglobal_trees[TI_POINTER_SIZED_TYPE]); |
2097 | tree temp = create_tmp_var (type); |
2098 | tree c = build_omp_clause (UNKNOWN_LOCATION((location_t) 0), OMP_CLAUSE__REDUCTEMP_); |
2099 | insert_decl_map (&outer_ctx->cb, temp, temp); |
2100 | OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2100, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2100, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2100, __FUNCTION__))) = temp; |
2101 | OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2101, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2101, __FUNCTION__))->common.chain) = gimple_omp_task_clauses (stmt); |
2102 | gimple_omp_task_set_clauses (stmt, c); |
2103 | } |
2104 | } |
2105 | |
2106 | /* Scan an OpenMP parallel directive. */ |
2107 | |
2108 | static void |
2109 | scan_omp_parallel (gimple_stmt_iterator *gsi, omp_context *outer_ctx) |
2110 | { |
2111 | omp_context *ctx; |
2112 | tree name; |
2113 | gomp_parallel *stmt = as_a <gomp_parallel *> (gsi_stmt (*gsi)); |
2114 | |
2115 | /* Ignore parallel directives with empty bodies, unless there |
2116 | are copyin clauses. */ |
2117 | if (optimizeglobal_options.x_optimize > 0 |
2118 | && empty_body_p (gimple_omp_body (stmt)) |
2119 | && omp_find_clause (gimple_omp_parallel_clauses (stmt), |
2120 | OMP_CLAUSE_COPYIN) == NULLnullptr) |
2121 | { |
2122 | gsi_replace (gsi, gimple_build_nop (), false); |
2123 | return; |
2124 | } |
2125 | |
2126 | if (gimple_omp_parallel_combined_p (stmt)) |
2127 | add_taskreg_looptemp_clauses (GF_OMP_FOR_KIND_FOR, stmt, outer_ctx); |
2128 | for (tree c = omp_find_clause (gimple_omp_parallel_clauses (stmt), |
2129 | OMP_CLAUSE_REDUCTION); |
2130 | c; c = omp_find_clause (OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2130, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2130, __FUNCTION__))->common.chain), OMP_CLAUSE_REDUCTION)) |
2131 | if (OMP_CLAUSE_REDUCTION_TASK (c)(((omp_clause_subcode_check ((c), (OMP_CLAUSE_REDUCTION), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2131, __FUNCTION__)))->base.protected_flag)) |
2132 | { |
2133 | tree type = build_pointer_type (pointer_sized_int_nodeglobal_trees[TI_POINTER_SIZED_TYPE]); |
2134 | tree temp = create_tmp_var (type); |
2135 | tree c = build_omp_clause (UNKNOWN_LOCATION((location_t) 0), OMP_CLAUSE__REDUCTEMP_); |
2136 | if (outer_ctx) |
2137 | insert_decl_map (&outer_ctx->cb, temp, temp); |
2138 | OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2138, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2138, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2138, __FUNCTION__))) = temp; |
2139 | OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2139, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2139, __FUNCTION__))->common.chain) = gimple_omp_parallel_clauses (stmt); |
2140 | gimple_omp_parallel_set_clauses (stmt, c); |
2141 | break; |
2142 | } |
2143 | else if (OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2143, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2143, __FUNCTION__))->common.chain) == NULL_TREE(tree) nullptr) |
2144 | break; |
2145 | |
2146 | ctx = new_omp_context (stmt, outer_ctx); |
2147 | taskreg_contexts.safe_push (ctx); |
2148 | if (taskreg_nesting_level > 1) |
2149 | ctx->is_nested = true; |
2150 | ctx->field_map = splay_tree_new (splay_tree_compare_pointers, 0, 0); |
2151 | ctx->record_type = lang_hooks.types.make_type (RECORD_TYPE); |
2152 | name = create_tmp_var_name (".omp_data_s"); |
2153 | name = build_decl (gimple_location (stmt), |
2154 | TYPE_DECL, name, ctx->record_type); |
2155 | DECL_ARTIFICIAL (name)((contains_struct_check ((name), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2155, __FUNCTION__))->decl_common.artificial_flag) = 1; |
2156 | DECL_NAMELESS (name)((contains_struct_check ((name), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2156, __FUNCTION__))->base.u.bits.nameless_flag) = 1; |
2157 | TYPE_NAME (ctx->record_type)((tree_class_check ((ctx->record_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2157, __FUNCTION__))->type_common.name) = name; |
2158 | TYPE_ARTIFICIAL (ctx->record_type)((tree_class_check ((ctx->record_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2158, __FUNCTION__))->base.nowarning_flag) = 1; |
2159 | create_omp_child_function (ctx, false); |
2160 | gimple_omp_parallel_set_child_fn (stmt, ctx->cb.dst_fn); |
2161 | |
2162 | scan_sharing_clauses (gimple_omp_parallel_clauses (stmt), ctx); |
2163 | scan_omp (gimple_omp_body_ptr (stmt), ctx); |
2164 | |
2165 | if (TYPE_FIELDS (ctx->record_type)((tree_check3 ((ctx->record_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2165, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values) == NULLnullptr) |
2166 | ctx->record_type = ctx->receiver_decl = NULLnullptr; |
2167 | } |
2168 | |
2169 | /* Scan an OpenMP task directive. */ |
2170 | |
2171 | static void |
2172 | scan_omp_task (gimple_stmt_iterator *gsi, omp_context *outer_ctx) |
2173 | { |
2174 | omp_context *ctx; |
2175 | tree name, t; |
2176 | gomp_task *stmt = as_a <gomp_task *> (gsi_stmt (*gsi)); |
2177 | |
2178 | /* Ignore task directives with empty bodies, unless they have depend |
2179 | clause. */ |
2180 | if (optimizeglobal_options.x_optimize > 0 |
2181 | && gimple_omp_body (stmt) |
2182 | && empty_body_p (gimple_omp_body (stmt)) |
2183 | && !omp_find_clause (gimple_omp_task_clauses (stmt), OMP_CLAUSE_DEPEND)) |
2184 | { |
2185 | gsi_replace (gsi, gimple_build_nop (), false); |
2186 | return; |
2187 | } |
2188 | |
2189 | if (gimple_omp_task_taskloop_p (stmt)) |
2190 | add_taskreg_looptemp_clauses (GF_OMP_FOR_KIND_TASKLOOP, stmt, outer_ctx); |
2191 | |
2192 | ctx = new_omp_context (stmt, outer_ctx); |
2193 | |
2194 | if (gimple_omp_task_taskwait_p (stmt)) |
2195 | { |
2196 | scan_sharing_clauses (gimple_omp_task_clauses (stmt), ctx); |
2197 | return; |
2198 | } |
2199 | |
2200 | taskreg_contexts.safe_push (ctx); |
2201 | if (taskreg_nesting_level > 1) |
2202 | ctx->is_nested = true; |
2203 | ctx->field_map = splay_tree_new (splay_tree_compare_pointers, 0, 0); |
2204 | ctx->record_type = lang_hooks.types.make_type (RECORD_TYPE); |
2205 | name = create_tmp_var_name (".omp_data_s"); |
2206 | name = build_decl (gimple_location (stmt), |
2207 | TYPE_DECL, name, ctx->record_type); |
2208 | DECL_ARTIFICIAL (name)((contains_struct_check ((name), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2208, __FUNCTION__))->decl_common.artificial_flag) = 1; |
2209 | DECL_NAMELESS (name)((contains_struct_check ((name), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2209, __FUNCTION__))->base.u.bits.nameless_flag) = 1; |
2210 | TYPE_NAME (ctx->record_type)((tree_class_check ((ctx->record_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2210, __FUNCTION__))->type_common.name) = name; |
2211 | TYPE_ARTIFICIAL (ctx->record_type)((tree_class_check ((ctx->record_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2211, __FUNCTION__))->base.nowarning_flag) = 1; |
2212 | create_omp_child_function (ctx, false); |
2213 | gimple_omp_task_set_child_fn (stmt, ctx->cb.dst_fn); |
2214 | |
2215 | scan_sharing_clauses (gimple_omp_task_clauses (stmt), ctx); |
2216 | |
2217 | if (ctx->srecord_type) |
2218 | { |
2219 | name = create_tmp_var_name (".omp_data_a"); |
2220 | name = build_decl (gimple_location (stmt), |
2221 | TYPE_DECL, name, ctx->srecord_type); |
2222 | DECL_ARTIFICIAL (name)((contains_struct_check ((name), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2222, __FUNCTION__))->decl_common.artificial_flag) = 1; |
2223 | DECL_NAMELESS (name)((contains_struct_check ((name), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2223, __FUNCTION__))->base.u.bits.nameless_flag) = 1; |
2224 | TYPE_NAME (ctx->srecord_type)((tree_class_check ((ctx->srecord_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2224, __FUNCTION__))->type_common.name) = name; |
2225 | TYPE_ARTIFICIAL (ctx->srecord_type)((tree_class_check ((ctx->srecord_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2225, __FUNCTION__))->base.nowarning_flag) = 1; |
2226 | create_omp_child_function (ctx, true); |
2227 | } |
2228 | |
2229 | scan_omp (gimple_omp_body_ptr (stmt), ctx); |
2230 | |
2231 | if (TYPE_FIELDS (ctx->record_type)((tree_check3 ((ctx->record_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2231, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values) == NULLnullptr) |
2232 | { |
2233 | ctx->record_type = ctx->receiver_decl = NULLnullptr; |
2234 | t = build_int_cst (long_integer_type_nodeinteger_types[itk_long], 0); |
2235 | gimple_omp_task_set_arg_size (stmt, t); |
2236 | t = build_int_cst (long_integer_type_nodeinteger_types[itk_long], 1); |
2237 | gimple_omp_task_set_arg_align (stmt, t); |
2238 | } |
2239 | } |
2240 | |
2241 | /* Helper function for finish_taskreg_scan, called through walk_tree. |
2242 | If maybe_lookup_decl_in_outer_context returns non-NULL for some |
2243 | tree, replace it in the expression. */ |
2244 | |
2245 | static tree |
2246 | finish_taskreg_remap (tree *tp, int *walk_subtrees, void *data) |
2247 | { |
2248 | if (VAR_P (*tp)(((enum tree_code) (*tp)->base.code) == VAR_DECL)) |
2249 | { |
2250 | omp_context *ctx = (omp_context *) data; |
2251 | tree t = maybe_lookup_decl_in_outer_ctx (*tp, ctx); |
2252 | if (t != *tp) |
2253 | { |
2254 | if (DECL_HAS_VALUE_EXPR_P (t)((tree_check3 ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2254, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL)) ) ->decl_common.decl_flag_2)) |
2255 | t = unshare_expr (DECL_VALUE_EXPR (t)(decl_value_expr_lookup ((contains_struct_check ((t), (TS_DECL_WRTL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2255, __FUNCTION__))))); |
2256 | *tp = t; |
2257 | } |
2258 | *walk_subtrees = 0; |
2259 | } |
2260 | else if (IS_TYPE_OR_DECL_P (*tp)((tree_code_type[(int) (((enum tree_code) (*tp)->base.code ))] == tcc_type) || (tree_code_type[(int) (((enum tree_code) ( *tp)->base.code))] == tcc_declaration))) |
2261 | *walk_subtrees = 0; |
2262 | return NULL_TREE(tree) nullptr; |
2263 | } |
2264 | |
2265 | /* If any decls have been made addressable during scan_omp, |
2266 | adjust their fields if needed, and layout record types |
2267 | of parallel/task constructs. */ |
2268 | |
2269 | static void |
2270 | finish_taskreg_scan (omp_context *ctx) |
2271 | { |
2272 | if (ctx->record_type == NULL_TREE(tree) nullptr) |
2273 | return; |
2274 | |
2275 | /* If any task_shared_vars were needed, verify all |
2276 | OMP_CLAUSE_SHARED clauses on GIMPLE_OMP_{PARALLEL,TASK,TEAMS} |
2277 | statements if use_pointer_for_field hasn't changed |
2278 | because of that. If it did, update field types now. */ |
2279 | if (task_shared_vars) |
2280 | { |
2281 | tree c; |
2282 | |
2283 | for (c = gimple_omp_taskreg_clauses (ctx->stmt); |
2284 | c; c = OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2284, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2284, __FUNCTION__))->common.chain)) |
2285 | if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2285, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_SHARED |
2286 | && !OMP_CLAUSE_SHARED_FIRSTPRIVATE (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_SHARED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2286, __FUNCTION__))->base.public_flag)) |
2287 | { |
2288 | tree decl = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2288, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2288, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2288, __FUNCTION__))); |
2289 | |
2290 | /* Global variables don't need to be copied, |
2291 | the receiver side will use them directly. */ |
2292 | if (is_global_var (maybe_lookup_decl_in_outer_ctx (decl, ctx))) |
2293 | continue; |
2294 | if (!bitmap_bit_p (task_shared_vars, DECL_UID (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2294, __FUNCTION__))->decl_minimal.uid)) |
2295 | || !use_pointer_for_field (decl, ctx)) |
2296 | continue; |
2297 | tree field = lookup_field (decl, ctx); |
2298 | if (TREE_CODE (TREE_TYPE (field))((enum tree_code) (((contains_struct_check ((field), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2298, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE |
2299 | && TREE_TYPE (TREE_TYPE (field))((contains_struct_check ((((contains_struct_check ((field), ( TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2299, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2299, __FUNCTION__))->typed.type) == TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2299, __FUNCTION__))->typed.type)) |
2300 | continue; |
2301 | TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2301, __FUNCTION__))->typed.type) = build_pointer_type (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2301, __FUNCTION__))->typed.type)); |
2302 | TREE_THIS_VOLATILE (field)((field)->base.volatile_flag) = 0; |
2303 | DECL_USER_ALIGN (field)((contains_struct_check ((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2303, __FUNCTION__))->base.u.bits.user_align) = 0; |
2304 | SET_DECL_ALIGN (field, TYPE_ALIGN (TREE_TYPE (field)))(((contains_struct_check ((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2304, __FUNCTION__))->decl_common.align) = ffs_hwi (((tree_class_check ((((contains_struct_check ((field), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2304, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2304, __FUNCTION__))->type_common.align ? ((unsigned)1) << ((((contains_struct_check ((field), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2304, __FUNCTION__))->typed.type))->type_common.align - 1) : 0))); |
2305 | if (TYPE_ALIGN (ctx->record_type)((tree_class_check ((ctx->record_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2305, __FUNCTION__))->type_common.align ? ((unsigned)1) << ((ctx->record_type)->type_common.align - 1) : 0) < DECL_ALIGN (field)(((contains_struct_check ((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2305, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((field), (TS_DECL_COMMON) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2305, __FUNCTION__))->decl_common.align) - 1) : 0)) |
2306 | SET_TYPE_ALIGN (ctx->record_type, DECL_ALIGN (field))((tree_class_check ((ctx->record_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2306, __FUNCTION__))->type_common.align = ffs_hwi ((((contains_struct_check ((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2306, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((field), (TS_DECL_COMMON) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2306, __FUNCTION__))->decl_common.align) - 1) : 0))); |
2307 | if (ctx->srecord_type) |
2308 | { |
2309 | tree sfield = lookup_sfield (decl, ctx); |
2310 | TREE_TYPE (sfield)((contains_struct_check ((sfield), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2310, __FUNCTION__))->typed.type) = TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2310, __FUNCTION__))->typed.type); |
2311 | TREE_THIS_VOLATILE (sfield)((sfield)->base.volatile_flag) = 0; |
2312 | DECL_USER_ALIGN (sfield)((contains_struct_check ((sfield), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2312, __FUNCTION__))->base.u.bits.user_align) = 0; |
2313 | SET_DECL_ALIGN (sfield, DECL_ALIGN (field))(((contains_struct_check ((sfield), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2313, __FUNCTION__))->decl_common.align) = ffs_hwi ((((contains_struct_check ((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2313, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((field), (TS_DECL_COMMON) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2313, __FUNCTION__))->decl_common.align) - 1) : 0))); |
2314 | if (TYPE_ALIGN (ctx->srecord_type)((tree_class_check ((ctx->srecord_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2314, __FUNCTION__))->type_common.align ? ((unsigned)1) << ((ctx->srecord_type)->type_common.align - 1) : 0) < DECL_ALIGN (sfield)(((contains_struct_check ((sfield), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2314, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((sfield), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2314, __FUNCTION__))->decl_common.align) - 1) : 0)) |
2315 | SET_TYPE_ALIGN (ctx->srecord_type, DECL_ALIGN (sfield))((tree_class_check ((ctx->srecord_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2315, __FUNCTION__))->type_common.align = ffs_hwi ((((contains_struct_check ((sfield), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2315, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((sfield), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2315, __FUNCTION__))->decl_common.align) - 1) : 0))); |
2316 | } |
2317 | } |
2318 | } |
2319 | |
2320 | if (gimple_code (ctx->stmt) == GIMPLE_OMP_PARALLEL) |
2321 | { |
2322 | tree clauses = gimple_omp_parallel_clauses (ctx->stmt); |
2323 | tree c = omp_find_clause (clauses, OMP_CLAUSE__REDUCTEMP_); |
2324 | if (c) |
2325 | { |
2326 | /* Move the _reductemp_ clause first. GOMP_parallel_reductions |
2327 | expects to find it at the start of data. */ |
2328 | tree f = lookup_field (OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2328, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2328, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2328, __FUNCTION__))), ctx); |
2329 | tree *p = &TYPE_FIELDS (ctx->record_type)((tree_check3 ((ctx->record_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2329, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); |
2330 | while (*p) |
2331 | if (*p == f) |
2332 | { |
2333 | *p = DECL_CHAIN (*p)(((contains_struct_check (((contains_struct_check ((*p), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2333, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2333, __FUNCTION__))->common.chain)); |
2334 | break; |
2335 | } |
2336 | else |
2337 | p = &DECL_CHAIN (*p)(((contains_struct_check (((contains_struct_check ((*p), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2337, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2337, __FUNCTION__))->common.chain)); |
2338 | DECL_CHAIN (f)(((contains_struct_check (((contains_struct_check ((f), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2338, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2338, __FUNCTION__))->common.chain)) = TYPE_FIELDS (ctx->record_type)((tree_check3 ((ctx->record_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2338, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); |
2339 | TYPE_FIELDS (ctx->record_type)((tree_check3 ((ctx->record_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2339, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values) = f; |
2340 | } |
2341 | layout_type (ctx->record_type); |
2342 | fixup_child_record_type (ctx); |
2343 | } |
2344 | else if (gimple_code (ctx->stmt) == GIMPLE_OMP_TEAMS) |
2345 | { |
2346 | layout_type (ctx->record_type); |
2347 | fixup_child_record_type (ctx); |
2348 | } |
2349 | else |
2350 | { |
2351 | location_t loc = gimple_location (ctx->stmt); |
2352 | tree *p, vla_fields = NULL_TREE(tree) nullptr, *q = &vla_fields; |
2353 | /* Move VLA fields to the end. */ |
2354 | p = &TYPE_FIELDS (ctx->record_type)((tree_check3 ((ctx->record_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2354, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); |
2355 | while (*p) |
2356 | if (!TYPE_SIZE_UNIT (TREE_TYPE (*p))((tree_class_check ((((contains_struct_check ((*p), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2356, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2356, __FUNCTION__))->type_common.size_unit) |
2357 | || ! TREE_CONSTANT (TYPE_SIZE_UNIT (TREE_TYPE (*p)))((non_type_check ((((tree_class_check ((((contains_struct_check ((*p), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2357, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2357, __FUNCTION__))->type_common.size_unit)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2357, __FUNCTION__))->base.constant_flag)) |
2358 | { |
2359 | *q = *p; |
2360 | *p = TREE_CHAIN (*p)((contains_struct_check ((*p), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2360, __FUNCTION__))->common.chain); |
2361 | TREE_CHAIN (*q)((contains_struct_check ((*q), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2361, __FUNCTION__))->common.chain) = NULL_TREE(tree) nullptr; |
2362 | q = &TREE_CHAIN (*q)((contains_struct_check ((*q), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2362, __FUNCTION__))->common.chain); |
2363 | } |
2364 | else |
2365 | p = &DECL_CHAIN (*p)(((contains_struct_check (((contains_struct_check ((*p), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2365, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2365, __FUNCTION__))->common.chain)); |
2366 | *p = vla_fields; |
2367 | if (gimple_omp_task_taskloop_p (ctx->stmt)) |
2368 | { |
2369 | /* Move fields corresponding to first and second _looptemp_ |
2370 | clause first. There are filled by GOMP_taskloop |
2371 | and thus need to be in specific positions. */ |
2372 | tree clauses = gimple_omp_task_clauses (ctx->stmt); |
2373 | tree c1 = omp_find_clause (clauses, OMP_CLAUSE__LOOPTEMP_); |
2374 | tree c2 = omp_find_clause (OMP_CLAUSE_CHAIN (c1)((contains_struct_check (((tree_check ((c1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2374, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2374, __FUNCTION__))->common.chain), |
2375 | OMP_CLAUSE__LOOPTEMP_); |
2376 | tree c3 = omp_find_clause (clauses, OMP_CLAUSE__REDUCTEMP_); |
2377 | tree f1 = lookup_field (OMP_CLAUSE_DECL (c1)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2377, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2377, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2377, __FUNCTION__))), ctx); |
2378 | tree f2 = lookup_field (OMP_CLAUSE_DECL (c2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2378, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2378, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2378, __FUNCTION__))), ctx); |
2379 | tree f3 = c3 ? lookup_field (OMP_CLAUSE_DECL (c3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2379, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2379, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2379, __FUNCTION__))), ctx) : NULL_TREE(tree) nullptr; |
2380 | p = &TYPE_FIELDS (ctx->record_type)((tree_check3 ((ctx->record_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2380, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); |
2381 | while (*p) |
2382 | if (*p == f1 || *p == f2 || *p == f3) |
2383 | *p = DECL_CHAIN (*p)(((contains_struct_check (((contains_struct_check ((*p), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2383, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2383, __FUNCTION__))->common.chain)); |
2384 | else |
2385 | p = &DECL_CHAIN (*p)(((contains_struct_check (((contains_struct_check ((*p), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2385, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2385, __FUNCTION__))->common.chain)); |
2386 | DECL_CHAIN (f1)(((contains_struct_check (((contains_struct_check ((f1), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2386, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2386, __FUNCTION__))->common.chain)) = f2; |
2387 | if (c3) |
2388 | { |
2389 | DECL_CHAIN (f2)(((contains_struct_check (((contains_struct_check ((f2), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2389, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2389, __FUNCTION__))->common.chain)) = f3; |
2390 | DECL_CHAIN (f3)(((contains_struct_check (((contains_struct_check ((f3), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2390, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2390, __FUNCTION__))->common.chain)) = TYPE_FIELDS (ctx->record_type)((tree_check3 ((ctx->record_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2390, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); |
2391 | } |
2392 | else |
2393 | DECL_CHAIN (f2)(((contains_struct_check (((contains_struct_check ((f2), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2393, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2393, __FUNCTION__))->common.chain)) = TYPE_FIELDS (ctx->record_type)((tree_check3 ((ctx->record_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2393, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); |
2394 | TYPE_FIELDS (ctx->record_type)((tree_check3 ((ctx->record_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2394, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values) = f1; |
2395 | if (ctx->srecord_type) |
2396 | { |
2397 | f1 = lookup_sfield (OMP_CLAUSE_DECL (c1)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2397, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2397, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2397, __FUNCTION__))), ctx); |
2398 | f2 = lookup_sfield (OMP_CLAUSE_DECL (c2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2398, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2398, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2398, __FUNCTION__))), ctx); |
2399 | if (c3) |
2400 | f3 = lookup_sfield (OMP_CLAUSE_DECL (c3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2400, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2400, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2400, __FUNCTION__))), ctx); |
2401 | p = &TYPE_FIELDS (ctx->srecord_type)((tree_check3 ((ctx->srecord_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2401, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); |
2402 | while (*p) |
2403 | if (*p == f1 || *p == f2 || *p == f3) |
2404 | *p = DECL_CHAIN (*p)(((contains_struct_check (((contains_struct_check ((*p), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2404, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2404, __FUNCTION__))->common.chain)); |
2405 | else |
2406 | p = &DECL_CHAIN (*p)(((contains_struct_check (((contains_struct_check ((*p), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2406, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2406, __FUNCTION__))->common.chain)); |
2407 | DECL_CHAIN (f1)(((contains_struct_check (((contains_struct_check ((f1), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2407, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2407, __FUNCTION__))->common.chain)) = f2; |
2408 | DECL_CHAIN (f2)(((contains_struct_check (((contains_struct_check ((f2), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2408, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2408, __FUNCTION__))->common.chain)) = TYPE_FIELDS (ctx->srecord_type)((tree_check3 ((ctx->srecord_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2408, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); |
2409 | if (c3) |
2410 | { |
2411 | DECL_CHAIN (f2)(((contains_struct_check (((contains_struct_check ((f2), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2411, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2411, __FUNCTION__))->common.chain)) = f3; |
2412 | DECL_CHAIN (f3)(((contains_struct_check (((contains_struct_check ((f3), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2412, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2412, __FUNCTION__))->common.chain)) = TYPE_FIELDS (ctx->srecord_type)((tree_check3 ((ctx->srecord_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2412, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); |
2413 | } |
2414 | else |
2415 | DECL_CHAIN (f2)(((contains_struct_check (((contains_struct_check ((f2), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2415, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2415, __FUNCTION__))->common.chain)) = TYPE_FIELDS (ctx->srecord_type)((tree_check3 ((ctx->srecord_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2415, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); |
2416 | TYPE_FIELDS (ctx->srecord_type)((tree_check3 ((ctx->srecord_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2416, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values) = f1; |
2417 | } |
2418 | } |
2419 | layout_type (ctx->record_type); |
2420 | fixup_child_record_type (ctx); |
2421 | if (ctx->srecord_type) |
2422 | layout_type (ctx->srecord_type); |
2423 | tree t = fold_convert_loc (loc, long_integer_type_nodeinteger_types[itk_long], |
2424 | TYPE_SIZE_UNIT (ctx->record_type)((tree_class_check ((ctx->record_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2424, __FUNCTION__))->type_common.size_unit)); |
2425 | if (TREE_CODE (t)((enum tree_code) (t)->base.code) != INTEGER_CST) |
2426 | { |
2427 | t = unshare_expr (t); |
2428 | walk_tree (&t, finish_taskreg_remap, ctx, NULL)walk_tree_1 (&t, finish_taskreg_remap, ctx, nullptr, nullptr ); |
2429 | } |
2430 | gimple_omp_task_set_arg_size (ctx->stmt, t); |
2431 | t = build_int_cst (long_integer_type_nodeinteger_types[itk_long], |
2432 | TYPE_ALIGN_UNIT (ctx->record_type)(((tree_class_check ((ctx->record_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2432, __FUNCTION__))->type_common.align ? ((unsigned)1) << ((ctx->record_type)->type_common.align - 1) : 0) / (8) )); |
2433 | gimple_omp_task_set_arg_align (ctx->stmt, t); |
2434 | } |
2435 | } |
2436 | |
2437 | /* Find the enclosing offload context. */ |
2438 | |
2439 | static omp_context * |
2440 | enclosing_target_ctx (omp_context *ctx) |
2441 | { |
2442 | for (; ctx; ctx = ctx->outer) |
2443 | if (gimple_code (ctx->stmt) == GIMPLE_OMP_TARGET) |
2444 | break; |
2445 | |
2446 | return ctx; |
2447 | } |
2448 | |
2449 | /* Return whether CTX's parent compute construct is an OpenACC 'kernels' |
2450 | construct. |
2451 | (This doesn't include OpenACC 'kernels' decomposed parts.) */ |
2452 | |
2453 | static bool |
2454 | ctx_in_oacc_kernels_region (omp_context *ctx) |
2455 | { |
2456 | for (;ctx != NULLnullptr; ctx = ctx->outer) |
2457 | { |
2458 | gimple *stmt = ctx->stmt; |
2459 | if (gimple_code (stmt) == GIMPLE_OMP_TARGET |
2460 | && gimple_omp_target_kind (stmt) == GF_OMP_TARGET_KIND_OACC_KERNELS) |
2461 | return true; |
2462 | } |
2463 | |
2464 | return false; |
2465 | } |
2466 | |
2467 | /* Check the parallelism clauses inside a OpenACC 'kernels' region. |
2468 | (This doesn't include OpenACC 'kernels' decomposed parts.) |
2469 | Until kernels handling moves to use the same loop indirection |
2470 | scheme as parallel, we need to do this checking early. */ |
2471 | |
2472 | static unsigned |
2473 | check_oacc_kernel_gwv (gomp_for *stmt, omp_context *ctx) |
2474 | { |
2475 | bool checking = true; |
2476 | unsigned outer_mask = 0; |
2477 | unsigned this_mask = 0; |
2478 | bool has_seq = false, has_auto = false; |
2479 | |
2480 | if (ctx->outer) |
2481 | outer_mask = check_oacc_kernel_gwv (NULLnullptr, ctx->outer); |
2482 | if (!stmt) |
2483 | { |
2484 | checking = false; |
2485 | if (gimple_code (ctx->stmt) != GIMPLE_OMP_FOR) |
2486 | return outer_mask; |
2487 | stmt = as_a <gomp_for *> (ctx->stmt); |
2488 | } |
2489 | |
2490 | for (tree c = gimple_omp_for_clauses (stmt); c; c = OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2490, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2490, __FUNCTION__))->common.chain)) |
2491 | { |
2492 | switch (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2492, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code) |
2493 | { |
2494 | case OMP_CLAUSE_GANG: |
2495 | this_mask |= GOMP_DIM_MASK (GOMP_DIM_GANG)(1u << (0)); |
2496 | break; |
2497 | case OMP_CLAUSE_WORKER: |
2498 | this_mask |= GOMP_DIM_MASK (GOMP_DIM_WORKER)(1u << (1)); |
2499 | break; |
2500 | case OMP_CLAUSE_VECTOR: |
2501 | this_mask |= GOMP_DIM_MASK (GOMP_DIM_VECTOR)(1u << (2)); |
2502 | break; |
2503 | case OMP_CLAUSE_SEQ: |
2504 | has_seq = true; |
2505 | break; |
2506 | case OMP_CLAUSE_AUTO: |
2507 | has_auto = true; |
2508 | break; |
2509 | default: |
2510 | break; |
2511 | } |
2512 | } |
2513 | |
2514 | if (checking) |
2515 | { |
2516 | if (has_seq && (this_mask || has_auto)) |
2517 | error_at (gimple_location (stmt), "%<seq%> overrides other" |
2518 | " OpenACC loop specifiers"); |
2519 | else if (has_auto && this_mask) |
2520 | error_at (gimple_location (stmt), "%<auto%> conflicts with other" |
2521 | " OpenACC loop specifiers"); |
2522 | |
2523 | if (this_mask & outer_mask) |
2524 | error_at (gimple_location (stmt), "inner loop uses same" |
2525 | " OpenACC parallelism as containing loop"); |
2526 | } |
2527 | |
2528 | return outer_mask | this_mask; |
2529 | } |
2530 | |
2531 | /* Scan a GIMPLE_OMP_FOR. */ |
2532 | |
2533 | static omp_context * |
2534 | scan_omp_for (gomp_for *stmt, omp_context *outer_ctx) |
2535 | { |
2536 | omp_context *ctx; |
2537 | size_t i; |
2538 | tree clauses = gimple_omp_for_clauses (stmt); |
2539 | |
2540 | ctx = new_omp_context (stmt, outer_ctx); |
2541 | |
2542 | if (is_gimple_omp_oacc (stmt)) |
2543 | { |
2544 | omp_context *tgt = enclosing_target_ctx (outer_ctx); |
2545 | |
2546 | if (!(tgt && is_oacc_kernels (tgt))) |
2547 | for (tree c = clauses; c; c = OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2547, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2547, __FUNCTION__))->common.chain)) |
2548 | { |
2549 | tree c_op0; |
2550 | switch (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2550, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code) |
2551 | { |
2552 | case OMP_CLAUSE_GANG: |
2553 | c_op0 = OMP_CLAUSE_GANG_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_GANG ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2553, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2553, __FUNCTION__))); |
2554 | break; |
2555 | |
2556 | case OMP_CLAUSE_WORKER: |
2557 | c_op0 = OMP_CLAUSE_WORKER_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_WORKER ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2557, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2557, __FUNCTION__))); |
2558 | break; |
2559 | |
2560 | case OMP_CLAUSE_VECTOR: |
2561 | c_op0 = OMP_CLAUSE_VECTOR_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_VECTOR ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2561, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2561, __FUNCTION__))); |
2562 | break; |
2563 | |
2564 | default: |
2565 | continue; |
2566 | } |
2567 | |
2568 | if (c_op0) |
2569 | { |
2570 | /* By construction, this is impossible for OpenACC 'kernels' |
2571 | decomposed parts. */ |
2572 | gcc_assert (!(tgt && is_oacc_kernels_decomposed_part (tgt)))((void)(!(!(tgt && is_oacc_kernels_decomposed_part (tgt ))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2572, __FUNCTION__), 0 : 0)); |
2573 | |
2574 | error_at (OMP_CLAUSE_LOCATION (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2574, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.locus, |
2575 | "argument not permitted on %qs clause", |
2576 | omp_clause_code_name[OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2576, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code]); |
2577 | if (tgt) |
2578 | inform (gimple_location (tgt->stmt), |
2579 | "enclosing parent compute construct"); |
2580 | else if (oacc_get_fn_attrib (current_function_decl)) |
2581 | inform (DECL_SOURCE_LOCATION (current_function_decl)((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2581, __FUNCTION__))->decl_minimal.locus), |
2582 | "enclosing routine"); |
2583 | else |
2584 | gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2584, __FUNCTION__)); |
2585 | } |
2586 | } |
2587 | |
2588 | if (tgt && is_oacc_kernels (tgt)) |
2589 | check_oacc_kernel_gwv (stmt, ctx); |
2590 | |
2591 | /* Collect all variables named in reductions on this loop. Ensure |
2592 | that, if this loop has a reduction on some variable v, and there is |
2593 | a reduction on v somewhere in an outer context, then there is a |
2594 | reduction on v on all intervening loops as well. */ |
2595 | tree local_reduction_clauses = NULLnullptr; |
2596 | for (tree c = gimple_omp_for_clauses (stmt); c; c = OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2596, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2596, __FUNCTION__))->common.chain)) |
2597 | { |
2598 | if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2598, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_REDUCTION) |
2599 | local_reduction_clauses |
2600 | = tree_cons (NULLnullptr, c, local_reduction_clauses); |
2601 | } |
2602 | if (ctx->outer_reduction_clauses == NULLnullptr && ctx->outer != NULLnullptr) |
2603 | ctx->outer_reduction_clauses |
2604 | = chainon (unshare_expr (ctx->outer->local_reduction_clauses), |
2605 | ctx->outer->outer_reduction_clauses); |
2606 | tree outer_reduction_clauses = ctx->outer_reduction_clauses; |
2607 | tree local_iter = local_reduction_clauses; |
2608 | for (; local_iter; local_iter = TREE_CHAIN (local_iter)((contains_struct_check ((local_iter), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2608, __FUNCTION__))->common.chain)) |
2609 | { |
2610 | tree local_clause = TREE_VALUE (local_iter)((tree_check ((local_iter), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2610, __FUNCTION__, (TREE_LIST)))->list.value); |
2611 | tree local_var = OMP_CLAUSE_DECL (local_clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((local_clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2611, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2611, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2611, __FUNCTION__))); |
2612 | tree_code local_op = OMP_CLAUSE_REDUCTION_CODE (local_clause)((omp_clause_range_check ((local_clause), (OMP_CLAUSE_REDUCTION ), (OMP_CLAUSE_IN_REDUCTION), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2612, __FUNCTION__))->omp_clause.subcode.reduction_code); |
2613 | bool have_outer_reduction = false; |
2614 | tree ctx_iter = outer_reduction_clauses; |
2615 | for (; ctx_iter; ctx_iter = TREE_CHAIN (ctx_iter)((contains_struct_check ((ctx_iter), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2615, __FUNCTION__))->common.chain)) |
2616 | { |
2617 | tree outer_clause = TREE_VALUE (ctx_iter)((tree_check ((ctx_iter), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2617, __FUNCTION__, (TREE_LIST)))->list.value); |
2618 | tree outer_var = OMP_CLAUSE_DECL (outer_clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((outer_clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2618, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2618, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2618, __FUNCTION__))); |
2619 | tree_code outer_op = OMP_CLAUSE_REDUCTION_CODE (outer_clause)((omp_clause_range_check ((outer_clause), (OMP_CLAUSE_REDUCTION ), (OMP_CLAUSE_IN_REDUCTION), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2619, __FUNCTION__))->omp_clause.subcode.reduction_code); |
2620 | if (outer_var == local_var && outer_op != local_op) |
2621 | { |
2622 | warning_at (OMP_CLAUSE_LOCATION (local_clause)((tree_check ((local_clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2622, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.locus, 0, |
2623 | "conflicting reduction operations for %qE", |
2624 | local_var); |
2625 | inform (OMP_CLAUSE_LOCATION (outer_clause)((tree_check ((outer_clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2625, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.locus, |
2626 | "location of the previous reduction for %qE", |
2627 | outer_var); |
2628 | } |
2629 | if (outer_var == local_var) |
2630 | { |
2631 | have_outer_reduction = true; |
2632 | break; |
2633 | } |
2634 | } |
2635 | if (have_outer_reduction) |
2636 | { |
2637 | /* There is a reduction on outer_var both on this loop and on |
2638 | some enclosing loop. Walk up the context tree until such a |
2639 | loop with a reduction on outer_var is found, and complain |
2640 | about all intervening loops that do not have such a |
2641 | reduction. */ |
2642 | struct omp_context *curr_loop = ctx->outer; |
2643 | bool found = false; |
2644 | while (curr_loop != NULLnullptr) |
2645 | { |
2646 | tree curr_iter = curr_loop->local_reduction_clauses; |
2647 | for (; curr_iter; curr_iter = TREE_CHAIN (curr_iter)((contains_struct_check ((curr_iter), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2647, __FUNCTION__))->common.chain)) |
2648 | { |
2649 | tree curr_clause = TREE_VALUE (curr_iter)((tree_check ((curr_iter), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2649, __FUNCTION__, (TREE_LIST)))->list.value); |
2650 | tree curr_var = OMP_CLAUSE_DECL (curr_clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((curr_clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2650, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2650, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2650, __FUNCTION__))); |
2651 | if (curr_var == local_var) |
2652 | { |
2653 | found = true; |
2654 | break; |
2655 | } |
2656 | } |
2657 | if (!found) |
2658 | warning_at (gimple_location (curr_loop->stmt), 0, |
2659 | "nested loop in reduction needs " |
2660 | "reduction clause for %qE", |
2661 | local_var); |
2662 | else |
2663 | break; |
2664 | curr_loop = curr_loop->outer; |
2665 | } |
2666 | } |
2667 | } |
2668 | ctx->local_reduction_clauses = local_reduction_clauses; |
2669 | ctx->outer_reduction_clauses |
2670 | = chainon (unshare_expr (ctx->local_reduction_clauses), |
2671 | ctx->outer_reduction_clauses); |
2672 | |
2673 | if (tgt && is_oacc_kernels (tgt)) |
2674 | { |
2675 | /* Strip out reductions, as they are not handled yet. */ |
2676 | tree *prev_ptr = &clauses; |
2677 | |
2678 | while (tree probe = *prev_ptr) |
2679 | { |
2680 | tree *next_ptr = &OMP_CLAUSE_CHAIN (probe)((contains_struct_check (((tree_check ((probe), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2680, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2680, __FUNCTION__))->common.chain); |
2681 | |
2682 | if (OMP_CLAUSE_CODE (probe)((tree_check ((probe), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2682, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_REDUCTION) |
2683 | *prev_ptr = *next_ptr; |
2684 | else |
2685 | prev_ptr = next_ptr; |
2686 | } |
2687 | |
2688 | gimple_omp_for_set_clauses (stmt, clauses); |
2689 | } |
2690 | } |
2691 | |
2692 | scan_sharing_clauses (clauses, ctx); |
2693 | |
2694 | scan_omp (gimple_omp_for_pre_body_ptr (stmt), ctx); |
2695 | for (i = 0; i < gimple_omp_for_collapse (stmt); i++) |
2696 | { |
2697 | scan_omp_op (gimple_omp_for_index_ptr (stmt, i), ctx); |
2698 | scan_omp_op (gimple_omp_for_initial_ptr (stmt, i), ctx); |
2699 | scan_omp_op (gimple_omp_for_final_ptr (stmt, i), ctx); |
2700 | scan_omp_op (gimple_omp_for_incr_ptr (stmt, i), ctx); |
2701 | } |
2702 | scan_omp (gimple_omp_body_ptr (stmt), ctx); |
2703 | return ctx; |
2704 | } |
2705 | |
2706 | /* Duplicate #pragma omp simd, one for SIMT, another one for SIMD. */ |
2707 | |
2708 | static void |
2709 | scan_omp_simd (gimple_stmt_iterator *gsi, gomp_for *stmt, |
2710 | omp_context *outer_ctx) |
2711 | { |
2712 | gbind *bind = gimple_build_bind (NULLnullptr, NULLnullptr, NULLnullptr); |
2713 | gsi_replace (gsi, bind, false); |
2714 | gimple_seq seq = NULLnullptr; |
2715 | gimple *g = gimple_build_call_internal (IFN_GOMP_USE_SIMT, 0); |
2716 | tree cond = create_tmp_var_raw (integer_type_nodeinteger_types[itk_int]); |
2717 | DECL_CONTEXT (cond)((contains_struct_check ((cond), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2717, __FUNCTION__))->decl_minimal.context) = current_function_decl; |
2718 | DECL_SEEN_IN_BIND_EXPR_P (cond)((contains_struct_check ((cond), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2718, __FUNCTION__))->decl_with_vis.seen_in_bind_expr) = 1; |
2719 | gimple_bind_set_vars (bind, cond); |
2720 | gimple_call_set_lhs (g, cond); |
2721 | gimple_seq_add_stmt (&seq, g); |
2722 | tree lab1 = create_artificial_label (UNKNOWN_LOCATION((location_t) 0)); |
2723 | tree lab2 = create_artificial_label (UNKNOWN_LOCATION((location_t) 0)); |
2724 | tree lab3 = create_artificial_label (UNKNOWN_LOCATION((location_t) 0)); |
2725 | g = gimple_build_cond (NE_EXPR, cond, integer_zero_nodeglobal_trees[TI_INTEGER_ZERO], lab1, lab2); |
2726 | gimple_seq_add_stmt (&seq, g); |
2727 | g = gimple_build_label (lab1); |
2728 | gimple_seq_add_stmt (&seq, g); |
2729 | gimple_seq new_seq = copy_gimple_seq_and_replace_locals (stmt); |
2730 | gomp_for *new_stmt = as_a <gomp_for *> (new_seq); |
2731 | tree clause = build_omp_clause (gimple_location (stmt), OMP_CLAUSE__SIMT_); |
2732 | OMP_CLAUSE_CHAIN (clause)((contains_struct_check (((tree_check ((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2732, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2732, __FUNCTION__))->common.chain) = gimple_omp_for_clauses (new_stmt); |
2733 | gimple_omp_for_set_clauses (new_stmt, clause); |
2734 | gimple_seq_add_stmt (&seq, new_stmt); |
2735 | g = gimple_build_goto (lab3); |
2736 | gimple_seq_add_stmt (&seq, g); |
2737 | g = gimple_build_label (lab2); |
2738 | gimple_seq_add_stmt (&seq, g); |
2739 | gimple_seq_add_stmt (&seq, stmt); |
2740 | g = gimple_build_label (lab3); |
2741 | gimple_seq_add_stmt (&seq, g); |
2742 | gimple_bind_set_body (bind, seq); |
2743 | update_stmt (bind); |
2744 | scan_omp_for (new_stmt, outer_ctx); |
2745 | scan_omp_for (stmt, outer_ctx)->simt_stmt = new_stmt; |
2746 | } |
2747 | |
2748 | static tree omp_find_scan (gimple_stmt_iterator *, bool *, |
2749 | struct walk_stmt_info *); |
2750 | static omp_context *maybe_lookup_ctx (gimple *); |
2751 | |
2752 | /* Duplicate #pragma omp simd, one for the scan input phase loop and one |
2753 | for scan phase loop. */ |
2754 | |
2755 | static void |
2756 | scan_omp_simd_scan (gimple_stmt_iterator *gsi, gomp_for *stmt, |
2757 | omp_context *outer_ctx) |
2758 | { |
2759 | /* The only change between inclusive and exclusive scan will be |
2760 | within the first simd loop, so just use inclusive in the |
2761 | worksharing loop. */ |
2762 | outer_ctx->scan_inclusive = true; |
2763 | tree c = build_omp_clause (UNKNOWN_LOCATION((location_t) 0), OMP_CLAUSE_INCLUSIVE); |
2764 | OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2764, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2764, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2764, __FUNCTION__))) = integer_zero_nodeglobal_trees[TI_INTEGER_ZERO]; |
2765 | |
2766 | gomp_scan *input_stmt = gimple_build_omp_scan (NULLnullptr, NULL_TREE(tree) nullptr); |
2767 | gomp_scan *scan_stmt = gimple_build_omp_scan (NULLnullptr, c); |
2768 | gsi_replace (gsi, input_stmt, false); |
2769 | gimple_seq input_body = NULLnullptr; |
2770 | gimple_seq_add_stmt (&input_body, stmt); |
2771 | gsi_insert_after (gsi, scan_stmt, GSI_NEW_STMT); |
2772 | |
2773 | gimple_stmt_iterator input1_gsi = gsi_none (); |
2774 | struct walk_stmt_info wi; |
2775 | memset (&wi, 0, sizeof (wi)); |
2776 | wi.val_only = true; |
2777 | wi.info = (void *) &input1_gsi; |
2778 | walk_gimple_seq_mod (gimple_omp_body_ptr (stmt), omp_find_scan, NULLnullptr, &wi); |
2779 | gcc_assert (!gsi_end_p (input1_gsi))((void)(!(!gsi_end_p (input1_gsi)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2779, __FUNCTION__), 0 : 0)); |
2780 | |
2781 | gimple *input_stmt1 = gsi_stmt (input1_gsi); |
2782 | gsi_next (&input1_gsi); |
2783 | gimple *scan_stmt1 = gsi_stmt (input1_gsi); |
2784 | gcc_assert (scan_stmt1 && gimple_code (scan_stmt1) == GIMPLE_OMP_SCAN)((void)(!(scan_stmt1 && gimple_code (scan_stmt1) == GIMPLE_OMP_SCAN ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2784, __FUNCTION__), 0 : 0)); |
2785 | c = gimple_omp_scan_clauses (as_a <gomp_scan *> (scan_stmt1)); |
2786 | if (c && OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2786, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_EXCLUSIVE) |
2787 | std::swap (input_stmt1, scan_stmt1); |
2788 | |
2789 | gimple_seq input_body1 = gimple_omp_body (input_stmt1); |
2790 | gimple_omp_set_body (input_stmt1, NULLnullptr); |
2791 | |
2792 | gimple_seq scan_body = copy_gimple_seq_and_replace_locals (stmt); |
2793 | gomp_for *new_stmt = as_a <gomp_for *> (scan_body); |
2794 | |
2795 | gimple_omp_set_body (input_stmt1, input_body1); |
2796 | gimple_omp_set_body (scan_stmt1, NULLnullptr); |
2797 | |
2798 | gimple_stmt_iterator input2_gsi = gsi_none (); |
2799 | memset (&wi, 0, sizeof (wi)); |
2800 | wi.val_only = true; |
2801 | wi.info = (void *) &input2_gsi; |
2802 | walk_gimple_seq_mod (gimple_omp_body_ptr (new_stmt), omp_find_scan, |
2803 | NULLnullptr, &wi); |
2804 | gcc_assert (!gsi_end_p (input2_gsi))((void)(!(!gsi_end_p (input2_gsi)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2804, __FUNCTION__), 0 : 0)); |
2805 | |
2806 | gimple *input_stmt2 = gsi_stmt (input2_gsi); |
2807 | gsi_next (&input2_gsi); |
2808 | gimple *scan_stmt2 = gsi_stmt (input2_gsi); |
2809 | gcc_assert (scan_stmt2 && gimple_code (scan_stmt2) == GIMPLE_OMP_SCAN)((void)(!(scan_stmt2 && gimple_code (scan_stmt2) == GIMPLE_OMP_SCAN ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2809, __FUNCTION__), 0 : 0)); |
2810 | if (c && OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2810, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_EXCLUSIVE) |
2811 | std::swap (input_stmt2, scan_stmt2); |
2812 | |
2813 | gimple_omp_set_body (input_stmt2, NULLnullptr); |
2814 | |
2815 | gimple_omp_set_body (input_stmt, input_body); |
2816 | gimple_omp_set_body (scan_stmt, scan_body); |
2817 | |
2818 | omp_context *ctx = new_omp_context (input_stmt, outer_ctx); |
2819 | scan_omp (gimple_omp_body_ptr (input_stmt), ctx); |
2820 | |
2821 | ctx = new_omp_context (scan_stmt, outer_ctx); |
2822 | scan_omp (gimple_omp_body_ptr (scan_stmt), ctx); |
2823 | |
2824 | maybe_lookup_ctx (new_stmt)->for_simd_scan_phase = true; |
2825 | } |
2826 | |
2827 | /* Scan an OpenMP sections directive. */ |
2828 | |
2829 | static void |
2830 | scan_omp_sections (gomp_sections *stmt, omp_context *outer_ctx) |
2831 | { |
2832 | omp_context *ctx; |
2833 | |
2834 | ctx = new_omp_context (stmt, outer_ctx); |
2835 | scan_sharing_clauses (gimple_omp_sections_clauses (stmt), ctx); |
2836 | scan_omp (gimple_omp_body_ptr (stmt), ctx); |
2837 | } |
2838 | |
2839 | /* Scan an OpenMP single directive. */ |
2840 | |
2841 | static void |
2842 | scan_omp_single (gomp_single *stmt, omp_context *outer_ctx) |
2843 | { |
2844 | omp_context *ctx; |
2845 | tree name; |
2846 | |
2847 | ctx = new_omp_context (stmt, outer_ctx); |
2848 | ctx->field_map = splay_tree_new (splay_tree_compare_pointers, 0, 0); |
2849 | ctx->record_type = lang_hooks.types.make_type (RECORD_TYPE); |
2850 | name = create_tmp_var_name (".omp_copy_s"); |
2851 | name = build_decl (gimple_location (stmt), |
2852 | TYPE_DECL, name, ctx->record_type); |
2853 | TYPE_NAME (ctx->record_type)((tree_class_check ((ctx->record_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2853, __FUNCTION__))->type_common.name) = name; |
2854 | |
2855 | scan_sharing_clauses (gimple_omp_single_clauses (stmt), ctx); |
2856 | scan_omp (gimple_omp_body_ptr (stmt), ctx); |
2857 | |
2858 | if (TYPE_FIELDS (ctx->record_type)((tree_check3 ((ctx->record_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2858, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values) == NULLnullptr) |
2859 | ctx->record_type = NULLnullptr; |
2860 | else |
2861 | layout_type (ctx->record_type); |
2862 | } |
2863 | |
2864 | /* Scan a GIMPLE_OMP_TARGET. */ |
2865 | |
2866 | static void |
2867 | scan_omp_target (gomp_target *stmt, omp_context *outer_ctx) |
2868 | { |
2869 | omp_context *ctx; |
2870 | tree name; |
2871 | bool offloaded = is_gimple_omp_offloaded (stmt); |
2872 | tree clauses = gimple_omp_target_clauses (stmt); |
2873 | |
2874 | ctx = new_omp_context (stmt, outer_ctx); |
2875 | ctx->field_map = splay_tree_new (splay_tree_compare_pointers, 0, 0); |
2876 | ctx->record_type = lang_hooks.types.make_type (RECORD_TYPE); |
2877 | name = create_tmp_var_name (".omp_data_t"); |
2878 | name = build_decl (gimple_location (stmt), |
2879 | TYPE_DECL, name, ctx->record_type); |
2880 | DECL_ARTIFICIAL (name)((contains_struct_check ((name), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2880, __FUNCTION__))->decl_common.artificial_flag) = 1; |
2881 | DECL_NAMELESS (name)((contains_struct_check ((name), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2881, __FUNCTION__))->base.u.bits.nameless_flag) = 1; |
2882 | TYPE_NAME (ctx->record_type)((tree_class_check ((ctx->record_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2882, __FUNCTION__))->type_common.name) = name; |
2883 | TYPE_ARTIFICIAL (ctx->record_type)((tree_class_check ((ctx->record_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2883, __FUNCTION__))->base.nowarning_flag) = 1; |
2884 | |
2885 | if (offloaded) |
2886 | { |
2887 | create_omp_child_function (ctx, false); |
2888 | gimple_omp_target_set_child_fn (stmt, ctx->cb.dst_fn); |
2889 | } |
2890 | |
2891 | scan_sharing_clauses (clauses, ctx); |
2892 | scan_omp (gimple_omp_body_ptr (stmt), ctx); |
2893 | |
2894 | if (TYPE_FIELDS (ctx->record_type)((tree_check3 ((ctx->record_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2894, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values) == NULLnullptr) |
2895 | ctx->record_type = ctx->receiver_decl = NULLnullptr; |
2896 | else |
2897 | { |
2898 | TYPE_FIELDS (ctx->record_type)((tree_check3 ((ctx->record_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2898, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values) |
2899 | = nreverse (TYPE_FIELDS (ctx->record_type)((tree_check3 ((ctx->record_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2899, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)); |
2900 | if (flag_checkingglobal_options.x_flag_checking) |
2901 | { |
2902 | unsigned int align = DECL_ALIGN (TYPE_FIELDS (ctx->record_type))(((contains_struct_check ((((tree_check3 ((ctx->record_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2902, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2902, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((((tree_check3 ((ctx-> record_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2902, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2902, __FUNCTION__))->decl_common.align) - 1) : 0); |
2903 | for (tree field = TYPE_FIELDS (ctx->record_type)((tree_check3 ((ctx->record_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2903, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); |
2904 | field; |
2905 | field = DECL_CHAIN (field)(((contains_struct_check (((contains_struct_check ((field), ( TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2905, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2905, __FUNCTION__))->common.chain))) |
2906 | gcc_assert (DECL_ALIGN (field) == align)((void)(!((((contains_struct_check ((field), (TS_DECL_COMMON) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2906, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((field), (TS_DECL_COMMON) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2906, __FUNCTION__))->decl_common.align) - 1) : 0) == align ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2906, __FUNCTION__), 0 : 0)); |
2907 | } |
2908 | layout_type (ctx->record_type); |
2909 | if (offloaded) |
2910 | fixup_child_record_type (ctx); |
2911 | } |
2912 | } |
2913 | |
2914 | /* Scan an OpenMP teams directive. */ |
2915 | |
2916 | static void |
2917 | scan_omp_teams (gomp_teams *stmt, omp_context *outer_ctx) |
2918 | { |
2919 | omp_context *ctx = new_omp_context (stmt, outer_ctx); |
2920 | |
2921 | if (!gimple_omp_teams_host (stmt)) |
2922 | { |
2923 | scan_sharing_clauses (gimple_omp_teams_clauses (stmt), ctx); |
2924 | scan_omp (gimple_omp_body_ptr (stmt), ctx); |
2925 | return; |
2926 | } |
2927 | taskreg_contexts.safe_push (ctx); |
2928 | gcc_assert (taskreg_nesting_level == 1)((void)(!(taskreg_nesting_level == 1) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2928, __FUNCTION__), 0 : 0)); |
2929 | ctx->field_map = splay_tree_new (splay_tree_compare_pointers, 0, 0); |
2930 | ctx->record_type = lang_hooks.types.make_type (RECORD_TYPE); |
2931 | tree name = create_tmp_var_name (".omp_data_s"); |
2932 | name = build_decl (gimple_location (stmt), |
2933 | TYPE_DECL, name, ctx->record_type); |
2934 | DECL_ARTIFICIAL (name)((contains_struct_check ((name), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2934, __FUNCTION__))->decl_common.artificial_flag) = 1; |
2935 | DECL_NAMELESS (name)((contains_struct_check ((name), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2935, __FUNCTION__))->base.u.bits.nameless_flag) = 1; |
2936 | TYPE_NAME (ctx->record_type)((tree_class_check ((ctx->record_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2936, __FUNCTION__))->type_common.name) = name; |
2937 | TYPE_ARTIFICIAL (ctx->record_type)((tree_class_check ((ctx->record_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2937, __FUNCTION__))->base.nowarning_flag) = 1; |
2938 | create_omp_child_function (ctx, false); |
2939 | gimple_omp_teams_set_child_fn (stmt, ctx->cb.dst_fn); |
2940 | |
2941 | scan_sharing_clauses (gimple_omp_teams_clauses (stmt), ctx); |
2942 | scan_omp (gimple_omp_body_ptr (stmt), ctx); |
2943 | |
2944 | if (TYPE_FIELDS (ctx->record_type)((tree_check3 ((ctx->record_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 2944, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values) == NULLnullptr) |
2945 | ctx->record_type = ctx->receiver_decl = NULLnullptr; |
2946 | } |
2947 | |
2948 | /* Check nesting restrictions. */ |
2949 | static bool |
2950 | check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx) |
2951 | { |
2952 | tree c; |
2953 | |
2954 | /* No nesting of non-OpenACC STMT (that is, an OpenMP one, or a GOMP builtin) |
2955 | inside an OpenACC CTX. */ |
2956 | if (!(is_gimple_omp (stmt) |
2957 | && is_gimple_omp_oacc (stmt)) |
2958 | /* Except for atomic codes that we share with OpenMP. */ |
2959 | && !(gimple_code (stmt) == GIMPLE_OMP_ATOMIC_LOAD |
2960 | || gimple_code (stmt) == GIMPLE_OMP_ATOMIC_STORE)) |
2961 | { |
2962 | if (oacc_get_fn_attrib (cfun(cfun + 0)->decl) != NULLnullptr) |
2963 | { |
2964 | error_at (gimple_location (stmt), |
2965 | "non-OpenACC construct inside of OpenACC routine"); |
2966 | return false; |
2967 | } |
2968 | else |
2969 | for (omp_context *octx = ctx; octx != NULLnullptr; octx = octx->outer) |
2970 | if (is_gimple_omp (octx->stmt) |
2971 | && is_gimple_omp_oacc (octx->stmt)) |
2972 | { |
2973 | error_at (gimple_location (stmt), |
2974 | "non-OpenACC construct inside of OpenACC region"); |
2975 | return false; |
2976 | } |
2977 | } |
2978 | |
2979 | if (ctx != NULLnullptr) |
2980 | { |
2981 | if (gimple_code (ctx->stmt) == GIMPLE_OMP_SCAN |
2982 | && ctx->outer |
2983 | && gimple_code (ctx->outer->stmt) == GIMPLE_OMP_FOR) |
2984 | ctx = ctx->outer; |
2985 | if (gimple_code (ctx->stmt) == GIMPLE_OMP_FOR |
2986 | && gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_KIND_SIMD |
2987 | && !ctx->loop_p) |
2988 | { |
2989 | c = NULL_TREE(tree) nullptr; |
2990 | if (ctx->order_concurrent |
2991 | && (gimple_code (stmt) == GIMPLE_OMP_ORDERED |
2992 | || gimple_code (stmt) == GIMPLE_OMP_ATOMIC_LOAD |
2993 | || gimple_code (stmt) == GIMPLE_OMP_ATOMIC_STORE)) |
2994 | { |
2995 | error_at (gimple_location (stmt), |
2996 | "OpenMP constructs other than %<parallel%>, %<loop%>" |
2997 | " or %<simd%> may not be nested inside a region with" |
2998 | " the %<order(concurrent)%> clause"); |
2999 | return false; |
3000 | } |
3001 | if (gimple_code (stmt) == GIMPLE_OMP_ORDERED) |
3002 | { |
3003 | c = gimple_omp_ordered_clauses (as_a <gomp_ordered *> (stmt)); |
3004 | if (omp_find_clause (c, OMP_CLAUSE_SIMD)) |
3005 | { |
3006 | if (omp_find_clause (c, OMP_CLAUSE_THREADS) |
3007 | && (ctx->outer == NULLnullptr |
3008 | || !gimple_omp_for_combined_into_p (ctx->stmt) |
3009 | || gimple_code (ctx->outer->stmt) != GIMPLE_OMP_FOR |
3010 | || (gimple_omp_for_kind (ctx->outer->stmt) |
3011 | != GF_OMP_FOR_KIND_FOR) |
3012 | || !gimple_omp_for_combined_p (ctx->outer->stmt))) |
3013 | { |
3014 | error_at (gimple_location (stmt), |
3015 | "%<ordered simd threads%> must be closely " |
3016 | "nested inside of %<%s simd%> region", |
3017 | lang_GNU_Fortran () ? "do" : "for"); |
3018 | return false; |
3019 | } |
3020 | return true; |
3021 | } |
3022 | } |
3023 | else if (gimple_code (stmt) == GIMPLE_OMP_ATOMIC_LOAD |
3024 | || gimple_code (stmt) == GIMPLE_OMP_ATOMIC_STORE |
3025 | || gimple_code (stmt) == GIMPLE_OMP_SCAN) |
3026 | return true; |
3027 | else if (gimple_code (stmt) == GIMPLE_OMP_FOR |
3028 | && gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_KIND_SIMD) |
3029 | return true; |
3030 | error_at (gimple_location (stmt), |
3031 | "OpenMP constructs other than " |
3032 | "%<ordered simd%>, %<simd%>, %<loop%> or %<atomic%> may " |
3033 | "not be nested inside %<simd%> region"); |
3034 | return false; |
3035 | } |
3036 | else if (gimple_code (ctx->stmt) == GIMPLE_OMP_TEAMS) |
3037 | { |
3038 | if ((gimple_code (stmt) != GIMPLE_OMP_FOR |
3039 | || (gimple_omp_for_kind (stmt) != GF_OMP_FOR_KIND_DISTRIBUTE |
3040 | && omp_find_clause (gimple_omp_for_clauses (stmt), |
3041 | OMP_CLAUSE_BIND) == NULL_TREE(tree) nullptr)) |
3042 | && gimple_code (stmt) != GIMPLE_OMP_PARALLEL) |
3043 | { |
3044 | error_at (gimple_location (stmt), |
3045 | "only %<distribute%>, %<parallel%> or %<loop%> " |
3046 | "regions are allowed to be strictly nested inside " |
3047 | "%<teams%> region"); |
3048 | return false; |
3049 | } |
3050 | } |
3051 | else if (ctx->order_concurrent |
3052 | && gimple_code (stmt) != GIMPLE_OMP_PARALLEL |
3053 | && (gimple_code (stmt) != GIMPLE_OMP_FOR |
3054 | || gimple_omp_for_kind (stmt) != GF_OMP_FOR_KIND_SIMD) |
3055 | && gimple_code (stmt) != GIMPLE_OMP_SCAN) |
3056 | { |
3057 | if (ctx->loop_p) |
3058 | error_at (gimple_location (stmt), |
3059 | "OpenMP constructs other than %<parallel%>, %<loop%> or " |
3060 | "%<simd%> may not be nested inside a %<loop%> region"); |
3061 | else |
3062 | error_at (gimple_location (stmt), |
3063 | "OpenMP constructs other than %<parallel%>, %<loop%> or " |
3064 | "%<simd%> may not be nested inside a region with " |
3065 | "the %<order(concurrent)%> clause"); |
3066 | return false; |
3067 | } |
3068 | } |
3069 | switch (gimple_code (stmt)) |
3070 | { |
3071 | case GIMPLE_OMP_FOR: |
3072 | if (gimple_omp_for_kind (stmt) == GF_OMP_FOR_KIND_SIMD) |
3073 | return true; |
3074 | if (gimple_omp_for_kind (stmt) == GF_OMP_FOR_KIND_DISTRIBUTE) |
3075 | { |
3076 | if (ctx != NULLnullptr && gimple_code (ctx->stmt) != GIMPLE_OMP_TEAMS) |
3077 | { |
3078 | error_at (gimple_location (stmt), |
3079 | "%<distribute%> region must be strictly nested " |
3080 | "inside %<teams%> construct"); |
3081 | return false; |
3082 | } |
3083 | return true; |
3084 | } |
3085 | /* We split taskloop into task and nested taskloop in it. */ |
3086 | if (gimple_omp_for_kind (stmt) == GF_OMP_FOR_KIND_TASKLOOP) |
3087 | return true; |
3088 | /* For now, hope this will change and loop bind(parallel) will not |
3089 | be allowed in lots of contexts. */ |
3090 | if (gimple_omp_for_kind (stmt) == GF_OMP_FOR_KIND_FOR |
3091 | && omp_find_clause (gimple_omp_for_clauses (stmt), OMP_CLAUSE_BIND)) |
3092 | return true; |
3093 | if (gimple_omp_for_kind (stmt) == GF_OMP_FOR_KIND_OACC_LOOP) |
3094 | { |
3095 | bool ok = false; |
3096 | |
3097 | if (ctx) |
3098 | switch (gimple_code (ctx->stmt)) |
3099 | { |
3100 | case GIMPLE_OMP_FOR: |
3101 | ok = (gimple_omp_for_kind (ctx->stmt) |
3102 | == GF_OMP_FOR_KIND_OACC_LOOP); |
3103 | break; |
3104 | |
3105 | case GIMPLE_OMP_TARGET: |
3106 | switch (gimple_omp_target_kind (ctx->stmt)) |
3107 | { |
3108 | case GF_OMP_TARGET_KIND_OACC_PARALLEL: |
3109 | case GF_OMP_TARGET_KIND_OACC_KERNELS: |
3110 | case GF_OMP_TARGET_KIND_OACC_SERIAL: |
3111 | case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED: |
3112 | case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE: |
3113 | ok = true; |
3114 | break; |
3115 | |
3116 | default: |
3117 | break; |
3118 | } |
3119 | |
3120 | default: |
3121 | break; |
3122 | } |
3123 | else if (oacc_get_fn_attrib (current_function_decl)) |
3124 | ok = true; |
3125 | if (!ok) |
3126 | { |
3127 | error_at (gimple_location (stmt), |
3128 | "OpenACC loop directive must be associated with" |
3129 | " an OpenACC compute region"); |
3130 | return false; |
3131 | } |
3132 | } |
3133 | /* FALLTHRU */ |
3134 | case GIMPLE_CALL: |
3135 | if (is_gimple_call (stmt) |
3136 | && (DECL_FUNCTION_CODE (gimple_call_fndecl (stmt)) |
3137 | == BUILT_IN_GOMP_CANCEL |
3138 | || DECL_FUNCTION_CODE (gimple_call_fndecl (stmt)) |
3139 | == BUILT_IN_GOMP_CANCELLATION_POINT)) |
3140 | { |
3141 | const char *bad = NULLnullptr; |
3142 | const char *kind = NULLnullptr; |
3143 | const char *construct |
3144 | = (DECL_FUNCTION_CODE (gimple_call_fndecl (stmt)) |
3145 | == BUILT_IN_GOMP_CANCEL) |
3146 | ? "cancel" |
3147 | : "cancellation point"; |
3148 | if (ctx == NULLnullptr) |
3149 | { |
3150 | error_at (gimple_location (stmt), "orphaned %qs construct", |
3151 | construct); |
3152 | return false; |
3153 | } |
3154 | switch (tree_fits_shwi_p (gimple_call_arg (stmt, 0)) |
3155 | ? tree_to_shwi (gimple_call_arg (stmt, 0)) |
3156 | : 0) |
3157 | { |
3158 | case 1: |
3159 | if (gimple_code (ctx->stmt) != GIMPLE_OMP_PARALLEL) |
3160 | bad = "parallel"; |
3161 | else if (DECL_FUNCTION_CODE (gimple_call_fndecl (stmt)) |
3162 | == BUILT_IN_GOMP_CANCEL |
3163 | && !integer_zerop (gimple_call_arg (stmt, 1))) |
3164 | ctx->cancellable = true; |
3165 | kind = "parallel"; |
3166 | break; |
3167 | case 2: |
3168 | if (gimple_code (ctx->stmt) != GIMPLE_OMP_FOR |
3169 | || gimple_omp_for_kind (ctx->stmt) != GF_OMP_FOR_KIND_FOR) |
3170 | bad = "for"; |
3171 | else if (DECL_FUNCTION_CODE (gimple_call_fndecl (stmt)) |
3172 | == BUILT_IN_GOMP_CANCEL |
3173 | && !integer_zerop (gimple_call_arg (stmt, 1))) |
3174 | { |
3175 | ctx->cancellable = true; |
3176 | if (omp_find_clause (gimple_omp_for_clauses (ctx->stmt), |
3177 | OMP_CLAUSE_NOWAIT)) |
3178 | warning_at (gimple_location (stmt), 0, |
3179 | "%<cancel for%> inside " |
3180 | "%<nowait%> for construct"); |
3181 | if (omp_find_clause (gimple_omp_for_clauses (ctx->stmt), |
3182 | OMP_CLAUSE_ORDERED)) |
3183 | warning_at (gimple_location (stmt), 0, |
3184 | "%<cancel for%> inside " |
3185 | "%<ordered%> for construct"); |
3186 | } |
3187 | kind = "for"; |
3188 | break; |
3189 | case 4: |
3190 | if (gimple_code (ctx->stmt) != GIMPLE_OMP_SECTIONS |
3191 | && gimple_code (ctx->stmt) != GIMPLE_OMP_SECTION) |
3192 | bad = "sections"; |
3193 | else if (DECL_FUNCTION_CODE (gimple_call_fndecl (stmt)) |
3194 | == BUILT_IN_GOMP_CANCEL |
3195 | && !integer_zerop (gimple_call_arg (stmt, 1))) |
3196 | { |
3197 | if (gimple_code (ctx->stmt) == GIMPLE_OMP_SECTIONS) |
3198 | { |
3199 | ctx->cancellable = true; |
3200 | if (omp_find_clause (gimple_omp_sections_clauses |
3201 | (ctx->stmt), |
3202 | OMP_CLAUSE_NOWAIT)) |
3203 | warning_at (gimple_location (stmt), 0, |
3204 | "%<cancel sections%> inside " |
3205 | "%<nowait%> sections construct"); |
3206 | } |
3207 | else |
3208 | { |
3209 | gcc_assert (ctx->outer((void)(!(ctx->outer && gimple_code (ctx->outer ->stmt) == GIMPLE_OMP_SECTIONS) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3211, __FUNCTION__), 0 : 0)) |
3210 | && gimple_code (ctx->outer->stmt)((void)(!(ctx->outer && gimple_code (ctx->outer ->stmt) == GIMPLE_OMP_SECTIONS) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3211, __FUNCTION__), 0 : 0)) |
3211 | == GIMPLE_OMP_SECTIONS)((void)(!(ctx->outer && gimple_code (ctx->outer ->stmt) == GIMPLE_OMP_SECTIONS) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3211, __FUNCTION__), 0 : 0)); |
3212 | ctx->outer->cancellable = true; |
3213 | if (omp_find_clause (gimple_omp_sections_clauses |
3214 | (ctx->outer->stmt), |
3215 | OMP_CLAUSE_NOWAIT)) |
3216 | warning_at (gimple_location (stmt), 0, |
3217 | "%<cancel sections%> inside " |
3218 | "%<nowait%> sections construct"); |
3219 | } |
3220 | } |
3221 | kind = "sections"; |
3222 | break; |
3223 | case 8: |
3224 | if (!is_task_ctx (ctx) |
3225 | && (!is_taskloop_ctx (ctx) |
3226 | || ctx->outer == NULLnullptr |
3227 | || !is_task_ctx (ctx->outer))) |
3228 | bad = "task"; |
3229 | else |
3230 | { |
3231 | for (omp_context *octx = ctx->outer; |
3232 | octx; octx = octx->outer) |
3233 | { |
3234 | switch (gimple_code (octx->stmt)) |
3235 | { |
3236 | case GIMPLE_OMP_TASKGROUP: |
3237 | break; |
3238 | case GIMPLE_OMP_TARGET: |
3239 | if (gimple_omp_target_kind (octx->stmt) |
3240 | != GF_OMP_TARGET_KIND_REGION) |
3241 | continue; |
3242 | /* FALLTHRU */ |
3243 | case GIMPLE_OMP_PARALLEL: |
3244 | case GIMPLE_OMP_TEAMS: |
3245 | error_at (gimple_location (stmt), |
3246 | "%<%s taskgroup%> construct not closely " |
3247 | "nested inside of %<taskgroup%> region", |
3248 | construct); |
3249 | return false; |
3250 | case GIMPLE_OMP_TASK: |
3251 | if (gimple_omp_task_taskloop_p (octx->stmt) |
3252 | && octx->outer |
3253 | && is_taskloop_ctx (octx->outer)) |
3254 | { |
3255 | tree clauses |
3256 | = gimple_omp_for_clauses (octx->outer->stmt); |
3257 | if (!omp_find_clause (clauses, OMP_CLAUSE_NOGROUP)) |
3258 | break; |
3259 | } |
3260 | continue; |
3261 | default: |
3262 | continue; |
3263 | } |
3264 | break; |
3265 | } |
3266 | ctx->cancellable = true; |
3267 | } |
3268 | kind = "taskgroup"; |
3269 | break; |
3270 | default: |
3271 | error_at (gimple_location (stmt), "invalid arguments"); |
3272 | return false; |
3273 | } |
3274 | if (bad) |
3275 | { |
3276 | error_at (gimple_location (stmt), |
3277 | "%<%s %s%> construct not closely nested inside of %qs", |
3278 | construct, kind, bad); |
3279 | return false; |
3280 | } |
3281 | } |
3282 | /* FALLTHRU */ |
3283 | case GIMPLE_OMP_SECTIONS: |
3284 | case GIMPLE_OMP_SINGLE: |
3285 | for (; ctx != NULLnullptr; ctx = ctx->outer) |
3286 | switch (gimple_code (ctx->stmt)) |
3287 | { |
3288 | case GIMPLE_OMP_FOR: |
3289 | if (gimple_omp_for_kind (ctx->stmt) != GF_OMP_FOR_KIND_FOR |
3290 | && gimple_omp_for_kind (ctx->stmt) != GF_OMP_FOR_KIND_TASKLOOP) |
3291 | break; |
3292 | /* FALLTHRU */ |
3293 | case GIMPLE_OMP_SECTIONS: |
3294 | case GIMPLE_OMP_SINGLE: |
3295 | case GIMPLE_OMP_ORDERED: |
3296 | case GIMPLE_OMP_MASTER: |
3297 | case GIMPLE_OMP_TASK: |
3298 | case GIMPLE_OMP_CRITICAL: |
3299 | if (is_gimple_call (stmt)) |
3300 | { |
3301 | if (DECL_FUNCTION_CODE (gimple_call_fndecl (stmt)) |
3302 | != BUILT_IN_GOMP_BARRIER) |
3303 | return true; |
3304 | error_at (gimple_location (stmt), |
3305 | "barrier region may not be closely nested inside " |
3306 | "of work-sharing, %<loop%>, %<critical%>, " |
3307 | "%<ordered%>, %<master%>, explicit %<task%> or " |
3308 | "%<taskloop%> region"); |
3309 | return false; |
3310 | } |
3311 | error_at (gimple_location (stmt), |
3312 | "work-sharing region may not be closely nested inside " |
3313 | "of work-sharing, %<loop%>, %<critical%>, %<ordered%>, " |
3314 | "%<master%>, explicit %<task%> or %<taskloop%> region"); |
3315 | return false; |
3316 | case GIMPLE_OMP_PARALLEL: |
3317 | case GIMPLE_OMP_TEAMS: |
3318 | return true; |
3319 | case GIMPLE_OMP_TARGET: |
3320 | if (gimple_omp_target_kind (ctx->stmt) |
3321 | == GF_OMP_TARGET_KIND_REGION) |
3322 | return true; |
3323 | break; |
3324 | default: |
3325 | break; |
3326 | } |
3327 | break; |
3328 | case GIMPLE_OMP_MASTER: |
3329 | for (; ctx != NULLnullptr; ctx = ctx->outer) |
3330 | switch (gimple_code (ctx->stmt)) |
3331 | { |
3332 | case GIMPLE_OMP_FOR: |
3333 | if (gimple_omp_for_kind (ctx->stmt) != GF_OMP_FOR_KIND_FOR |
3334 | && gimple_omp_for_kind (ctx->stmt) != GF_OMP_FOR_KIND_TASKLOOP) |
3335 | break; |
3336 | /* FALLTHRU */ |
3337 | case GIMPLE_OMP_SECTIONS: |
3338 | case GIMPLE_OMP_SINGLE: |
3339 | case GIMPLE_OMP_TASK: |
3340 | error_at (gimple_location (stmt), |
3341 | "%<master%> region may not be closely nested inside " |
3342 | "of work-sharing, %<loop%>, explicit %<task%> or " |
3343 | "%<taskloop%> region"); |
3344 | return false; |
3345 | case GIMPLE_OMP_PARALLEL: |
3346 | case GIMPLE_OMP_TEAMS: |
3347 | return true; |
3348 | case GIMPLE_OMP_TARGET: |
3349 | if (gimple_omp_target_kind (ctx->stmt) |
3350 | == GF_OMP_TARGET_KIND_REGION) |
3351 | return true; |
3352 | break; |
3353 | default: |
3354 | break; |
3355 | } |
3356 | break; |
3357 | case GIMPLE_OMP_TASK: |
3358 | for (c = gimple_omp_task_clauses (stmt); c; c = OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3358, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3358, __FUNCTION__))->common.chain)) |
3359 | if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3359, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_DEPEND |
3360 | && (OMP_CLAUSE_DEPEND_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_DEPEND), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3360, __FUNCTION__))->omp_clause.subcode.depend_kind) == OMP_CLAUSE_DEPEND_SOURCE |
3361 | || OMP_CLAUSE_DEPEND_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_DEPEND), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3361, __FUNCTION__))->omp_clause.subcode.depend_kind) == OMP_CLAUSE_DEPEND_SINK)) |
3362 | { |
3363 | enum omp_clause_depend_kind kind = OMP_CLAUSE_DEPEND_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_DEPEND), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3363, __FUNCTION__))->omp_clause.subcode.depend_kind); |
3364 | error_at (OMP_CLAUSE_LOCATION (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3364, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.locus, |
3365 | "%<depend(%s)%> is only allowed in %<omp ordered%>", |
3366 | kind == OMP_CLAUSE_DEPEND_SOURCE ? "source" : "sink"); |
3367 | return false; |
3368 | } |
3369 | break; |
3370 | case GIMPLE_OMP_ORDERED: |
3371 | for (c = gimple_omp_ordered_clauses (as_a <gomp_ordered *> (stmt)); |
3372 | c; c = OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3372, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3372, __FUNCTION__))->common.chain)) |
3373 | { |
3374 | if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3374, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code != OMP_CLAUSE_DEPEND) |
3375 | { |
3376 | gcc_assert (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_THREADS((void)(!(((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3376, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_THREADS || ((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3377, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_SIMD ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3377, __FUNCTION__), 0 : 0)) |
3377 | || OMP_CLAUSE_CODE (c) == OMP_CLAUSE_SIMD)((void)(!(((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3376, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_THREADS || ((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3377, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_SIMD ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3377, __FUNCTION__), 0 : 0)); |
3378 | continue; |
3379 | } |
3380 | enum omp_clause_depend_kind kind = OMP_CLAUSE_DEPEND_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_DEPEND), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3380, __FUNCTION__))->omp_clause.subcode.depend_kind); |
3381 | if (kind == OMP_CLAUSE_DEPEND_SOURCE |
3382 | || kind == OMP_CLAUSE_DEPEND_SINK) |
3383 | { |
3384 | tree oclause; |
3385 | /* Look for containing ordered(N) loop. */ |
3386 | if (ctx == NULLnullptr |
3387 | || gimple_code (ctx->stmt) != GIMPLE_OMP_FOR |
3388 | || (oclause |
3389 | = omp_find_clause (gimple_omp_for_clauses (ctx->stmt), |
3390 | OMP_CLAUSE_ORDERED)) == NULL_TREE(tree) nullptr) |
3391 | { |
3392 | error_at (OMP_CLAUSE_LOCATION (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3392, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.locus, |
3393 | "%<ordered%> construct with %<depend%> clause " |
3394 | "must be closely nested inside an %<ordered%> " |
3395 | "loop"); |
3396 | return false; |
3397 | } |
3398 | else if (OMP_CLAUSE_ORDERED_EXPR (oclause)(*(omp_clause_elt_check (((omp_clause_subcode_check ((oclause ), (OMP_CLAUSE_ORDERED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3398, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3398, __FUNCTION__))) == NULL_TREE(tree) nullptr) |
3399 | { |
3400 | error_at (OMP_CLAUSE_LOCATION (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3400, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.locus, |
3401 | "%<ordered%> construct with %<depend%> clause " |
3402 | "must be closely nested inside a loop with " |
3403 | "%<ordered%> clause with a parameter"); |
3404 | return false; |
3405 | } |
3406 | } |
3407 | else |
3408 | { |
3409 | error_at (OMP_CLAUSE_LOCATION (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3409, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.locus, |
3410 | "invalid depend kind in omp %<ordered%> %<depend%>"); |
3411 | return false; |
3412 | } |
3413 | } |
3414 | c = gimple_omp_ordered_clauses (as_a <gomp_ordered *> (stmt)); |
3415 | if (omp_find_clause (c, OMP_CLAUSE_SIMD)) |
3416 | { |
3417 | /* ordered simd must be closely nested inside of simd region, |
3418 | and simd region must not encounter constructs other than |
3419 | ordered simd, therefore ordered simd may be either orphaned, |
3420 | or ctx->stmt must be simd. The latter case is handled already |
3421 | earlier. */ |
3422 | if (ctx != NULLnullptr) |
3423 | { |
3424 | error_at (gimple_location (stmt), |
3425 | "%<ordered%> %<simd%> must be closely nested inside " |
3426 | "%<simd%> region"); |
3427 | return false; |
3428 | } |
3429 | } |
3430 | for (; ctx != NULLnullptr; ctx = ctx->outer) |
3431 | switch (gimple_code (ctx->stmt)) |
3432 | { |
3433 | case GIMPLE_OMP_CRITICAL: |
3434 | case GIMPLE_OMP_TASK: |
3435 | case GIMPLE_OMP_ORDERED: |
3436 | ordered_in_taskloop: |
3437 | error_at (gimple_location (stmt), |
3438 | "%<ordered%> region may not be closely nested inside " |
3439 | "of %<critical%>, %<ordered%>, explicit %<task%> or " |
3440 | "%<taskloop%> region"); |
3441 | return false; |
3442 | case GIMPLE_OMP_FOR: |
3443 | if (gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_KIND_TASKLOOP) |
3444 | goto ordered_in_taskloop; |
3445 | tree o; |
3446 | o = omp_find_clause (gimple_omp_for_clauses (ctx->stmt), |
3447 | OMP_CLAUSE_ORDERED); |
3448 | if (o == NULLnullptr) |
3449 | { |
3450 | error_at (gimple_location (stmt), |
3451 | "%<ordered%> region must be closely nested inside " |
3452 | "a loop region with an %<ordered%> clause"); |
3453 | return false; |
3454 | } |
3455 | if (OMP_CLAUSE_ORDERED_EXPR (o)(*(omp_clause_elt_check (((omp_clause_subcode_check ((o), (OMP_CLAUSE_ORDERED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3455, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3455, __FUNCTION__))) != NULL_TREE(tree) nullptr |
3456 | && omp_find_clause (c, OMP_CLAUSE_DEPEND) == NULL_TREE(tree) nullptr) |
3457 | { |
3458 | error_at (gimple_location (stmt), |
3459 | "%<ordered%> region without %<depend%> clause may " |
3460 | "not be closely nested inside a loop region with " |
3461 | "an %<ordered%> clause with a parameter"); |
3462 | return false; |
3463 | } |
3464 | return true; |
3465 | case GIMPLE_OMP_TARGET: |
3466 | if (gimple_omp_target_kind (ctx->stmt) |
3467 | != GF_OMP_TARGET_KIND_REGION) |
3468 | break; |
3469 | /* FALLTHRU */ |
3470 | case GIMPLE_OMP_PARALLEL: |
3471 | case GIMPLE_OMP_TEAMS: |
3472 | error_at (gimple_location (stmt), |
3473 | "%<ordered%> region must be closely nested inside " |
3474 | "a loop region with an %<ordered%> clause"); |
3475 | return false; |
3476 | default: |
3477 | break; |
3478 | } |
3479 | break; |
3480 | case GIMPLE_OMP_CRITICAL: |
3481 | { |
3482 | tree this_stmt_name |
3483 | = gimple_omp_critical_name (as_a <gomp_critical *> (stmt)); |
3484 | for (; ctx != NULLnullptr; ctx = ctx->outer) |
3485 | if (gomp_critical *other_crit |
3486 | = dyn_cast <gomp_critical *> (ctx->stmt)) |
3487 | if (this_stmt_name == gimple_omp_critical_name (other_crit)) |
3488 | { |
3489 | error_at (gimple_location (stmt), |
3490 | "%<critical%> region may not be nested inside " |
3491 | "a %<critical%> region with the same name"); |
3492 | return false; |
3493 | } |
3494 | } |
3495 | break; |
3496 | case GIMPLE_OMP_TEAMS: |
3497 | if (ctx == NULLnullptr) |
3498 | break; |
3499 | else if (gimple_code (ctx->stmt) != GIMPLE_OMP_TARGET |
3500 | || (gimple_omp_target_kind (ctx->stmt) |
3501 | != GF_OMP_TARGET_KIND_REGION)) |
3502 | { |
3503 | /* Teams construct can appear either strictly nested inside of |
3504 | target construct with no intervening stmts, or can be encountered |
3505 | only by initial task (so must not appear inside any OpenMP |
3506 | construct. */ |
3507 | error_at (gimple_location (stmt), |
3508 | "%<teams%> construct must be closely nested inside of " |
3509 | "%<target%> construct or not nested in any OpenMP " |
3510 | "construct"); |
3511 | return false; |
3512 | } |
3513 | break; |
3514 | case GIMPLE_OMP_TARGET: |
3515 | for (c = gimple_omp_target_clauses (stmt); c; c = OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3515, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3515, __FUNCTION__))->common.chain)) |
3516 | if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3516, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_DEPEND |
3517 | && (OMP_CLAUSE_DEPEND_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_DEPEND), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3517, __FUNCTION__))->omp_clause.subcode.depend_kind) == OMP_CLAUSE_DEPEND_SOURCE |
3518 | || OMP_CLAUSE_DEPEND_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_DEPEND), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3518, __FUNCTION__))->omp_clause.subcode.depend_kind) == OMP_CLAUSE_DEPEND_SINK)) |
3519 | { |
3520 | enum omp_clause_depend_kind kind = OMP_CLAUSE_DEPEND_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_DEPEND), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3520, __FUNCTION__))->omp_clause.subcode.depend_kind); |
3521 | error_at (OMP_CLAUSE_LOCATION (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3521, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.locus, |
3522 | "%<depend(%s)%> is only allowed in %<omp ordered%>", |
3523 | kind == OMP_CLAUSE_DEPEND_SOURCE ? "source" : "sink"); |
3524 | return false; |
3525 | } |
3526 | if (is_gimple_omp_offloaded (stmt) |
3527 | && oacc_get_fn_attrib (cfun(cfun + 0)->decl) != NULLnullptr) |
3528 | { |
3529 | error_at (gimple_location (stmt), |
3530 | "OpenACC region inside of OpenACC routine, nested " |
3531 | "parallelism not supported yet"); |
3532 | return false; |
3533 | } |
3534 | for (; ctx != NULLnullptr; ctx = ctx->outer) |
3535 | { |
3536 | if (gimple_code (ctx->stmt) != GIMPLE_OMP_TARGET) |
3537 | { |
3538 | if (is_gimple_omp (stmt) |
3539 | && is_gimple_omp_oacc (stmt) |
3540 | && is_gimple_omp (ctx->stmt)) |
3541 | { |
3542 | error_at (gimple_location (stmt), |
3543 | "OpenACC construct inside of non-OpenACC region"); |
3544 | return false; |
3545 | } |
3546 | continue; |
3547 | } |
3548 | |
3549 | const char *stmt_name, *ctx_stmt_name; |
3550 | switch (gimple_omp_target_kind (stmt)) |
3551 | { |
3552 | case GF_OMP_TARGET_KIND_REGION: stmt_name = "target"; break; |
3553 | case GF_OMP_TARGET_KIND_DATA: stmt_name = "target data"; break; |
3554 | case GF_OMP_TARGET_KIND_UPDATE: stmt_name = "target update"; break; |
3555 | case GF_OMP_TARGET_KIND_ENTER_DATA: |
3556 | stmt_name = "target enter data"; break; |
3557 | case GF_OMP_TARGET_KIND_EXIT_DATA: |
3558 | stmt_name = "target exit data"; break; |
3559 | case GF_OMP_TARGET_KIND_OACC_PARALLEL: stmt_name = "parallel"; break; |
3560 | case GF_OMP_TARGET_KIND_OACC_KERNELS: stmt_name = "kernels"; break; |
3561 | case GF_OMP_TARGET_KIND_OACC_SERIAL: stmt_name = "serial"; break; |
3562 | case GF_OMP_TARGET_KIND_OACC_DATA: stmt_name = "data"; break; |
3563 | case GF_OMP_TARGET_KIND_OACC_UPDATE: stmt_name = "update"; break; |
3564 | case GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA: |
3565 | stmt_name = "enter/exit data"; break; |
3566 | case GF_OMP_TARGET_KIND_OACC_DECLARE: stmt_name = "declare"; break; |
3567 | case GF_OMP_TARGET_KIND_OACC_HOST_DATA: stmt_name = "host_data"; |
3568 | break; |
3569 | case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED: |
3570 | case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE: |
3571 | case GF_OMP_TARGET_KIND_OACC_DATA_KERNELS: |
3572 | /* OpenACC 'kernels' decomposed parts. */ |
3573 | stmt_name = "kernels"; break; |
3574 | default: gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3574, __FUNCTION__)); |
3575 | } |
3576 | switch (gimple_omp_target_kind (ctx->stmt)) |
3577 | { |
3578 | case GF_OMP_TARGET_KIND_REGION: ctx_stmt_name = "target"; break; |
3579 | case GF_OMP_TARGET_KIND_DATA: ctx_stmt_name = "target data"; break; |
3580 | case GF_OMP_TARGET_KIND_OACC_PARALLEL: |
3581 | ctx_stmt_name = "parallel"; break; |
3582 | case GF_OMP_TARGET_KIND_OACC_KERNELS: |
3583 | ctx_stmt_name = "kernels"; break; |
3584 | case GF_OMP_TARGET_KIND_OACC_SERIAL: |
3585 | ctx_stmt_name = "serial"; break; |
3586 | case GF_OMP_TARGET_KIND_OACC_DATA: ctx_stmt_name = "data"; break; |
3587 | case GF_OMP_TARGET_KIND_OACC_HOST_DATA: |
3588 | ctx_stmt_name = "host_data"; break; |
3589 | case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED: |
3590 | case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE: |
3591 | case GF_OMP_TARGET_KIND_OACC_DATA_KERNELS: |
3592 | /* OpenACC 'kernels' decomposed parts. */ |
3593 | ctx_stmt_name = "kernels"; break; |
3594 | default: gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3594, __FUNCTION__)); |
3595 | } |
3596 | |
3597 | /* OpenACC/OpenMP mismatch? */ |
3598 | if (is_gimple_omp_oacc (stmt) |
3599 | != is_gimple_omp_oacc (ctx->stmt)) |
3600 | { |
3601 | error_at (gimple_location (stmt), |
3602 | "%s %qs construct inside of %s %qs region", |
3603 | (is_gimple_omp_oacc (stmt) |
3604 | ? "OpenACC" : "OpenMP"), stmt_name, |
3605 | (is_gimple_omp_oacc (ctx->stmt) |
3606 | ? "OpenACC" : "OpenMP"), ctx_stmt_name); |
3607 | return false; |
3608 | } |
3609 | if (is_gimple_omp_offloaded (ctx->stmt)) |
3610 | { |
3611 | /* No GIMPLE_OMP_TARGET inside offloaded OpenACC CTX. */ |
3612 | if (is_gimple_omp_oacc (ctx->stmt)) |
3613 | { |
3614 | error_at (gimple_location (stmt), |
3615 | "%qs construct inside of %qs region", |
3616 | stmt_name, ctx_stmt_name); |
3617 | return false; |
3618 | } |
3619 | else |
3620 | { |
3621 | warning_at (gimple_location (stmt), 0, |
3622 | "%qs construct inside of %qs region", |
3623 | stmt_name, ctx_stmt_name); |
3624 | } |
3625 | } |
3626 | } |
3627 | break; |
3628 | default: |
3629 | break; |
3630 | } |
3631 | return true; |
3632 | } |
3633 | |
3634 | |
3635 | /* Helper function scan_omp. |
3636 | |
3637 | Callback for walk_tree or operators in walk_gimple_stmt used to |
3638 | scan for OMP directives in TP. */ |
3639 | |
3640 | static tree |
3641 | scan_omp_1_op (tree *tp, int *walk_subtrees, void *data) |
3642 | { |
3643 | struct walk_stmt_info *wi = (struct walk_stmt_info *) data; |
3644 | omp_context *ctx = (omp_context *) wi->info; |
3645 | tree t = *tp; |
3646 | |
3647 | switch (TREE_CODE (t)((enum tree_code) (t)->base.code)) |
3648 | { |
3649 | case VAR_DECL: |
3650 | case PARM_DECL: |
3651 | case LABEL_DECL: |
3652 | case RESULT_DECL: |
3653 | if (ctx) |
3654 | { |
3655 | tree repl = remap_decl (t, &ctx->cb); |
3656 | gcc_checking_assert (TREE_CODE (repl) != ERROR_MARK)((void)(!(((enum tree_code) (repl)->base.code) != ERROR_MARK ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3656, __FUNCTION__), 0 : 0)); |
3657 | *tp = repl; |
3658 | } |
3659 | break; |
3660 | |
3661 | default: |
3662 | if (ctx && TYPE_P (t)(tree_code_type[(int) (((enum tree_code) (t)->base.code))] == tcc_type)) |
3663 | *tp = remap_type (t, &ctx->cb); |
3664 | else if (!DECL_P (t)(tree_code_type[(int) (((enum tree_code) (t)->base.code))] == tcc_declaration)) |
3665 | { |
3666 | *walk_subtrees = 1; |
3667 | if (ctx) |
3668 | { |
3669 | tree tem = remap_type (TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3669, __FUNCTION__))->typed.type), &ctx->cb); |
3670 | if (tem != TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3670, __FUNCTION__))->typed.type)) |
3671 | { |
3672 | if (TREE_CODE (t)((enum tree_code) (t)->base.code) == INTEGER_CST) |
3673 | *tp = wide_int_to_tree (tem, wi::to_wide (t)); |
3674 | else |
3675 | TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3675, __FUNCTION__))->typed.type) = tem; |
3676 | } |
3677 | } |
3678 | } |
3679 | break; |
3680 | } |
3681 | |
3682 | return NULL_TREE(tree) nullptr; |
3683 | } |
3684 | |
3685 | /* Return true if FNDECL is a setjmp or a longjmp. */ |
3686 | |
3687 | static bool |
3688 | setjmp_or_longjmp_p (const_tree fndecl) |
3689 | { |
3690 | if (fndecl_built_in_p (fndecl, BUILT_IN_SETJMP) |
3691 | || fndecl_built_in_p (fndecl, BUILT_IN_LONGJMP)) |
3692 | return true; |
3693 | |
3694 | tree declname = DECL_NAME (fndecl)((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3694, __FUNCTION__))->decl_minimal.name); |
3695 | if (!declname |
3696 | || (DECL_CONTEXT (fndecl)((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3696, __FUNCTION__))->decl_minimal.context) != NULL_TREE(tree) nullptr |
3697 | && TREE_CODE (DECL_CONTEXT (fndecl))((enum tree_code) (((contains_struct_check ((fndecl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3697, __FUNCTION__))->decl_minimal.context))->base.code ) != TRANSLATION_UNIT_DECL) |
3698 | || !TREE_PUBLIC (fndecl)((fndecl)->base.public_flag)) |
3699 | return false; |
3700 | |
3701 | const char *name = IDENTIFIER_POINTER (declname)((const char *) (tree_check ((declname), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3701, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str ); |
3702 | return !strcmp (name, "setjmp") || !strcmp (name, "longjmp"); |
3703 | } |
3704 | |
3705 | /* Return true if FNDECL is an omp_* runtime API call. */ |
3706 | |
3707 | static bool |
3708 | omp_runtime_api_call (const_tree fndecl) |
3709 | { |
3710 | tree declname = DECL_NAME (fndecl)((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3710, __FUNCTION__))->decl_minimal.name); |
3711 | if (!declname |
3712 | || (DECL_CONTEXT (fndecl)((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3712, __FUNCTION__))->decl_minimal.context) != NULL_TREE(tree) nullptr |
3713 | && TREE_CODE (DECL_CONTEXT (fndecl))((enum tree_code) (((contains_struct_check ((fndecl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3713, __FUNCTION__))->decl_minimal.context))->base.code ) != TRANSLATION_UNIT_DECL) |
3714 | || !TREE_PUBLIC (fndecl)((fndecl)->base.public_flag)) |
3715 | return false; |
3716 | |
3717 | const char *name = IDENTIFIER_POINTER (declname)((const char *) (tree_check ((declname), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3717, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str ); |
3718 | if (strncmp (name, "omp_", 4) != 0) |
3719 | return false; |
3720 | |
3721 | static const char *omp_runtime_apis[] = |
3722 | { |
3723 | /* This array has 3 sections. First omp_* calls that don't |
3724 | have any suffixes. */ |
3725 | "target_alloc", |
3726 | "target_associate_ptr", |
3727 | "target_disassociate_ptr", |
3728 | "target_free", |
3729 | "target_is_present", |
3730 | "target_memcpy", |
3731 | "target_memcpy_rect", |
3732 | NULLnullptr, |
3733 | /* Now omp_* calls that are available as omp_* and omp_*_. */ |
3734 | "capture_affinity", |
3735 | "destroy_lock", |
3736 | "destroy_nest_lock", |
3737 | "display_affinity", |
3738 | "get_active_level", |
3739 | "get_affinity_format", |
3740 | "get_cancellation", |
3741 | "get_default_device", |
3742 | "get_dynamic", |
3743 | "get_initial_device", |
3744 | "get_level", |
3745 | "get_max_active_levels", |
3746 | "get_max_task_priority", |
3747 | "get_max_threads", |
3748 | "get_nested", |
3749 | "get_num_devices", |
3750 | "get_num_places", |
3751 | "get_num_procs", |
3752 | "get_num_teams", |
3753 | "get_num_threads", |
3754 | "get_partition_num_places", |
3755 | "get_place_num", |
3756 | "get_proc_bind", |
3757 | "get_team_num", |
3758 | "get_thread_limit", |
3759 | "get_thread_num", |
3760 | "get_wtick", |
3761 | "get_wtime", |
3762 | "in_final", |
3763 | "in_parallel", |
3764 | "init_lock", |
3765 | "init_nest_lock", |
3766 | "is_initial_device", |
3767 | "pause_resource", |
3768 | "pause_resource_all", |
3769 | "set_affinity_format", |
3770 | "set_lock", |
3771 | "set_nest_lock", |
3772 | "test_lock", |
3773 | "test_nest_lock", |
3774 | "unset_lock", |
3775 | "unset_nest_lock", |
3776 | NULLnullptr, |
3777 | /* And finally calls available as omp_*, omp_*_ and omp_*_8_. */ |
3778 | "get_ancestor_thread_num", |
3779 | "get_partition_place_nums", |
3780 | "get_place_num_procs", |
3781 | "get_place_proc_ids", |
3782 | "get_schedule", |
3783 | "get_team_size", |
3784 | "set_default_device", |
3785 | "set_dynamic", |
3786 | "set_max_active_levels", |
3787 | "set_nested", |
3788 | "set_num_threads", |
3789 | "set_schedule" |
3790 | }; |
3791 | |
3792 | int mode = 0; |
3793 | for (unsigned i = 0; i < ARRAY_SIZE (omp_runtime_apis)(sizeof (omp_runtime_apis) / sizeof ((omp_runtime_apis)[0])); i++) |
3794 | { |
3795 | if (omp_runtime_apis[i] == NULLnullptr) |
3796 | { |
3797 | mode++; |
3798 | continue; |
3799 | } |
3800 | size_t len = strlen (omp_runtime_apis[i]); |
3801 | if (strncmp (name + 4, omp_runtime_apis[i], len) == 0 |
3802 | && (name[4 + len] == '\0' |
3803 | || (mode > 0 |
3804 | && name[4 + len] == '_' |
3805 | && (name[4 + len + 1] == '\0' |
3806 | || (mode > 1 |
3807 | && strcmp (name + 4 + len + 1, "8_") == 0))))) |
3808 | return true; |
3809 | } |
3810 | return false; |
3811 | } |
3812 | |
3813 | /* Helper function for scan_omp. |
3814 | |
3815 | Callback for walk_gimple_stmt used to scan for OMP directives in |
3816 | the current statement in GSI. */ |
3817 | |
3818 | static tree |
3819 | scan_omp_1_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p, |
3820 | struct walk_stmt_info *wi) |
3821 | { |
3822 | gimple *stmt = gsi_stmt (*gsi); |
3823 | omp_context *ctx = (omp_context *) wi->info; |
3824 | |
3825 | if (gimple_has_location (stmt)) |
3826 | input_location = gimple_location (stmt); |
3827 | |
3828 | /* Check the nesting restrictions. */ |
3829 | bool remove = false; |
3830 | if (is_gimple_omp (stmt)) |
3831 | remove = !check_omp_nesting_restrictions (stmt, ctx); |
3832 | else if (is_gimple_call (stmt)) |
3833 | { |
3834 | tree fndecl = gimple_call_fndecl (stmt); |
3835 | if (fndecl) |
3836 | { |
3837 | if (ctx |
3838 | && gimple_code (ctx->stmt) == GIMPLE_OMP_FOR |
3839 | && gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_KIND_SIMD |
3840 | && setjmp_or_longjmp_p (fndecl) |
3841 | && !ctx->loop_p) |
3842 | { |
3843 | remove = true; |
3844 | error_at (gimple_location (stmt), |
3845 | "setjmp/longjmp inside %<simd%> construct"); |
3846 | } |
3847 | else if (DECL_BUILT_IN_CLASS (fndecl)((built_in_class) (tree_check ((fndecl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3847, __FUNCTION__, (FUNCTION_DECL)))->function_decl.built_in_class ) == BUILT_IN_NORMAL) |
3848 | switch (DECL_FUNCTION_CODE (fndecl)) |
3849 | { |
3850 | case BUILT_IN_GOMP_BARRIER: |
3851 | case BUILT_IN_GOMP_CANCEL: |
3852 | case BUILT_IN_GOMP_CANCELLATION_POINT: |
3853 | case BUILT_IN_GOMP_TASKYIELD: |
3854 | case BUILT_IN_GOMP_TASKWAIT: |
3855 | case BUILT_IN_GOMP_TASKGROUP_START: |
3856 | case BUILT_IN_GOMP_TASKGROUP_END: |
3857 | remove = !check_omp_nesting_restrictions (stmt, ctx); |
3858 | break; |
3859 | default: |
3860 | break; |
3861 | } |
3862 | else if (ctx) |
3863 | { |
3864 | omp_context *octx = ctx; |
3865 | if (gimple_code (ctx->stmt) == GIMPLE_OMP_SCAN && ctx->outer) |
3866 | octx = ctx->outer; |
3867 | if (octx->order_concurrent && omp_runtime_api_call (fndecl)) |
3868 | { |
3869 | remove = true; |
3870 | error_at (gimple_location (stmt), |
3871 | "OpenMP runtime API call %qD in a region with " |
3872 | "%<order(concurrent)%> clause", fndecl); |
3873 | } |
3874 | } |
3875 | } |
3876 | } |
3877 | if (remove) |
3878 | { |
3879 | stmt = gimple_build_nop (); |
3880 | gsi_replace (gsi, stmt, false); |
3881 | } |
3882 | |
3883 | *handled_ops_p = true; |
3884 | |
3885 | switch (gimple_code (stmt)) |
3886 | { |
3887 | case GIMPLE_OMP_PARALLEL: |
3888 | taskreg_nesting_level++; |
3889 | scan_omp_parallel (gsi, ctx); |
3890 | taskreg_nesting_level--; |
3891 | break; |
3892 | |
3893 | case GIMPLE_OMP_TASK: |
3894 | taskreg_nesting_level++; |
3895 | scan_omp_task (gsi, ctx); |
3896 | taskreg_nesting_level--; |
3897 | break; |
3898 | |
3899 | case GIMPLE_OMP_FOR: |
3900 | if ((gimple_omp_for_kind (as_a <gomp_for *> (stmt)) |
3901 | == GF_OMP_FOR_KIND_SIMD) |
3902 | && gimple_omp_for_combined_into_p (stmt) |
3903 | && gimple_code (ctx->stmt) != GIMPLE_OMP_SCAN) |
3904 | { |
3905 | tree clauses = gimple_omp_for_clauses (as_a <gomp_for *> (stmt)); |
3906 | tree c = omp_find_clause (clauses, OMP_CLAUSE_REDUCTION); |
3907 | if (c && OMP_CLAUSE_REDUCTION_INSCAN (c)(((omp_clause_subcode_check ((c), (OMP_CLAUSE_REDUCTION), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3907, __FUNCTION__)))->base.private_flag) && !seen_error ()) |
3908 | { |
3909 | scan_omp_simd_scan (gsi, as_a <gomp_for *> (stmt), ctx); |
3910 | break; |
3911 | } |
3912 | } |
3913 | if ((gimple_omp_for_kind (as_a <gomp_for *> (stmt)) |
3914 | == GF_OMP_FOR_KIND_SIMD) |
3915 | && omp_maybe_offloaded_ctx (ctx) |
3916 | && omp_max_simt_vf () |
3917 | && gimple_omp_for_collapse (stmt) == 1) |
3918 | scan_omp_simd (gsi, as_a <gomp_for *> (stmt), ctx); |
3919 | else |
3920 | scan_omp_for (as_a <gomp_for *> (stmt), ctx); |
3921 | break; |
3922 | |
3923 | case GIMPLE_OMP_SECTIONS: |
3924 | scan_omp_sections (as_a <gomp_sections *> (stmt), ctx); |
3925 | break; |
3926 | |
3927 | case GIMPLE_OMP_SINGLE: |
3928 | scan_omp_single (as_a <gomp_single *> (stmt), ctx); |
3929 | break; |
3930 | |
3931 | case GIMPLE_OMP_SCAN: |
3932 | if (tree clauses = gimple_omp_scan_clauses (as_a <gomp_scan *> (stmt))) |
3933 | { |
3934 | if (OMP_CLAUSE_CODE (clauses)((tree_check ((clauses), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3934, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_INCLUSIVE) |
3935 | ctx->scan_inclusive = true; |
3936 | else if (OMP_CLAUSE_CODE (clauses)((tree_check ((clauses), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3936, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_EXCLUSIVE) |
3937 | ctx->scan_exclusive = true; |
3938 | } |
3939 | /* FALLTHRU */ |
3940 | case GIMPLE_OMP_SECTION: |
3941 | case GIMPLE_OMP_MASTER: |
3942 | case GIMPLE_OMP_ORDERED: |
3943 | case GIMPLE_OMP_CRITICAL: |
3944 | ctx = new_omp_context (stmt, ctx); |
3945 | scan_omp (gimple_omp_body_ptr (stmt), ctx); |
3946 | break; |
3947 | |
3948 | case GIMPLE_OMP_TASKGROUP: |
3949 | ctx = new_omp_context (stmt, ctx); |
3950 | scan_sharing_clauses (gimple_omp_taskgroup_clauses (stmt), ctx); |
3951 | scan_omp (gimple_omp_body_ptr (stmt), ctx); |
3952 | break; |
3953 | |
3954 | case GIMPLE_OMP_TARGET: |
3955 | if (is_gimple_omp_offloaded (stmt)) |
3956 | { |
3957 | taskreg_nesting_level++; |
3958 | scan_omp_target (as_a <gomp_target *> (stmt), ctx); |
3959 | taskreg_nesting_level--; |
3960 | } |
3961 | else |
3962 | scan_omp_target (as_a <gomp_target *> (stmt), ctx); |
3963 | break; |
3964 | |
3965 | case GIMPLE_OMP_TEAMS: |
3966 | if (gimple_omp_teams_host (as_a <gomp_teams *> (stmt))) |
3967 | { |
3968 | taskreg_nesting_level++; |
3969 | scan_omp_teams (as_a <gomp_teams *> (stmt), ctx); |
3970 | taskreg_nesting_level--; |
3971 | } |
3972 | else |
3973 | scan_omp_teams (as_a <gomp_teams *> (stmt), ctx); |
3974 | break; |
3975 | |
3976 | case GIMPLE_BIND: |
3977 | { |
3978 | tree var; |
3979 | |
3980 | *handled_ops_p = false; |
3981 | if (ctx) |
3982 | for (var = gimple_bind_vars (as_a <gbind *> (stmt)); |
3983 | var ; |
3984 | var = DECL_CHAIN (var)(((contains_struct_check (((contains_struct_check ((var), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3984, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 3984, __FUNCTION__))->common.chain))) |
3985 | insert_decl_map (&ctx->cb, var, var); |
3986 | } |
3987 | break; |
3988 | default: |
3989 | *handled_ops_p = false; |
3990 | break; |
3991 | } |
3992 | |
3993 | return NULL_TREE(tree) nullptr; |
3994 | } |
3995 | |
3996 | |
3997 | /* Scan all the statements starting at the current statement. CTX |
3998 | contains context information about the OMP directives and |
3999 | clauses found during the scan. */ |
4000 | |
4001 | static void |
4002 | scan_omp (gimple_seq *body_p, omp_context *ctx) |
4003 | { |
4004 | location_t saved_location; |
4005 | struct walk_stmt_info wi; |
4006 | |
4007 | memset (&wi, 0, sizeof (wi)); |
4008 | wi.info = ctx; |
4009 | wi.want_locations = true; |
4010 | |
4011 | saved_location = input_location; |
4012 | walk_gimple_seq_mod (body_p, scan_omp_1_stmt, scan_omp_1_op, &wi); |
4013 | input_location = saved_location; |
4014 | } |
4015 | |
4016 | /* Re-gimplification and code generation routines. */ |
4017 | |
4018 | /* Remove omp_member_access_dummy_var variables from gimple_bind_vars |
4019 | of BIND if in a method. */ |
4020 | |
4021 | static void |
4022 | maybe_remove_omp_member_access_dummy_vars (gbind *bind) |
4023 | { |
4024 | if (DECL_ARGUMENTS (current_function_decl)((tree_check ((current_function_decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4024, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments ) |
4025 | && DECL_ARTIFICIAL (DECL_ARGUMENTS (current_function_decl))((contains_struct_check ((((tree_check ((current_function_decl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4025, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments )), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4025, __FUNCTION__))->decl_common.artificial_flag) |
4026 | && (TREE_CODE (TREE_TYPE (DECL_ARGUMENTS (current_function_decl)))((enum tree_code) (((contains_struct_check ((((tree_check ((current_function_decl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4026, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments )), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4026, __FUNCTION__))->typed.type))->base.code) |
4027 | == POINTER_TYPE)) |
4028 | { |
4029 | tree vars = gimple_bind_vars (bind); |
4030 | for (tree *pvar = &vars; *pvar; ) |
4031 | if (omp_member_access_dummy_var (*pvar)) |
4032 | *pvar = DECL_CHAIN (*pvar)(((contains_struct_check (((contains_struct_check ((*pvar), ( TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4032, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4032, __FUNCTION__))->common.chain)); |
4033 | else |
4034 | pvar = &DECL_CHAIN (*pvar)(((contains_struct_check (((contains_struct_check ((*pvar), ( TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4034, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4034, __FUNCTION__))->common.chain)); |
4035 | gimple_bind_set_vars (bind, vars); |
4036 | } |
4037 | } |
4038 | |
4039 | /* Remove omp_member_access_dummy_var variables from BLOCK_VARS of |
4040 | block and its subblocks. */ |
4041 | |
4042 | static void |
4043 | remove_member_access_dummy_vars (tree block) |
4044 | { |
4045 | for (tree *pvar = &BLOCK_VARS (block)((tree_check ((block), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4045, __FUNCTION__, (BLOCK)))->block.vars); *pvar; ) |
4046 | if (omp_member_access_dummy_var (*pvar)) |
4047 | *pvar = DECL_CHAIN (*pvar)(((contains_struct_check (((contains_struct_check ((*pvar), ( TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4047, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4047, __FUNCTION__))->common.chain)); |
4048 | else |
4049 | pvar = &DECL_CHAIN (*pvar)(((contains_struct_check (((contains_struct_check ((*pvar), ( TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4049, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4049, __FUNCTION__))->common.chain)); |
4050 | |
4051 | for (block = BLOCK_SUBBLOCKS (block)((tree_check ((block), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4051, __FUNCTION__, (BLOCK)))->block.subblocks); block; block = BLOCK_CHAIN (block)((tree_check ((block), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4051, __FUNCTION__, (BLOCK)))->block.chain)) |
4052 | remove_member_access_dummy_vars (block); |
4053 | } |
4054 | |
4055 | /* If a context was created for STMT when it was scanned, return it. */ |
4056 | |
4057 | static omp_context * |
4058 | maybe_lookup_ctx (gimple *stmt) |
4059 | { |
4060 | splay_tree_node n; |
4061 | n = splay_tree_lookup (all_contexts, (splay_tree_key) stmt); |
4062 | return n ? (omp_context *) n->value : NULLnullptr; |
4063 | } |
4064 | |
4065 | |
4066 | /* Find the mapping for DECL in CTX or the immediately enclosing |
4067 | context that has a mapping for DECL. |
4068 | |
4069 | If CTX is a nested parallel directive, we may have to use the decl |
4070 | mappings created in CTX's parent context. Suppose that we have the |
4071 | following parallel nesting (variable UIDs showed for clarity): |
4072 | |
4073 | iD.1562 = 0; |
4074 | #omp parallel shared(iD.1562) -> outer parallel |
4075 | iD.1562 = iD.1562 + 1; |
4076 | |
4077 | #omp parallel shared (iD.1562) -> inner parallel |
4078 | iD.1562 = iD.1562 - 1; |
4079 | |
4080 | Each parallel structure will create a distinct .omp_data_s structure |
4081 | for copying iD.1562 in/out of the directive: |
4082 | |
4083 | outer parallel .omp_data_s.1.i -> iD.1562 |
4084 | inner parallel .omp_data_s.2.i -> iD.1562 |
4085 | |
4086 | A shared variable mapping will produce a copy-out operation before |
4087 | the parallel directive and a copy-in operation after it. So, in |
4088 | this case we would have: |
4089 | |
4090 | iD.1562 = 0; |
4091 | .omp_data_o.1.i = iD.1562; |
4092 | #omp parallel shared(iD.1562) -> outer parallel |
4093 | .omp_data_i.1 = &.omp_data_o.1 |
4094 | .omp_data_i.1->i = .omp_data_i.1->i + 1; |
4095 | |
4096 | .omp_data_o.2.i = iD.1562; -> ** |
4097 | #omp parallel shared(iD.1562) -> inner parallel |
4098 | .omp_data_i.2 = &.omp_data_o.2 |
4099 | .omp_data_i.2->i = .omp_data_i.2->i - 1; |
4100 | |
4101 | |
4102 | ** This is a problem. The symbol iD.1562 cannot be referenced |
4103 | inside the body of the outer parallel region. But since we are |
4104 | emitting this copy operation while expanding the inner parallel |
4105 | directive, we need to access the CTX structure of the outer |
4106 | parallel directive to get the correct mapping: |
4107 | |
4108 | .omp_data_o.2.i = .omp_data_i.1->i |
4109 | |
4110 | Since there may be other workshare or parallel directives enclosing |
4111 | the parallel directive, it may be necessary to walk up the context |
4112 | parent chain. This is not a problem in general because nested |
4113 | parallelism happens only rarely. */ |
4114 | |
4115 | static tree |
4116 | lookup_decl_in_outer_ctx (tree decl, omp_context *ctx) |
4117 | { |
4118 | tree t; |
4119 | omp_context *up; |
4120 | |
4121 | for (up = ctx->outer, t = NULLnullptr; up && t == NULLnullptr; up = up->outer) |
4122 | t = maybe_lookup_decl (decl, up); |
4123 | |
4124 | gcc_assert (!ctx->is_nested || t || is_global_var (decl))((void)(!(!ctx->is_nested || t || is_global_var (decl)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4124, __FUNCTION__), 0 : 0)); |
4125 | |
4126 | return t ? t : decl; |
4127 | } |
4128 | |
4129 | |
4130 | /* Similar to lookup_decl_in_outer_ctx, but return DECL if not found |
4131 | in outer contexts. */ |
4132 | |
4133 | static tree |
4134 | maybe_lookup_decl_in_outer_ctx (tree decl, omp_context *ctx) |
4135 | { |
4136 | tree t = NULLnullptr; |
4137 | omp_context *up; |
4138 | |
4139 | for (up = ctx->outer, t = NULLnullptr; up && t == NULLnullptr; up = up->outer) |
4140 | t = maybe_lookup_decl (decl, up); |
4141 | |
4142 | return t ? t : decl; |
4143 | } |
4144 | |
4145 | |
4146 | /* Construct the initialization value for reduction operation OP. */ |
4147 | |
4148 | tree |
4149 | omp_reduction_init_op (location_t loc, enum tree_code op, tree type) |
4150 | { |
4151 | switch (op) |
4152 | { |
4153 | case PLUS_EXPR: |
4154 | case MINUS_EXPR: |
4155 | case BIT_IOR_EXPR: |
4156 | case BIT_XOR_EXPR: |
4157 | case TRUTH_OR_EXPR: |
4158 | case TRUTH_ORIF_EXPR: |
4159 | case TRUTH_XOR_EXPR: |
4160 | case NE_EXPR: |
4161 | return build_zero_cst (type); |
4162 | |
4163 | case MULT_EXPR: |
4164 | case TRUTH_AND_EXPR: |
4165 | case TRUTH_ANDIF_EXPR: |
4166 | case EQ_EXPR: |
4167 | return fold_convert_loc (loc, type, integer_one_nodeglobal_trees[TI_INTEGER_ONE]); |
4168 | |
4169 | case BIT_AND_EXPR: |
4170 | return fold_convert_loc (loc, type, integer_minus_one_nodeglobal_trees[TI_INTEGER_MINUS_ONE]); |
4171 | |
4172 | case MAX_EXPR: |
4173 | if (SCALAR_FLOAT_TYPE_P (type)(((enum tree_code) (type)->base.code) == REAL_TYPE)) |
4174 | { |
4175 | REAL_VALUE_TYPEstruct real_value max, min; |
4176 | if (HONOR_INFINITIES (type)) |
4177 | { |
4178 | real_inf (&max); |
4179 | real_arithmetic (&min, NEGATE_EXPR, &max, NULLnullptr); |
4180 | } |
4181 | else |
4182 | real_maxval (&min, 1, TYPE_MODE (type)((((enum tree_code) ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4182, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (type) : (type)->type_common.mode)); |
4183 | return build_real (type, min); |
4184 | } |
4185 | else if (POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || ( (enum tree_code) (type)->base.code) == REFERENCE_TYPE)) |
4186 | { |
4187 | wide_int min |
4188 | = wi::min_value (TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4188, __FUNCTION__))->type_common.precision), TYPE_SIGN (type)((signop) ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4188, __FUNCTION__))->base.u.bits.unsigned_flag))); |
4189 | return wide_int_to_tree (type, min); |
4190 | } |
4191 | else |
4192 | { |
4193 | gcc_assert (INTEGRAL_TYPE_P (type))((void)(!((((enum tree_code) (type)->base.code) == ENUMERAL_TYPE || ((enum tree_code) (type)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (type)->base.code) == INTEGER_TYPE)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4193, __FUNCTION__), 0 : 0)); |
4194 | return TYPE_MIN_VALUE (type)((tree_check5 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4194, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE ), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.minval ); |
4195 | } |
4196 | |
4197 | case MIN_EXPR: |
4198 | if (SCALAR_FLOAT_TYPE_P (type)(((enum tree_code) (type)->base.code) == REAL_TYPE)) |
4199 | { |
4200 | REAL_VALUE_TYPEstruct real_value max; |
4201 | if (HONOR_INFINITIES (type)) |
4202 | real_inf (&max); |
4203 | else |
4204 | real_maxval (&max, 0, TYPE_MODE (type)((((enum tree_code) ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4204, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (type) : (type)->type_common.mode)); |
4205 | return build_real (type, max); |
4206 | } |
4207 | else if (POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || ( (enum tree_code) (type)->base.code) == REFERENCE_TYPE)) |
4208 | { |
4209 | wide_int max |
4210 | = wi::max_value (TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4210, __FUNCTION__))->type_common.precision), TYPE_SIGN (type)((signop) ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4210, __FUNCTION__))->base.u.bits.unsigned_flag))); |
4211 | return wide_int_to_tree (type, max); |
4212 | } |
4213 | else |
4214 | { |
4215 | gcc_assert (INTEGRAL_TYPE_P (type))((void)(!((((enum tree_code) (type)->base.code) == ENUMERAL_TYPE || ((enum tree_code) (type)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (type)->base.code) == INTEGER_TYPE)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4215, __FUNCTION__), 0 : 0)); |
4216 | return TYPE_MAX_VALUE (type)((tree_check5 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4216, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE ), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval ); |
4217 | } |
4218 | |
4219 | default: |
4220 | gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4220, __FUNCTION__)); |
4221 | } |
4222 | } |
4223 | |
4224 | /* Construct the initialization value for reduction CLAUSE. */ |
4225 | |
4226 | tree |
4227 | omp_reduction_init (tree clause, tree type) |
4228 | { |
4229 | return omp_reduction_init_op (OMP_CLAUSE_LOCATION (clause)((tree_check ((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4229, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.locus, |
4230 | OMP_CLAUSE_REDUCTION_CODE (clause)((omp_clause_range_check ((clause), (OMP_CLAUSE_REDUCTION), ( OMP_CLAUSE_IN_REDUCTION), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4230, __FUNCTION__))->omp_clause.subcode.reduction_code), type); |
4231 | } |
4232 | |
4233 | /* Return alignment to be assumed for var in CLAUSE, which should be |
4234 | OMP_CLAUSE_ALIGNED. */ |
4235 | |
4236 | static tree |
4237 | omp_clause_aligned_alignment (tree clause) |
4238 | { |
4239 | if (OMP_CLAUSE_ALIGNED_ALIGNMENT (clause)(*(omp_clause_elt_check (((omp_clause_subcode_check ((clause) , (OMP_CLAUSE_ALIGNED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4239, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4239, __FUNCTION__)))) |
4240 | return OMP_CLAUSE_ALIGNED_ALIGNMENT (clause)(*(omp_clause_elt_check (((omp_clause_subcode_check ((clause) , (OMP_CLAUSE_ALIGNED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4240, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4240, __FUNCTION__))); |
4241 | |
4242 | /* Otherwise return implementation defined alignment. */ |
4243 | unsigned int al = 1; |
4244 | opt_scalar_mode mode_iter; |
4245 | auto_vector_modes modes; |
4246 | targetm.vectorize.autovectorize_vector_modes (&modes, true); |
4247 | static enum mode_class classes[] |
4248 | = { MODE_INT, MODE_VECTOR_INT, MODE_FLOAT, MODE_VECTOR_FLOAT }; |
4249 | for (int i = 0; i < 4; i += 2) |
4250 | /* The for loop above dictates that we only walk through scalar classes. */ |
4251 | FOR_EACH_MODE_IN_CLASS (mode_iter, classes[i])for (mode_iterator::start (&(mode_iter), classes[i]); mode_iterator ::iterate_p (&(mode_iter)); mode_iterator::get_wider (& (mode_iter))) |
4252 | { |
4253 | scalar_mode mode = mode_iter.require (); |
4254 | machine_mode vmode = targetm.vectorize.preferred_simd_mode (mode); |
4255 | if (GET_MODE_CLASS (vmode)((enum mode_class) mode_class[vmode]) != classes[i + 1]) |
4256 | continue; |
4257 | machine_mode alt_vmode; |
4258 | for (unsigned int j = 0; j < modes.length (); ++j) |
4259 | if (related_vector_mode (modes[j], mode).exists (&alt_vmode) |
4260 | && known_ge (GET_MODE_SIZE (alt_vmode), GET_MODE_SIZE (vmode))(!maybe_lt (GET_MODE_SIZE (alt_vmode), GET_MODE_SIZE (vmode)) )) |
4261 | vmode = alt_vmode; |
4262 | |
4263 | tree type = lang_hooks.types.type_for_mode (mode, 1); |
4264 | if (type == NULL_TREE(tree) nullptr || TYPE_MODE (type)((((enum tree_code) ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4264, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (type) : (type)->type_common.mode) != mode) |
4265 | continue; |
4266 | type = build_vector_type_for_mode (type, vmode); |
4267 | 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/omp-low.c" , 4267, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (type) : (type)->type_common.mode) != vmode) |
4268 | continue; |
4269 | if (TYPE_ALIGN_UNIT (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4269, __FUNCTION__))->type_common.align ? ((unsigned)1) << ((type)->type_common.align - 1) : 0) / (8)) > al) |
4270 | al = TYPE_ALIGN_UNIT (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4270, __FUNCTION__))->type_common.align ? ((unsigned)1) << ((type)->type_common.align - 1) : 0) / (8)); |
4271 | } |
4272 | return build_int_cst (integer_type_nodeinteger_types[itk_int], al); |
4273 | } |
4274 | |
4275 | |
4276 | /* This structure is part of the interface between lower_rec_simd_input_clauses |
4277 | and lower_rec_input_clauses. */ |
4278 | |
4279 | class omplow_simd_context { |
4280 | public: |
4281 | omplow_simd_context () { memset (this, 0, sizeof (*this)); } |
4282 | tree idx; |
4283 | tree lane; |
4284 | tree lastlane; |
4285 | vec<tree, va_heap> simt_eargs; |
4286 | gimple_seq simt_dlist; |
4287 | poly_uint64_pod max_vf; |
4288 | bool is_simt; |
4289 | }; |
4290 | |
4291 | /* Helper function of lower_rec_input_clauses, used for #pragma omp simd |
4292 | privatization. */ |
4293 | |
4294 | static bool |
4295 | lower_rec_simd_input_clauses (tree new_var, omp_context *ctx, |
4296 | omplow_simd_context *sctx, tree &ivar, |
4297 | tree &lvar, tree *rvar = NULLnullptr, |
4298 | tree *rvar2 = NULLnullptr) |
4299 | { |
4300 | if (known_eq (sctx->max_vf, 0U)(!maybe_ne (sctx->max_vf, 0U))) |
4301 | { |
4302 | sctx->max_vf = sctx->is_simt ? omp_max_simt_vf () : omp_max_vf (); |
4303 | if (maybe_gt (sctx->max_vf, 1U)maybe_lt (1U, sctx->max_vf)) |
4304 | { |
4305 | tree c = omp_find_clause (gimple_omp_for_clauses (ctx->stmt), |
4306 | OMP_CLAUSE_SAFELEN); |
4307 | if (c) |
4308 | { |
4309 | poly_uint64 safe_len; |
4310 | if (!poly_int_tree_p (OMP_CLAUSE_SAFELEN_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_SAFELEN ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4310, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4310, __FUNCTION__))), &safe_len) |
4311 | || maybe_lt (safe_len, 1U)) |
4312 | sctx->max_vf = 1; |
4313 | else |
4314 | sctx->max_vf = lower_bound (sctx->max_vf, safe_len); |
4315 | } |
4316 | } |
4317 | if (maybe_gt (sctx->max_vf, 1U)maybe_lt (1U, sctx->max_vf)) |
4318 | { |
4319 | sctx->idx = create_tmp_var (unsigned_type_nodeinteger_types[itk_unsigned_int]); |
4320 | sctx->lane = create_tmp_var (unsigned_type_nodeinteger_types[itk_unsigned_int]); |
4321 | } |
4322 | } |
4323 | if (known_eq (sctx->max_vf, 1U)(!maybe_ne (sctx->max_vf, 1U))) |
4324 | return false; |
4325 | |
4326 | if (sctx->is_simt) |
4327 | { |
4328 | if (is_gimple_reg (new_var)) |
4329 | { |
4330 | ivar = lvar = new_var; |
4331 | return true; |
4332 | } |
4333 | tree type = TREE_TYPE (new_var)((contains_struct_check ((new_var), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4333, __FUNCTION__))->typed.type), ptype = build_pointer_type (type); |
4334 | ivar = lvar = create_tmp_var (type); |
4335 | TREE_ADDRESSABLE (ivar)((ivar)->base.addressable_flag) = 1; |
4336 | DECL_ATTRIBUTES (ivar)((contains_struct_check ((ivar), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4336, __FUNCTION__))->decl_common.attributes) = tree_cons (get_identifier ("omp simt private")(__builtin_constant_p ("omp simt private") ? get_identifier_with_length (("omp simt private"), strlen ("omp simt private")) : get_identifier ("omp simt private")), |
4337 | NULLnullptr, DECL_ATTRIBUTES (ivar)((contains_struct_check ((ivar), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4337, __FUNCTION__))->decl_common.attributes)); |
4338 | sctx->simt_eargs.safe_push (build1 (ADDR_EXPR, ptype, ivar)); |
4339 | tree clobber = build_clobber (type); |
4340 | gimple *g = gimple_build_assign (ivar, clobber); |
4341 | gimple_seq_add_stmt (&sctx->simt_dlist, g); |
4342 | } |
4343 | else |
4344 | { |
4345 | tree atype = build_array_type_nelts (TREE_TYPE (new_var)((contains_struct_check ((new_var), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4345, __FUNCTION__))->typed.type), sctx->max_vf); |
4346 | tree avar = create_tmp_var_raw (atype); |
4347 | if (TREE_ADDRESSABLE (new_var)((new_var)->base.addressable_flag)) |
4348 | TREE_ADDRESSABLE (avar)((avar)->base.addressable_flag) = 1; |
4349 | DECL_ATTRIBUTES (avar)((contains_struct_check ((avar), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4349, __FUNCTION__))->decl_common.attributes) |
4350 | = tree_cons (get_identifier ("omp simd array")(__builtin_constant_p ("omp simd array") ? get_identifier_with_length (("omp simd array"), strlen ("omp simd array")) : get_identifier ("omp simd array")), NULLnullptr, |
4351 | DECL_ATTRIBUTES (avar)((contains_struct_check ((avar), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4351, __FUNCTION__))->decl_common.attributes)); |
4352 | gimple_add_tmp_var (avar); |
4353 | tree iavar = avar; |
4354 | if (rvar && !ctx->for_simd_scan_phase) |
4355 | { |
4356 | /* For inscan reductions, create another array temporary, |
4357 | which will hold the reduced value. */ |
4358 | iavar = create_tmp_var_raw (atype); |
4359 | if (TREE_ADDRESSABLE (new_var)((new_var)->base.addressable_flag)) |
4360 | TREE_ADDRESSABLE (iavar)((iavar)->base.addressable_flag) = 1; |
4361 | DECL_ATTRIBUTES (iavar)((contains_struct_check ((iavar), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4361, __FUNCTION__))->decl_common.attributes) |
4362 | = tree_cons (get_identifier ("omp simd array")(__builtin_constant_p ("omp simd array") ? get_identifier_with_length (("omp simd array"), strlen ("omp simd array")) : get_identifier ("omp simd array")), NULLnullptr, |
4363 | tree_cons (get_identifier ("omp simd inscan")(__builtin_constant_p ("omp simd inscan") ? get_identifier_with_length (("omp simd inscan"), strlen ("omp simd inscan")) : get_identifier ("omp simd inscan")), NULLnullptr, |
4364 | DECL_ATTRIBUTES (iavar)((contains_struct_check ((iavar), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4364, __FUNCTION__))->decl_common.attributes))); |
4365 | gimple_add_tmp_var (iavar); |
4366 | ctx->cb.decl_map->put (avar, iavar); |
4367 | if (sctx->lastlane == NULL_TREE(tree) nullptr) |
4368 | sctx->lastlane = create_tmp_var (unsigned_type_nodeinteger_types[itk_unsigned_int]); |
4369 | *rvar = build4 (ARRAY_REF, TREE_TYPE (new_var)((contains_struct_check ((new_var), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4369, __FUNCTION__))->typed.type), iavar, |
4370 | sctx->lastlane, NULL_TREE(tree) nullptr, NULL_TREE(tree) nullptr); |
4371 | TREE_THIS_NOTRAP (*rvar)((tree_check5 ((*rvar), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4371, __FUNCTION__, (INDIRECT_REF), (MEM_REF), (TARGET_MEM_REF ), (ARRAY_REF), (ARRAY_RANGE_REF)))->base.nothrow_flag) = 1; |
4372 | |
4373 | if (ctx->scan_exclusive) |
4374 | { |
4375 | /* And for exclusive scan yet another one, which will |
4376 | hold the value during the scan phase. */ |
4377 | tree savar = create_tmp_var_raw (atype); |
4378 | if (TREE_ADDRESSABLE (new_var)((new_var)->base.addressable_flag)) |
4379 | TREE_ADDRESSABLE (savar)((savar)->base.addressable_flag) = 1; |
4380 | DECL_ATTRIBUTES (savar)((contains_struct_check ((savar), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4380, __FUNCTION__))->decl_common.attributes) |
4381 | = tree_cons (get_identifier ("omp simd array")(__builtin_constant_p ("omp simd array") ? get_identifier_with_length (("omp simd array"), strlen ("omp simd array")) : get_identifier ("omp simd array")), NULLnullptr, |
4382 | tree_cons (get_identifier ("omp simd inscan "(__builtin_constant_p ("omp simd inscan " "exclusive") ? get_identifier_with_length (("omp simd inscan " "exclusive"), strlen ("omp simd inscan " "exclusive")) : get_identifier ("omp simd inscan " "exclusive" )) |
4383 | "exclusive")(__builtin_constant_p ("omp simd inscan " "exclusive") ? get_identifier_with_length (("omp simd inscan " "exclusive"), strlen ("omp simd inscan " "exclusive")) : get_identifier ("omp simd inscan " "exclusive" )), NULLnullptr, |
4384 | DECL_ATTRIBUTES (savar)((contains_struct_check ((savar), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4384, __FUNCTION__))->decl_common.attributes))); |
4385 | gimple_add_tmp_var (savar); |
4386 | ctx->cb.decl_map->put (iavar, savar); |
4387 | *rvar2 = build4 (ARRAY_REF, TREE_TYPE (new_var)((contains_struct_check ((new_var), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4387, __FUNCTION__))->typed.type), savar, |
4388 | sctx->idx, NULL_TREE(tree) nullptr, NULL_TREE(tree) nullptr); |
4389 | TREE_THIS_NOTRAP (*rvar2)((tree_check5 ((*rvar2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4389, __FUNCTION__, (INDIRECT_REF), (MEM_REF), (TARGET_MEM_REF ), (ARRAY_REF), (ARRAY_RANGE_REF)))->base.nothrow_flag) = 1; |
4390 | } |
4391 | } |
4392 | ivar = build4 (ARRAY_REF, TREE_TYPE (new_var)((contains_struct_check ((new_var), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4392, __FUNCTION__))->typed.type), iavar, sctx->idx, |
4393 | NULL_TREE(tree) nullptr, NULL_TREE(tree) nullptr); |
4394 | lvar = build4 (ARRAY_REF, TREE_TYPE (new_var)((contains_struct_check ((new_var), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4394, __FUNCTION__))->typed.type), avar, sctx->lane, |
4395 | NULL_TREE(tree) nullptr, NULL_TREE(tree) nullptr); |
4396 | TREE_THIS_NOTRAP (ivar)((tree_check5 ((ivar), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4396, __FUNCTION__, (INDIRECT_REF), (MEM_REF), (TARGET_MEM_REF ), (ARRAY_REF), (ARRAY_RANGE_REF)))->base.nothrow_flag) = 1; |
4397 | TREE_THIS_NOTRAP (lvar)((tree_check5 ((lvar), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4397, __FUNCTION__, (INDIRECT_REF), (MEM_REF), (TARGET_MEM_REF ), (ARRAY_REF), (ARRAY_RANGE_REF)))->base.nothrow_flag) = 1; |
4398 | } |
4399 | if (DECL_P (new_var)(tree_code_type[(int) (((enum tree_code) (new_var)->base.code ))] == tcc_declaration)) |
4400 | { |
4401 | SET_DECL_VALUE_EXPR (new_var, lvar)(decl_value_expr_insert ((contains_struct_check ((new_var), ( TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4401, __FUNCTION__)), lvar)); |
4402 | DECL_HAS_VALUE_EXPR_P (new_var)((tree_check3 ((new_var), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4402, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL)) ) ->decl_common.decl_flag_2) = 1; |
4403 | } |
4404 | return true; |
4405 | } |
4406 | |
4407 | /* Helper function of lower_rec_input_clauses. For a reference |
4408 | in simd reduction, add an underlying variable it will reference. */ |
4409 | |
4410 | static void |
4411 | handle_simd_reference (location_t loc, tree new_vard, gimple_seq *ilist) |
4412 | { |
4413 | tree z = TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (new_vard)))((tree_class_check ((((contains_struct_check ((((contains_struct_check ((new_vard), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4413, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4413, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4413, __FUNCTION__))->type_common.size_unit); |
4414 | if (TREE_CONSTANT (z)((non_type_check ((z), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4414, __FUNCTION__))->base.constant_flag)) |
4415 | { |
4416 | z = create_tmp_var_raw (TREE_TYPE (TREE_TYPE (new_vard))((contains_struct_check ((((contains_struct_check ((new_vard) , (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4416, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4416, __FUNCTION__))->typed.type), |
4417 | get_name (new_vard)); |
4418 | gimple_add_tmp_var (z); |
4419 | TREE_ADDRESSABLE (z)((z)->base.addressable_flag) = 1; |
4420 | z = build_fold_addr_expr_loc (loc, z); |
4421 | gimplify_assign (new_vard, z, ilist); |
4422 | } |
4423 | } |
4424 | |
4425 | /* Helper function for lower_rec_input_clauses. Emit into ilist sequence |
4426 | code to emit (type) (tskred_temp[idx]). */ |
4427 | |
4428 | static tree |
4429 | task_reduction_read (gimple_seq *ilist, tree tskred_temp, tree type, |
4430 | unsigned idx) |
4431 | { |
4432 | unsigned HOST_WIDE_INTlong sz |
4433 | = tree_to_uhwi (TYPE_SIZE_UNIT (pointer_sized_int_node)((tree_class_check ((global_trees[TI_POINTER_SIZED_TYPE]), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4433, __FUNCTION__))->type_common.size_unit)); |
4434 | tree r = build2 (MEM_REF, pointer_sized_int_nodeglobal_trees[TI_POINTER_SIZED_TYPE], |
4435 | tskred_temp, build_int_cst (TREE_TYPE (tskred_temp)((contains_struct_check ((tskred_temp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4435, __FUNCTION__))->typed.type), |
4436 | idx * sz)); |
4437 | tree v = create_tmp_var (pointer_sized_int_nodeglobal_trees[TI_POINTER_SIZED_TYPE]); |
4438 | gimple *g = gimple_build_assign (v, r); |
4439 | gimple_seq_add_stmt (ilist, g); |
4440 | if (!useless_type_conversion_p (type, pointer_sized_int_nodeglobal_trees[TI_POINTER_SIZED_TYPE])) |
4441 | { |
4442 | v = create_tmp_var (type); |
4443 | g = gimple_build_assign (v, NOP_EXPR, gimple_assign_lhs (g)); |
4444 | gimple_seq_add_stmt (ilist, g); |
4445 | } |
4446 | return v; |
4447 | } |
4448 | |
4449 | /* Lower early initialization of privatized variable NEW_VAR |
4450 | if it needs an allocator (has allocate clause). */ |
4451 | |
4452 | static bool |
4453 | lower_private_allocate (tree var, tree new_var, tree &allocator, |
4454 | tree &allocate_ptr, gimple_seq *ilist, |
4455 | omp_context *ctx, bool is_ref, tree size) |
4456 | { |
4457 | if (allocator) |
4458 | return false; |
4459 | gcc_assert (allocate_ptr == NULL_TREE)((void)(!(allocate_ptr == (tree) nullptr) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4459, __FUNCTION__), 0 : 0)); |
4460 | if (ctx->allocate_map |
4461 | && (DECL_P (new_var)(tree_code_type[(int) (((enum tree_code) (new_var)->base.code ))] == tcc_declaration) || (TYPE_P (new_var)(tree_code_type[(int) (((enum tree_code) (new_var)->base.code ))] == tcc_type) && size))) |
4462 | if (tree *allocatorp = ctx->allocate_map->get (var)) |
4463 | allocator = *allocatorp; |
4464 | if (allocator == NULL_TREE(tree) nullptr) |
4465 | return false; |
4466 | if (!is_ref && omp_is_reference (var)) |
4467 | { |
4468 | allocator = NULL_TREE(tree) nullptr; |
4469 | return false; |
4470 | } |
4471 | |
4472 | if (TREE_CODE (allocator)((enum tree_code) (allocator)->base.code) != INTEGER_CST) |
4473 | allocator = build_outer_var_ref (allocator, ctx); |
4474 | allocator = fold_convert (pointer_sized_int_node, allocator)fold_convert_loc (((location_t) 0), global_trees[TI_POINTER_SIZED_TYPE ], allocator); |
4475 | if (TREE_CODE (allocator)((enum tree_code) (allocator)->base.code) != INTEGER_CST) |
4476 | { |
4477 | tree var = create_tmp_var (TREE_TYPE (allocator)((contains_struct_check ((allocator), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4477, __FUNCTION__))->typed.type)); |
4478 | gimplify_assign (var, allocator, ilist); |
4479 | allocator = var; |
4480 | } |
4481 | |
4482 | tree ptr_type, align, sz = size; |
4483 | if (TYPE_P (new_var)(tree_code_type[(int) (((enum tree_code) (new_var)->base.code ))] == tcc_type)) |
4484 | { |
4485 | ptr_type = build_pointer_type (new_var); |
4486 | align = build_int_cst (size_type_nodeglobal_trees[TI_SIZE_TYPE], TYPE_ALIGN_UNIT (new_var)(((tree_class_check ((new_var), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4486, __FUNCTION__))->type_common.align ? ((unsigned)1) << ((new_var)->type_common.align - 1) : 0) / (8))); |
4487 | } |
4488 | else if (is_ref) |
4489 | { |
4490 | ptr_type = build_pointer_type (TREE_TYPE (TREE_TYPE (new_var))((contains_struct_check ((((contains_struct_check ((new_var), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4490, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4490, __FUNCTION__))->typed.type)); |
4491 | align = build_int_cst (size_type_nodeglobal_trees[TI_SIZE_TYPE], |
4492 | TYPE_ALIGN_UNIT (TREE_TYPE (ptr_type))(((tree_class_check ((((contains_struct_check ((ptr_type), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4492, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4492, __FUNCTION__))->type_common.align ? ((unsigned)1) << ((((contains_struct_check ((ptr_type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4492, __FUNCTION__))->typed.type))->type_common.align - 1) : 0) / (8))); |
4493 | } |
4494 | else |
4495 | { |
4496 | ptr_type = build_pointer_type (TREE_TYPE (new_var)((contains_struct_check ((new_var), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4496, __FUNCTION__))->typed.type)); |
4497 | align = build_int_cst (size_type_nodeglobal_trees[TI_SIZE_TYPE], DECL_ALIGN_UNIT (new_var)((((contains_struct_check ((new_var), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4497, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((new_var), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4497, __FUNCTION__))->decl_common.align) - 1) : 0) / (8) )); |
4498 | if (sz == NULL_TREE(tree) nullptr) |
4499 | sz = fold_convert (size_type_node, DECL_SIZE_UNIT (new_var))fold_convert_loc (((location_t) 0), global_trees[TI_SIZE_TYPE ], ((contains_struct_check ((new_var), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4499, __FUNCTION__))->decl_common.size_unit)); |
4500 | } |
4501 | if (TREE_CODE (sz)((enum tree_code) (sz)->base.code) != INTEGER_CST) |
4502 | { |
4503 | tree szvar = create_tmp_var (size_type_nodeglobal_trees[TI_SIZE_TYPE]); |
4504 | gimplify_assign (szvar, sz, ilist); |
4505 | sz = szvar; |
4506 | } |
4507 | allocate_ptr = create_tmp_var (ptr_type); |
4508 | tree a = builtin_decl_explicit (BUILT_IN_GOMP_ALLOC); |
4509 | gimple *g = gimple_build_call (a, 3, align, sz, allocator); |
4510 | gimple_call_set_lhs (g, allocate_ptr); |
4511 | gimple_seq_add_stmt (ilist, g); |
4512 | if (!is_ref) |
4513 | { |
4514 | tree x = build_simple_mem_ref (allocate_ptr)build_simple_mem_ref_loc (((location_t) 0), allocate_ptr); |
4515 | TREE_THIS_NOTRAP (x)((tree_check5 ((x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4515, __FUNCTION__, (INDIRECT_REF), (MEM_REF), (TARGET_MEM_REF ), (ARRAY_REF), (ARRAY_RANGE_REF)))->base.nothrow_flag) = 1; |
4516 | SET_DECL_VALUE_EXPR (new_var, x)(decl_value_expr_insert ((contains_struct_check ((new_var), ( TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4516, __FUNCTION__)), x)); |
4517 | DECL_HAS_VALUE_EXPR_P (new_var)((tree_check3 ((new_var), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4517, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL)) ) ->decl_common.decl_flag_2) = 1; |
4518 | } |
4519 | return true; |
4520 | } |
4521 | |
4522 | /* Generate code to implement the input clauses, FIRSTPRIVATE and COPYIN, |
4523 | from the receiver (aka child) side and initializers for REFERENCE_TYPE |
4524 | private variables. Initialization statements go in ILIST, while calls |
4525 | to destructors go in DLIST. */ |
4526 | |
4527 | static void |
4528 | lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist, |
4529 | omp_context *ctx, struct omp_for_data *fd) |
4530 | { |
4531 | tree c, copyin_seq, x, ptr; |
4532 | bool copyin_by_ref = false; |
4533 | bool lastprivate_firstprivate = false; |
4534 | bool reduction_omp_orig_ref = false; |
4535 | int pass; |
4536 | bool is_simd = (gimple_code (ctx->stmt) == GIMPLE_OMP_FOR |
4537 | && gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_KIND_SIMD); |
4538 | omplow_simd_context sctx = omplow_simd_context (); |
4539 | tree simt_lane = NULL_TREE(tree) nullptr, simtrec = NULL_TREE(tree) nullptr; |
4540 | tree ivar = NULL_TREE(tree) nullptr, lvar = NULL_TREE(tree) nullptr, uid = NULL_TREE(tree) nullptr; |
4541 | gimple_seq llist[4] = { }; |
4542 | tree nonconst_simd_if = NULL_TREE(tree) nullptr; |
4543 | |
4544 | copyin_seq = NULLnullptr; |
4545 | sctx.is_simt = is_simd && omp_find_clause (clauses, OMP_CLAUSE__SIMT_); |
4546 | |
4547 | /* Set max_vf=1 (which will later enforce safelen=1) in simd loops |
4548 | with data sharing clauses referencing variable sized vars. That |
4549 | is unnecessarily hard to support and very unlikely to result in |
4550 | vectorized code anyway. */ |
4551 | if (is_simd) |
4552 | for (c = clauses; c ; c = OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4552, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4552, __FUNCTION__))->common.chain)) |
4553 | switch (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4553, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code) |
4554 | { |
4555 | case OMP_CLAUSE_LINEAR: |
4556 | if (OMP_CLAUSE_LINEAR_ARRAY (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_LINEAR), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4556, __FUNCTION__))->base.deprecated_flag)) |
4557 | sctx.max_vf = 1; |
4558 | /* FALLTHRU */ |
4559 | case OMP_CLAUSE_PRIVATE: |
4560 | case OMP_CLAUSE_FIRSTPRIVATE: |
4561 | case OMP_CLAUSE_LASTPRIVATE: |
4562 | if (is_variable_sized (OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4562, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4562, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4562, __FUNCTION__))))) |
4563 | sctx.max_vf = 1; |
4564 | else if (omp_is_reference (OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4564, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4564, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4564, __FUNCTION__))))) |
4565 | { |
4566 | tree rtype = TREE_TYPE (TREE_TYPE (OMP_CLAUSE_DECL (c)))((contains_struct_check ((((contains_struct_check (((*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4566, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4566, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4566, __FUNCTION__)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4566, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4566, __FUNCTION__))->typed.type); |
4567 | if (!TREE_CONSTANT (TYPE_SIZE_UNIT (rtype))((non_type_check ((((tree_class_check ((rtype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4567, __FUNCTION__))->type_common.size_unit)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4567, __FUNCTION__))->base.constant_flag)) |
4568 | sctx.max_vf = 1; |
4569 | } |
4570 | break; |
4571 | case OMP_CLAUSE_REDUCTION: |
4572 | case OMP_CLAUSE_IN_REDUCTION: |
4573 | if (TREE_CODE (OMP_CLAUSE_DECL (c))((enum tree_code) ((*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4573, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4573, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4573, __FUNCTION__))))->base.code) == MEM_REF |
4574 | || is_variable_sized (OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4574, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4574, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4574, __FUNCTION__))))) |
4575 | sctx.max_vf = 1; |
4576 | else if (omp_is_reference (OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4576, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4576, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4576, __FUNCTION__))))) |
4577 | { |
4578 | tree rtype = TREE_TYPE (TREE_TYPE (OMP_CLAUSE_DECL (c)))((contains_struct_check ((((contains_struct_check (((*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4578, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4578, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4578, __FUNCTION__)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4578, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4578, __FUNCTION__))->typed.type); |
4579 | if (!TREE_CONSTANT (TYPE_SIZE_UNIT (rtype))((non_type_check ((((tree_class_check ((rtype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4579, __FUNCTION__))->type_common.size_unit)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4579, __FUNCTION__))->base.constant_flag)) |
4580 | sctx.max_vf = 1; |
4581 | } |
4582 | break; |
4583 | case OMP_CLAUSE_IF: |
4584 | if (integer_zerop (OMP_CLAUSE_IF_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4584, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4584, __FUNCTION__))))) |
4585 | sctx.max_vf = 1; |
4586 | else if (TREE_CODE (OMP_CLAUSE_IF_EXPR (c))((enum tree_code) ((*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4586, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4586, __FUNCTION__))))->base.code) != INTEGER_CST) |
4587 | nonconst_simd_if = OMP_CLAUSE_IF_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4587, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4587, __FUNCTION__))); |
4588 | break; |
4589 | case OMP_CLAUSE_SIMDLEN: |
4590 | if (integer_onep (OMP_CLAUSE_SIMDLEN_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_SIMDLEN ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4590, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4590, __FUNCTION__))))) |
4591 | sctx.max_vf = 1; |
4592 | break; |
4593 | case OMP_CLAUSE__CONDTEMP_: |
4594 | /* FIXME: lastprivate(conditional:) not handled for SIMT yet. */ |
4595 | if (sctx.is_simt) |
4596 | sctx.max_vf = 1; |
4597 | break; |
4598 | default: |
4599 | continue; |
4600 | } |
4601 | |
4602 | /* Add a placeholder for simduid. */ |
4603 | if (sctx.is_simt && maybe_ne (sctx.max_vf, 1U)) |
4604 | sctx.simt_eargs.safe_push (NULL_TREE(tree) nullptr); |
4605 | |
4606 | unsigned task_reduction_cnt = 0; |
4607 | unsigned task_reduction_cntorig = 0; |
4608 | unsigned task_reduction_cnt_full = 0; |
4609 | unsigned task_reduction_cntorig_full = 0; |
4610 | unsigned task_reduction_other_cnt = 0; |
4611 | tree tskred_atype = NULL_TREE(tree) nullptr, tskred_avar = NULL_TREE(tree) nullptr; |
4612 | tree tskred_base = NULL_TREE(tree) nullptr, tskred_temp = NULL_TREE(tree) nullptr; |
4613 | /* Do all the fixed sized types in the first pass, and the variable sized |
4614 | types in the second pass. This makes sure that the scalar arguments to |
4615 | the variable sized types are processed before we use them in the |
4616 | variable sized operations. For task reductions we use 4 passes, in the |
4617 | first two we ignore them, in the third one gather arguments for |
4618 | GOMP_task_reduction_remap call and in the last pass actually handle |
4619 | the task reductions. */ |
4620 | for (pass = 0; pass < ((task_reduction_cnt || task_reduction_other_cnt) |
4621 | ? 4 : 2); ++pass) |
4622 | { |
4623 | if (pass == 2 && task_reduction_cnt) |
4624 | { |
4625 | tskred_atype |
4626 | = build_array_type_nelts (ptr_type_nodeglobal_trees[TI_PTR_TYPE], task_reduction_cnt |
4627 | + task_reduction_cntorig); |
4628 | tskred_avar = create_tmp_var_raw (tskred_atype); |
4629 | gimple_add_tmp_var (tskred_avar); |
4630 | TREE_ADDRESSABLE (tskred_avar)((tskred_avar)->base.addressable_flag) = 1; |
4631 | task_reduction_cnt_full = task_reduction_cnt; |
4632 | task_reduction_cntorig_full = task_reduction_cntorig; |
4633 | } |
4634 | else if (pass == 3 && task_reduction_cnt) |
4635 | { |
4636 | x = builtin_decl_explicit (BUILT_IN_GOMP_TASK_REDUCTION_REMAP); |
4637 | gimple *g |
4638 | = gimple_build_call (x, 3, size_int (task_reduction_cnt)size_int_kind (task_reduction_cnt, stk_sizetype), |
4639 | size_int (task_reduction_cntorig)size_int_kind (task_reduction_cntorig, stk_sizetype), |
4640 | build_fold_addr_expr (tskred_avar)build_fold_addr_expr_loc (((location_t) 0), (tskred_avar))); |
4641 | gimple_seq_add_stmt (ilist, g); |
4642 | } |
4643 | if (pass == 3 && task_reduction_other_cnt) |
4644 | { |
4645 | /* For reduction clauses, build |
4646 | tskred_base = (void *) tskred_temp[2] |
4647 | + omp_get_thread_num () * tskred_temp[1] |
4648 | or if tskred_temp[1] is known to be constant, that constant |
4649 | directly. This is the start of the private reduction copy block |
4650 | for the current thread. */ |
4651 | tree v = create_tmp_var (integer_type_nodeinteger_types[itk_int]); |
4652 | x = builtin_decl_explicit (BUILT_IN_OMP_GET_THREAD_NUM); |
4653 | gimple *g = gimple_build_call (x, 0); |
4654 | gimple_call_set_lhs (g, v); |
4655 | gimple_seq_add_stmt (ilist, g); |
4656 | c = omp_find_clause (clauses, OMP_CLAUSE__REDUCTEMP_); |
4657 | tskred_temp = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4657, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4657, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4657, __FUNCTION__))); |
4658 | if (is_taskreg_ctx (ctx)) |
4659 | tskred_temp = lookup_decl (tskred_temp, ctx); |
4660 | tree v2 = create_tmp_var (sizetypesizetype_tab[(int) stk_sizetype]); |
4661 | g = gimple_build_assign (v2, NOP_EXPR, v); |
4662 | gimple_seq_add_stmt (ilist, g); |
4663 | if (ctx->task_reductions[0]) |
4664 | v = fold_convert (sizetype, ctx->task_reductions[0])fold_convert_loc (((location_t) 0), sizetype_tab[(int) stk_sizetype ], ctx->task_reductions[0]); |
4665 | else |
4666 | v = task_reduction_read (ilist, tskred_temp, sizetypesizetype_tab[(int) stk_sizetype], 1); |
4667 | tree v3 = create_tmp_var (sizetypesizetype_tab[(int) stk_sizetype]); |
4668 | g = gimple_build_assign (v3, MULT_EXPR, v2, v); |
4669 | gimple_seq_add_stmt (ilist, g); |
4670 | v = task_reduction_read (ilist, tskred_temp, ptr_type_nodeglobal_trees[TI_PTR_TYPE], 2); |
4671 | tskred_base = create_tmp_var (ptr_type_nodeglobal_trees[TI_PTR_TYPE]); |
4672 | g = gimple_build_assign (tskred_base, POINTER_PLUS_EXPR, v, v3); |
4673 | gimple_seq_add_stmt (ilist, g); |
4674 | } |
4675 | task_reduction_cnt = 0; |
4676 | task_reduction_cntorig = 0; |
4677 | task_reduction_other_cnt = 0; |
4678 | for (c = clauses; c ; c = OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4678, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4678, __FUNCTION__))->common.chain)) |
4679 | { |
4680 | enum omp_clause_code c_kind = OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4680, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code; |
4681 | tree var, new_var; |
4682 | bool by_ref; |
4683 | location_t clause_loc = OMP_CLAUSE_LOCATION (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4683, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.locus; |
4684 | bool task_reduction_p = false; |
4685 | bool task_reduction_needs_orig_p = false; |
4686 | tree cond = NULL_TREE(tree) nullptr; |
4687 | tree allocator, allocate_ptr; |
4688 | |
4689 | switch (c_kind) |
4690 | { |
4691 | case OMP_CLAUSE_PRIVATE: |
4692 | if (OMP_CLAUSE_PRIVATE_DEBUG (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_PRIVATE), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4692, __FUNCTION__))->base.public_flag)) |
4693 | continue; |
4694 | break; |
4695 | case OMP_CLAUSE_SHARED: |
4696 | /* Ignore shared directives in teams construct inside |
4697 | of target construct. */ |
4698 | if (gimple_code (ctx->stmt) == GIMPLE_OMP_TEAMS |
4699 | && !is_host_teams_ctx (ctx)) |
4700 | continue; |
4701 | if (maybe_lookup_decl (OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4701, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4701, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4701, __FUNCTION__))), ctx) == NULLnullptr) |
4702 | { |
4703 | gcc_assert (OMP_CLAUSE_SHARED_FIRSTPRIVATE (c)((void)(!(((omp_clause_subcode_check ((c), (OMP_CLAUSE_SHARED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4703, __FUNCTION__))->base.public_flag) || is_global_var ((*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4704, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4704, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4704, __FUNCTION__))))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4704, __FUNCTION__), 0 : 0)) |
4704 | || is_global_var (OMP_CLAUSE_DECL (c)))((void)(!(((omp_clause_subcode_check ((c), (OMP_CLAUSE_SHARED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4703, __FUNCTION__))->base.public_flag) || is_global_var ((*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4704, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4704, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4704, __FUNCTION__))))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4704, __FUNCTION__), 0 : 0)); |
4705 | continue; |
4706 | } |
4707 | case OMP_CLAUSE_FIRSTPRIVATE: |
4708 | case OMP_CLAUSE_COPYIN: |
4709 | break; |
4710 | case OMP_CLAUSE_LINEAR: |
4711 | if (!OMP_CLAUSE_LINEAR_NO_COPYIN (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_LINEAR), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4711, __FUNCTION__))->base.public_flag) |
4712 | && !OMP_CLAUSE_LINEAR_NO_COPYOUT (c)(((omp_clause_subcode_check ((c), (OMP_CLAUSE_LINEAR), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4712, __FUNCTION__)))->base.private_flag)) |
4713 | lastprivate_firstprivate = true; |
4714 | break; |
4715 | case OMP_CLAUSE_REDUCTION: |
4716 | case OMP_CLAUSE_IN_REDUCTION: |
4717 | if (is_task_ctx (ctx) || OMP_CLAUSE_REDUCTION_TASK (c)(((omp_clause_subcode_check ((c), (OMP_CLAUSE_REDUCTION), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4717, __FUNCTION__)))->base.protected_flag)) |
4718 | { |
4719 | task_reduction_p = true; |
4720 | if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4720, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_REDUCTION) |
4721 | { |
4722 | task_reduction_other_cnt++; |
4723 | if (pass == 2) |
4724 | continue; |
4725 | } |
4726 | else |
4727 | task_reduction_cnt++; |
4728 | if (OMP_CLAUSE_REDUCTION_OMP_ORIG_REF (c)((omp_clause_range_check ((c), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4728, __FUNCTION__))->base.public_flag)) |
4729 | { |
4730 | var = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4730, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4730, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4730, __FUNCTION__))); |
4731 | /* If var is a global variable that isn't privatized |
4732 | in outer contexts, we don't need to look up the |
4733 | original address, it is always the address of the |
4734 | global variable itself. */ |
4735 | if (!DECL_P (var)(tree_code_type[(int) (((enum tree_code) (var)->base.code) )] == tcc_declaration) |
4736 | || omp_is_reference (var) |
4737 | || !is_global_var |
4738 | (maybe_lookup_decl_in_outer_ctx (var, ctx))) |
4739 | { |
4740 | task_reduction_needs_orig_p = true; |
4741 | if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4741, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code != OMP_CLAUSE_REDUCTION) |
4742 | task_reduction_cntorig++; |
4743 | } |
4744 | } |
4745 | } |
4746 | else if (OMP_CLAUSE_REDUCTION_OMP_ORIG_REF (c)((omp_clause_range_check ((c), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4746, __FUNCTION__))->base.public_flag)) |
4747 | reduction_omp_orig_ref = true; |
4748 | break; |
4749 | case OMP_CLAUSE__REDUCTEMP_: |
4750 | if (!is_taskreg_ctx (ctx)) |
4751 | continue; |
4752 | /* FALLTHRU */ |
4753 | case OMP_CLAUSE__LOOPTEMP_: |
4754 | /* Handle _looptemp_/_reductemp_ clauses only on |
4755 | parallel/task. */ |
4756 | if (fd) |
4757 | continue; |
4758 | break; |
4759 | case OMP_CLAUSE_LASTPRIVATE: |
4760 | if (OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_LASTPRIVATE), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4760, __FUNCTION__))->base.public_flag)) |
4761 | { |
4762 | lastprivate_firstprivate = true; |
4763 | if (pass != 0 || is_taskloop_ctx (ctx)) |
4764 | continue; |
4765 | } |
4766 | /* Even without corresponding firstprivate, if |
4767 | decl is Fortran allocatable, it needs outer var |
4768 | reference. */ |
4769 | else if (pass == 0 |
4770 | && lang_hooks.decls.omp_private_outer_ref |
4771 | (OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4771, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4771, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4771, __FUNCTION__))))) |
4772 | lastprivate_firstprivate = true; |
4773 | break; |
4774 | case OMP_CLAUSE_ALIGNED: |
4775 | if (pass != 1) |
4776 | continue; |
4777 | var = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4777, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4777, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4777, __FUNCTION__))); |
4778 | if (TREE_CODE (TREE_TYPE (var))((enum tree_code) (((contains_struct_check ((var), (TS_TYPED) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4778, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE |
4779 | && !is_global_var (var)) |
4780 | { |
4781 | new_var = maybe_lookup_decl (var, ctx); |
4782 | if (new_var == NULL_TREE(tree) nullptr) |
4783 | new_var = maybe_lookup_decl_in_outer_ctx (var, ctx); |
4784 | x = builtin_decl_explicit (BUILT_IN_ASSUME_ALIGNED); |
4785 | tree alarg = omp_clause_aligned_alignment (c); |
4786 | alarg = fold_convert_loc (clause_loc, size_type_nodeglobal_trees[TI_SIZE_TYPE], alarg); |
4787 | x = build_call_expr_loc (clause_loc, x, 2, new_var, alarg); |
4788 | x = fold_convert_loc (clause_loc, TREE_TYPE (new_var)((contains_struct_check ((new_var), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4788, __FUNCTION__))->typed.type), x); |
4789 | x = build2 (MODIFY_EXPR, TREE_TYPE (new_var)((contains_struct_check ((new_var), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4789, __FUNCTION__))->typed.type), new_var, x); |
4790 | gimplify_and_add (x, ilist); |
4791 | } |
4792 | else if (TREE_CODE (TREE_TYPE (var))((enum tree_code) (((contains_struct_check ((var), (TS_TYPED) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4792, __FUNCTION__))->typed.type))->base.code) == ARRAY_TYPE |
4793 | && is_global_var (var)) |
4794 | { |
4795 | tree ptype = build_pointer_type (TREE_TYPE (var)((contains_struct_check ((var), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4795, __FUNCTION__))->typed.type)), t, t2; |
4796 | new_var = lookup_decl (var, ctx); |
4797 | t = maybe_lookup_decl_in_outer_ctx (var, ctx); |
4798 | t = build_fold_addr_expr_loc (clause_loc, t); |
4799 | t2 = builtin_decl_explicit (BUILT_IN_ASSUME_ALIGNED); |
4800 | tree alarg = omp_clause_aligned_alignment (c); |
4801 | alarg = fold_convert_loc (clause_loc, size_type_nodeglobal_trees[TI_SIZE_TYPE], alarg); |
4802 | t = build_call_expr_loc (clause_loc, t2, 2, t, alarg); |
4803 | t = fold_convert_loc (clause_loc, ptype, t); |
4804 | x = create_tmp_var (ptype); |
4805 | t = build2 (MODIFY_EXPR, ptype, x, t); |
4806 | gimplify_and_add (t, ilist); |
4807 | t = build_simple_mem_ref_loc (clause_loc, x); |
4808 | SET_DECL_VALUE_EXPR (new_var, t)(decl_value_expr_insert ((contains_struct_check ((new_var), ( TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4808, __FUNCTION__)), t)); |
4809 | DECL_HAS_VALUE_EXPR_P (new_var)((tree_check3 ((new_var), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4809, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL)) ) ->decl_common.decl_flag_2) = 1; |
4810 | } |
4811 | continue; |
4812 | case OMP_CLAUSE__CONDTEMP_: |
4813 | if (is_parallel_ctx (ctx) |
4814 | || (is_simd && !OMP_CLAUSE__CONDTEMP__ITER (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE__CONDTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4814, __FUNCTION__))->base.public_flag))) |
4815 | break; |
4816 | continue; |
4817 | default: |
4818 | continue; |
4819 | } |
4820 | |
4821 | if (task_reduction_p != (pass >= 2)) |
4822 | continue; |
4823 | |
4824 | allocator = NULL_TREE(tree) nullptr; |
4825 | allocate_ptr = NULL_TREE(tree) nullptr; |
4826 | new_var = var = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4826, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4826, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4826, __FUNCTION__))); |
4827 | if ((c_kind == OMP_CLAUSE_REDUCTION |
4828 | || c_kind == OMP_CLAUSE_IN_REDUCTION) |
4829 | && TREE_CODE (var)((enum tree_code) (var)->base.code) == MEM_REF) |
4830 | { |
4831 | var = TREE_OPERAND (var, 0)(*((const_cast<tree*> (tree_operand_check ((var), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4831, __FUNCTION__))))); |
4832 | if (TREE_CODE (var)((enum tree_code) (var)->base.code) == POINTER_PLUS_EXPR) |
4833 | var = TREE_OPERAND (var, 0)(*((const_cast<tree*> (tree_operand_check ((var), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4833, __FUNCTION__))))); |
4834 | if (TREE_CODE (var)((enum tree_code) (var)->base.code) == INDIRECT_REF |
4835 | || TREE_CODE (var)((enum tree_code) (var)->base.code) == ADDR_EXPR) |
4836 | var = TREE_OPERAND (var, 0)(*((const_cast<tree*> (tree_operand_check ((var), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4836, __FUNCTION__))))); |
4837 | if (is_variable_sized (var)) |
4838 | { |
4839 | gcc_assert (DECL_HAS_VALUE_EXPR_P (var))((void)(!(((tree_check3 ((var), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4839, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL)) ) ->decl_common.decl_flag_2)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4839, __FUNCTION__), 0 : 0)); |
4840 | var = DECL_VALUE_EXPR (var)(decl_value_expr_lookup ((contains_struct_check ((var), (TS_DECL_WRTL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4840, __FUNCTION__)))); |
4841 | gcc_assert (TREE_CODE (var) == INDIRECT_REF)((void)(!(((enum tree_code) (var)->base.code) == INDIRECT_REF ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4841, __FUNCTION__), 0 : 0)); |
4842 | var = TREE_OPERAND (var, 0)(*((const_cast<tree*> (tree_operand_check ((var), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4842, __FUNCTION__))))); |
4843 | gcc_assert (DECL_P (var))((void)(!((tree_code_type[(int) (((enum tree_code) (var)-> base.code))] == tcc_declaration)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4843, __FUNCTION__), 0 : 0)); |
4844 | } |
4845 | new_var = var; |
4846 | } |
4847 | if (c_kind != OMP_CLAUSE_COPYIN) |
4848 | new_var = lookup_decl (var, ctx); |
4849 | |
4850 | if (c_kind == OMP_CLAUSE_SHARED || c_kind == OMP_CLAUSE_COPYIN) |
4851 | { |
4852 | if (pass != 0) |
4853 | continue; |
4854 | } |
4855 | /* C/C++ array section reductions. */ |
4856 | else if ((c_kind == OMP_CLAUSE_REDUCTION |
4857 | || c_kind == OMP_CLAUSE_IN_REDUCTION) |
4858 | && var != OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4858, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4858, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4858, __FUNCTION__)))) |
4859 | { |
4860 | if (pass == 0) |
4861 | continue; |
4862 | |
4863 | tree bias = TREE_OPERAND (OMP_CLAUSE_DECL (c), 1)(*((const_cast<tree*> (tree_operand_check (((*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4863, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4863, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4863, __FUNCTION__)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4863, __FUNCTION__))))); |
4864 | tree orig_var = TREE_OPERAND (OMP_CLAUSE_DECL (c), 0)(*((const_cast<tree*> (tree_operand_check (((*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4864, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4864, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4864, __FUNCTION__)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4864, __FUNCTION__))))); |
4865 | |
4866 | if (TREE_CODE (orig_var)((enum tree_code) (orig_var)->base.code) == POINTER_PLUS_EXPR) |
4867 | { |
4868 | tree b = TREE_OPERAND (orig_var, 1)(*((const_cast<tree*> (tree_operand_check ((orig_var), ( 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4868, __FUNCTION__))))); |
4869 | b = maybe_lookup_decl (b, ctx); |
4870 | if (b == NULLnullptr) |
4871 | { |
4872 | b = TREE_OPERAND (orig_var, 1)(*((const_cast<tree*> (tree_operand_check ((orig_var), ( 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4872, __FUNCTION__))))); |
4873 | b = maybe_lookup_decl_in_outer_ctx (b, ctx); |
4874 | } |
4875 | if (integer_zerop (bias)) |
4876 | bias = b; |
4877 | else |
4878 | { |
4879 | bias = fold_convert_loc (clause_loc, |
4880 | TREE_TYPE (b)((contains_struct_check ((b), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4880, __FUNCTION__))->typed.type), bias); |
4881 | bias = fold_build2_loc (clause_loc, PLUS_EXPR, |
4882 | TREE_TYPE (b)((contains_struct_check ((b), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4882, __FUNCTION__))->typed.type), b, bias); |
4883 | } |
4884 | orig_var = TREE_OPERAND (orig_var, 0)(*((const_cast<tree*> (tree_operand_check ((orig_var), ( 0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4884, __FUNCTION__))))); |
4885 | } |
4886 | if (pass == 2) |
4887 | { |
4888 | tree out = maybe_lookup_decl_in_outer_ctx (var, ctx); |
4889 | if (is_global_var (out) |
4890 | && TREE_CODE (TREE_TYPE (out))((enum tree_code) (((contains_struct_check ((out), (TS_TYPED) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4890, __FUNCTION__))->typed.type))->base.code) != POINTER_TYPE |
4891 | && (TREE_CODE (TREE_TYPE (out))((enum tree_code) (((contains_struct_check ((out), (TS_TYPED) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4891, __FUNCTION__))->typed.type))->base.code) != REFERENCE_TYPE |
4892 | || (TREE_CODE (TREE_TYPE (TREE_TYPE (out)))((enum tree_code) (((contains_struct_check ((((contains_struct_check ((out), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4892, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4892, __FUNCTION__))->typed.type))->base.code) |
4893 | != POINTER_TYPE))) |
4894 | x = var; |
4895 | else |
4896 | { |
4897 | bool by_ref = use_pointer_for_field (var, NULLnullptr); |
4898 | x = build_receiver_ref (var, by_ref, ctx); |
4899 | if (TREE_CODE (TREE_TYPE (var))((enum tree_code) (((contains_struct_check ((var), (TS_TYPED) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4899, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE |
4900 | && (TREE_CODE (TREE_TYPE (TREE_TYPE (var)))((enum tree_code) (((contains_struct_check ((((contains_struct_check ((var), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4900, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4900, __FUNCTION__))->typed.type))->base.code) |
4901 | == POINTER_TYPE)) |
4902 | x = build_fold_addr_expr (x)build_fold_addr_expr_loc (((location_t) 0), (x)); |
4903 | } |
4904 | if (TREE_CODE (orig_var)((enum tree_code) (orig_var)->base.code) == INDIRECT_REF) |
4905 | x = build_simple_mem_ref (x)build_simple_mem_ref_loc (((location_t) 0), x); |
4906 | else if (TREE_CODE (orig_var)((enum tree_code) (orig_var)->base.code) == ADDR_EXPR) |
4907 | { |
4908 | if (var == TREE_OPERAND (orig_var, 0)(*((const_cast<tree*> (tree_operand_check ((orig_var), ( 0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4908, __FUNCTION__)))))) |
4909 | x = build_fold_addr_expr (x)build_fold_addr_expr_loc (((location_t) 0), (x)); |
4910 | } |
4911 | bias = fold_convert (sizetype, bias)fold_convert_loc (((location_t) 0), sizetype_tab[(int) stk_sizetype ], bias); |
4912 | x = fold_convert (ptr_type_node, x)fold_convert_loc (((location_t) 0), global_trees[TI_PTR_TYPE] , x); |
4913 | x = fold_build2_loc (clause_loc, POINTER_PLUS_EXPR, |
4914 | TREE_TYPE (x)((contains_struct_check ((x), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4914, __FUNCTION__))->typed.type), x, bias); |
4915 | unsigned cnt = task_reduction_cnt - 1; |
4916 | if (!task_reduction_needs_orig_p) |
4917 | cnt += (task_reduction_cntorig_full |
4918 | - task_reduction_cntorig); |
4919 | else |
4920 | cnt = task_reduction_cntorig - 1; |
4921 | tree r = build4 (ARRAY_REF, ptr_type_nodeglobal_trees[TI_PTR_TYPE], tskred_avar, |
4922 | size_int (cnt)size_int_kind (cnt, stk_sizetype), NULL_TREE(tree) nullptr, NULL_TREE(tree) nullptr); |
4923 | gimplify_assign (r, x, ilist); |
4924 | continue; |
4925 | } |
4926 | |
4927 | if (TREE_CODE (orig_var)((enum tree_code) (orig_var)->base.code) == INDIRECT_REF |
4928 | || TREE_CODE (orig_var)((enum tree_code) (orig_var)->base.code) == ADDR_EXPR) |
4929 | orig_var = TREE_OPERAND (orig_var, 0)(*((const_cast<tree*> (tree_operand_check ((orig_var), ( 0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4929, __FUNCTION__))))); |
4930 | tree d = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4930, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), ( OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4930, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4930, __FUNCTION__))); |
4931 | tree type = TREE_TYPE (d)((contains_struct_check ((d), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4931, __FUNCTION__))->typed.type); |
4932 | gcc_assert (TREE_CODE (type) == ARRAY_TYPE)((void)(!(((enum tree_code) (type)->base.code) == ARRAY_TYPE ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4932, __FUNCTION__), 0 : 0)); |
4933 | tree v = TYPE_MAX_VALUE (TYPE_DOMAIN (type))((tree_check5 ((((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4933, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values )), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4933, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE ), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval ); |
4934 | tree sz = v; |
4935 | const char *name = get_name (orig_var); |
4936 | if (pass != 3 && !TREE_CONSTANT (v)((non_type_check ((v), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4936, __FUNCTION__))->base.constant_flag)) |
4937 | { |
4938 | tree t = maybe_lookup_decl (v, ctx); |
4939 | if (t) |
4940 | v = t; |
4941 | else |
4942 | v = maybe_lookup_decl_in_outer_ctx (v, ctx); |
4943 | gimplify_expr (&v, ilist, NULLnullptr, is_gimple_val, fb_rvalue); |
4944 | t = fold_build2_loc (clause_loc, PLUS_EXPR, |
4945 | TREE_TYPE (v)((contains_struct_check ((v), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4945, __FUNCTION__))->typed.type), v, |
4946 | build_int_cst (TREE_TYPE (v)((contains_struct_check ((v), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4946, __FUNCTION__))->typed.type), 1)); |
4947 | sz = fold_build2_loc (clause_loc, MULT_EXPR, |
4948 | TREE_TYPE (v)((contains_struct_check ((v), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4948, __FUNCTION__))->typed.type), t, |
4949 | TYPE_SIZE_UNIT (TREE_TYPE (type))((tree_class_check ((((contains_struct_check ((type), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4949, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4949, __FUNCTION__))->type_common.size_unit)); |
4950 | } |
4951 | if (pass == 3) |
4952 | { |
4953 | tree xv = create_tmp_var (ptr_type_nodeglobal_trees[TI_PTR_TYPE]); |
4954 | if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/omp-low.c" , 4954, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code != OMP_CLAUSE_REDUCTION) |
4955 | { |
4956 | unsigned cnt = task_reduction_cnt - 1; |
4957 | if (!task_reduction_needs_orig_p) |
4958 | cnt += (task_reduction_cntorig_full |
4959 | - task_reduction_cntorig); |
4960 | else |
4961 | cnt = task_reduction_cntorig - 1; |
4962 | x = build4 (ARRAY_REF, ptr_type_nodeglobal_trees[TI_PTR_TYPE], tskred_avar, |
4963 | size_int (cnt)size_int_kind (cnt, stk_sizetype), NULL_TREE(tree) nullptr, NULL_TREE(tree) nullptr); |
4964 | |
4965 | gimple *g = gimple_build_assign (xv, x); |
4966 | gimple_seq_add_stmt (ilist, g); |
4967 | } |
4968 | else |
4969 | { |
4970 | unsigned int idx = *ctx->task_reduction_map->get (c); |
4971 | tree off; |
4972 | if (ctx->task_reductions[1 + idx]) |
4973 | off = fold_convert (sizetype,fold_convert_loc (((location_t) 0), sizetype_tab[(int) stk_sizetype ], ctx->task_reductions[1 + idx]) |
4974 | ctx->task_reductions[1 + idx])fold_convert_loc (((location_t) 0), sizetype_tab[(int) stk_sizetype ], ctx->task_reductions[1 + idx]); |
4975 | else |
4976 | off = task_reduction_read (ilist, tskred_temp, sizetypesizetype_tab[(int) stk_sizetype], |
4977 | 7 + 3 * idx + 1); |
4978 | gimple *g = gimple_build_assign (xv, POINTER_PLUS_EXPR, |
4979 | tskred_base, off); |
4980 | gimple_seq_add_stmt (ilist, g); |
4981 | } |
4982 | x = fold_convert (build_pointer_type (boolean_type_node),fold_convert_loc (((location_t) 0), build_pointer_type (global_trees [TI_ |