Bug Summary

File:build/gcc/fortran/trans-openmp.cc
Warning:line 1574, column 9
Value stored to 'ptr' during its initialization is never read

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-suse-linux -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name trans-openmp.cc -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -analyzer-config-compatibility-mode=true -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/buildworker/marxinbox-gcc-clang-static-analyzer/objdir/gcc -resource-dir /usr/lib64/clang/15.0.7 -D IN_GCC_FRONTEND -D IN_GCC -D HAVE_CONFIG_H -I . -I fortran -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../include -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libcpp/include -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libcody -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libdecnumber -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libdecnumber/bid -I ../libdecnumber -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libbacktrace -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13 -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13/x86_64-suse-linux -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13/backward -internal-isystem /usr/lib64/clang/15.0.7/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-narrowing -Wwrite-strings -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fdeprecated-macro -fdebug-compilation-dir=/buildworker/marxinbox-gcc-clang-static-analyzer/objdir/gcc -ferror-limit 19 -fno-rtti -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-output=plist-html -analyzer-config silence-checkers=core.NullDereference -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /buildworker/marxinbox-gcc-clang-static-analyzer/objdir/clang-static-analyzer/2023-03-27-141847-20772-1/report-gQ9WyI.plist -x c++ /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc
1/* OpenMP directive translation -- generate GCC trees from gfc_code.
2 Copyright (C) 2005-2023 Free Software Foundation, Inc.
3 Contributed by Jakub Jelinek <jakub@redhat.com>
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free
9Software Foundation; either version 3, or (at your option) any later
10version.
11
12GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15for more details.
16
17You should have received a copy of the GNU General Public License
18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
20
21
22#include "config.h"
23#include "system.h"
24#include "coretypes.h"
25#include "options.h"
26#include "tree.h"
27#include "gfortran.h"
28#include "gimple-expr.h"
29#include "trans.h"
30#include "stringpool.h"
31#include "fold-const.h"
32#include "gimplify.h" /* For create_tmp_var_raw. */
33#include "trans-stmt.h"
34#include "trans-types.h"
35#include "trans-array.h"
36#include "trans-const.h"
37#include "arith.h"
38#include "constructor.h"
39#include "gomp-constants.h"
40#include "omp-general.h"
41#include "omp-low.h"
42#include "memmodel.h" /* For MEMMODEL_ enums. */
43
44#undef GCC_DIAG_STYLE__gcc_gfc__
45#define GCC_DIAG_STYLE__gcc_gfc__ __gcc_tdiag__
46#include "diagnostic-core.h"
47#undef GCC_DIAG_STYLE__gcc_gfc__
48#define GCC_DIAG_STYLE__gcc_gfc__ __gcc_gfc__
49#include "attribs.h"
50#include "function.h"
51
52int ompws_flags;
53
54/* True if OpenMP should regard this DECL as being a scalar which has Fortran's
55 allocatable or pointer attribute. */
56
57bool
58gfc_omp_is_allocatable_or_ptr (const_tree decl)
59{
60 return (DECL_P (decl)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (decl)->base.code))] == tcc_declaration)
61 && (GFC_DECL_GET_SCALAR_POINTER (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 61, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 61, __FUNCTION__))->decl_common.lang_specific)->scalar_pointer
) : 0)
62 || GFC_DECL_GET_SCALAR_ALLOCATABLE (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 62, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 62, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
));
63}
64
65/* True if the argument is an optional argument; except that false is also
66 returned for arguments with the value attribute (nonpointers) and for
67 assumed-shape variables (decl is a local variable containing arg->data).
68 Note that for 'procedure(), optional' the value false is used as that's
69 always a pointer and no additional indirection is used.
70 Note that pvoid_type_node is for 'type(c_ptr), value' (and c_funloc). */
71
72static bool
73gfc_omp_is_optional_argument (const_tree decl)
74{
75 /* Note: VAR_DECL can occur with BIND(C) and array descriptors. */
76 return ((TREE_CODE (decl)((enum tree_code) (decl)->base.code) == PARM_DECL || TREE_CODE (decl)((enum tree_code) (decl)->base.code) == VAR_DECL)
77 && DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 77, __FUNCTION__))->decl_common.lang_specific)
78 && TREE_CODE (TREE_TYPE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 78, __FUNCTION__))->typed.type))->base.code)
== POINTER_TYPE
79 && !VOID_TYPE_P (TREE_TYPE (TREE_TYPE (decl)))(((enum tree_code) (((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 79, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 79, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
)
80 && TREE_CODE (TREE_TYPE (TREE_TYPE (decl)))((enum tree_code) (((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 80, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 80, __FUNCTION__))->typed.type))->base.code)
!= FUNCTION_TYPE
81 && GFC_DECL_OPTIONAL_ARGUMENT (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 81, __FUNCTION__))->decl_common.lang_specific)->optional_arg
)
);
82}
83
84/* Check whether this DECL belongs to a Fortran optional argument.
85 With 'for_present_check' set to false, decls which are optional parameters
86 themselve are returned as tree - or a NULL_TREE otherwise. Those decls are
87 always pointers. With 'for_present_check' set to true, the decl for checking
88 whether an argument is present is returned; for arguments with value
89 attribute this is the hidden argument and of BOOLEAN_TYPE. If the decl is
90 unrelated to optional arguments, NULL_TREE is returned. */
91
92tree
93gfc_omp_check_optional_argument (tree decl, bool for_present_check)
94{
95 if (!for_present_check)
96 return gfc_omp_is_optional_argument (decl) ? decl : NULL_TREE(tree) __null;
97
98 if (!DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 98, __FUNCTION__))->decl_common.lang_specific)
)
99 return NULL_TREE(tree) __null;
100
101 tree orig_decl = decl;
102
103 /* For assumed-shape arrays, a local decl with arg->data is used. */
104 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != PARM_DECL
105 && (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 105, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 105, __FUNCTION__))->type_common.lang_flag_1)
106 || GFC_ARRAY_TYPE_P (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 106, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 106, __FUNCTION__))->type_common.lang_flag_2)
))
107 decl = GFC_DECL_SAVED_DESCRIPTOR (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 107, __FUNCTION__))->decl_common.lang_specific)->saved_descriptor
)
;
108
109 /* Note: With BIND(C), array descriptors are converted to a VAR_DECL. */
110 if (decl == NULL_TREE(tree) __null
111 || (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != PARM_DECL && TREE_CODE (decl)((enum tree_code) (decl)->base.code) != VAR_DECL)
112 || !DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 112, __FUNCTION__))->decl_common.lang_specific)
113 || !GFC_DECL_OPTIONAL_ARGUMENT (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 113, __FUNCTION__))->decl_common.lang_specific)->optional_arg
)
)
114 return NULL_TREE(tree) __null;
115
116 /* Scalars with VALUE attribute which are passed by value use a hidden
117 argument to denote the present status. They are passed as nonpointer type
118 with one exception: 'type(c_ptr), value' as 'void*'. */
119 /* Cf. trans-expr.cc's gfc_conv_expr_present. */
120 if (TREE_CODE (TREE_TYPE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 120, __FUNCTION__))->typed.type))->base.code)
!= POINTER_TYPE
121 || VOID_TYPE_P (TREE_TYPE (TREE_TYPE (decl)))(((enum tree_code) (((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 121, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 121, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
)
)
122 {
123 char name[GFC_MAX_SYMBOL_LEN63 + 2];
124 tree tree_name;
125
126 name[0] = '.';
127 strcpy (&name[1], IDENTIFIER_POINTER (DECL_NAME (decl))((const char *) (tree_check ((((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 127, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 127, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str
)
);
128 tree_name = get_identifier (name)(__builtin_constant_p (name) ? get_identifier_with_length ((name
), strlen (name)) : get_identifier (name))
;
129
130 /* Walk function argument list to find the hidden arg. */
131 decl = DECL_ARGUMENTS (DECL_CONTEXT (decl))((tree_check ((((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 131, __FUNCTION__))->decl_minimal.context)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 131, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments
)
;
132 for ( ; decl != NULL_TREE(tree) __null; decl = TREE_CHAIN (decl)((contains_struct_check ((decl), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 132, __FUNCTION__))->common.chain)
)
133 if (DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 133, __FUNCTION__))->decl_minimal.name)
== tree_name
134 && DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 134, __FUNCTION__))->decl_common.artificial_flag)
)
135 break;
136
137 gcc_assert (decl)((void)(!(decl) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 137, __FUNCTION__), 0 : 0))
;
138 return decl;
139 }
140
141 return fold_build2_loc (input_location, NE_EXPR, boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE],
142 orig_decl, null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
143}
144
145
146/* Returns tree with NULL if it is not an array descriptor and with the tree to
147 access the 'data' component otherwise. With type_only = true, it returns the
148 TREE_TYPE without creating a new tree. */
149
150tree
151gfc_omp_array_data (tree decl, bool type_only)
152{
153 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 153, __FUNCTION__))->typed.type)
;
154
155 if (POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || (
(enum tree_code) (type)->base.code) == REFERENCE_TYPE)
)
156 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 156, __FUNCTION__))->typed.type)
;
157
158 if (!GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 158, __FUNCTION__))->type_common.lang_flag_1)
)
159 return NULL_TREE(tree) __null;
160
161 if (type_only)
162 return GFC_TYPE_ARRAY_DATAPTR_TYPE (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 162, __FUNCTION__))->type_with_lang_specific.lang_specific
)->dataptr_type)
;
163
164 if (POINTER_TYPE_P (TREE_TYPE (decl))(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 164, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 164, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)
)
165 decl = build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
166
167 decl = gfc_conv_descriptor_data_get (decl);
168 STRIP_NOPS (decl)(decl) = tree_strip_nop_conversions ((const_cast<union tree_node
*> (((decl)))))
;
169 return decl;
170}
171
172/* Return the byte-size of the passed array descriptor. */
173
174tree
175gfc_omp_array_size (tree decl, gimple_seq *pre_p)
176{
177 stmtblock_t block;
178 if (POINTER_TYPE_P (TREE_TYPE (decl))(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 178, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 178, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)
)
179 decl = build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
180 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 180, __FUNCTION__))->typed.type)
;
181 gcc_assert (GFC_DESCRIPTOR_TYPE_P (type))((void)(!(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 181, __FUNCTION__))->type_common.lang_flag_1)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 181, __FUNCTION__), 0 : 0))
;
182 bool allocatable = (GFC_TYPE_ARRAY_AKIND (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 182, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_ALLOCATABLE
183 || GFC_TYPE_ARRAY_AKIND (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 183, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_POINTER
184 || GFC_TYPE_ARRAY_AKIND (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 184, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_POINTER_CONT);
185 gfc_init_block (&block);
186 tree size = gfc_full_array_size (&block, decl,
187 GFC_TYPE_ARRAY_RANK (TREE_TYPE (decl))(((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 187, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 187, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
);
188 size = fold_convert (size_type_node, size)fold_convert_loc (((location_t) 0), global_trees[TI_SIZE_TYPE
], size)
;
189 tree elemsz = gfc_get_element_type (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 189, __FUNCTION__))->typed.type)
);
190 if (TREE_CODE (elemsz)((enum tree_code) (elemsz)->base.code) == ARRAY_TYPE && TYPE_STRING_FLAG (elemsz)((tree_check2 ((elemsz), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 190, __FUNCTION__, (ARRAY_TYPE), (INTEGER_TYPE)))->type_common
.string_flag)
)
191 elemsz = gfc_conv_descriptor_elem_len (decl);
192 else
193 elemsz = TYPE_SIZE_UNIT (elemsz)((tree_class_check ((elemsz), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 193, __FUNCTION__))->type_common.size_unit)
;
194 size = fold_build2 (MULT_EXPR, size_type_node, size, elemsz)fold_build2_loc (((location_t) 0), MULT_EXPR, global_trees[TI_SIZE_TYPE
], size, elemsz )
;
195 if (!allocatable)
196 gimplify_and_add (gfc_finish_block (&block), pre_p);
197 else
198 {
199 tree var = create_tmp_var (size_type_nodeglobal_trees[TI_SIZE_TYPE]);
200 gfc_add_expr_to_block (&block, build2 (MODIFY_EXPR, sizetypesizetype_tab[(int) stk_sizetype], var, size));
201 tree tmp = fold_build2_loc (input_location, NE_EXPR, boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE],
202 gfc_conv_descriptor_data_get (decl),
203 null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
204 tmp = build3_loc (input_location, COND_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE], tmp,
205 gfc_finish_block (&block),
206 build2 (MODIFY_EXPR, sizetypesizetype_tab[(int) stk_sizetype], var, size_zero_nodeglobal_trees[TI_SIZE_ZERO]));
207 gimplify_and_add (tmp, pre_p);
208 size = var;
209 }
210 return size;
211}
212
213
214/* True if OpenMP should privatize what this DECL points to rather
215 than the DECL itself. */
216
217bool
218gfc_omp_privatize_by_reference (const_tree decl)
219{
220 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 220, __FUNCTION__))->typed.type)
;
221
222 if (TREE_CODE (type)((enum tree_code) (type)->base.code) == REFERENCE_TYPE
223 && (!DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 223, __FUNCTION__))->decl_common.artificial_flag)
|| TREE_CODE (decl)((enum tree_code) (decl)->base.code) == PARM_DECL))
224 return true;
225
226 if (TREE_CODE (type)((enum tree_code) (type)->base.code) == POINTER_TYPE
227 && gfc_omp_is_optional_argument (decl))
228 return true;
229
230 if (TREE_CODE (type)((enum tree_code) (type)->base.code) == POINTER_TYPE)
231 {
232 while (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == COMPONENT_REF)
233 decl = TREE_OPERAND (decl, 1)(*((const_cast<tree*> (tree_operand_check ((decl), (1),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 233, __FUNCTION__)))))
;
234
235 /* Array POINTER/ALLOCATABLE have aggregate types, all user variables
236 that have POINTER_TYPE type and aren't scalar pointers, scalar
237 allocatables, Cray pointees or C pointers are supposed to be
238 privatized by reference. */
239 if (GFC_DECL_GET_SCALAR_POINTER (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 239, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 239, __FUNCTION__))->decl_common.lang_specific)->scalar_pointer
) : 0)
240 || GFC_DECL_GET_SCALAR_ALLOCATABLE (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 240, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 240, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
241 || GFC_DECL_CRAY_POINTEE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 241, __FUNCTION__))->decl_common.lang_flag_4)
242 || GFC_DECL_ASSOCIATE_VAR_P (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 242, __FUNCTION__))->decl_common.lang_flag_7)
243 || VOID_TYPE_P (TREE_TYPE (TREE_TYPE (decl)))(((enum tree_code) (((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 243, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 243, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
)
)
244 return false;
245
246 if (!DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 246, __FUNCTION__))->decl_common.artificial_flag)
247 && TREE_CODE (TREE_TYPE (type))((enum tree_code) (((contains_struct_check ((type), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 247, __FUNCTION__))->typed.type))->base.code)
!= FUNCTION_TYPE)
248 return true;
249
250 /* Some arrays are expanded as DECL_ARTIFICIAL pointers
251 by the frontend. */
252 if (DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 252, __FUNCTION__))->decl_common.lang_specific)
253 && GFC_DECL_SAVED_DESCRIPTOR (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 253, __FUNCTION__))->decl_common.lang_specific)->saved_descriptor
)
)
254 return true;
255 }
256
257 return false;
258}
259
260/* OMP_CLAUSE_DEFAULT_UNSPECIFIED unless OpenMP sharing attribute
261 of DECL is predetermined. */
262
263enum omp_clause_default_kind
264gfc_omp_predetermined_sharing (tree decl)
265{
266 /* Associate names preserve the association established during ASSOCIATE.
267 As they are implemented either as pointers to the selector or array
268 descriptor and shouldn't really change in the ASSOCIATE region,
269 this decl can be either shared or firstprivate. If it is a pointer,
270 use firstprivate, as it is cheaper that way, otherwise make it shared. */
271 if (GFC_DECL_ASSOCIATE_VAR_P (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 271, __FUNCTION__))->decl_common.lang_flag_7)
)
272 {
273 if (TREE_CODE (TREE_TYPE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 273, __FUNCTION__))->typed.type))->base.code)
== POINTER_TYPE)
274 return OMP_CLAUSE_DEFAULT_FIRSTPRIVATE;
275 else
276 return OMP_CLAUSE_DEFAULT_SHARED;
277 }
278
279 if (DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 279, __FUNCTION__))->decl_common.artificial_flag)
280 && ! GFC_DECL_RESULT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 280, __FUNCTION__))->decl_common.lang_flag_5)
281 && ! (DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 281, __FUNCTION__))->decl_common.lang_specific)
282 && GFC_DECL_SAVED_DESCRIPTOR (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 282, __FUNCTION__))->decl_common.lang_specific)->saved_descriptor
)
))
283 return OMP_CLAUSE_DEFAULT_SHARED;
284
285 /* Cray pointees shouldn't be listed in any clauses and should be
286 gimplified to dereference of the corresponding Cray pointer.
287 Make them all private, so that they are emitted in the debug
288 information. */
289 if (GFC_DECL_CRAY_POINTEE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 289, __FUNCTION__))->decl_common.lang_flag_4)
)
290 return OMP_CLAUSE_DEFAULT_PRIVATE;
291
292 /* Assumed-size arrays are predetermined shared. */
293 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == PARM_DECL
294 && GFC_ARRAY_TYPE_P (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 294, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 294, __FUNCTION__))->type_common.lang_flag_2)
295 && GFC_TYPE_ARRAY_AKIND (TREE_TYPE (decl))(((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 295, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 295, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_UNKNOWN
296 && GFC_TYPE_ARRAY_UBOUND (TREE_TYPE (decl),(((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 296, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 297, __FUNCTION__))->type_with_lang_specific.lang_specific
)->ubound[(((tree_class_check ((((contains_struct_check ((
decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 297, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 297, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank) - 1])
297 GFC_TYPE_ARRAY_RANK (TREE_TYPE (decl)) - 1)(((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 296, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 297, __FUNCTION__))->type_with_lang_specific.lang_specific
)->ubound[(((tree_class_check ((((contains_struct_check ((
decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 297, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 297, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank) - 1])
298 == NULL__null)
299 return OMP_CLAUSE_DEFAULT_SHARED;
300
301 /* Dummy procedures aren't considered variables by OpenMP, thus are
302 disallowed in OpenMP clauses. They are represented as PARM_DECLs
303 in the middle-end, so return OMP_CLAUSE_DEFAULT_FIRSTPRIVATE here
304 to avoid complaining about their uses with default(none). */
305 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == PARM_DECL
306 && TREE_CODE (TREE_TYPE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 306, __FUNCTION__))->typed.type))->base.code)
== POINTER_TYPE
307 && TREE_CODE (TREE_TYPE (TREE_TYPE (decl)))((enum tree_code) (((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 307, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 307, __FUNCTION__))->typed.type))->base.code)
== FUNCTION_TYPE)
308 return OMP_CLAUSE_DEFAULT_FIRSTPRIVATE;
309
310 /* COMMON and EQUIVALENCE decls are shared. They
311 are only referenced through DECL_VALUE_EXPR of the variables
312 contained in them. If those are privatized, they will not be
313 gimplified to the COMMON or EQUIVALENCE decls. */
314 if (GFC_DECL_COMMON_OR_EQUIV (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 314, __FUNCTION__))->decl_common.lang_flag_3)
&& ! DECL_HAS_VALUE_EXPR_P (decl)((tree_check3 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 314, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL)))
->decl_common.decl_flag_2)
)
315 return OMP_CLAUSE_DEFAULT_SHARED;
316
317 if (GFC_DECL_RESULT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 317, __FUNCTION__))->decl_common.lang_flag_5)
&& ! DECL_HAS_VALUE_EXPR_P (decl)((tree_check3 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 317, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL)))
->decl_common.decl_flag_2)
)
318 return OMP_CLAUSE_DEFAULT_SHARED;
319
320 /* These are either array or derived parameters, or vtables.
321 In the former cases, the OpenMP standard doesn't consider them to be
322 variables at all (they can't be redefined), but they can nevertheless appear
323 in parallel/task regions and for default(none) purposes treat them as shared.
324 For vtables likely the same handling is desirable. */
325 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && TREE_READONLY (decl)((non_type_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 325, __FUNCTION__))->base.readonly_flag)
326 && (TREE_STATIC (decl)((decl)->base.static_flag) || DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 326, __FUNCTION__))->decl_common.decl_flag_1)
))
327 return OMP_CLAUSE_DEFAULT_SHARED;
328
329 return OMP_CLAUSE_DEFAULT_UNSPECIFIED;
330}
331
332
333/* OMP_CLAUSE_DEFAULTMAP_CATEGORY_UNSPECIFIED unless OpenMP mapping attribute
334 of DECL is predetermined. */
335
336enum omp_clause_defaultmap_kind
337gfc_omp_predetermined_mapping (tree decl)
338{
339 if (DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 339, __FUNCTION__))->decl_common.artificial_flag)
340 && ! GFC_DECL_RESULT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 340, __FUNCTION__))->decl_common.lang_flag_5)
341 && ! (DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 341, __FUNCTION__))->decl_common.lang_specific)
342 && GFC_DECL_SAVED_DESCRIPTOR (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 342, __FUNCTION__))->decl_common.lang_specific)->saved_descriptor
)
))
343 return OMP_CLAUSE_DEFAULTMAP_TO;
344
345 /* These are either array or derived parameters, or vtables. */
346 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && TREE_READONLY (decl)((non_type_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 346, __FUNCTION__))->base.readonly_flag)
347 && (TREE_STATIC (decl)((decl)->base.static_flag) || DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 347, __FUNCTION__))->decl_common.decl_flag_1)
))
348 return OMP_CLAUSE_DEFAULTMAP_TO;
349
350 return OMP_CLAUSE_DEFAULTMAP_CATEGORY_UNSPECIFIED;
351}
352
353
354/* Return decl that should be used when reporting DEFAULT(NONE)
355 diagnostics. */
356
357tree
358gfc_omp_report_decl (tree decl)
359{
360 if (DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 360, __FUNCTION__))->decl_common.artificial_flag)
361 && DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 361, __FUNCTION__))->decl_common.lang_specific)
362 && GFC_DECL_SAVED_DESCRIPTOR (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 362, __FUNCTION__))->decl_common.lang_specific)->saved_descriptor
)
)
363 return GFC_DECL_SAVED_DESCRIPTOR (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 363, __FUNCTION__))->decl_common.lang_specific)->saved_descriptor
)
;
364
365 return decl;
366}
367
368/* Return true if TYPE has any allocatable components. */
369
370static bool
371gfc_has_alloc_comps (tree type, tree decl)
372{
373 tree field, ftype;
374
375 if (POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || (
(enum tree_code) (type)->base.code) == REFERENCE_TYPE)
)
376 {
377 if (GFC_DECL_GET_SCALAR_ALLOCATABLE (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 377, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 377, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
)
378 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 378, __FUNCTION__))->typed.type)
;
379 else if (GFC_DECL_GET_SCALAR_POINTER (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 379, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 379, __FUNCTION__))->decl_common.lang_specific)->scalar_pointer
) : 0)
)
380 return false;
381 }
382
383 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 383, __FUNCTION__))->type_common.lang_flag_1)
384 && (GFC_TYPE_ARRAY_AKIND (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 384, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_POINTER
385 || GFC_TYPE_ARRAY_AKIND (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 385, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_POINTER_CONT))
386 return false;
387
388 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 388, __FUNCTION__))->type_common.lang_flag_1)
|| GFC_ARRAY_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 388, __FUNCTION__))->type_common.lang_flag_2)
)
389 type = gfc_get_element_type (type);
390
391 if (TREE_CODE (type)((enum tree_code) (type)->base.code) != RECORD_TYPE)
392 return false;
393
394 for (field = TYPE_FIELDS (type)((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 394, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
; field; field = DECL_CHAIN (field)(((contains_struct_check (((contains_struct_check ((field), (
TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 394, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 394, __FUNCTION__))->common.chain))
)
395 {
396 ftype = TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 396, __FUNCTION__))->typed.type)
;
397 if (GFC_DECL_GET_SCALAR_ALLOCATABLE (field)(((contains_struct_check ((field), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 397, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((field), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 397, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
)
398 return true;
399 if (GFC_DESCRIPTOR_TYPE_P (ftype)((tree_class_check ((ftype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 399, __FUNCTION__))->type_common.lang_flag_1)
400 && GFC_TYPE_ARRAY_AKIND (ftype)(((tree_class_check ((ftype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 400, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_ALLOCATABLE)
401 return true;
402 if (gfc_has_alloc_comps (ftype, field))
403 return true;
404 }
405 return false;
406}
407
408/* Return true if TYPE is polymorphic but not with pointer attribute. */
409
410static bool
411gfc_is_polymorphic_nonptr (tree type)
412{
413 if (POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || (
(enum tree_code) (type)->base.code) == REFERENCE_TYPE)
)
414 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 414, __FUNCTION__))->typed.type)
;
415 return GFC_CLASS_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 415, __FUNCTION__))->type_common.lang_flag_4)
;
416}
417
418/* Return true if TYPE is unlimited polymorphic but not with pointer attribute;
419 unlimited means also intrinsic types are handled and _len is used. */
420
421static bool
422gfc_is_unlimited_polymorphic_nonptr (tree type)
423{
424 if (POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || (
(enum tree_code) (type)->base.code) == REFERENCE_TYPE)
)
425 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 425, __FUNCTION__))->typed.type)
;
426 if (!GFC_CLASS_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 426, __FUNCTION__))->type_common.lang_flag_4)
)
427 return false;
428
429 tree field = TYPE_FIELDS (type)((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 429, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
; /* _data */
430 gcc_assert (field)((void)(!(field) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 430, __FUNCTION__), 0 : 0))
;
431 field = DECL_CHAIN (field)(((contains_struct_check (((contains_struct_check ((field), (
TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 431, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 431, __FUNCTION__))->common.chain))
; /* _vptr */
432 gcc_assert (field)((void)(!(field) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 432, __FUNCTION__), 0 : 0))
;
433 field = DECL_CHAIN (field)(((contains_struct_check (((contains_struct_check ((field), (
TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 433, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 433, __FUNCTION__))->common.chain))
;
434 if (!field)
435 return false;
436 gcc_assert (strcmp ("_len", IDENTIFIER_POINTER (DECL_NAME (field))) == 0)((void)(!(strcmp ("_len", ((const char *) (tree_check ((((contains_struct_check
((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 436, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 436, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str
)) == 0) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 436, __FUNCTION__), 0 : 0))
;
437 return true;
438}
439
440/* Return true if the DECL is for an allocatable array or scalar. */
441
442bool
443gfc_omp_allocatable_p (tree decl)
444{
445 if (!DECL_P (decl)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (decl)->base.code))] == tcc_declaration)
)
446 return false;
447
448 if (GFC_DECL_GET_SCALAR_ALLOCATABLE (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 448, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 448, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
)
449 return true;
450
451 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 451, __FUNCTION__))->typed.type)
;
452 if (gfc_omp_privatize_by_reference (decl))
453 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 453, __FUNCTION__))->typed.type)
;
454
455 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 455, __FUNCTION__))->type_common.lang_flag_1)
456 && GFC_TYPE_ARRAY_AKIND (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 456, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_ALLOCATABLE)
457 return true;
458
459 return false;
460}
461
462
463/* Return true if DECL in private clause needs
464 OMP_CLAUSE_PRIVATE_OUTER_REF on the private clause. */
465bool
466gfc_omp_private_outer_ref (tree decl)
467{
468 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 468, __FUNCTION__))->typed.type)
;
469
470 if (gfc_omp_privatize_by_reference (decl))
471 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 471, __FUNCTION__))->typed.type)
;
472
473 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 473, __FUNCTION__))->type_common.lang_flag_1)
474 && GFC_TYPE_ARRAY_AKIND (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 474, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_ALLOCATABLE)
475 return true;
476
477 if (GFC_DECL_GET_SCALAR_ALLOCATABLE (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 477, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 477, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
)
478 return true;
479
480 if (gfc_has_alloc_comps (type, decl))
481 return true;
482
483 return false;
484}
485
486/* Callback for gfc_omp_unshare_expr. */
487
488static tree
489gfc_omp_unshare_expr_r (tree *tp, int *walk_subtrees, void *)
490{
491 tree t = *tp;
492 enum tree_code code = TREE_CODE (t)((enum tree_code) (t)->base.code);
493
494 /* Stop at types, decls, constants like copy_tree_r. */
495 if (TREE_CODE_CLASS (code)tree_code_type_tmpl <0>::tree_code_type[(int) (code)] == tcc_type
496 || TREE_CODE_CLASS (code)tree_code_type_tmpl <0>::tree_code_type[(int) (code)] == tcc_declaration
497 || TREE_CODE_CLASS (code)tree_code_type_tmpl <0>::tree_code_type[(int) (code)] == tcc_constant
498 || code == BLOCK)
499 *walk_subtrees = 0;
500 else if (handled_component_p (t)
501 || TREE_CODE (t)((enum tree_code) (t)->base.code) == MEM_REF)
502 {
503 *tp = unshare_expr (t);
504 *walk_subtrees = 0;
505 }
506
507 return NULL_TREE(tree) __null;
508}
509
510/* Unshare in expr anything that the FE which normally doesn't
511 care much about tree sharing (because during gimplification
512 everything is unshared) could cause problems with tree sharing
513 at omp-low.cc time. */
514
515static tree
516gfc_omp_unshare_expr (tree expr)
517{
518 walk_tree (&expr, gfc_omp_unshare_expr_r, NULL, NULL)walk_tree_1 (&expr, gfc_omp_unshare_expr_r, __null, __null
, __null)
;
519 return expr;
520}
521
522enum walk_alloc_comps
523{
524 WALK_ALLOC_COMPS_DTOR,
525 WALK_ALLOC_COMPS_DEFAULT_CTOR,
526 WALK_ALLOC_COMPS_COPY_CTOR
527};
528
529/* Handle allocatable components in OpenMP clauses. */
530
531static tree
532gfc_walk_alloc_comps (tree decl, tree dest, tree var,
533 enum walk_alloc_comps kind)
534{
535 stmtblock_t block, tmpblock;
536 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 536, __FUNCTION__))->typed.type)
, then_b, tem, field;
537 gfc_init_block (&block);
538
539 if (GFC_ARRAY_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 539, __FUNCTION__))->type_common.lang_flag_2)
|| GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 539, __FUNCTION__))->type_common.lang_flag_1)
)
540 {
541 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 541, __FUNCTION__))->type_common.lang_flag_1)
)
542 {
543 gfc_init_block (&tmpblock);
544 tem = gfc_full_array_size (&tmpblock, decl,
545 GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 545, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
);
546 then_b = gfc_finish_block (&tmpblock);
547 gfc_add_expr_to_block (&block, gfc_omp_unshare_expr (then_b));
548 tem = gfc_omp_unshare_expr (tem);
549 tem = fold_build2_loc (input_location, MINUS_EXPR,
550 gfc_array_index_type, tem,
551 gfc_index_one_nodegfc_rank_cst[1]);
552 }
553 else
554 {
555 bool compute_nelts = false;
556 if (!TYPE_DOMAIN (type)((tree_check ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 556, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
557 || TYPE_MAX_VALUE (TYPE_DOMAIN (type))((tree_check5 ((((tree_check ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 557, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 557, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)
== NULL_TREE(tree) __null
558 || TYPE_MIN_VALUE (TYPE_DOMAIN (type))((tree_check5 ((((tree_check ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 558, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 558, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.minval
)
== error_mark_nodeglobal_trees[TI_ERROR_MARK]
559 || TYPE_MAX_VALUE (TYPE_DOMAIN (type))((tree_check5 ((((tree_check ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 559, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 559, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)
== error_mark_nodeglobal_trees[TI_ERROR_MARK])
560 compute_nelts = true;
561 else if (VAR_P (TYPE_MAX_VALUE (TYPE_DOMAIN (type)))(((enum tree_code) (((tree_check5 ((((tree_check ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 561, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 561, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
))->base.code) == VAR_DECL)
)
562 {
563 tree a = DECL_ATTRIBUTES (TYPE_MAX_VALUE (TYPE_DOMAIN (type)))((contains_struct_check ((((tree_check5 ((((tree_check ((type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 563, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 563, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 563, __FUNCTION__))->decl_common.attributes)
;
564 if (lookup_attribute ("omp dummy var", a))
565 compute_nelts = true;
566 }
567 if (compute_nelts)
568 {
569 tem = fold_build2 (EXACT_DIV_EXPR, sizetype,fold_build2_loc (((location_t) 0), EXACT_DIV_EXPR, sizetype_tab
[(int) stk_sizetype], ((tree_class_check ((type), (tcc_type),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 570, __FUNCTION__))->type_common.size_unit), ((tree_class_check
((((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 571, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 571, __FUNCTION__))->type_common.size_unit) )
570 TYPE_SIZE_UNIT (type),fold_build2_loc (((location_t) 0), EXACT_DIV_EXPR, sizetype_tab
[(int) stk_sizetype], ((tree_class_check ((type), (tcc_type),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 570, __FUNCTION__))->type_common.size_unit), ((tree_class_check
((((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 571, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 571, __FUNCTION__))->type_common.size_unit) )
571 TYPE_SIZE_UNIT (TREE_TYPE (type)))fold_build2_loc (((location_t) 0), EXACT_DIV_EXPR, sizetype_tab
[(int) stk_sizetype], ((tree_class_check ((type), (tcc_type),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 570, __FUNCTION__))->type_common.size_unit), ((tree_class_check
((((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 571, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 571, __FUNCTION__))->type_common.size_unit) )
;
572 tem = size_binop (MINUS_EXPR, tem, size_one_node)size_binop_loc (((location_t) 0), MINUS_EXPR, tem, global_trees
[TI_SIZE_ONE])
;
573 }
574 else
575 tem = array_type_nelts (type);
576 tem = fold_convert (gfc_array_index_type, tem)fold_convert_loc (((location_t) 0), gfc_array_index_type, tem
)
;
577 }
578
579 tree nelems = gfc_evaluate_now (tem, &block);
580 tree index = gfc_create_var (gfc_array_index_type, "S");
581
582 gfc_init_block (&tmpblock);
583 tem = gfc_conv_array_data (decl);
584 tree declvar = build_fold_indirect_ref_loc (input_location, tem);
585 tree declvref = gfc_build_array_ref (declvar, index, NULL__null);
586 tree destvar, destvref = NULL_TREE(tree) __null;
587 if (dest)
588 {
589 tem = gfc_conv_array_data (dest);
590 destvar = build_fold_indirect_ref_loc (input_location, tem);
591 destvref = gfc_build_array_ref (destvar, index, NULL__null);
592 }
593 gfc_add_expr_to_block (&tmpblock,
594 gfc_walk_alloc_comps (declvref, destvref,
595 var, kind));
596
597 gfc_loopinfo loop;
598 gfc_init_loopinfo (&loop);
599 loop.dimen = 1;
600 loop.from[0] = gfc_index_zero_nodegfc_rank_cst[0];
601 loop.loopvar[0] = index;
602 loop.to[0] = nelems;
603 gfc_trans_scalarizing_loops (&loop, &tmpblock);
604 gfc_add_block_to_block (&block, &loop.pre);
605 return gfc_finish_block (&block);
606 }
607 else if (GFC_DECL_GET_SCALAR_ALLOCATABLE (var)(((contains_struct_check ((var), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 607, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((var), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 607, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
)
608 {
609 decl = build_fold_indirect_ref_loc (input_location, decl);
610 if (dest)
611 dest = build_fold_indirect_ref_loc (input_location, dest);
612 type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 612, __FUNCTION__))->typed.type)
;
613 }
614
615 gcc_assert (TREE_CODE (type) == RECORD_TYPE)((void)(!(((enum tree_code) (type)->base.code) == RECORD_TYPE
) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 615, __FUNCTION__), 0 : 0))
;
616 for (field = TYPE_FIELDS (type)((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 616, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
; field; field = DECL_CHAIN (field)(((contains_struct_check (((contains_struct_check ((field), (
TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 616, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 616, __FUNCTION__))->common.chain))
)
617 {
618 tree ftype = TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 618, __FUNCTION__))->typed.type)
;
619 tree declf, destf = NULL_TREE(tree) __null;
620 bool has_alloc_comps = gfc_has_alloc_comps (ftype, field);
621 if ((!GFC_DESCRIPTOR_TYPE_P (ftype)((tree_class_check ((ftype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 621, __FUNCTION__))->type_common.lang_flag_1)
622 || GFC_TYPE_ARRAY_AKIND (ftype)(((tree_class_check ((ftype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 622, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
!= GFC_ARRAY_ALLOCATABLE)
623 && !GFC_DECL_GET_SCALAR_ALLOCATABLE (field)(((contains_struct_check ((field), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 623, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((field), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 623, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
624 && !has_alloc_comps)
625 continue;
626 declf = fold_build3_loc (input_location, COMPONENT_REF, ftype,
627 decl, field, NULL_TREE(tree) __null);
628 if (dest)
629 destf = fold_build3_loc (input_location, COMPONENT_REF, ftype,
630 dest, field, NULL_TREE(tree) __null);
631
632 tem = NULL_TREE(tree) __null;
633 switch (kind)
634 {
635 case WALK_ALLOC_COMPS_DTOR:
636 break;
637 case WALK_ALLOC_COMPS_DEFAULT_CTOR:
638 if (GFC_DESCRIPTOR_TYPE_P (ftype)((tree_class_check ((ftype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 638, __FUNCTION__))->type_common.lang_flag_1)
639 && GFC_TYPE_ARRAY_AKIND (ftype)(((tree_class_check ((ftype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 639, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_ALLOCATABLE)
640 {
641 gfc_add_modify (&block, unshare_expr (destf),
642 unshare_expr (declf));
643 tem = gfc_duplicate_allocatable_nocopy
644 (destf, declf, ftype,
645 GFC_TYPE_ARRAY_RANK (ftype)(((tree_class_check ((ftype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 645, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
);
646 }
647 else if (GFC_DECL_GET_SCALAR_ALLOCATABLE (field)(((contains_struct_check ((field), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 647, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((field), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 647, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
)
648 tem = gfc_duplicate_allocatable_nocopy (destf, declf, ftype, 0);
649 break;
650 case WALK_ALLOC_COMPS_COPY_CTOR:
651 if (GFC_DESCRIPTOR_TYPE_P (ftype)((tree_class_check ((ftype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 651, __FUNCTION__))->type_common.lang_flag_1)
652 && GFC_TYPE_ARRAY_AKIND (ftype)(((tree_class_check ((ftype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 652, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_ALLOCATABLE)
653 tem = gfc_duplicate_allocatable (destf, declf, ftype,
654 GFC_TYPE_ARRAY_RANK (ftype)(((tree_class_check ((ftype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 654, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
,
655 NULL_TREE(tree) __null);
656 else if (GFC_DECL_GET_SCALAR_ALLOCATABLE (field)(((contains_struct_check ((field), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 656, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((field), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 656, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
)
657 tem = gfc_duplicate_allocatable (destf, declf, ftype, 0,
658 NULL_TREE(tree) __null);
659 break;
660 }
661 if (tem)
662 gfc_add_expr_to_block (&block, gfc_omp_unshare_expr (tem));
663 if (has_alloc_comps)
664 {
665 gfc_init_block (&tmpblock);
666 gfc_add_expr_to_block (&tmpblock,
667 gfc_walk_alloc_comps (declf, destf,
668 field, kind));
669 then_b = gfc_finish_block (&tmpblock);
670 if (GFC_DESCRIPTOR_TYPE_P (ftype)((tree_class_check ((ftype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 670, __FUNCTION__))->type_common.lang_flag_1)
671 && GFC_TYPE_ARRAY_AKIND (ftype)(((tree_class_check ((ftype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 671, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_ALLOCATABLE)
672 tem = gfc_conv_descriptor_data_get (unshare_expr (declf));
673 else if (GFC_DECL_GET_SCALAR_ALLOCATABLE (field)(((contains_struct_check ((field), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 673, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((field), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 673, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
)
674 tem = unshare_expr (declf);
675 else
676 tem = NULL_TREE(tree) __null;
677 if (tem)
678 {
679 tem = fold_convert (pvoid_type_node, tem)fold_convert_loc (((location_t) 0), pvoid_type_node, tem);
680 tem = fold_build2_loc (input_location, NE_EXPR,
681 logical_type_node, tem,
682 null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
683 then_b = build3_loc (input_location, COND_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE],
684 tem, then_b,
685 build_empty_stmt (input_location));
686 }
687 gfc_add_expr_to_block (&block, then_b);
688 }
689 if (kind == WALK_ALLOC_COMPS_DTOR)
690 {
691 if (GFC_DESCRIPTOR_TYPE_P (ftype)((tree_class_check ((ftype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 691, __FUNCTION__))->type_common.lang_flag_1)
692 && GFC_TYPE_ARRAY_AKIND (ftype)(((tree_class_check ((ftype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 692, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_ALLOCATABLE)
693 {
694 tem = gfc_conv_descriptor_data_get (unshare_expr (declf));
695 tem = gfc_deallocate_with_status (tem, NULL_TREE(tree) __null, NULL_TREE(tree) __null,
696 NULL_TREE(tree) __null, NULL_TREE(tree) __null, true,
697 NULL__null,
698 GFC_CAF_COARRAY_NOCOARRAY);
699 gfc_add_expr_to_block (&block, gfc_omp_unshare_expr (tem));
700 }
701 else if (GFC_DECL_GET_SCALAR_ALLOCATABLE (field)(((contains_struct_check ((field), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 701, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((field), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 701, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
)
702 {
703 tem = gfc_call_free (unshare_expr (declf));
704 gfc_add_expr_to_block (&block, gfc_omp_unshare_expr (tem));
705 }
706 }
707 }
708
709 return gfc_finish_block (&block);
710}
711
712/* Return code to initialize DECL with its default constructor, or
713 NULL if there's nothing to do. */
714
715tree
716gfc_omp_clause_default_ctor (tree clause, tree decl, tree outer)
717{
718 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 718, __FUNCTION__))->typed.type)
, size, ptr, cond, then_b, else_b;
719 stmtblock_t block, cond_block;
720
721 switch (OMP_CLAUSE_CODE (clause)((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 721, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code
)
722 {
723 case OMP_CLAUSE__LOOPTEMP_:
724 case OMP_CLAUSE__REDUCTEMP_:
725 case OMP_CLAUSE__CONDTEMP_:
726 case OMP_CLAUSE__SCANTEMP_:
727 return NULL__null;
728 case OMP_CLAUSE_PRIVATE:
729 case OMP_CLAUSE_LASTPRIVATE:
730 case OMP_CLAUSE_LINEAR:
731 case OMP_CLAUSE_REDUCTION:
732 case OMP_CLAUSE_IN_REDUCTION:
733 case OMP_CLAUSE_TASK_REDUCTION:
734 break;
735 default:
736 gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 736, __FUNCTION__))
;
737 }
738
739 if ((! GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 739, __FUNCTION__))->type_common.lang_flag_1)
740 || GFC_TYPE_ARRAY_AKIND (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 740, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
!= GFC_ARRAY_ALLOCATABLE)
741 && (!GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause))(((contains_struct_check (((*(omp_clause_elt_check (((omp_clause_range_check
(((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 741, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 741, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 741, __FUNCTION__)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 741, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
(((*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 741, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 741, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 741, __FUNCTION__)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 741, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
742 || !POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || (
(enum tree_code) (type)->base.code) == REFERENCE_TYPE)
))
743 {
744 if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 744, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 744, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 744, __FUNCTION__)))
))
745 {
746 gcc_assert (outer)((void)(!(outer) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 746, __FUNCTION__), 0 : 0))
;
747 gfc_start_block (&block);
748 tree tem = gfc_walk_alloc_comps (outer, decl,
749 OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 749, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 749, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 749, __FUNCTION__)))
,
750 WALK_ALLOC_COMPS_DEFAULT_CTOR);
751 gfc_add_expr_to_block (&block, tem);
752 return gfc_finish_block (&block);
753 }
754 return NULL_TREE(tree) __null;
755 }
756
757 gcc_assert (outer != NULL_TREE)((void)(!(outer != (tree) __null) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 757, __FUNCTION__), 0 : 0))
;
758
759 /* Allocatable arrays and scalars in PRIVATE clauses need to be set to
760 "not currently allocated" allocation status if outer
761 array is "not currently allocated", otherwise should be allocated. */
762 gfc_start_block (&block);
763
764 gfc_init_block (&cond_block);
765
766 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 766, __FUNCTION__))->type_common.lang_flag_1)
)
767 {
768 gfc_add_modify (&cond_block, decl, outer);
769 tree rank = gfc_rank_cst[GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 769, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
- 1];
770 size = gfc_conv_descriptor_ubound_get (decl, rank);
771 size = fold_build2_loc (input_location, MINUS_EXPR, gfc_array_index_type,
772 size,
773 gfc_conv_descriptor_lbound_get (decl, rank));
774 size = fold_build2_loc (input_location, PLUS_EXPR, gfc_array_index_type,
775 size, gfc_index_one_nodegfc_rank_cst[1]);
776 if (GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 776, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
> 1)
777 size = fold_build2_loc (input_location, MULT_EXPR,
778 gfc_array_index_type, size,
779 gfc_conv_descriptor_stride_get (decl, rank));
780 tree esize = fold_convert (gfc_array_index_type,fold_convert_loc (((location_t) 0), gfc_array_index_type, ((tree_class_check
((gfc_get_element_type (type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 781, __FUNCTION__))->type_common.size_unit))
781 TYPE_SIZE_UNIT (gfc_get_element_type (type)))fold_convert_loc (((location_t) 0), gfc_array_index_type, ((tree_class_check
((gfc_get_element_type (type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 781, __FUNCTION__))->type_common.size_unit))
;
782 size = fold_build2_loc (input_location, MULT_EXPR, gfc_array_index_type,
783 size, esize);
784 size = unshare_expr (size);
785 size = gfc_evaluate_now (fold_convert (size_type_node, size)fold_convert_loc (((location_t) 0), global_trees[TI_SIZE_TYPE
], size)
,
786 &cond_block);
787 }
788 else
789 size = fold_convert (size_type_node, TYPE_SIZE_UNIT (TREE_TYPE (type)))fold_convert_loc (((location_t) 0), global_trees[TI_SIZE_TYPE
], ((tree_class_check ((((contains_struct_check ((type), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 789, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 789, __FUNCTION__))->type_common.size_unit))
;
790 ptr = gfc_create_var (pvoid_type_node, NULL__null);
791 gfc_allocate_using_malloc (&cond_block, ptr, size, NULL_TREE(tree) __null);
792 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 792, __FUNCTION__))->type_common.lang_flag_1)
)
793 gfc_conv_descriptor_data_set (&cond_block, unshare_expr (decl), ptr);
794 else
795 gfc_add_modify (&cond_block, unshare_expr (decl),
796 fold_convert (TREE_TYPE (decl), ptr)fold_convert_loc (((location_t) 0), ((contains_struct_check (
(decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 796, __FUNCTION__))->typed.type), ptr)
);
797 if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 797, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 797, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 797, __FUNCTION__)))
))
798 {
799 tree tem = gfc_walk_alloc_comps (outer, decl,
800 OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 800, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 800, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 800, __FUNCTION__)))
,
801 WALK_ALLOC_COMPS_DEFAULT_CTOR);
802 gfc_add_expr_to_block (&cond_block, tem);
803 }
804 then_b = gfc_finish_block (&cond_block);
805
806 /* Reduction clause requires allocated ALLOCATABLE. */
807 if (OMP_CLAUSE_CODE (clause)((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 807, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code
!= OMP_CLAUSE_REDUCTION
808 && OMP_CLAUSE_CODE (clause)((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 808, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code
!= OMP_CLAUSE_IN_REDUCTION
809 && OMP_CLAUSE_CODE (clause)((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 809, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code
!= OMP_CLAUSE_TASK_REDUCTION)
810 {
811 gfc_init_block (&cond_block);
812 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 812, __FUNCTION__))->type_common.lang_flag_1)
)
813 gfc_conv_descriptor_data_set (&cond_block, unshare_expr (decl),
814 null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
815 else
816 gfc_add_modify (&cond_block, unshare_expr (decl),
817 build_zero_cst (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 817, __FUNCTION__))->typed.type)
));
818 else_b = gfc_finish_block (&cond_block);
819
820 tree tem = fold_convert (pvoid_type_node,fold_convert_loc (((location_t) 0), pvoid_type_node, ((tree_class_check
((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 821, __FUNCTION__))->type_common.lang_flag_1) ? gfc_conv_descriptor_data_get
(outer) : outer)
821 GFC_DESCRIPTOR_TYPE_P (type)fold_convert_loc (((location_t) 0), pvoid_type_node, ((tree_class_check
((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 821, __FUNCTION__))->type_common.lang_flag_1) ? gfc_conv_descriptor_data_get
(outer) : outer)
822 ? gfc_conv_descriptor_data_get (outer) : outer)fold_convert_loc (((location_t) 0), pvoid_type_node, ((tree_class_check
((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 821, __FUNCTION__))->type_common.lang_flag_1) ? gfc_conv_descriptor_data_get
(outer) : outer)
;
823 tem = unshare_expr (tem);
824 cond = fold_build2_loc (input_location, NE_EXPR, logical_type_node,
825 tem, null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
826 gfc_add_expr_to_block (&block,
827 build3_loc (input_location, COND_EXPR,
828 void_type_nodeglobal_trees[TI_VOID_TYPE], cond, then_b,
829 else_b));
830 /* Avoid -W*uninitialized warnings. */
831 if (DECL_P (decl)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (decl)->base.code))] == tcc_declaration)
)
832 suppress_warning (decl, OPT_Wuninitialized);
833 }
834 else
835 gfc_add_expr_to_block (&block, then_b);
836
837 return gfc_finish_block (&block);
838}
839
840/* Build and return code for a copy constructor from SRC to DEST. */
841
842tree
843gfc_omp_clause_copy_ctor (tree clause, tree dest, tree src)
844{
845 tree type = TREE_TYPE (dest)((contains_struct_check ((dest), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 845, __FUNCTION__))->typed.type)
, ptr, size, call;
846 tree decl_type = TREE_TYPE (OMP_CLAUSE_DECL (clause))((contains_struct_check (((*(omp_clause_elt_check (((omp_clause_range_check
(((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 846, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 846, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 846, __FUNCTION__)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 846, __FUNCTION__))->typed.type)
;
847 tree cond, then_b, else_b;
848 stmtblock_t block, cond_block;
849
850 gcc_assert (OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_FIRSTPRIVATE((void)(!(((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 850, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_FIRSTPRIVATE
|| ((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 851, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_LINEAR
) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 851, __FUNCTION__), 0 : 0))
851 || OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_LINEAR)((void)(!(((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 850, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_FIRSTPRIVATE
|| ((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 851, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_LINEAR
) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 851, __FUNCTION__), 0 : 0))
;
852
853 /* Privatize pointer, only; cf. gfc_omp_predetermined_sharing. */
854 if (DECL_P (OMP_CLAUSE_DECL (clause))(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) ((*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 854, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 854, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 854, __FUNCTION__))))->base.code))] == tcc_declaration)
855 && GFC_DECL_ASSOCIATE_VAR_P (OMP_CLAUSE_DECL (clause))((contains_struct_check (((*(omp_clause_elt_check (((omp_clause_range_check
(((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 855, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 855, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 855, __FUNCTION__)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 855, __FUNCTION__))->decl_common.lang_flag_7)
)
856 return build2 (MODIFY_EXPR, TREE_TYPE (dest)((contains_struct_check ((dest), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 856, __FUNCTION__))->typed.type)
, dest, src);
857
858 if (DECL_ARTIFICIAL (OMP_CLAUSE_DECL (clause))((contains_struct_check (((*(omp_clause_elt_check (((omp_clause_range_check
(((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 858, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 858, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 858, __FUNCTION__)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 858, __FUNCTION__))->decl_common.artificial_flag)
859 && DECL_LANG_SPECIFIC (OMP_CLAUSE_DECL (clause))((contains_struct_check (((*(omp_clause_elt_check (((omp_clause_range_check
(((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 859, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 859, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 859, __FUNCTION__)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 859, __FUNCTION__))->decl_common.lang_specific)
860 && GFC_DECL_SAVED_DESCRIPTOR (OMP_CLAUSE_DECL (clause))(((contains_struct_check (((*(omp_clause_elt_check (((omp_clause_range_check
(((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 860, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 860, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 860, __FUNCTION__)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 860, __FUNCTION__))->decl_common.lang_specific)->saved_descriptor
)
)
861 decl_type
862 = TREE_TYPE (GFC_DECL_SAVED_DESCRIPTOR (OMP_CLAUSE_DECL (clause)))((contains_struct_check (((((contains_struct_check (((*(omp_clause_elt_check
(((omp_clause_range_check (((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 862, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 862, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 862, __FUNCTION__)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 862, __FUNCTION__))->decl_common.lang_specific)->saved_descriptor
)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 862, __FUNCTION__))->typed.type)
;
863
864 if (gfc_is_polymorphic_nonptr (decl_type))
865 {
866 if (POINTER_TYPE_P (decl_type)(((enum tree_code) (decl_type)->base.code) == POINTER_TYPE
|| ((enum tree_code) (decl_type)->base.code) == REFERENCE_TYPE
)
)
867 decl_type = TREE_TYPE (decl_type)((contains_struct_check ((decl_type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 867, __FUNCTION__))->typed.type)
;
868 decl_type = TREE_TYPE (TYPE_FIELDS (decl_type))((contains_struct_check ((((tree_check3 ((decl_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 868, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 868, __FUNCTION__))->typed.type)
;
869 if (GFC_DESCRIPTOR_TYPE_P (decl_type)((tree_class_check ((decl_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 869, __FUNCTION__))->type_common.lang_flag_1)
|| GFC_ARRAY_TYPE_P (decl_type)((tree_class_check ((decl_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 869, __FUNCTION__))->type_common.lang_flag_2)
)
870 fatal_error (input_location,
871 "Sorry, polymorphic arrays not yet supported for "
872 "firstprivate");
873 tree src_len;
874 tree nelems = build_int_cst (size_type_nodeglobal_trees[TI_SIZE_TYPE], 1); /* Scalar. */
875 tree src_data = gfc_class_data_get (unshare_expr (src));
876 tree dest_data = gfc_class_data_get (unshare_expr (dest));
877 bool unlimited = gfc_is_unlimited_polymorphic_nonptr (type);
878
879 gfc_start_block (&block);
880 gfc_add_modify (&block, gfc_class_vptr_get (dest),
881 gfc_class_vptr_get (src));
882 gfc_init_block (&cond_block);
883
884 if (unlimited)
885 {
886 src_len = gfc_class_len_get (src);
887 gfc_add_modify (&cond_block, gfc_class_len_get (unshare_expr (dest)), src_len);
888 }
889
890 /* Use: size = class._vtab._size * (class._len > 0 ? class._len : 1). */
891 size = fold_convert (size_type_node, gfc_class_vtab_size_get (src))fold_convert_loc (((location_t) 0), global_trees[TI_SIZE_TYPE
], gfc_class_vtab_size_get (src))
;
892 if (unlimited)
893 {
894 cond = fold_build2_loc (input_location, GT_EXPR, boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE],
895 unshare_expr (src_len),
896 build_zero_cst (TREE_TYPE (src_len)((contains_struct_check ((src_len), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 896, __FUNCTION__))->typed.type)
));
897 cond = build3_loc (input_location, COND_EXPR, size_type_nodeglobal_trees[TI_SIZE_TYPE], cond,
898 fold_convert (size_type_node,fold_convert_loc (((location_t) 0), global_trees[TI_SIZE_TYPE
], unshare_expr (src_len))
899 unshare_expr (src_len))fold_convert_loc (((location_t) 0), global_trees[TI_SIZE_TYPE
], unshare_expr (src_len))
,
900 build_int_cst (size_type_nodeglobal_trees[TI_SIZE_TYPE], 1));
901 size = fold_build2_loc (input_location, MULT_EXPR, size_type_nodeglobal_trees[TI_SIZE_TYPE],
902 size, cond);
903 }
904
905 /* Malloc memory + call class->_vpt->_copy. */
906 call = builtin_decl_explicit (BUILT_IN_MALLOC);
907 call = build_call_expr_loc (input_location, call, 1, size);
908 gfc_add_modify (&cond_block, dest_data,
909 fold_convert (TREE_TYPE (dest_data), call)fold_convert_loc (((location_t) 0), ((contains_struct_check (
(dest_data), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 909, __FUNCTION__))->typed.type), call)
);
910 gfc_add_expr_to_block (&cond_block,
911 gfc_copy_class_to_class (src, dest, nelems,
912 unlimited));
913
914 gcc_assert (TREE_CODE (dest_data) == COMPONENT_REF)((void)(!(((enum tree_code) (dest_data)->base.code) == COMPONENT_REF
) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 914, __FUNCTION__), 0 : 0))
;
915 if (!GFC_DECL_GET_SCALAR_ALLOCATABLE (TREE_OPERAND (dest_data, 1))(((contains_struct_check (((*((const_cast<tree*> (tree_operand_check
((dest_data), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 915, __FUNCTION__)))))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 915, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
(((*((const_cast<tree*> (tree_operand_check ((dest_data
), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 915, __FUNCTION__)))))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 915, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
)
916 {
917 gfc_add_block_to_block (&block, &cond_block);
918 }
919 else
920 {
921 /* Create: if (class._data != 0) <cond_block> else class._data = NULL; */
922 cond = fold_build2_loc (input_location, NE_EXPR, boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE],
923 src_data, null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
924 gfc_add_expr_to_block (&block, build3_loc (input_location, COND_EXPR,
925 void_type_nodeglobal_trees[TI_VOID_TYPE], cond,
926 gfc_finish_block (&cond_block),
927 fold_build2_loc (input_location, MODIFY_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE],
928 unshare_expr (dest_data), null_pointer_nodeglobal_trees[TI_NULL_POINTER])));
929 }
930 return gfc_finish_block (&block);
931 }
932
933 if ((! GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 933, __FUNCTION__))->type_common.lang_flag_1)
934 || GFC_TYPE_ARRAY_AKIND (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 934, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
!= GFC_ARRAY_ALLOCATABLE)
935 && (!GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause))(((contains_struct_check (((*(omp_clause_elt_check (((omp_clause_range_check
(((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 935, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 935, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 935, __FUNCTION__)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 935, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
(((*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 935, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 935, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 935, __FUNCTION__)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 935, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
936 || !POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || (
(enum tree_code) (type)->base.code) == REFERENCE_TYPE)
))
937 {
938 if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 938, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 938, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 938, __FUNCTION__)))
))
939 {
940 gfc_start_block (&block);
941 gfc_add_modify (&block, dest, src);
942 tree tem = gfc_walk_alloc_comps (src, dest, OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 942, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 942, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 942, __FUNCTION__)))
,
943 WALK_ALLOC_COMPS_COPY_CTOR);
944 gfc_add_expr_to_block (&block, tem);
945 return gfc_finish_block (&block);
946 }
947 else
948 return build2_v (MODIFY_EXPR, dest, src)fold_build2_loc (input_location, MODIFY_EXPR, global_trees[TI_VOID_TYPE
], dest, src)
;
949 }
950
951 /* Allocatable arrays in FIRSTPRIVATE clauses need to be allocated
952 and copied from SRC. */
953 gfc_start_block (&block);
954
955 gfc_init_block (&cond_block);
956
957 gfc_add_modify (&cond_block, dest, fold_convert (TREE_TYPE (dest), src)fold_convert_loc (((location_t) 0), ((contains_struct_check (
(dest), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 957, __FUNCTION__))->typed.type), src)
);
958 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 958, __FUNCTION__))->type_common.lang_flag_1)
)
959 {
960 tree rank = gfc_rank_cst[GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 960, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
- 1];
961 size = gfc_conv_descriptor_ubound_get (dest, rank);
962 size = fold_build2_loc (input_location, MINUS_EXPR, gfc_array_index_type,
963 size,
964 gfc_conv_descriptor_lbound_get (dest, rank));
965 size = fold_build2_loc (input_location, PLUS_EXPR, gfc_array_index_type,
966 size, gfc_index_one_nodegfc_rank_cst[1]);
967 if (GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 967, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
> 1)
968 size = fold_build2_loc (input_location, MULT_EXPR,
969 gfc_array_index_type, size,
970 gfc_conv_descriptor_stride_get (dest, rank));
971 tree esize = fold_convert (gfc_array_index_type,fold_convert_loc (((location_t) 0), gfc_array_index_type, ((tree_class_check
((gfc_get_element_type (type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 972, __FUNCTION__))->type_common.size_unit))
972 TYPE_SIZE_UNIT (gfc_get_element_type (type)))fold_convert_loc (((location_t) 0), gfc_array_index_type, ((tree_class_check
((gfc_get_element_type (type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 972, __FUNCTION__))->type_common.size_unit))
;
973 size = fold_build2_loc (input_location, MULT_EXPR, gfc_array_index_type,
974 size, esize);
975 size = unshare_expr (size);
976 size = gfc_evaluate_now (fold_convert (size_type_node, size)fold_convert_loc (((location_t) 0), global_trees[TI_SIZE_TYPE
], size)
,
977 &cond_block);
978 }
979 else
980 size = fold_convert (size_type_node, TYPE_SIZE_UNIT (TREE_TYPE (type)))fold_convert_loc (((location_t) 0), global_trees[TI_SIZE_TYPE
], ((tree_class_check ((((contains_struct_check ((type), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 980, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 980, __FUNCTION__))->type_common.size_unit))
;
981 ptr = gfc_create_var (pvoid_type_node, NULL__null);
982 gfc_allocate_using_malloc (&cond_block, ptr, size, NULL_TREE(tree) __null);
983 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 983, __FUNCTION__))->type_common.lang_flag_1)
)
984 gfc_conv_descriptor_data_set (&cond_block, unshare_expr (dest), ptr);
985 else
986 gfc_add_modify (&cond_block, unshare_expr (dest),
987 fold_convert (TREE_TYPE (dest), ptr)fold_convert_loc (((location_t) 0), ((contains_struct_check (
(dest), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 987, __FUNCTION__))->typed.type), ptr)
);
988
989 tree srcptr = GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 989, __FUNCTION__))->type_common.lang_flag_1)
990 ? gfc_conv_descriptor_data_get (src) : src;
991 srcptr = unshare_expr (srcptr);
992 srcptr = fold_convert (pvoid_type_node, srcptr)fold_convert_loc (((location_t) 0), pvoid_type_node, srcptr);
993 call = build_call_expr_loc (input_location,
994 builtin_decl_explicit (BUILT_IN_MEMCPY), 3, ptr,
995 srcptr, size);
996 gfc_add_expr_to_block (&cond_block, fold_convert (void_type_node, call)fold_convert_loc (((location_t) 0), global_trees[TI_VOID_TYPE
], call)
);
997 if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 997, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 997, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 997, __FUNCTION__)))
))
998 {
999 tree tem = gfc_walk_alloc_comps (src, dest,
1000 OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1000, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1000, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1000, __FUNCTION__)))
,
1001 WALK_ALLOC_COMPS_COPY_CTOR);
1002 gfc_add_expr_to_block (&cond_block, tem);
1003 }
1004 then_b = gfc_finish_block (&cond_block);
1005
1006 gfc_init_block (&cond_block);
1007 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1007, __FUNCTION__))->type_common.lang_flag_1)
)
1008 gfc_conv_descriptor_data_set (&cond_block, unshare_expr (dest),
1009 null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
1010 else
1011 gfc_add_modify (&cond_block, unshare_expr (dest),
1012 build_zero_cst (TREE_TYPE (dest)((contains_struct_check ((dest), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1012, __FUNCTION__))->typed.type)
));
1013 else_b = gfc_finish_block (&cond_block);
1014
1015 cond = fold_build2_loc (input_location, NE_EXPR, logical_type_node,
1016 unshare_expr (srcptr), null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
1017 gfc_add_expr_to_block (&block,
1018 build3_loc (input_location, COND_EXPR,
1019 void_type_nodeglobal_trees[TI_VOID_TYPE], cond, then_b, else_b));
1020 /* Avoid -W*uninitialized warnings. */
1021 if (DECL_P (dest)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (dest)->base.code))] == tcc_declaration)
)
1022 suppress_warning (dest, OPT_Wuninitialized);
1023
1024 return gfc_finish_block (&block);
1025}
1026
1027/* Similarly, except use an intrinsic or pointer assignment operator
1028 instead. */
1029
1030tree
1031gfc_omp_clause_assign_op (tree clause, tree dest, tree src)
1032{
1033 tree type = TREE_TYPE (dest)((contains_struct_check ((dest), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1033, __FUNCTION__))->typed.type)
, ptr, size, call, nonalloc;
1034 tree cond, then_b, else_b;
1035 stmtblock_t block, cond_block, cond_block2, inner_block;
1036
1037 if ((! GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1037, __FUNCTION__))->type_common.lang_flag_1)
1038 || GFC_TYPE_ARRAY_AKIND (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1038, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
!= GFC_ARRAY_ALLOCATABLE)
1039 && (!GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause))(((contains_struct_check (((*(omp_clause_elt_check (((omp_clause_range_check
(((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1039, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1039, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1039, __FUNCTION__)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1039, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
(((*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1039, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1039, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1039, __FUNCTION__)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1039, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
1040 || !POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || (
(enum tree_code) (type)->base.code) == REFERENCE_TYPE)
))
1041 {
1042 if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1042, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1042, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1042, __FUNCTION__)))
))
1043 {
1044 gfc_start_block (&block);
1045 /* First dealloc any allocatable components in DEST. */
1046 tree tem = gfc_walk_alloc_comps (dest, NULL_TREE(tree) __null,
1047 OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1047, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1047, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1047, __FUNCTION__)))
,
1048 WALK_ALLOC_COMPS_DTOR);
1049 gfc_add_expr_to_block (&block, tem);
1050 /* Then copy over toplevel data. */
1051 gfc_add_modify (&block, dest, src);
1052 /* Finally allocate any allocatable components and copy. */
1053 tem = gfc_walk_alloc_comps (src, dest, OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1053, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1053, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1053, __FUNCTION__)))
,
1054 WALK_ALLOC_COMPS_COPY_CTOR);
1055 gfc_add_expr_to_block (&block, tem);
1056 return gfc_finish_block (&block);
1057 }
1058 else
1059 return build2_v (MODIFY_EXPR, dest, src)fold_build2_loc (input_location, MODIFY_EXPR, global_trees[TI_VOID_TYPE
], dest, src)
;
1060 }
1061
1062 gfc_start_block (&block);
1063
1064 if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1064, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1064, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1064, __FUNCTION__)))
))
1065 {
1066 then_b = gfc_walk_alloc_comps (dest, NULL_TREE(tree) __null, OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1066, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1066, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1066, __FUNCTION__)))
,
1067 WALK_ALLOC_COMPS_DTOR);
1068 tree tem = fold_convert (pvoid_type_node,fold_convert_loc (((location_t) 0), pvoid_type_node, ((tree_class_check
((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1069, __FUNCTION__))->type_common.lang_flag_1) ? gfc_conv_descriptor_data_get
(dest) : dest)
1069 GFC_DESCRIPTOR_TYPE_P (type)fold_convert_loc (((location_t) 0), pvoid_type_node, ((tree_class_check
((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1069, __FUNCTION__))->type_common.lang_flag_1) ? gfc_conv_descriptor_data_get
(dest) : dest)
1070 ? gfc_conv_descriptor_data_get (dest) : dest)fold_convert_loc (((location_t) 0), pvoid_type_node, ((tree_class_check
((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1069, __FUNCTION__))->type_common.lang_flag_1) ? gfc_conv_descriptor_data_get
(dest) : dest)
;
1071 tem = unshare_expr (tem);
1072 cond = fold_build2_loc (input_location, NE_EXPR, logical_type_node,
1073 tem, null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
1074 tem = build3_loc (input_location, COND_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE], cond,
1075 then_b, build_empty_stmt (input_location));
1076 gfc_add_expr_to_block (&block, tem);
1077 }
1078
1079 gfc_init_block (&cond_block);
1080
1081 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1081, __FUNCTION__))->type_common.lang_flag_1)
)
1082 {
1083 tree rank = gfc_rank_cst[GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1083, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
- 1];
1084 size = gfc_conv_descriptor_ubound_get (src, rank);
1085 size = fold_build2_loc (input_location, MINUS_EXPR, gfc_array_index_type,
1086 size,
1087 gfc_conv_descriptor_lbound_get (src, rank));
1088 size = fold_build2_loc (input_location, PLUS_EXPR, gfc_array_index_type,
1089 size, gfc_index_one_nodegfc_rank_cst[1]);
1090 if (GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1090, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
> 1)
1091 size = fold_build2_loc (input_location, MULT_EXPR,
1092 gfc_array_index_type, size,
1093 gfc_conv_descriptor_stride_get (src, rank));
1094 tree esize = fold_convert (gfc_array_index_type,fold_convert_loc (((location_t) 0), gfc_array_index_type, ((tree_class_check
((gfc_get_element_type (type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1095, __FUNCTION__))->type_common.size_unit))
1095 TYPE_SIZE_UNIT (gfc_get_element_type (type)))fold_convert_loc (((location_t) 0), gfc_array_index_type, ((tree_class_check
((gfc_get_element_type (type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1095, __FUNCTION__))->type_common.size_unit))
;
1096 size = fold_build2_loc (input_location, MULT_EXPR, gfc_array_index_type,
1097 size, esize);
1098 size = unshare_expr (size);
1099 size = gfc_evaluate_now (fold_convert (size_type_node, size)fold_convert_loc (((location_t) 0), global_trees[TI_SIZE_TYPE
], size)
,
1100 &cond_block);
1101 }
1102 else
1103 size = fold_convert (size_type_node, TYPE_SIZE_UNIT (TREE_TYPE (type)))fold_convert_loc (((location_t) 0), global_trees[TI_SIZE_TYPE
], ((tree_class_check ((((contains_struct_check ((type), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1103, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1103, __FUNCTION__))->type_common.size_unit))
;
1104 ptr = gfc_create_var (pvoid_type_node, NULL__null);
1105
1106 tree destptr = GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1106, __FUNCTION__))->type_common.lang_flag_1)
1107 ? gfc_conv_descriptor_data_get (dest) : dest;
1108 destptr = unshare_expr (destptr);
1109 destptr = fold_convert (pvoid_type_node, destptr)fold_convert_loc (((location_t) 0), pvoid_type_node, destptr);
1110 gfc_add_modify (&cond_block, ptr, destptr);
1111
1112 nonalloc = fold_build2_loc (input_location, EQ_EXPR, logical_type_node,
1113 destptr, null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
1114 cond = nonalloc;
1115 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1115, __FUNCTION__))->type_common.lang_flag_1)
)
1116 {
1117 int i;
1118 for (i = 0; i < GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1118, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
; i++)
1119 {
1120 tree rank = gfc_rank_cst[i];
1121 tree tem = gfc_conv_descriptor_ubound_get (src, rank);
1122 tem = fold_build2_loc (input_location, MINUS_EXPR,
1123 gfc_array_index_type, tem,
1124 gfc_conv_descriptor_lbound_get (src, rank));
1125 tem = fold_build2_loc (input_location, PLUS_EXPR,
1126 gfc_array_index_type, tem,
1127 gfc_conv_descriptor_lbound_get (dest, rank));
1128 tem = fold_build2_loc (input_location, NE_EXPR, logical_type_node,
1129 tem, gfc_conv_descriptor_ubound_get (dest,
1130 rank));
1131 cond = fold_build2_loc (input_location, TRUTH_ORIF_EXPR,
1132 logical_type_node, cond, tem);
1133 }
1134 }
1135
1136 gfc_init_block (&cond_block2);
1137
1138 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1138, __FUNCTION__))->type_common.lang_flag_1)
)
1139 {
1140 gfc_init_block (&inner_block);
1141 gfc_allocate_using_malloc (&inner_block, ptr, size, NULL_TREE(tree) __null);
1142 then_b = gfc_finish_block (&inner_block);
1143
1144 gfc_init_block (&inner_block);
1145 gfc_add_modify (&inner_block, ptr,
1146 gfc_call_realloc (&inner_block, ptr, size));
1147 else_b = gfc_finish_block (&inner_block);
1148
1149 gfc_add_expr_to_block (&cond_block2,
1150 build3_loc (input_location, COND_EXPR,
1151 void_type_nodeglobal_trees[TI_VOID_TYPE],
1152 unshare_expr (nonalloc),
1153 then_b, else_b));
1154 gfc_add_modify (&cond_block2, dest, src);
1155 gfc_conv_descriptor_data_set (&cond_block2, unshare_expr (dest), ptr);
1156 }
1157 else
1158 {
1159 gfc_allocate_using_malloc (&cond_block2, ptr, size, NULL_TREE(tree) __null);
1160 gfc_add_modify (&cond_block2, unshare_expr (dest),
1161 fold_convert (type, ptr)fold_convert_loc (((location_t) 0), type, ptr));
1162 }
1163 then_b = gfc_finish_block (&cond_block2);
1164 else_b = build_empty_stmt (input_location);
1165
1166 gfc_add_expr_to_block (&cond_block,
1167 build3_loc (input_location, COND_EXPR,
1168 void_type_nodeglobal_trees[TI_VOID_TYPE], unshare_expr (cond),
1169 then_b, else_b));
1170
1171 tree srcptr = GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1171, __FUNCTION__))->type_common.lang_flag_1)
1172 ? gfc_conv_descriptor_data_get (src) : src;
1173 srcptr = unshare_expr (srcptr);
1174 srcptr = fold_convert (pvoid_type_node, srcptr)fold_convert_loc (((location_t) 0), pvoid_type_node, srcptr);
1175 call = build_call_expr_loc (input_location,
1176 builtin_decl_explicit (BUILT_IN_MEMCPY), 3, ptr,
1177 srcptr, size);
1178 gfc_add_expr_to_block (&cond_block, fold_convert (void_type_node, call)fold_convert_loc (((location_t) 0), global_trees[TI_VOID_TYPE
], call)
);
1179 if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1179, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1179, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1179, __FUNCTION__)))
))
1180 {
1181 tree tem = gfc_walk_alloc_comps (src, dest,
1182 OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1182, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1182, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1182, __FUNCTION__)))
,
1183 WALK_ALLOC_COMPS_COPY_CTOR);
1184 gfc_add_expr_to_block (&cond_block, tem);
1185 }
1186 then_b = gfc_finish_block (&cond_block);
1187
1188 if (OMP_CLAUSE_CODE (clause)((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1188, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code
== OMP_CLAUSE_COPYIN)
1189 {
1190 gfc_init_block (&cond_block);
1191 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1191, __FUNCTION__))->type_common.lang_flag_1)
)
1192 {
1193 tree tmp = gfc_conv_descriptor_data_get (unshare_expr (dest));
1194 tmp = gfc_deallocate_with_status (tmp, NULL_TREE(tree) __null, NULL_TREE(tree) __null,
1195 NULL_TREE(tree) __null, NULL_TREE(tree) __null, true, NULL__null,
1196 GFC_CAF_COARRAY_NOCOARRAY);
1197 gfc_add_expr_to_block (&cond_block, tmp);
1198 }
1199 else
1200 {
1201 destptr = gfc_evaluate_now (destptr, &cond_block);
1202 gfc_add_expr_to_block (&cond_block, gfc_call_free (destptr));
1203 gfc_add_modify (&cond_block, unshare_expr (dest),
1204 build_zero_cst (TREE_TYPE (dest)((contains_struct_check ((dest), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1204, __FUNCTION__))->typed.type)
));
1205 }
1206 else_b = gfc_finish_block (&cond_block);
1207
1208 cond = fold_build2_loc (input_location, NE_EXPR, logical_type_node,
1209 unshare_expr (srcptr), null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
1210 gfc_add_expr_to_block (&block,
1211 build3_loc (input_location, COND_EXPR,
1212 void_type_nodeglobal_trees[TI_VOID_TYPE], cond,
1213 then_b, else_b));
1214 }
1215 else
1216 gfc_add_expr_to_block (&block, then_b);
1217
1218 return gfc_finish_block (&block);
1219}
1220
1221static void
1222gfc_omp_linear_clause_add_loop (stmtblock_t *block, tree dest, tree src,
1223 tree add, tree nelems)
1224{
1225 stmtblock_t tmpblock;
1226 tree desta, srca, index = gfc_create_var (gfc_array_index_type, "S");
1227 nelems = gfc_evaluate_now (nelems, block);
1228
1229 gfc_init_block (&tmpblock);
1230 if (TREE_CODE (TREE_TYPE (dest))((enum tree_code) (((contains_struct_check ((dest), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1230, __FUNCTION__))->typed.type))->base.code)
== ARRAY_TYPE)
1231 {
1232 desta = gfc_build_array_ref (dest, index, NULL__null);
1233 srca = gfc_build_array_ref (src, index, NULL__null);
1234 }
1235 else
1236 {
1237 gcc_assert (POINTER_TYPE_P (TREE_TYPE (dest)))((void)(!((((enum tree_code) (((contains_struct_check ((dest)
, (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1237, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((dest), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1237, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1237, __FUNCTION__), 0 : 0))
;
1238 tree idx = fold_build2 (MULT_EXPR, sizetype,fold_build2_loc (((location_t) 0), MULT_EXPR, sizetype_tab[(int
) stk_sizetype], fold_convert_loc (((location_t) 0), sizetype_tab
[(int) stk_sizetype], index), ((tree_class_check ((((contains_struct_check
((((contains_struct_check ((dest), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1240, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1240, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1240, __FUNCTION__))->type_common.size_unit) )
1239 fold_convert (sizetype, index),fold_build2_loc (((location_t) 0), MULT_EXPR, sizetype_tab[(int
) stk_sizetype], fold_convert_loc (((location_t) 0), sizetype_tab
[(int) stk_sizetype], index), ((tree_class_check ((((contains_struct_check
((((contains_struct_check ((dest), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1240, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1240, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1240, __FUNCTION__))->type_common.size_unit) )
1240 TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (dest))))fold_build2_loc (((location_t) 0), MULT_EXPR, sizetype_tab[(int
) stk_sizetype], fold_convert_loc (((location_t) 0), sizetype_tab
[(int) stk_sizetype], index), ((tree_class_check ((((contains_struct_check
((((contains_struct_check ((dest), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1240, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1240, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1240, __FUNCTION__))->type_common.size_unit) )
;
1241 desta = build_fold_indirect_ref (fold_build2 (POINTER_PLUS_EXPR,build_fold_indirect_ref_loc (((location_t) 0), fold_build2_loc
(((location_t) 0), POINTER_PLUS_EXPR, ((contains_struct_check
((dest), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1242, __FUNCTION__))->typed.type), dest, idx ))
1242 TREE_TYPE (dest), dest,build_fold_indirect_ref_loc (((location_t) 0), fold_build2_loc
(((location_t) 0), POINTER_PLUS_EXPR, ((contains_struct_check
((dest), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1242, __FUNCTION__))->typed.type), dest, idx ))
1243 idx))build_fold_indirect_ref_loc (((location_t) 0), fold_build2_loc
(((location_t) 0), POINTER_PLUS_EXPR, ((contains_struct_check
((dest), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1242, __FUNCTION__))->typed.type), dest, idx ))
;
1244 srca = build_fold_indirect_ref (fold_build2 (POINTER_PLUS_EXPR,build_fold_indirect_ref_loc (((location_t) 0), fold_build2_loc
(((location_t) 0), POINTER_PLUS_EXPR, ((contains_struct_check
((src), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1245, __FUNCTION__))->typed.type), src, idx ))
1245 TREE_TYPE (src), src,build_fold_indirect_ref_loc (((location_t) 0), fold_build2_loc
(((location_t) 0), POINTER_PLUS_EXPR, ((contains_struct_check
((src), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1245, __FUNCTION__))->typed.type), src, idx ))
1246 idx))build_fold_indirect_ref_loc (((location_t) 0), fold_build2_loc
(((location_t) 0), POINTER_PLUS_EXPR, ((contains_struct_check
((src), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1245, __FUNCTION__))->typed.type), src, idx ))
;
1247 }
1248 gfc_add_modify (&tmpblock, desta,
1249 fold_build2 (PLUS_EXPR, TREE_TYPE (desta),fold_build2_loc (((location_t) 0), PLUS_EXPR, ((contains_struct_check
((desta), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1249, __FUNCTION__))->typed.type), srca, add )
1250 srca, add)fold_build2_loc (((location_t) 0), PLUS_EXPR, ((contains_struct_check
((desta), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1249, __FUNCTION__))->typed.type), srca, add )
);
1251
1252 gfc_loopinfo loop;
1253 gfc_init_loopinfo (&loop);
1254 loop.dimen = 1;
1255 loop.from[0] = gfc_index_zero_nodegfc_rank_cst[0];
1256 loop.loopvar[0] = index;
1257 loop.to[0] = nelems;
1258 gfc_trans_scalarizing_loops (&loop, &tmpblock);
1259 gfc_add_block_to_block (block, &loop.pre);
1260}
1261
1262/* Build and return code for a constructor of DEST that initializes
1263 it to SRC plus ADD (ADD is scalar integer). */
1264
1265tree
1266gfc_omp_clause_linear_ctor (tree clause, tree dest, tree src, tree add)
1267{
1268 tree type = TREE_TYPE (dest)((contains_struct_check ((dest), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1268, __FUNCTION__))->typed.type)
, ptr, size, nelems = NULL_TREE(tree) __null;
1269 stmtblock_t block;
1270
1271 gcc_assert (OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_LINEAR)((void)(!(((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1271, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_LINEAR
) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1271, __FUNCTION__), 0 : 0))
;
1272
1273 gfc_start_block (&block);
1274 add = gfc_evaluate_now (add, &block);
1275
1276 if ((! GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1276, __FUNCTION__))->type_common.lang_flag_1)
1277 || GFC_TYPE_ARRAY_AKIND (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1277, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
!= GFC_ARRAY_ALLOCATABLE)
1278 && (!GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause))(((contains_struct_check (((*(omp_clause_elt_check (((omp_clause_range_check
(((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1278, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1278, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1278, __FUNCTION__)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1278, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
(((*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1278, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1278, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1278, __FUNCTION__)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1278, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
1279 || !POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || (
(enum tree_code) (type)->base.code) == REFERENCE_TYPE)
))
1280 {
1281 bool compute_nelts = false;
1282 gcc_assert (TREE_CODE (type) == ARRAY_TYPE)((void)(!(((enum tree_code) (type)->base.code) == ARRAY_TYPE
) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1282, __FUNCTION__), 0 : 0))
;
1283 if (!TYPE_DOMAIN (type)((tree_check ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1283, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
1284 || TYPE_MAX_VALUE (TYPE_DOMAIN (type))((tree_check5 ((((tree_check ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1284, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1284, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)
== NULL_TREE(tree) __null
1285 || TYPE_MIN_VALUE (TYPE_DOMAIN (type))((tree_check5 ((((tree_check ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1285, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1285, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.minval
)
== error_mark_nodeglobal_trees[TI_ERROR_MARK]
1286 || TYPE_MAX_VALUE (TYPE_DOMAIN (type))((tree_check5 ((((tree_check ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1286, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1286, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)
== error_mark_nodeglobal_trees[TI_ERROR_MARK])
1287 compute_nelts = true;
1288 else if (VAR_P (TYPE_MAX_VALUE (TYPE_DOMAIN (type)))(((enum tree_code) (((tree_check5 ((((tree_check ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1288, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1288, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
))->base.code) == VAR_DECL)
)
1289 {
1290 tree a = DECL_ATTRIBUTES (TYPE_MAX_VALUE (TYPE_DOMAIN (type)))((contains_struct_check ((((tree_check5 ((((tree_check ((type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1290, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1290, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1290, __FUNCTION__))->decl_common.attributes)
;
1291 if (lookup_attribute ("omp dummy var", a))
1292 compute_nelts = true;
1293 }
1294 if (compute_nelts)
1295 {
1296 nelems = fold_build2 (EXACT_DIV_EXPR, sizetype,fold_build2_loc (((location_t) 0), EXACT_DIV_EXPR, sizetype_tab
[(int) stk_sizetype], ((tree_class_check ((type), (tcc_type),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1297, __FUNCTION__))->type_common.size_unit), ((tree_class_check
((((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1298, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1298, __FUNCTION__))->type_common.size_unit) )
1297 TYPE_SIZE_UNIT (type),fold_build2_loc (((location_t) 0), EXACT_DIV_EXPR, sizetype_tab
[(int) stk_sizetype], ((tree_class_check ((type), (tcc_type),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1297, __FUNCTION__))->type_common.size_unit), ((tree_class_check
((((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1298, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1298, __FUNCTION__))->type_common.size_unit) )
1298 TYPE_SIZE_UNIT (TREE_TYPE (type)))fold_build2_loc (((location_t) 0), EXACT_DIV_EXPR, sizetype_tab
[(int) stk_sizetype], ((tree_class_check ((type), (tcc_type),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1297, __FUNCTION__))->type_common.size_unit), ((tree_class_check
((((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1298, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1298, __FUNCTION__))->type_common.size_unit) )
;
1299 nelems = size_binop (MINUS_EXPR, nelems, size_one_node)size_binop_loc (((location_t) 0), MINUS_EXPR, nelems, global_trees
[TI_SIZE_ONE])
;
1300 }
1301 else
1302 nelems = array_type_nelts (type);
1303 nelems = fold_convert (gfc_array_index_type, nelems)fold_convert_loc (((location_t) 0), gfc_array_index_type, nelems
)
;
1304
1305 gfc_omp_linear_clause_add_loop (&block, dest, src, add, nelems);
1306 return gfc_finish_block (&block);
1307 }
1308
1309 /* Allocatable arrays in LINEAR clauses need to be allocated
1310 and copied from SRC. */
1311 gfc_add_modify (&block, dest, src);
1312 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1312, __FUNCTION__))->type_common.lang_flag_1)
)
1313 {
1314 tree rank = gfc_rank_cst[GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1314, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
- 1];
1315 size = gfc_conv_descriptor_ubound_get (dest, rank);
1316 size = fold_build2_loc (input_location, MINUS_EXPR, gfc_array_index_type,
1317 size,
1318 gfc_conv_descriptor_lbound_get (dest, rank));
1319 size = fold_build2_loc (input_location, PLUS_EXPR, gfc_array_index_type,
1320 size, gfc_index_one_nodegfc_rank_cst[1]);
1321 if (GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1321, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
> 1)
1322 size = fold_build2_loc (input_location, MULT_EXPR,
1323 gfc_array_index_type, size,
1324 gfc_conv_descriptor_stride_get (dest, rank));
1325 tree esize = fold_convert (gfc_array_index_type,fold_convert_loc (((location_t) 0), gfc_array_index_type, ((tree_class_check
((gfc_get_element_type (type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1326, __FUNCTION__))->type_common.size_unit))
1326 TYPE_SIZE_UNIT (gfc_get_element_type (type)))fold_convert_loc (((location_t) 0), gfc_array_index_type, ((tree_class_check
((gfc_get_element_type (type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1326, __FUNCTION__))->type_common.size_unit))
;
1327 nelems = gfc_evaluate_now (unshare_expr (size), &block);
1328 size = fold_build2_loc (input_location, MULT_EXPR, gfc_array_index_type,
1329 nelems, unshare_expr (esize));
1330 size = gfc_evaluate_now (fold_convert (size_type_node, size)fold_convert_loc (((location_t) 0), global_trees[TI_SIZE_TYPE
], size)
,
1331 &block);
1332 nelems = fold_build2_loc (input_location, MINUS_EXPR,
1333 gfc_array_index_type, nelems,
1334 gfc_index_one_nodegfc_rank_cst[1]);
1335 }
1336 else
1337 size = fold_convert (size_type_node, TYPE_SIZE_UNIT (TREE_TYPE (type)))fold_convert_loc (((location_t) 0), global_trees[TI_SIZE_TYPE
], ((tree_class_check ((((contains_struct_check ((type), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1337, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1337, __FUNCTION__))->type_common.size_unit))
;
1338 ptr = gfc_create_var (pvoid_type_node, NULL__null);
1339 gfc_allocate_using_malloc (&block, ptr, size, NULL_TREE(tree) __null);
1340 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1340, __FUNCTION__))->type_common.lang_flag_1)
)
1341 {
1342 gfc_conv_descriptor_data_set (&block, unshare_expr (dest), ptr);
1343 tree etype = gfc_get_element_type (type);
1344 ptr = fold_convert (build_pointer_type (etype), ptr)fold_convert_loc (((location_t) 0), build_pointer_type (etype
), ptr)
;
1345 tree srcptr = gfc_conv_descriptor_data_get (unshare_expr (src));
1346 srcptr = fold_convert (build_pointer_type (etype), srcptr)fold_convert_loc (((location_t) 0), build_pointer_type (etype
), srcptr)
;
1347 gfc_omp_linear_clause_add_loop (&block, ptr, srcptr, add, nelems);
1348 }
1349 else
1350 {
1351 gfc_add_modify (&block, unshare_expr (dest),
1352 fold_convert (TREE_TYPE (dest), ptr)fold_convert_loc (((location_t) 0), ((contains_struct_check (
(dest), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1352, __FUNCTION__))->typed.type), ptr)
);
1353 ptr = fold_convert (TREE_TYPE (dest), ptr)fold_convert_loc (((location_t) 0), ((contains_struct_check (
(dest), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1353, __FUNCTION__))->typed.type), ptr)
;
1354 tree dstm = build_fold_indirect_ref (ptr)build_fold_indirect_ref_loc (((location_t) 0), ptr);
1355 tree srcm = build_fold_indirect_ref (unshare_expr (src))build_fold_indirect_ref_loc (((location_t) 0), unshare_expr (
src))
;
1356 gfc_add_modify (&block, dstm,
1357 fold_build2 (PLUS_EXPR, TREE_TYPE (add), srcm, add)fold_build2_loc (((location_t) 0), PLUS_EXPR, ((contains_struct_check
((add), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1357, __FUNCTION__))->typed.type), srcm, add )
);
1358 }
1359 return gfc_finish_block (&block);
1360}
1361
1362/* Build and return code destructing DECL. Return NULL if nothing
1363 to be done. */
1364
1365tree
1366gfc_omp_clause_dtor (tree clause, tree decl)
1367{
1368 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1368, __FUNCTION__))->typed.type)
, tem;
1369 tree decl_type = TREE_TYPE (OMP_CLAUSE_DECL (clause))((contains_struct_check (((*(omp_clause_elt_check (((omp_clause_range_check
(((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1369, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1369, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1369, __FUNCTION__)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1369, __FUNCTION__))->typed.type)
;
1370
1371 /* Only pointer was privatized; cf. gfc_omp_clause_copy_ctor. */
1372 if (DECL_P (OMP_CLAUSE_DECL (clause))(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) ((*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1372, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1372, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1372, __FUNCTION__))))->base.code))] == tcc_declaration)
1373 && GFC_DECL_ASSOCIATE_VAR_P (OMP_CLAUSE_DECL (clause))((contains_struct_check (((*(omp_clause_elt_check (((omp_clause_range_check
(((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1373, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1373, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1373, __FUNCTION__)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1373, __FUNCTION__))->decl_common.lang_flag_7)
)
1374 return NULL_TREE(tree) __null;
1375
1376 if (DECL_ARTIFICIAL (OMP_CLAUSE_DECL (clause))((contains_struct_check (((*(omp_clause_elt_check (((omp_clause_range_check
(((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1376, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1376, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1376, __FUNCTION__)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1376, __FUNCTION__))->decl_common.artificial_flag)
1377 && DECL_LANG_SPECIFIC (OMP_CLAUSE_DECL (clause))((contains_struct_check (((*(omp_clause_elt_check (((omp_clause_range_check
(((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1377, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1377, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1377, __FUNCTION__)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1377, __FUNCTION__))->decl_common.lang_specific)
1378 && GFC_DECL_SAVED_DESCRIPTOR (OMP_CLAUSE_DECL (clause))(((contains_struct_check (((*(omp_clause_elt_check (((omp_clause_range_check
(((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1378, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1378, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1378, __FUNCTION__)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1378, __FUNCTION__))->decl_common.lang_specific)->saved_descriptor
)
)
1379 decl_type
1380 = TREE_TYPE (GFC_DECL_SAVED_DESCRIPTOR (OMP_CLAUSE_DECL (clause)))((contains_struct_check (((((contains_struct_check (((*(omp_clause_elt_check
(((omp_clause_range_check (((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1380, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1380, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1380, __FUNCTION__)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1380, __FUNCTION__))->decl_common.lang_specific)->saved_descriptor
)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1380, __FUNCTION__))->typed.type)
;
1381 if (gfc_is_polymorphic_nonptr (decl_type))
1382 {
1383 if (POINTER_TYPE_P (decl_type)(((enum tree_code) (decl_type)->base.code) == POINTER_TYPE
|| ((enum tree_code) (decl_type)->base.code) == REFERENCE_TYPE
)
)
1384 decl_type = TREE_TYPE (decl_type)((contains_struct_check ((decl_type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1384, __FUNCTION__))->typed.type)
;
1385 decl_type = TREE_TYPE (TYPE_FIELDS (decl_type))((contains_struct_check ((((tree_check3 ((decl_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1385, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1385, __FUNCTION__))->typed.type)
;
1386 if (GFC_DESCRIPTOR_TYPE_P (decl_type)((tree_class_check ((decl_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1386, __FUNCTION__))->type_common.lang_flag_1)
|| GFC_ARRAY_TYPE_P (decl_type)((tree_class_check ((decl_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1386, __FUNCTION__))->type_common.lang_flag_2)
)
1387 fatal_error (input_location,
1388 "Sorry, polymorphic arrays not yet supported for "
1389 "firstprivate");
1390 stmtblock_t block, cond_block;
1391 gfc_start_block (&block);
1392 gfc_init_block (&cond_block);
1393 tree final = gfc_class_vtab_final_get (decl);
1394 tree size = fold_convert (size_type_node, gfc_class_vtab_size_get (decl))fold_convert_loc (((location_t) 0), global_trees[TI_SIZE_TYPE
], gfc_class_vtab_size_get (decl))
;
1395 gfc_se se;
1396 gfc_init_se (&se, NULL__null);
1397 symbol_attribute attr = {};
1398 tree data = gfc_class_data_get (decl);
1399 tree desc = gfc_conv_scalar_to_descriptor (&se, data, attr);
1400
1401 /* Call class->_vpt->_finalize + free. */
1402 tree call = build_fold_indirect_ref (final)build_fold_indirect_ref_loc (((location_t) 0), final);
1403 call = build_call_expr_loc (input_location, call, 3,
1404 gfc_build_addr_expr (NULL__null, desc),
1405 size, boolean_false_nodeglobal_trees[TI_BOOLEAN_FALSE]);
1406 gfc_add_block_to_block (&cond_block, &se.pre);
1407 gfc_add_expr_to_block (&cond_block, fold_convert (void_type_node, call)fold_convert_loc (((location_t) 0), global_trees[TI_VOID_TYPE
], call)
);
1408 gfc_add_block_to_block (&cond_block, &se.post);
1409 /* Create: if (_vtab && _final) <cond_block> */
1410 tree cond = fold_build2_loc (input_location, NE_EXPR, boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE],
1411 gfc_class_vptr_get (decl),
1412 null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
1413 tree cond2 = fold_build2_loc (input_location, NE_EXPR, boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE],
1414 final, null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
1415 cond = fold_build2_loc (input_location, TRUTH_ANDIF_EXPR,
1416 boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE], cond, cond2);
1417 gfc_add_expr_to_block (&block, build3_loc (input_location, COND_EXPR,
1418 void_type_nodeglobal_trees[TI_VOID_TYPE], cond,
1419 gfc_finish_block (&cond_block), NULL_TREE(tree) __null));
1420 call = builtin_decl_explicit (BUILT_IN_FREE);
1421 call = build_call_expr_loc (input_location, call, 1, data);
1422 gfc_add_expr_to_block (&block, fold_convert (void_type_node, call)fold_convert_loc (((location_t) 0), global_trees[TI_VOID_TYPE
], call)
);
1423 return gfc_finish_block (&block);
1424 }
1425
1426 if ((! GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1426, __FUNCTION__))->type_common.lang_flag_1)
1427 || GFC_TYPE_ARRAY_AKIND (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1427, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
!= GFC_ARRAY_ALLOCATABLE)
1428 && (!GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause))(((contains_struct_check (((*(omp_clause_elt_check (((omp_clause_range_check
(((tree_check ((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1428, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1428, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1428, __FUNCTION__)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1428, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
(((*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1428, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1428, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1428, __FUNCTION__)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1428, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
1429 || !POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || (
(enum tree_code) (type)->base.code) == REFERENCE_TYPE)
))
1430 {
1431 if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1431, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1431, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1431, __FUNCTION__)))
))
1432 return gfc_walk_alloc_comps (decl, NULL_TREE(tree) __null,
1433 OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1433, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1433, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1433, __FUNCTION__)))
,
1434 WALK_ALLOC_COMPS_DTOR);
1435 return NULL_TREE(tree) __null;
1436 }
1437
1438 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1438, __FUNCTION__))->type_common.lang_flag_1)
)
1439 {
1440 /* Allocatable arrays in FIRSTPRIVATE/LASTPRIVATE etc. clauses need
1441 to be deallocated if they were allocated. */
1442 tem = gfc_conv_descriptor_data_get (decl);
1443 tem = gfc_deallocate_with_status (tem, NULL_TREE(tree) __null, NULL_TREE(tree) __null, NULL_TREE(tree) __null,
1444 NULL_TREE(tree) __null, true, NULL__null,
1445 GFC_CAF_COARRAY_NOCOARRAY);
1446 }
1447 else
1448 tem = gfc_call_free (decl);
1449 tem = gfc_omp_unshare_expr (tem);
1450
1451 if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1451, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1451, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1451, __FUNCTION__)))
))
1452 {
1453 stmtblock_t block;
1454 tree then_b;
1455
1456 gfc_init_block (&block);
1457 gfc_add_expr_to_block (&block,
1458 gfc_walk_alloc_comps (decl, NULL_TREE(tree) __null,
1459 OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1459, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1459, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1459, __FUNCTION__)))
,
1460 WALK_ALLOC_COMPS_DTOR));
1461 gfc_add_expr_to_block (&block, tem);
1462 then_b = gfc_finish_block (&block);
1463
1464 tem = fold_convert (pvoid_type_node,fold_convert_loc (((location_t) 0), pvoid_type_node, ((tree_class_check
((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1465, __FUNCTION__))->type_common.lang_flag_1) ? gfc_conv_descriptor_data_get
(decl) : decl)
1465 GFC_DESCRIPTOR_TYPE_P (type)fold_convert_loc (((location_t) 0), pvoid_type_node, ((tree_class_check
((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1465, __FUNCTION__))->type_common.lang_flag_1) ? gfc_conv_descriptor_data_get
(decl) : decl)
1466 ? gfc_conv_descriptor_data_get (decl) : decl)fold_convert_loc (((location_t) 0), pvoid_type_node, ((tree_class_check
((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1465, __FUNCTION__))->type_common.lang_flag_1) ? gfc_conv_descriptor_data_get
(decl) : decl)
;
1467 tem = unshare_expr (tem);
1468 tree cond = fold_build2_loc (input_location, NE_EXPR, logical_type_node,
1469 tem, null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
1470 tem = build3_loc (input_location, COND_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE], cond,
1471 then_b, build_empty_stmt (input_location));
1472 }
1473 return tem;
1474}
1475
1476/* Build a conditional expression in BLOCK. If COND_VAL is not
1477 null, then the block THEN_B is executed, otherwise ELSE_VAL
1478 is assigned to VAL. */
1479
1480static void
1481gfc_build_cond_assign (stmtblock_t *block, tree val, tree cond_val,
1482 tree then_b, tree else_val)
1483{
1484 stmtblock_t cond_block;
1485 tree else_b = NULL_TREE(tree) __null;
1486 tree val_ty = TREE_TYPE (val)((contains_struct_check ((val), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1486, __FUNCTION__))->typed.type)
;
1487
1488 if (else_val)
1489 {
1490 gfc_init_block (&cond_block);
1491 gfc_add_modify (&cond_block, val, fold_convert (val_ty, else_val)fold_convert_loc (((location_t) 0), val_ty, else_val));
1492 else_b = gfc_finish_block (&cond_block);
1493 }
1494 gfc_add_expr_to_block (block,
1495 build3_loc (input_location, COND_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE],
1496 cond_val, then_b, else_b));
1497}
1498
1499/* Build a conditional expression in BLOCK, returning a temporary
1500 variable containing the result. If COND_VAL is not null, then
1501 THEN_VAL will be assigned to the variable, otherwise ELSE_VAL
1502 is assigned.
1503 */
1504
1505static tree
1506gfc_build_cond_assign_expr (stmtblock_t *block, tree cond_val,
1507 tree then_val, tree else_val)
1508{
1509 tree val;
1510 tree val_ty = TREE_TYPE (then_val)((contains_struct_check ((then_val), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1510, __FUNCTION__))->typed.type)
;
1511 stmtblock_t cond_block;
1512
1513 val = create_tmp_var (val_ty);
1514
1515 gfc_init_block (&cond_block);
1516 gfc_add_modify (&cond_block, val, then_val);
1517 tree then_b = gfc_finish_block (&cond_block);
1518
1519 gfc_build_cond_assign (block, val, cond_val, then_b, else_val);
1520
1521 return val;
1522}
1523
1524void
1525gfc_omp_finish_clause (tree c, gimple_seq *pre_p, bool openacc)
1526{
1527 if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1527, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code
!= OMP_CLAUSE_MAP)
1528 return;
1529
1530 tree decl = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1530, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1530, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1530, __FUNCTION__)))
;
1531
1532 /* Assumed-size arrays can't be mapped implicitly, they have to be
1533 mapped explicitly using array sections. */
1534 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == PARM_DECL
1535 && GFC_ARRAY_TYPE_P (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1535, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1535, __FUNCTION__))->type_common.lang_flag_2)
1536 && GFC_TYPE_ARRAY_AKIND (TREE_TYPE (decl))(((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1536, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1536, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_UNKNOWN
1537 && GFC_TYPE_ARRAY_UBOUND (TREE_TYPE (decl),(((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1537, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1538, __FUNCTION__))->type_with_lang_specific.lang_specific
)->ubound[(((tree_class_check ((((contains_struct_check ((
decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1538, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1538, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank) - 1])
1538 GFC_TYPE_ARRAY_RANK (TREE_TYPE (decl)) - 1)(((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1537, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1538, __FUNCTION__))->type_with_lang_specific.lang_specific
)->ubound[(((tree_class_check ((((contains_struct_check ((
decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1538, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1538, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank) - 1])
1539 == NULL__null)
1540 {
1541 error_at (OMP_CLAUSE_LOCATION (c)((tree_check ((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1541, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.locus
,
1542 "implicit mapping of assumed size array %qD", decl);
1543 return;
1544 }
1545
1546 tree c2 = NULL_TREE(tree) __null, c3 = NULL_TREE(tree) __null, c4 = NULL_TREE(tree) __null;
1547 tree present = gfc_omp_check_optional_argument (decl, true);
1548 if (POINTER_TYPE_P (TREE_TYPE (decl))(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1548, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1548, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)
)
1549 {
1550 if (!gfc_omp_privatize_by_reference (decl)
1551 && !GFC_DECL_GET_SCALAR_POINTER (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1551, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1551, __FUNCTION__))->decl_common.lang_specific)->scalar_pointer
) : 0)
1552 && !GFC_DECL_GET_SCALAR_ALLOCATABLE (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1552, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1552, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
1553 && !GFC_DECL_CRAY_POINTEE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1553, __FUNCTION__))->decl_common.lang_flag_4)
1554 && !GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (TREE_TYPE (decl)))((tree_class_check ((((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1554, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1554, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1554, __FUNCTION__))->type_common.lang_flag_1)
)
1555 return;
1556 tree orig_decl = decl;
1557
1558 c4 = build_omp_clause (OMP_CLAUSE_LOCATION (c)((tree_check ((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1558, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.locus
, OMP_CLAUSE_MAP);
1559 OMP_CLAUSE_SET_MAP_KIND (c4, GOMP_MAP_POINTER)((omp_clause_subcode_check ((c4), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1559, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_POINTER))
;
1560 OMP_CLAUSE_DECL (c4)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c4), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1560, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1560, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1560, __FUNCTION__)))
= decl;
1561 OMP_CLAUSE_SIZE (c4)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c4), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1561, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1561, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1561, __FUNCTION__)))
= size_int (0)size_int_kind (0, stk_sizetype);
1562 decl = build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
1563 if (present
1564 && (GFC_DECL_GET_SCALAR_POINTER (orig_decl)(((contains_struct_check ((orig_decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1564, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((orig_decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1564, __FUNCTION__))->decl_common.lang_specific)->scalar_pointer
) : 0)
1565 || GFC_DECL_GET_SCALAR_ALLOCATABLE (orig_decl)(((contains_struct_check ((orig_decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1565, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((orig_decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1565, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
))
1566 {
1567 c2 = build_omp_clause (input_location, OMP_CLAUSE_MAP);
1568 OMP_CLAUSE_SET_MAP_KIND (c2, GOMP_MAP_POINTER)((omp_clause_subcode_check ((c2), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1568, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_POINTER))
;
1569 OMP_CLAUSE_DECL (c2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1569, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1569, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1569, __FUNCTION__)))
= decl;
1570 OMP_CLAUSE_SIZE (c2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1570, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1570, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1570, __FUNCTION__)))
= size_int (0)size_int_kind (0, stk_sizetype);
1571
1572 stmtblock_t block;
1573 gfc_start_block (&block);
1574 tree ptr = decl;
Value stored to 'ptr' during its initialization is never read
1575 ptr = gfc_build_cond_assign_expr (&block, present, decl,
1576 null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
1577 gimplify_and_add (gfc_finish_block (&block), pre_p);
1578 ptr = build_fold_indirect_ref (ptr)build_fold_indirect_ref_loc (((location_t) 0), ptr);
1579 OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1579, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1579, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1579, __FUNCTION__)))
= ptr;
1580 OMP_CLAUSE_SIZE (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1580, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1580, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1580, __FUNCTION__)))
= TYPE_SIZE_UNIT (TREE_TYPE (ptr))((tree_class_check ((((contains_struct_check ((ptr), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1580, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1580, __FUNCTION__))->type_common.size_unit)
;
1581 }
1582 else
1583 {
1584 OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1584, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1584, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1584, __FUNCTION__)))
= decl;
1585 OMP_CLAUSE_SIZE (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1585, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1585, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1585, __FUNCTION__)))
= NULL_TREE(tree) __null;
1586 }
1587 if (TREE_CODE (TREE_TYPE (orig_decl))((enum tree_code) (((contains_struct_check ((orig_decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1587, __FUNCTION__))->typed.type))->base.code)
== REFERENCE_TYPE
1588 && (GFC_DECL_GET_SCALAR_POINTER (orig_decl)(((contains_struct_check ((orig_decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1588, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((orig_decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1588, __FUNCTION__))->decl_common.lang_specific)->scalar_pointer
) : 0)
1589 || GFC_DECL_GET_SCALAR_ALLOCATABLE (orig_decl)(((contains_struct_check ((orig_decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1589, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((orig_decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1589, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
))
1590 {
1591 c3 = build_omp_clause (OMP_CLAUSE_LOCATION (c)((tree_check ((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1591, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.locus
, OMP_CLAUSE_MAP);
1592 OMP_CLAUSE_SET_MAP_KIND (c3, GOMP_MAP_POINTER)((omp_clause_subcode_check ((c3), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1592, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_POINTER))
;
1593 OMP_CLAUSE_DECL (c3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1593, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1593, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1593, __FUNCTION__)))
= unshare_expr (decl);
1594 OMP_CLAUSE_SIZE (c3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1594, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1594, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1594, __FUNCTION__)))
= size_int (0)size_int_kind (0, stk_sizetype);
1595 decl = build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
1596 OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1596, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1596, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1596, __FUNCTION__)))
= decl;
1597 }
1598 }
1599 if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1599, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1599, __FUNCTION__))->type_common.lang_flag_1)
)
1600 {
1601 stmtblock_t block;
1602 gfc_start_block (&block);
1603 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1603, __FUNCTION__))->typed.type)
;
1604 tree ptr = gfc_conv_descriptor_data_get (decl);
1605
1606 /* OpenMP: automatically map pointer targets with the pointer;
1607 hence, always update the descriptor/pointer itself.
1608 NOTE: This also remaps the pointer for allocatable arrays with
1609 'target' attribute which also don't have the 'restrict' qualifier. */
1610 bool always_modifier = false;
1611
1612 if (!openacc
1613 && !(TYPE_QUALS (TREE_TYPE (ptr))((int) ((((tree_class_check ((((contains_struct_check ((ptr),
(TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1613, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1613, __FUNCTION__))->base.readonly_flag) * TYPE_QUAL_CONST
) | (((tree_class_check ((((contains_struct_check ((ptr), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1613, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1613, __FUNCTION__))->base.volatile_flag) * TYPE_QUAL_VOLATILE
) | (((tree_class_check ((((contains_struct_check ((ptr), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1613, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1613, __FUNCTION__))->base.u.bits.atomic_flag) * TYPE_QUAL_ATOMIC
) | (((tree_class_check ((((contains_struct_check ((ptr), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1613, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1613, __FUNCTION__))->type_common.restrict_flag) * TYPE_QUAL_RESTRICT
) | (((((tree_class_check ((((contains_struct_check ((ptr), (
TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1613, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1613, __FUNCTION__))->base.u.bits.address_space) & 0xFF
) << 8))))
& TYPE_QUAL_RESTRICT))
1614 always_modifier = true;
1615
1616 if (present)
1617 ptr = gfc_build_cond_assign_expr (&block, present, ptr,
1618 null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
1619 gcc_assert (POINTER_TYPE_P (TREE_TYPE (ptr)))((void)(!((((enum tree_code) (((contains_struct_check ((ptr),
(TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1619, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((ptr), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1619, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1619, __FUNCTION__), 0 : 0))
;
1620 ptr = build_fold_indirect_ref (ptr)build_fold_indirect_ref_loc (((location_t) 0), ptr);
1621 OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1621, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1621, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1621, __FUNCTION__)))
= ptr;
1622 c2 = build_omp_clause (input_location, OMP_CLAUSE_MAP);
1623 OMP_CLAUSE_SET_MAP_KIND (c2, GOMP_MAP_TO_PSET)((omp_clause_subcode_check ((c2), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1623, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_TO_PSET))
;
1624 if (present)
1625 {
1626 ptr = create_tmp_var (TREE_TYPE (TREE_OPERAND (decl, 0))((contains_struct_check (((*((const_cast<tree*> (tree_operand_check
((decl), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1626, __FUNCTION__)))))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1626, __FUNCTION__))->typed.type)
);
1627 gfc_add_modify (&block, ptr, TREE_OPERAND (decl, 0)(*((const_cast<tree*> (tree_operand_check ((decl), (0),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1627, __FUNCTION__)))))
);
1628
1629 OMP_CLAUSE_DECL (c2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1629, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1629, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1629, __FUNCTION__)))
= build_fold_indirect_ref (ptr)build_fold_indirect_ref_loc (((location_t) 0), ptr);
1630 }
1631 else
1632 OMP_CLAUSE_DECL (c2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1632, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1632, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1632, __FUNCTION__)))
= decl;
1633 OMP_CLAUSE_SIZE (c2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1633, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1633, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1633, __FUNCTION__)))
= TYPE_SIZE_UNIT (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1633, __FUNCTION__))->type_common.size_unit)
;
1634 c3 = build_omp_clause (OMP_CLAUSE_LOCATION (c)((tree_check ((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1634, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.locus
, OMP_CLAUSE_MAP);
1635 OMP_CLAUSE_SET_MAP_KIND (c3, always_modifier ? GOMP_MAP_ALWAYS_POINTER((omp_clause_subcode_check ((c3), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1636, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (always_modifier ? GOMP_MAP_ALWAYS_POINTER : GOMP_MAP_POINTER
))
1636 : GOMP_MAP_POINTER)((omp_clause_subcode_check ((c3), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1636, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (always_modifier ? GOMP_MAP_ALWAYS_POINTER : GOMP_MAP_POINTER
))
;
1637 if (present)
1638 {
1639 ptr = gfc_conv_descriptor_data_get (decl);
1640 ptr = gfc_build_addr_expr (NULL__null, ptr);
1641 ptr = gfc_build_cond_assign_expr (&block, present,
1642 ptr, null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
1643 ptr = build_fold_indirect_ref (ptr)build_fold_indirect_ref_loc (((location_t) 0), ptr);
1644 OMP_CLAUSE_DECL (c3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1644, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1644, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1644, __FUNCTION__)))
= ptr;
1645 }
1646 else
1647 OMP_CLAUSE_DECL (c3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1647, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1647, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1647, __FUNCTION__)))
= gfc_conv_descriptor_data_get (decl);
1648 OMP_CLAUSE_SIZE (c3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1648, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1648, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1648, __FUNCTION__)))
= size_int (0)size_int_kind (0, stk_sizetype);
1649 tree size = create_tmp_var (gfc_array_index_type);
1650 tree elemsz = TYPE_SIZE_UNIT (gfc_get_element_type (type))((tree_class_check ((gfc_get_element_type (type)), (tcc_type)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1650, __FUNCTION__))->type_common.size_unit)
;
1651 elemsz = fold_convert (gfc_array_index_type, elemsz)fold_convert_loc (((location_t) 0), gfc_array_index_type, elemsz
)
;
1652 if (GFC_TYPE_ARRAY_AKIND (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1652, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_ALLOCATABLE
1653 || GFC_TYPE_ARRAY_AKIND (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1653, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_POINTER
1654 || GFC_TYPE_ARRAY_AKIND (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1654, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_POINTER_CONT)
1655 {
1656 stmtblock_t cond_block;
1657 tree tem, then_b, else_b, zero, cond;
1658
1659 gfc_init_block (&cond_block);
1660 tem = gfc_full_array_size (&cond_block, decl,
1661 GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1661, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
);
1662 gfc_add_modify (&cond_block, size, tem);
1663 gfc_add_modify (&cond_block, size,
1664 fold_build2 (MULT_EXPR, gfc_array_index_type,fold_build2_loc (((location_t) 0), MULT_EXPR, gfc_array_index_type
, size, elemsz )
1665 size, elemsz)fold_build2_loc (((location_t) 0), MULT_EXPR, gfc_array_index_type
, size, elemsz )
);
1666 then_b = gfc_finish_block (&cond_block);
1667 gfc_init_block (&cond_block);
1668 zero = build_int_cst (gfc_array_index_type, 0);
1669 gfc_add_modify (&cond_block, size, zero);
1670 else_b = gfc_finish_block (&cond_block);
1671 tem = gfc_conv_descriptor_data_get (decl);
1672 tem = fold_convert (pvoid_type_node, tem)fold_convert_loc (((location_t) 0), pvoid_type_node, tem);
1673 cond = fold_build2_loc (input_location, NE_EXPR,
1674 boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE], tem, null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
1675 if (present)
1676 {
1677 cond = fold_build2_loc (input_location, TRUTH_ANDIF_EXPR,
1678 boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE], present, cond);
1679 }
1680 gfc_add_expr_to_block (&block, build3_loc (input_location, COND_EXPR,
1681 void_type_nodeglobal_trees[TI_VOID_TYPE], cond,
1682 then_b, else_b));
1683 }
1684 else if (present)
1685 {
1686 stmtblock_t cond_block;
1687 tree then_b;
1688
1689 gfc_init_block (&cond_block);
1690 gfc_add_modify (&cond_block, size,
1691 gfc_full_array_size (&cond_block, decl,
1692 GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1692, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
));
1693 gfc_add_modify (&cond_block, size,
1694 fold_build2 (MULT_EXPR, gfc_array_index_type,fold_build2_loc (((location_t) 0), MULT_EXPR, gfc_array_index_type
, size, elemsz )
1695 size, elemsz)fold_build2_loc (((location_t) 0), MULT_EXPR, gfc_array_index_type
, size, elemsz )
);
1696 then_b = gfc_finish_block (&cond_block);
1697
1698 gfc_build_cond_assign (&block, size, present, then_b,
1699 build_int_cst (gfc_array_index_type, 0));
1700 }
1701 else
1702 {
1703 gfc_add_modify (&block, size,
1704 gfc_full_array_size (&block, decl,
1705 GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1705, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
));
1706 gfc_add_modify (&block, size,
1707 fold_build2 (MULT_EXPR, gfc_array_index_type,fold_build2_loc (((location_t) 0), MULT_EXPR, gfc_array_index_type
, size, elemsz )
1708 size, elemsz)fold_build2_loc (((location_t) 0), MULT_EXPR, gfc_array_index_type
, size, elemsz )
);
1709 }
1710 OMP_CLAUSE_SIZE (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1710, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1710, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1710, __FUNCTION__)))
= size;
1711 tree stmt = gfc_finish_block (&block);
1712 gimplify_and_add (stmt, pre_p);
1713 }
1714 tree last = c;
1715 if (OMP_CLAUSE_SIZE (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1715, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1715, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1715, __FUNCTION__)))
== NULL_TREE(tree) __null)
1716 OMP_CLAUSE_SIZE (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1716, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1716, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1716, __FUNCTION__)))
1717 = DECL_P (decl)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (decl)->base.code))] == tcc_declaration)
? DECL_SIZE_UNIT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1717, __FUNCTION__))->decl_common.size_unit)
1718 : TYPE_SIZE_UNIT (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1718, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1718, __FUNCTION__))->type_common.size_unit)
;
1719 if (gimplify_expr (&OMP_CLAUSE_SIZE (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1719, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1719, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1719, __FUNCTION__)))
, pre_p,
1720 NULL__null, is_gimple_val, fb_rvalue) == GS_ERROR)
1721 OMP_CLAUSE_SIZE (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1721, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1721, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1721, __FUNCTION__)))
= size_int (0)size_int_kind (0, stk_sizetype);
1722 if (c2)
1723 {
1724 OMP_CLAUSE_CHAIN (c2)((contains_struct_check (((tree_check ((c2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1724, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1724, __FUNCTION__))->common.chain)
= OMP_CLAUSE_CHAIN (last)((contains_struct_check (((tree_check ((last), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1724, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1724, __FUNCTION__))->common.chain)
;
1725 OMP_CLAUSE_CHAIN (last)((contains_struct_check (((tree_check ((last), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1725, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1725, __FUNCTION__))->common.chain)
= c2;
1726 last = c2;
1727 }
1728 if (c3)
1729 {
1730 OMP_CLAUSE_CHAIN (c3)((contains_struct_check (((tree_check ((c3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1730, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1730, __FUNCTION__))->common.chain)
= OMP_CLAUSE_CHAIN (last)((contains_struct_check (((tree_check ((last), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1730, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1730, __FUNCTION__))->common.chain)
;
1731 OMP_CLAUSE_CHAIN (last)((contains_struct_check (((tree_check ((last), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1731, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1731, __FUNCTION__))->common.chain)
= c3;
1732 last = c3;
1733 }
1734 if (c4)
1735 {
1736 OMP_CLAUSE_CHAIN (c4)((contains_struct_check (((tree_check ((c4), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1736, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1736, __FUNCTION__))->common.chain)
= OMP_CLAUSE_CHAIN (last)((contains_struct_check (((tree_check ((last), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1736, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1736, __FUNCTION__))->common.chain)
;
1737 OMP_CLAUSE_CHAIN (last)((contains_struct_check (((tree_check ((last), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1737, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1737, __FUNCTION__))->common.chain)
= c4;
1738 }
1739}
1740
1741
1742/* Return true if DECL is a scalar variable (for the purpose of
1743 implicit firstprivatization/mapping). Only if 'ptr_alloc_ok.'
1744 is true, allocatables and pointers are permitted. */
1745
1746bool
1747gfc_omp_scalar_p (tree decl, bool ptr_alloc_ok)
1748{
1749 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1749, __FUNCTION__))->typed.type)
;
1750 if (TREE_CODE (type)((enum tree_code) (type)->base.code) == REFERENCE_TYPE)
1751 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1751, __FUNCTION__))->typed.type)
;
1752 if (TREE_CODE (type)((enum tree_code) (type)->base.code) == POINTER_TYPE)
1753 {
1754 if (GFC_DECL_GET_SCALAR_ALLOCATABLE (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1754, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1754, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
1755 || GFC_DECL_GET_SCALAR_POINTER (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1755, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1755, __FUNCTION__))->decl_common.lang_specific)->scalar_pointer
) : 0)
)
1756 {
1757 if (!ptr_alloc_ok)
1758 return false;
1759 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1759, __FUNCTION__))->typed.type)
;
1760 }
1761 if (GFC_ARRAY_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1761, __FUNCTION__))->type_common.lang_flag_2)
1762 || GFC_CLASS_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1762, __FUNCTION__))->type_common.lang_flag_4)
)
1763 return false;
1764 }
1765 if ((TREE_CODE (type)((enum tree_code) (type)->base.code) == ARRAY_TYPE || TREE_CODE (type)((enum tree_code) (type)->base.code) == INTEGER_TYPE)
1766 && TYPE_STRING_FLAG (type)((tree_check2 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1766, __FUNCTION__, (ARRAY_TYPE), (INTEGER_TYPE)))->type_common
.string_flag)
)
1767 return false;
1768 if (INTEGRAL_TYPE_P (type)(((enum tree_code) (type)->base.code) == ENUMERAL_TYPE || (
(enum tree_code) (type)->base.code) == BOOLEAN_TYPE || ((enum
tree_code) (type)->base.code) == INTEGER_TYPE)
1769 || SCALAR_FLOAT_TYPE_P (type)(((enum tree_code) (type)->base.code) == REAL_TYPE)
1770 || COMPLEX_FLOAT_TYPE_P (type)(((enum tree_code) (type)->base.code) == COMPLEX_TYPE &&
((enum tree_code) (((contains_struct_check ((type), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1770, __FUNCTION__))->typed.type))->base.code) == REAL_TYPE
)
)
1771 return true;
1772 return false;
1773}
1774
1775
1776/* Return true if DECL is a scalar with target attribute but does not have the
1777 allocatable (or pointer) attribute (for the purpose of implicit mapping). */
1778
1779bool
1780gfc_omp_scalar_target_p (tree decl)
1781{
1782 return (DECL_P (decl)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (decl)->base.code))] == tcc_declaration)
&& GFC_DECL_GET_SCALAR_TARGET (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1782, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1782, __FUNCTION__))->decl_common.lang_specific)->scalar_target
) : 0)
1783 && gfc_omp_scalar_p (decl, false));
1784}
1785
1786
1787/* Return true if DECL's DECL_VALUE_EXPR (if any) should be
1788 disregarded in OpenMP construct, because it is going to be
1789 remapped during OpenMP lowering. SHARED is true if DECL
1790 is going to be shared, false if it is going to be privatized. */
1791
1792bool
1793gfc_omp_disregard_value_expr (tree decl, bool shared)
1794{
1795 if (GFC_DECL_COMMON_OR_EQUIV (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1795, __FUNCTION__))->decl_common.lang_flag_3)
1796 && DECL_HAS_VALUE_EXPR_P (decl)((tree_check3 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1796, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL))
) ->decl_common.decl_flag_2)
)
1797 {
1798 tree value = DECL_VALUE_EXPR (decl)(decl_value_expr_lookup ((contains_struct_check ((decl), (TS_DECL_WRTL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1798, __FUNCTION__))))
;
1799
1800 if (TREE_CODE (value)((enum tree_code) (value)->base.code) == COMPONENT_REF
1801 && VAR_P (TREE_OPERAND (value, 0))(((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((value), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1801, __FUNCTION__))))))->base.code) == VAR_DECL)
1802 && GFC_DECL_COMMON_OR_EQUIV (TREE_OPERAND (value, 0))((contains_struct_check (((*((const_cast<tree*> (tree_operand_check
((value), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1802, __FUNCTION__)))))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1802, __FUNCTION__))->decl_common.lang_flag_3)
)
1803 {
1804 /* If variable in COMMON or EQUIVALENCE is privatized, return
1805 true, as just that variable is supposed to be privatized,
1806 not the whole COMMON or whole EQUIVALENCE.
1807 For shared variables in COMMON or EQUIVALENCE, let them be
1808 gimplified to DECL_VALUE_EXPR, so that for multiple shared vars
1809 from the same COMMON or EQUIVALENCE just one sharing of the
1810 whole COMMON or EQUIVALENCE is enough. */
1811 return ! shared;
1812 }
1813 }
1814
1815 if (GFC_DECL_RESULT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1815, __FUNCTION__))->decl_common.lang_flag_5)
&& DECL_HAS_VALUE_EXPR_P (decl)((tree_check3 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1815, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL))
) ->decl_common.decl_flag_2)
)
1816 return ! shared;
1817
1818 return false;
1819}
1820
1821/* Return true if DECL that is shared iff SHARED is true should
1822 be put into OMP_CLAUSE_PRIVATE with OMP_CLAUSE_PRIVATE_DEBUG
1823 flag set. */
1824
1825bool
1826gfc_omp_private_debug_clause (tree decl, bool shared)
1827{
1828 if (GFC_DECL_CRAY_POINTEE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1828, __FUNCTION__))->decl_common.lang_flag_4)
)
1829 return true;
1830
1831 if (GFC_DECL_COMMON_OR_EQUIV (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1831, __FUNCTION__))->decl_common.lang_flag_3)
1832 && DECL_HAS_VALUE_EXPR_P (decl)((tree_check3 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1832, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL))
) ->decl_common.decl_flag_2)
)
1833 {
1834 tree value = DECL_VALUE_EXPR (decl)(decl_value_expr_lookup ((contains_struct_check ((decl), (TS_DECL_WRTL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1834, __FUNCTION__))))
;
1835
1836 if (TREE_CODE (value)((enum tree_code) (value)->base.code) == COMPONENT_REF
1837 && VAR_P (TREE_OPERAND (value, 0))(((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((value), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1837, __FUNCTION__))))))->base.code) == VAR_DECL)
1838 && GFC_DECL_COMMON_OR_EQUIV (TREE_OPERAND (value, 0))((contains_struct_check (((*((const_cast<tree*> (tree_operand_check
((value), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1838, __FUNCTION__)))))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1838, __FUNCTION__))->decl_common.lang_flag_3)
)
1839 return shared;
1840 }
1841
1842 return false;
1843}
1844
1845/* Register language specific type size variables as potentially OpenMP
1846 firstprivate variables. */
1847
1848void
1849gfc_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *ctx, tree type)
1850{
1851 if (GFC_ARRAY_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1851, __FUNCTION__))->type_common.lang_flag_2)
|| GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1851, __FUNCTION__))->type_common.lang_flag_1)
)
1852 {
1853 int r;
1854
1855 gcc_assert (TYPE_LANG_SPECIFIC (type) != NULL)((void)(!(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1855, __FUNCTION__))->type_with_lang_specific.lang_specific
) != __null) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1855, __FUNCTION__), 0 : 0))
;
1856 for (r = 0; r < GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1856, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
; r++)
1857 {
1858 omp_firstprivatize_variable (ctx, GFC_TYPE_ARRAY_LBOUND (type, r)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1858, __FUNCTION__))->type_with_lang_specific.lang_specific
)->lbound[r])
);
1859 omp_firstprivatize_variable (ctx, GFC_TYPE_ARRAY_UBOUND (type, r)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1859, __FUNCTION__))->type_with_lang_specific.lang_specific
)->ubound[r])
);
1860 omp_firstprivatize_variable (ctx, GFC_TYPE_ARRAY_STRIDE (type, r)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1860, __FUNCTION__))->type_with_lang_specific.lang_specific
)->stride[r])
);
1861 }
1862 omp_firstprivatize_variable (ctx, GFC_TYPE_ARRAY_SIZE (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1862, __FUNCTION__))->type_with_lang_specific.lang_specific
)->size)
);
1863 omp_firstprivatize_variable (ctx, GFC_TYPE_ARRAY_OFFSET (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1863, __FUNCTION__))->type_with_lang_specific.lang_specific
)->offset)
);
1864 }
1865}
1866
1867
1868static inline tree
1869gfc_trans_add_clause (tree node, tree tail)
1870{
1871 OMP_CLAUSE_CHAIN (node)((contains_struct_check (((tree_check ((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1871, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1871, __FUNCTION__))->common.chain)
= tail;
1872 return node;
1873}
1874
1875static tree
1876gfc_trans_omp_variable (gfc_symbol *sym, bool declare_simd)
1877{
1878 if (declare_simd)
1879 {
1880 int cnt = 0;
1881 gfc_symbol *proc_sym;
1882 gfc_formal_arglist *f;
1883
1884 gcc_assert (sym->attr.dummy)((void)(!(sym->attr.dummy) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1884, __FUNCTION__), 0 : 0))
;
1885 proc_sym = sym->ns->proc_name;
1886 if (proc_sym->attr.entry_master)
1887 ++cnt;
1888 if (gfc_return_by_reference (proc_sym))
1889 {
1890 ++cnt;
1891 if (proc_sym->ts.type == BT_CHARACTER)
1892 ++cnt;
1893 }
1894 for (f = gfc_sym_get_dummy_args (proc_sym); f; f = f->next)
1895 if (f->sym == sym)
1896 break;
1897 else if (f->sym)
1898 ++cnt;
1899 gcc_assert (f)((void)(!(f) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1899, __FUNCTION__), 0 : 0))
;
1900 return build_int_cst (integer_type_nodeinteger_types[itk_int], cnt);
1901 }
1902
1903 tree t = gfc_get_symbol_decl (sym);
1904 tree parent_decl;
1905 int parent_flag;
1906 bool return_value;
1907 bool alternate_entry;
1908 bool entry_master;
1909
1910 return_value = sym->attr.function && sym->result == sym;
1911 alternate_entry = sym->attr.function && sym->attr.entry
1912 && sym->result == sym;
1913 entry_master = sym->attr.result
1914 && sym->ns->proc_name->attr.entry_master
1915 && !gfc_return_by_reference (sym->ns->proc_name);
1916 parent_decl = current_function_decl
1917 ? DECL_CONTEXT (current_function_decl)((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1917, __FUNCTION__))->decl_minimal.context)
: NULL_TREE(tree) __null;
1918
1919 if ((t == parent_decl && return_value)
1920 || (sym->ns && sym->ns->proc_name
1921 && sym->ns->proc_name->backend_decl == parent_decl
1922 && (alternate_entry || entry_master)))
1923 parent_flag = 1;
1924 else
1925 parent_flag = 0;
1926
1927 /* Special case for assigning the return value of a function.
1928 Self recursive functions must have an explicit return value. */
1929 if (return_value && (t == current_function_decl || parent_flag))
1930 t = gfc_get_fake_result_decl (sym, parent_flag);
1931
1932 /* Similarly for alternate entry points. */
1933 else if (alternate_entry
1934 && (sym->ns->proc_name->backend_decl == current_function_decl
1935 || parent_flag))
1936 {
1937 gfc_entry_list *el = NULL__null;
1938
1939 for (el = sym->ns->entries; el; el = el->next)
1940 if (sym == el->sym)
1941 {
1942 t = gfc_get_fake_result_decl (sym, parent_flag);
1943 break;
1944 }
1945 }
1946
1947 else if (entry_master
1948 && (sym->ns->proc_name->backend_decl == current_function_decl
1949 || parent_flag))
1950 t = gfc_get_fake_result_decl (sym, parent_flag);
1951
1952 return t;
1953}
1954
1955static tree
1956gfc_trans_omp_variable_list (enum omp_clause_code code,
1957 gfc_omp_namelist *namelist, tree list,
1958 bool declare_simd)
1959{
1960 for (; namelist != NULL__null; namelist = namelist->next)
1961 if (namelist->sym->attr.referenced || declare_simd)
1962 {
1963 tree t = gfc_trans_omp_variable (namelist->sym, declare_simd);
1964 if (t != error_mark_nodeglobal_trees[TI_ERROR_MARK])
1965 {
1966 tree node;
1967 node = build_omp_clause (input_location, code);
1968 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1968, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1968, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1968, __FUNCTION__)))
= t;
1969 list = gfc_trans_add_clause (node, list);
1970
1971 if (code == OMP_CLAUSE_LASTPRIVATE
1972 && namelist->u.lastprivate_conditional)
1973 OMP_CLAUSE_LASTPRIVATE_CONDITIONAL (node)(((omp_clause_subcode_check ((node), (OMP_CLAUSE_LASTPRIVATE)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 1973, __FUNCTION__)))->base.private_flag)
= 1;
1974 }
1975 }
1976 return list;
1977}
1978
1979struct omp_udr_find_orig_data
1980{
1981 gfc_omp_udr *omp_udr;
1982 bool omp_orig_seen;
1983};
1984
1985static int
1986omp_udr_find_orig (gfc_expr **e, int *walk_subtrees ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
1987 void *data)
1988{
1989 struct omp_udr_find_orig_data *cd = (struct omp_udr_find_orig_data *) data;
1990 if ((*e)->expr_type == EXPR_VARIABLE
1991 && (*e)->symtree->n.sym == cd->omp_udr->omp_orig)
1992 cd->omp_orig_seen = true;
1993
1994 return 0;
1995}
1996
1997static void
1998gfc_trans_omp_array_reduction_or_udr (tree c, gfc_omp_namelist *n, locus where)
1999{
2000 gfc_symbol *sym = n->sym;
2001 gfc_symtree *root1 = NULL__null, *root2 = NULL__null, *root3 = NULL__null, *root4 = NULL__null;
2002 gfc_symtree *symtree1, *symtree2, *symtree3, *symtree4 = NULL__null;
2003 gfc_symbol init_val_sym, outer_sym, intrinsic_sym;
2004 gfc_symbol omp_var_copy[4];
2005 gfc_expr *e1, *e2, *e3, *e4;
2006 gfc_ref *ref;
2007 tree decl, backend_decl, stmt, type, outer_decl;
2008 locus old_loc = gfc_current_locus;
2009 const char *iname;
2010 bool t;
2011 gfc_omp_udr *udr = n->u2.udr ? n->u2.udr->udr : NULL__null;
2012
2013 decl = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2013, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2013, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2013, __FUNCTION__)))
;
2014 gfc_current_locus = where;
2015 type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2015, __FUNCTION__))->typed.type)
;
2016 outer_decl = create_tmp_var_raw (type);
2017 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == PARM_DECL
2018 && TREE_CODE (type)((enum tree_code) (type)->base.code) == REFERENCE_TYPE
2019 && GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (type))((tree_class_check ((((contains_struct_check ((type), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2019, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2019, __FUNCTION__))->type_common.lang_flag_1)
2020 && GFC_TYPE_ARRAY_AKIND (TREE_TYPE (type))(((tree_class_check ((((contains_struct_check ((type), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2020, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2020, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_ALLOCATABLE)
2021 {
2022 decl = build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
2023 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2023, __FUNCTION__))->typed.type)
;
2024 }
2025
2026 /* Create a fake symbol for init value. */
2027 memset (&init_val_sym, 0, sizeof (init_val_sym));
2028 init_val_sym.ns = sym->ns;
2029 init_val_sym.name = sym->name;
2030 init_val_sym.ts = sym->ts;
2031 init_val_sym.attr.referenced = 1;
2032 init_val_sym.declared_at = where;
2033 init_val_sym.attr.flavor = FL_VARIABLE;
2034 if (OMP_CLAUSE_REDUCTION_CODE (c)((omp_clause_range_check ((c), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2034, __FUNCTION__))->omp_clause.subcode.reduction_code)
!= ERROR_MARK)
2035 backend_decl = omp_reduction_init (c, gfc_sym_type (&init_val_sym));
2036 else if (udr->initializer_ns)
2037 backend_decl = NULL__null;
2038 else
2039 switch (sym->ts.type)
2040 {
2041 case BT_LOGICAL:
2042 case BT_INTEGER:
2043 case BT_REAL:
2044 case BT_COMPLEX:
2045 backend_decl = build_zero_cst (gfc_sym_type (&init_val_sym));
2046 break;
2047 default:
2048 backend_decl = NULL_TREE(tree) __null;
2049 break;
2050 }
2051 init_val_sym.backend_decl = backend_decl;
2052
2053 /* Create a fake symbol for the outer array reference. */
2054 outer_sym = *sym;
2055 if (sym->as)
2056 outer_sym.as = gfc_copy_array_spec (sym->as);
2057 outer_sym.attr.dummy = 0;
2058 outer_sym.attr.result = 0;
2059 outer_sym.attr.flavor = FL_VARIABLE;
2060 outer_sym.backend_decl = outer_decl;
2061 if (decl != OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2061, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2061, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2061, __FUNCTION__)))
)
2062 outer_sym.backend_decl = build_fold_indirect_ref (outer_decl)build_fold_indirect_ref_loc (((location_t) 0), outer_decl);
2063
2064 /* Create fake symtrees for it. */
2065 symtree1 = gfc_new_symtree (&root1, sym->name);
2066 symtree1->n.sym = sym;
2067 gcc_assert (symtree1 == root1)((void)(!(symtree1 == root1) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2067, __FUNCTION__), 0 : 0))
;
2068
2069 symtree2 = gfc_new_symtree (&root2, sym->name);
2070 symtree2->n.sym = &init_val_sym;
2071 gcc_assert (symtree2 == root2)((void)(!(symtree2 == root2) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2071, __FUNCTION__), 0 : 0))
;
2072
2073 symtree3 = gfc_new_symtree (&root3, sym->name);
2074 symtree3->n.sym = &outer_sym;
2075 gcc_assert (symtree3 == root3)((void)(!(symtree3 == root3) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2075, __FUNCTION__), 0 : 0))
;
2076
2077 memset (omp_var_copy, 0, sizeof omp_var_copy);
2078 if (udr)
2079 {
2080 omp_var_copy[0] = *udr->omp_out;
2081 omp_var_copy[1] = *udr->omp_in;
2082 *udr->omp_out = outer_sym;
2083 *udr->omp_in = *sym;
2084 if (udr->initializer_ns)
2085 {
2086 omp_var_copy[2] = *udr->omp_priv;
2087 omp_var_copy[3] = *udr->omp_orig;
2088 *udr->omp_priv = *sym;
2089 *udr->omp_orig = outer_sym;
2090 }
2091 }
2092
2093 /* Create expressions. */
2094 e1 = gfc_get_expr ();
2095 e1->expr_type = EXPR_VARIABLE;
2096 e1->where = where;
2097 e1->symtree = symtree1;
2098 e1->ts = sym->ts;
2099 if (sym->attr.dimension)
2100 {
2101 e1->ref = ref = gfc_get_ref ()((gfc_ref *) xcalloc (1, sizeof (gfc_ref)));
2102 ref->type = REF_ARRAY;
2103 ref->u.ar.where = where;
2104 ref->u.ar.as = sym->as;
2105 ref->u.ar.type = AR_FULL;
2106 ref->u.ar.dimen = 0;
2107 }
2108 t = gfc_resolve_expr (e1);
2109 gcc_assert (t)((void)(!(t) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2109, __FUNCTION__), 0 : 0))
;
2110
2111 e2 = NULL__null;
2112 if (backend_decl != NULL_TREE(tree) __null)
2113 {
2114 e2 = gfc_get_expr ();
2115 e2->expr_type = EXPR_VARIABLE;
2116 e2->where = where;
2117 e2->symtree = symtree2;
2118 e2->ts = sym->ts;
2119 t = gfc_resolve_expr (e2);
2120 gcc_assert (t)((void)(!(t) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2120, __FUNCTION__), 0 : 0))
;
2121 }
2122 else if (udr->initializer_ns == NULL__null)
2123 {
2124 gcc_assert (sym->ts.type == BT_DERIVED)((void)(!(sym->ts.type == BT_DERIVED) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2124, __FUNCTION__), 0 : 0))
;
2125 e2 = gfc_default_initializer (&sym->ts);
2126 gcc_assert (e2)((void)(!(e2) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2126, __FUNCTION__), 0 : 0))
;
2127 t = gfc_resolve_expr (e2);
2128 gcc_assert (t)((void)(!(t) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2128, __FUNCTION__), 0 : 0))
;
2129 }
2130 else if (n->u2.udr->initializer->op == EXEC_ASSIGN)
2131 {
2132 e2 = gfc_copy_expr (n->u2.udr->initializer->expr2);
2133 t = gfc_resolve_expr (e2);
2134 gcc_assert (t)((void)(!(t) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2134, __FUNCTION__), 0 : 0))
;
2135 }
2136 if (udr && udr->initializer_ns)
2137 {
2138 struct omp_udr_find_orig_data cd;
2139 cd.omp_udr = udr;
2140 cd.omp_orig_seen = false;
2141 gfc_code_walker (&n->u2.udr->initializer,
2142 gfc_dummy_code_callback, omp_udr_find_orig, &cd);
2143 if (cd.omp_orig_seen)
2144 OMP_CLAUSE_REDUCTION_OMP_ORIG_REF (c)((omp_clause_range_check ((c), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2144, __FUNCTION__))->base.public_flag)
= 1;
2145 }
2146
2147 e3 = gfc_copy_expr (e1);
2148 e3->symtree = symtree3;
2149 t = gfc_resolve_expr (e3);
2150 gcc_assert (t)((void)(!(t) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2150, __FUNCTION__), 0 : 0))
;
2151
2152 iname = NULL__null;
2153 e4 = NULL__null;
2154 switch (OMP_CLAUSE_REDUCTION_CODE (c)((omp_clause_range_check ((c), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2154, __FUNCTION__))->omp_clause.subcode.reduction_code)
)
2155 {
2156 case PLUS_EXPR:
2157 case MINUS_EXPR:
2158 e4 = gfc_add (e3, e1);
2159 break;
2160 case MULT_EXPR:
2161 e4 = gfc_multiply (e3, e1);
2162 break;
2163 case TRUTH_ANDIF_EXPR:
2164 e4 = gfc_and (e3, e1);
2165 break;
2166 case TRUTH_ORIF_EXPR:
2167 e4 = gfc_or (e3, e1);
2168 break;
2169 case EQ_EXPR:
2170 e4 = gfc_eqv (e3, e1);
2171 break;
2172 case NE_EXPR:
2173 e4 = gfc_neqv (e3, e1);
2174 break;
2175 case MIN_EXPR:
2176 iname = "min";
2177 break;
2178 case MAX_EXPR:
2179 iname = "max";
2180 break;
2181 case BIT_AND_EXPR:
2182 iname = "iand";
2183 break;
2184 case BIT_IOR_EXPR:
2185 iname = "ior";
2186 break;
2187 case BIT_XOR_EXPR:
2188 iname = "ieor";
2189 break;
2190 case ERROR_MARK:
2191 if (n->u2.udr->combiner->op == EXEC_ASSIGN)
2192 {
2193 gfc_free_expr (e3);
2194 e3 = gfc_copy_expr (n->u2.udr->combiner->expr1);
2195 e4 = gfc_copy_expr (n->u2.udr->combiner->expr2);
2196 t = gfc_resolve_expr (e3);
2197 gcc_assert (t)((void)(!(t) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2197, __FUNCTION__), 0 : 0))
;
2198 t = gfc_resolve_expr (e4);
2199 gcc_assert (t)((void)(!(t) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2199, __FUNCTION__), 0 : 0))
;
2200 }
2201 break;
2202 default:
2203 gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2203, __FUNCTION__))
;
2204 }
2205 if (iname != NULL__null)
2206 {
2207 memset (&intrinsic_sym, 0, sizeof (intrinsic_sym));
2208 intrinsic_sym.ns = sym->ns;
2209 intrinsic_sym.name = iname;
2210 intrinsic_sym.ts = sym->ts;
2211 intrinsic_sym.attr.referenced = 1;
2212 intrinsic_sym.attr.intrinsic = 1;
2213 intrinsic_sym.attr.function = 1;
2214 intrinsic_sym.attr.implicit_type = 1;
2215 intrinsic_sym.result = &intrinsic_sym;
2216 intrinsic_sym.declared_at = where;
2217
2218 symtree4 = gfc_new_symtree (&root4, iname);
2219 symtree4->n.sym = &intrinsic_sym;
2220 gcc_assert (symtree4 == root4)((void)(!(symtree4 == root4) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2220, __FUNCTION__), 0 : 0))
;
2221
2222 e4 = gfc_get_expr ();
2223 e4->expr_type = EXPR_FUNCTION;
2224 e4->where = where;
2225 e4->symtree = symtree4;
2226 e4->value.function.actual = gfc_get_actual_arglist ()((gfc_actual_arglist *) xcalloc (1, sizeof (gfc_actual_arglist
)))
;
2227 e4->value.function.actual->expr = e3;
2228 e4->value.function.actual->next = gfc_get_actual_arglist ()((gfc_actual_arglist *) xcalloc (1, sizeof (gfc_actual_arglist
)))
;
2229 e4->value.function.actual->next->expr = e1;
2230 }
2231 if (OMP_CLAUSE_REDUCTION_CODE (c)((omp_clause_range_check ((c), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2231, __FUNCTION__))->omp_clause.subcode.reduction_code)
!= ERROR_MARK)
2232 {
2233 /* e1 and e3 have been stored as arguments of e4, avoid sharing. */
2234 e1 = gfc_copy_expr (e1);
2235 e3 = gfc_copy_expr (e3);
2236 t = gfc_resolve_expr (e4);
2237 gcc_assert (t)((void)(!(t) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2237, __FUNCTION__), 0 : 0))
;
2238 }
2239
2240 /* Create the init statement list. */
2241 pushlevel ();
2242 if (e2)
2243 stmt = gfc_trans_assignment (e1, e2, false, false);
2244 else
2245 stmt = gfc_trans_call (n->u2.udr->initializer, false,
2246 NULL_TREE(tree) __null, NULL_TREE(tree) __null, false);
2247 if (TREE_CODE (stmt)((enum tree_code) (stmt)->base.code) != BIND_EXPR)
2248 stmt = build3_v (BIND_EXPR, NULL, stmt, poplevel (1, 0))fold_build3_loc (input_location, BIND_EXPR, global_trees[TI_VOID_TYPE
], __null, stmt, poplevel (1, 0))
;
2249 else
2250 poplevel (0, 0);
2251 OMP_CLAUSE_REDUCTION_INIT (c)(*(omp_clause_elt_check (((omp_clause_range_check ((c), (OMP_CLAUSE_REDUCTION
), (OMP_CLAUSE_IN_REDUCTION), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2251, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2251, __FUNCTION__)))
= stmt;
2252
2253 /* Create the merge statement list. */
2254 pushlevel ();
2255 if (e4)
2256 stmt = gfc_trans_assignment (e3, e4, false, true);
2257 else
2258 stmt = gfc_trans_call (n->u2.udr->combiner, false,
2259 NULL_TREE(tree) __null, NULL_TREE(tree) __null, false);
2260 if (TREE_CODE (stmt)((enum tree_code) (stmt)->base.code) != BIND_EXPR)
2261 stmt = build3_v (BIND_EXPR, NULL, stmt, poplevel (1, 0))fold_build3_loc (input_location, BIND_EXPR, global_trees[TI_VOID_TYPE
], __null, stmt, poplevel (1, 0))
;
2262 else
2263 poplevel (0, 0);
2264 OMP_CLAUSE_REDUCTION_MERGE (c)(*(omp_clause_elt_check (((omp_clause_range_check ((c), (OMP_CLAUSE_REDUCTION
), (OMP_CLAUSE_IN_REDUCTION), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2264, __FUNCTION__))), (2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2264, __FUNCTION__)))
= stmt;
2265
2266 /* And stick the placeholder VAR_DECL into the clause as well. */
2267 OMP_CLAUSE_REDUCTION_PLACEHOLDER (c)(*(omp_clause_elt_check (((omp_clause_range_check ((c), (OMP_CLAUSE_REDUCTION
), (OMP_CLAUSE_IN_REDUCTION), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2267, __FUNCTION__))), (3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2267, __FUNCTION__)))
= outer_decl;
2268
2269 gfc_current_locus = old_loc;
2270
2271 gfc_free_expr (e1);
2272 if (e2)
2273 gfc_free_expr (e2);
2274 gfc_free_expr (e3);
2275 if (e4)
2276 gfc_free_expr (e4);
2277 free (symtree1);
2278 free (symtree2);
2279 free (symtree3);
2280 free (symtree4);
2281 if (outer_sym.as)
2282 gfc_free_array_spec (outer_sym.as);
2283
2284 if (udr)
2285 {
2286 *udr->omp_out = omp_var_copy[0];
2287 *udr->omp_in = omp_var_copy[1];
2288 if (udr->initializer_ns)
2289 {
2290 *udr->omp_priv = omp_var_copy[2];
2291 *udr->omp_orig = omp_var_copy[3];
2292 }
2293 }
2294}
2295
2296static tree
2297gfc_trans_omp_reduction_list (int kind, gfc_omp_namelist *namelist, tree list,
2298 locus where, bool mark_addressable)
2299{
2300 omp_clause_code clause = OMP_CLAUSE_REDUCTION;
2301 switch (kind)
2302 {
2303 case OMP_LIST_REDUCTION:
2304 case OMP_LIST_REDUCTION_INSCAN:
2305 case OMP_LIST_REDUCTION_TASK:
2306 break;
2307 case OMP_LIST_IN_REDUCTION:
2308 clause = OMP_CLAUSE_IN_REDUCTION;
2309 break;
2310 case OMP_LIST_TASK_REDUCTION:
2311 clause = OMP_CLAUSE_TASK_REDUCTION;
2312 break;
2313 default:
2314 gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2314, __FUNCTION__))
;
2315 }
2316 for (; namelist != NULL__null; namelist = namelist->next)
2317 if (namelist->sym->attr.referenced)
2318 {
2319 tree t = gfc_trans_omp_variable (namelist->sym, false);
2320 if (t != error_mark_nodeglobal_trees[TI_ERROR_MARK])
2321 {
2322 tree node = build_omp_clause (gfc_get_location (&namelist->where),
2323 clause);
2324 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2324, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2324, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2324, __FUNCTION__)))
= t;
2325 if (mark_addressable)
2326 TREE_ADDRESSABLE (t)((t)->base.addressable_flag) = 1;
2327 if (kind == OMP_LIST_REDUCTION_INSCAN)
2328 OMP_CLAUSE_REDUCTION_INSCAN (node)(((omp_clause_subcode_check ((node), (OMP_CLAUSE_REDUCTION), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2328, __FUNCTION__)))->base.private_flag)
= 1;
2329 if (kind == OMP_LIST_REDUCTION_TASK)
2330 OMP_CLAUSE_REDUCTION_TASK (node)(((omp_clause_subcode_check ((node), (OMP_CLAUSE_REDUCTION), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2330, __FUNCTION__)))->base.protected_flag)
= 1;
2331 switch (namelist->u.reduction_op)
2332 {
2333 case OMP_REDUCTION_PLUS:
2334 OMP_CLAUSE_REDUCTION_CODE (node)((omp_clause_range_check ((node), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2334, __FUNCTION__))->omp_clause.subcode.reduction_code)
= PLUS_EXPR;
2335 break;
2336 case OMP_REDUCTION_MINUS:
2337 OMP_CLAUSE_REDUCTION_CODE (node)((omp_clause_range_check ((node), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2337, __FUNCTION__))->omp_clause.subcode.reduction_code)
= MINUS_EXPR;
2338 break;
2339 case OMP_REDUCTION_TIMES:
2340 OMP_CLAUSE_REDUCTION_CODE (node)((omp_clause_range_check ((node), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2340, __FUNCTION__))->omp_clause.subcode.reduction_code)
= MULT_EXPR;
2341 break;
2342 case OMP_REDUCTION_AND:
2343 OMP_CLAUSE_REDUCTION_CODE (node)((omp_clause_range_check ((node), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2343, __FUNCTION__))->omp_clause.subcode.reduction_code)
= TRUTH_ANDIF_EXPR;
2344 break;
2345 case OMP_REDUCTION_OR:
2346 OMP_CLAUSE_REDUCTION_CODE (node)((omp_clause_range_check ((node), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2346, __FUNCTION__))->omp_clause.subcode.reduction_code)
= TRUTH_ORIF_EXPR;
2347 break;
2348 case OMP_REDUCTION_EQV:
2349 OMP_CLAUSE_REDUCTION_CODE (node)((omp_clause_range_check ((node), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2349, __FUNCTION__))->omp_clause.subcode.reduction_code)
= EQ_EXPR;
2350 break;
2351 case OMP_REDUCTION_NEQV:
2352 OMP_CLAUSE_REDUCTION_CODE (node)((omp_clause_range_check ((node), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2352, __FUNCTION__))->omp_clause.subcode.reduction_code)
= NE_EXPR;
2353 break;
2354 case OMP_REDUCTION_MAX:
2355 OMP_CLAUSE_REDUCTION_CODE (node)((omp_clause_range_check ((node), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2355, __FUNCTION__))->omp_clause.subcode.reduction_code)
= MAX_EXPR;
2356 break;
2357 case OMP_REDUCTION_MIN:
2358 OMP_CLAUSE_REDUCTION_CODE (node)((omp_clause_range_check ((node), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2358, __FUNCTION__))->omp_clause.subcode.reduction_code)
= MIN_EXPR;
2359 break;
2360 case OMP_REDUCTION_IAND:
2361 OMP_CLAUSE_REDUCTION_CODE (node)((omp_clause_range_check ((node), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2361, __FUNCTION__))->omp_clause.subcode.reduction_code)
= BIT_AND_EXPR;
2362 break;
2363 case OMP_REDUCTION_IOR:
2364 OMP_CLAUSE_REDUCTION_CODE (node)((omp_clause_range_check ((node), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2364, __FUNCTION__))->omp_clause.subcode.reduction_code)
= BIT_IOR_EXPR;
2365 break;
2366 case OMP_REDUCTION_IEOR:
2367 OMP_CLAUSE_REDUCTION_CODE (node)((omp_clause_range_check ((node), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2367, __FUNCTION__))->omp_clause.subcode.reduction_code)
= BIT_XOR_EXPR;
2368 break;
2369 case OMP_REDUCTION_USER:
2370 OMP_CLAUSE_REDUCTION_CODE (node)((omp_clause_range_check ((node), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2370, __FUNCTION__))->omp_clause.subcode.reduction_code)
= ERROR_MARK;
2371 break;
2372 default:
2373 gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2373, __FUNCTION__))
;
2374 }
2375 if (namelist->sym->attr.dimension
2376 || namelist->u.reduction_op == OMP_REDUCTION_USER
2377 || namelist->sym->attr.allocatable)
2378 gfc_trans_omp_array_reduction_or_udr (node, namelist, where);
2379 list = gfc_trans_add_clause (node, list);
2380 }
2381 }
2382 return list;
2383}
2384
2385static inline tree
2386gfc_convert_expr_to_tree (stmtblock_t *block, gfc_expr *expr)
2387{
2388 gfc_se se;
2389 tree result;
2390
2391 gfc_init_se (&se, NULL__null );
2392 gfc_conv_expr (&se, expr);
2393 gfc_add_block_to_block (block, &se.pre);
2394 result = gfc_evaluate_now (se.expr, block);
2395 gfc_add_block_to_block (block, &se.post);
2396
2397 return result;
2398}
2399
2400static vec<tree, va_heap, vl_embed> *doacross_steps;
2401
2402
2403/* Translate an array section or array element. */
2404
2405static void
2406gfc_trans_omp_array_section (stmtblock_t *block, gfc_omp_namelist *n,
2407 tree decl, bool element, gomp_map_kind ptr_kind,
2408 tree &node, tree &node2, tree &node3, tree &node4)
2409{
2410 gfc_se se;
2411 tree ptr, ptr2;
2412 tree elemsz = NULL_TREE(tree) __null;
2413
2414 gfc_init_se (&se, NULL__null);
2415
2416 if (element)
2417 {
2418 gfc_conv_expr_reference (&se, n->expr);
2419 gfc_add_block_to_block (block, &se.pre);
2420 ptr = se.expr;
2421 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2421, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2421, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2421, __FUNCTION__)))
= TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (ptr)))((tree_class_check ((((contains_struct_check ((((contains_struct_check
((ptr), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2421, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2421, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2421, __FUNCTION__))->type_common.size_unit)
;
2422 elemsz = OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2422, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2422, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2422, __FUNCTION__)))
;
2423 }
2424 else
2425 {
2426 gfc_conv_expr_descriptor (&se, n->expr);
2427 ptr = gfc_conv_array_data (se.expr);
2428 tree type = TREE_TYPE (se.expr)((contains_struct_check ((se.expr), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2428, __FUNCTION__))->typed.type)
;
2429 gfc_add_block_to_block (block, &se.pre);
2430 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2430, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2430, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2430, __FUNCTION__)))
= gfc_full_array_size (block, se.expr,
2431 GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2431, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
);
2432 elemsz = TYPE_SIZE_UNIT (gfc_get_element_type (type))((tree_class_check ((gfc_get_element_type (type)), (tcc_type)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2432, __FUNCTION__))->type_common.size_unit)
;
2433 elemsz = fold_convert (gfc_array_index_type, elemsz)fold_convert_loc (((location_t) 0), gfc_array_index_type, elemsz
)
;
2434 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2434, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2434, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2434, __FUNCTION__)))
= fold_build2 (MULT_EXPR, gfc_array_index_type,fold_build2_loc (((location_t) 0), MULT_EXPR, gfc_array_index_type
, (*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2435, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2435, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2435, __FUNCTION__))), elemsz )
2435 OMP_CLAUSE_SIZE (node), elemsz)fold_build2_loc (((location_t) 0), MULT_EXPR, gfc_array_index_type
, (*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2435, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2435, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2435, __FUNCTION__))), elemsz )
;
2436 }
2437 gcc_assert (se.post.head == NULL_TREE)((void)(!(se.post.head == (tree) __null) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2437, __FUNCTION__), 0 : 0))
;
2438 gcc_assert (POINTER_TYPE_P (TREE_TYPE (ptr)))((void)(!((((enum tree_code) (((contains_struct_check ((ptr),
(TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2438, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((ptr), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2438, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2438, __FUNCTION__), 0 : 0))
;
2439 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2439, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2439, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2439, __FUNCTION__)))
= build_fold_indirect_ref (ptr)build_fold_indirect_ref_loc (((location_t) 0), ptr);
2440 ptr = fold_convert (ptrdiff_type_node, ptr)fold_convert_loc (((location_t) 0), global_trees[TI_PTRDIFF_TYPE
], ptr)
;
2441
2442 if (POINTER_TYPE_P (TREE_TYPE (decl))(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2442, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2442, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)
2443 && GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (TREE_TYPE (decl)))((tree_class_check ((((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2443, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2443, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2443, __FUNCTION__))->type_common.lang_flag_1)
2444 && ptr_kind == GOMP_MAP_POINTER)
2445 {
2446 node4 = build_omp_clause (input_location,
2447 OMP_CLAUSE_MAP);
2448 OMP_CLAUSE_SET_MAP_KIND (node4, GOMP_MAP_POINTER)((omp_clause_subcode_check ((node4), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2448, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_POINTER))
;
2449 OMP_CLAUSE_DECL (node4)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node4), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2449, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2449, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2449, __FUNCTION__)))
= decl;
2450 OMP_CLAUSE_SIZE (node4)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node4), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2450, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2450, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2450, __FUNCTION__)))
= size_int (0)size_int_kind (0, stk_sizetype);
2451 decl = build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
2452 }
2453 else if (ptr_kind == GOMP_MAP_ALWAYS_POINTER
2454 && n->expr->ts.type == BT_CHARACTER
2455 && n->expr->ts.deferred)
2456 {
2457 gomp_map_kind map_kind;
2458 if (GOMP_MAP_COPY_TO_P (OMP_CLAUSE_MAP_KIND (node))(!((((enum gomp_map_kind) (omp_clause_subcode_check ((node), (
OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2458, __FUNCTION__))->omp_clause.subcode.map_kind)) &
((1 << 3) | (1 << 2))) && ((((enum gomp_map_kind
) (omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2458, __FUNCTION__))->omp_clause.subcode.map_kind)) &
(1 << 0)))
)
2459 map_kind = GOMP_MAP_TO;
2460 else if (OMP_CLAUSE_MAP_KIND (node)((enum gomp_map_kind) (omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2460, __FUNCTION__))->omp_clause.subcode.map_kind)
== GOMP_MAP_RELEASE
2461 || OMP_CLAUSE_MAP_KIND (node)((enum gomp_map_kind) (omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2461, __FUNCTION__))->omp_clause.subcode.map_kind)
== GOMP_MAP_DELETE)
2462 map_kind = OMP_CLAUSE_MAP_KIND (node)((enum gomp_map_kind) (omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2462, __FUNCTION__))->omp_clause.subcode.map_kind)
;
2463 else
2464 map_kind = GOMP_MAP_ALLOC;
2465 gcc_assert (se.string_length)((void)(!(se.string_length) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2465, __FUNCTION__), 0 : 0))
;
2466 node4 = build_omp_clause (input_location, OMP_CLAUSE_MAP);
2467 OMP_CLAUSE_SET_MAP_KIND (node4, map_kind)((omp_clause_subcode_check ((node4), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2467, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (map_kind))
;
2468 OMP_CLAUSE_DECL (node4)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node4), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2468, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2468, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2468, __FUNCTION__)))
= se.string_length;
2469 OMP_CLAUSE_SIZE (node4)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node4), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2469, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2469, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2469, __FUNCTION__)))
= TYPE_SIZE_UNIT (gfc_charlen_type_node)((tree_class_check ((gfc_charlen_type_node), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2469, __FUNCTION__))->type_common.size_unit)
;
2470 }
2471 if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2471, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2471, __FUNCTION__))->type_common.lang_flag_1)
)
2472 {
2473 tree desc_node;
2474 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2474, __FUNCTION__))->typed.type)
;
2475 ptr2 = gfc_conv_descriptor_data_get (decl);
2476 desc_node = build_omp_clause (input_location, OMP_CLAUSE_MAP);
2477 OMP_CLAUSE_DECL (desc_node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((desc_node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2477, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2477, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2477, __FUNCTION__)))
= decl;
2478 OMP_CLAUSE_SIZE (desc_node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((desc_node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2478, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2478, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2478, __FUNCTION__)))
= TYPE_SIZE_UNIT (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2478, __FUNCTION__))->type_common.size_unit)
;
2479 if (ptr_kind == GOMP_MAP_ALWAYS_POINTER)
2480 {
2481 OMP_CLAUSE_SET_MAP_KIND (desc_node, GOMP_MAP_TO)((omp_clause_subcode_check ((desc_node), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2481, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_TO))
;
2482 node2 = node;
2483 node = desc_node; /* Needs to come first. */
2484 }
2485 else
2486 {
2487 OMP_CLAUSE_SET_MAP_KIND (desc_node, GOMP_MAP_TO_PSET)((omp_clause_subcode_check ((desc_node), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2487, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_TO_PSET))
;
2488 node2 = desc_node;
2489 }
2490 node3 = build_omp_clause (input_location,
2491 OMP_CLAUSE_MAP);
2492 OMP_CLAUSE_SET_MAP_KIND (node3, ptr_kind)((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2492, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (ptr_kind))
;
2493 OMP_CLAUSE_DECL (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2493, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2493, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2493, __FUNCTION__)))
2494 = gfc_conv_descriptor_data_get (decl);
2495 /* This purposely does not include GOMP_MAP_ALWAYS_POINTER. The extra
2496 cast prevents gimplify.cc from recognising it as being part of the
2497 struct - and adding an 'alloc: for the 'desc.data' pointer, which
2498 would break as the 'desc' (the descriptor) is also mapped
2499 (see node4 above). */
2500 if (ptr_kind == GOMP_MAP_ATTACH_DETACH)
2501 STRIP_NOPS (OMP_CLAUSE_DECL (node3))((*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2501, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2501, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2501, __FUNCTION__)))) = tree_strip_nop_conversions ((const_cast
<union tree_node *> ((((*(omp_clause_elt_check (((omp_clause_range_check
(((tree_check ((node3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2501, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2501, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2501, __FUNCTION__))))))))
;
2502 }
2503 else
2504 {
2505 if (TREE_CODE (TREE_TYPE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2505, __FUNCTION__))->typed.type))->base.code)
== ARRAY_TYPE)
2506 {
2507 tree offset;
2508 ptr2 = build_fold_addr_expr (decl)build_fold_addr_expr_loc (((location_t) 0), (decl));
2509 offset = fold_build2 (MINUS_EXPR, ptrdiff_type_node, ptr,fold_build2_loc (((location_t) 0), MINUS_EXPR, global_trees[TI_PTRDIFF_TYPE
], ptr, fold_convert_loc (((location_t) 0), global_trees[TI_PTRDIFF_TYPE
], ptr2) )
2510 fold_convert (ptrdiff_type_node, ptr2))fold_build2_loc (((location_t) 0), MINUS_EXPR, global_trees[TI_PTRDIFF_TYPE
], ptr, fold_convert_loc (((location_t) 0), global_trees[TI_PTRDIFF_TYPE
], ptr2) )
;
2511 offset = build2 (TRUNC_DIV_EXPR, ptrdiff_type_nodeglobal_trees[TI_PTRDIFF_TYPE],
2512 offset, fold_convert (ptrdiff_type_node, elemsz)fold_convert_loc (((location_t) 0), global_trees[TI_PTRDIFF_TYPE
], elemsz)
);
2513 offset = build4_loc (input_location, ARRAY_REF,
2514 TREE_TYPE (TREE_TYPE (decl))((contains_struct_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2514, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2514, __FUNCTION__))->typed.type)
,
2515 decl, offset, NULL_TREE(tree) __null, NULL_TREE(tree) __null);
2516 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2516, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2516, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2516, __FUNCTION__)))
= offset;
2517
2518 if (ptr_kind == GOMP_MAP_ALWAYS_POINTER)
2519 return;
2520 }
2521 else
2522 {
2523 gcc_assert (POINTER_TYPE_P (TREE_TYPE (decl)))((void)(!((((enum tree_code) (((contains_struct_check ((decl)
, (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2523, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2523, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2523, __FUNCTION__), 0 : 0))
;
2524 ptr2 = decl;
2525 }
2526 node3 = build_omp_clause (input_location,
2527 OMP_CLAUSE_MAP);
2528 OMP_CLAUSE_SET_MAP_KIND (node3, ptr_kind)((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2528, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (ptr_kind))
;
2529 OMP_CLAUSE_DECL (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2529, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2529, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2529, __FUNCTION__)))
= decl;
2530 }
2531 ptr2 = fold_convert (ptrdiff_type_node, ptr2)fold_convert_loc (((location_t) 0), global_trees[TI_PTRDIFF_TYPE
], ptr2)
;
2532 OMP_CLAUSE_SIZE (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2532, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2532, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2532, __FUNCTION__)))
= fold_build2 (MINUS_EXPR, ptrdiff_type_node,fold_build2_loc (((location_t) 0), MINUS_EXPR, global_trees[TI_PTRDIFF_TYPE
], ptr, ptr2 )
2533 ptr, ptr2)fold_build2_loc (((location_t) 0), MINUS_EXPR, global_trees[TI_PTRDIFF_TYPE
], ptr, ptr2 )
;
2534}
2535
2536static tree
2537handle_iterator (gfc_namespace *ns, stmtblock_t *iter_block, tree block)
2538{
2539 tree list = NULL_TREE(tree) __null;
2540 for (gfc_symbol *sym = ns->omp_affinity_iterators; sym; sym = sym->tlink)
2541 {
2542 gfc_constructor *c;
2543 gfc_se se;
2544
2545 tree last = make_tree_vec (6);
2546 tree iter_var = gfc_get_symbol_decl (sym);
2547 tree type = TREE_TYPE (iter_var)((contains_struct_check ((iter_var), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2547, __FUNCTION__))->typed.type)
;
2548 TREE_VEC_ELT (last, 0)(*((const_cast<tree *> (tree_vec_elt_check ((last), (0)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2548, __FUNCTION__)))))
= iter_var;
2549 DECL_CHAIN (iter_var)(((contains_struct_check (((contains_struct_check ((iter_var)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2549, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2549, __FUNCTION__))->common.chain))
= BLOCK_VARS (block)((tree_check ((block), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2549, __FUNCTION__, (BLOCK)))->block.vars)
;
2550 BLOCK_VARS (block)((tree_check ((block), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2550, __FUNCTION__, (BLOCK)))->block.vars)
= iter_var;
2551
2552 /* begin */
2553 c = gfc_constructor_first (sym->value->value.constructor);
2554 gfc_init_se (&se, NULL__null);
2555 gfc_conv_expr (&se, c->expr);
2556 gfc_add_block_to_block (iter_block, &se.pre);
2557 gfc_add_block_to_block (iter_block, &se.post);
2558 TREE_VEC_ELT (last, 1)(*((const_cast<tree *> (tree_vec_elt_check ((last), (1)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2558, __FUNCTION__)))))
= fold_convert (type,fold_convert_loc (((location_t) 0), type, gfc_evaluate_now (se
.expr, iter_block))
2559 gfc_evaluate_now (se.expr,fold_convert_loc (((location_t) 0), type, gfc_evaluate_now (se
.expr, iter_block))
2560 iter_block))fold_convert_loc (((location_t) 0), type, gfc_evaluate_now (se
.expr, iter_block))
;
2561 /* end */
2562 c = gfc_constructor_next (c);
2563 gfc_init_se (&se, NULL__null);
2564 gfc_conv_expr (&se, c->expr);
2565 gfc_add_block_to_block (iter_block, &se.pre);
2566 gfc_add_block_to_block (iter_block, &se.post);
2567 TREE_VEC_ELT (last, 2)(*((const_cast<tree *> (tree_vec_elt_check ((last), (2)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2567, __FUNCTION__)))))
= fold_convert (type,fold_convert_loc (((location_t) 0), type, gfc_evaluate_now (se
.expr, iter_block))
2568 gfc_evaluate_now (se.expr,fold_convert_loc (((location_t) 0), type, gfc_evaluate_now (se
.expr, iter_block))
2569 iter_block))fold_convert_loc (((location_t) 0), type, gfc_evaluate_now (se
.expr, iter_block))
;
2570 /* step */
2571 c = gfc_constructor_next (c);
2572 tree step;
2573 if (c)
2574 {
2575 gfc_init_se (&se, NULL__null);
2576 gfc_conv_expr (&se, c->expr);
2577 gfc_add_block_to_block (iter_block, &se.pre);
2578 gfc_add_block_to_block (iter_block, &se.post);
2579 gfc_conv_expr (&se, c->expr);
2580 step = fold_convert (type,fold_convert_loc (((location_t) 0), type, gfc_evaluate_now (se
.expr, iter_block))
2581 gfc_evaluate_now (se.expr,fold_convert_loc (((location_t) 0), type, gfc_evaluate_now (se
.expr, iter_block))
2582 iter_block))fold_convert_loc (((location_t) 0), type, gfc_evaluate_now (se
.expr, iter_block))
;
2583 }
2584 else
2585 step = build_int_cst (type, 1);
2586 TREE_VEC_ELT (last, 3)(*((const_cast<tree *> (tree_vec_elt_check ((last), (3)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2586, __FUNCTION__)))))
= step;
2587 /* orig_step */
2588 TREE_VEC_ELT (last, 4)(*((const_cast<tree *> (tree_vec_elt_check ((last), (4)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2588, __FUNCTION__)))))
= save_expr (step);
2589 TREE_CHAIN (last)((contains_struct_check ((last), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2589, __FUNCTION__))->common.chain)
= list;
2590 list = last;
2591 }
2592 return list;
2593}
2594
2595static tree
2596gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
2597 locus where, bool declare_simd = false,
2598 bool openacc = false)
2599{
2600 tree omp_clauses = NULL_TREE(tree) __null, prev_clauses, chunk_size, c;
2601 tree iterator = NULL_TREE(tree) __null;
2602 tree tree_block = NULL_TREE(tree) __null;
2603 stmtblock_t iter_block;
2604 int list, ifc;
2605 enum omp_clause_code clause_code;
2606 gfc_omp_namelist *prev = NULL__null;
2607 gfc_se se;
2608
2609 if (clauses == NULL__null)
2610 return NULL_TREE(tree) __null;
2611
2612 for (list = 0; list < OMP_LIST_NUM; list++)
2613 {
2614 gfc_omp_namelist *n = clauses->lists[list];
2615
2616 if (n == NULL__null)
2617 continue;
2618 switch (list)
2619 {
2620 case OMP_LIST_REDUCTION:
2621 case OMP_LIST_REDUCTION_INSCAN:
2622 case OMP_LIST_REDUCTION_TASK:
2623 case OMP_LIST_IN_REDUCTION:
2624 case OMP_LIST_TASK_REDUCTION:
2625 /* An OpenACC async clause indicates the need to set reduction
2626 arguments addressable, to allow asynchronous copy-out. */
2627 omp_clauses = gfc_trans_omp_reduction_list (list, n, omp_clauses,
2628 where, clauses->async);
2629 break;
2630 case OMP_LIST_PRIVATE:
2631 clause_code = OMP_CLAUSE_PRIVATE;
2632 goto add_clause;
2633 case OMP_LIST_SHARED:
2634 clause_code = OMP_CLAUSE_SHARED;
2635 goto add_clause;
2636 case OMP_LIST_FIRSTPRIVATE:
2637 clause_code = OMP_CLAUSE_FIRSTPRIVATE;
2638 goto add_clause;
2639 case OMP_LIST_LASTPRIVATE:
2640 clause_code = OMP_CLAUSE_LASTPRIVATE;
2641 goto add_clause;
2642 case OMP_LIST_COPYIN:
2643 clause_code = OMP_CLAUSE_COPYIN;
2644 goto add_clause;
2645 case OMP_LIST_COPYPRIVATE:
2646 clause_code = OMP_CLAUSE_COPYPRIVATE;
2647 goto add_clause;
2648 case OMP_LIST_UNIFORM:
2649 clause_code = OMP_CLAUSE_UNIFORM;
2650 goto add_clause;
2651 case OMP_LIST_USE_DEVICE:
2652 case OMP_LIST_USE_DEVICE_PTR:
2653 clause_code = OMP_CLAUSE_USE_DEVICE_PTR;
2654 goto add_clause;
2655 case OMP_LIST_USE_DEVICE_ADDR:
2656 clause_code = OMP_CLAUSE_USE_DEVICE_ADDR;
2657 goto add_clause;
2658 case OMP_LIST_IS_DEVICE_PTR:
2659 clause_code = OMP_CLAUSE_IS_DEVICE_PTR;
2660 goto add_clause;
2661 case OMP_LIST_HAS_DEVICE_ADDR:
2662 clause_code = OMP_CLAUSE_HAS_DEVICE_ADDR;
2663 goto add_clause;
2664 case OMP_LIST_NONTEMPORAL:
2665 clause_code = OMP_CLAUSE_NONTEMPORAL;
2666 goto add_clause;
2667 case OMP_LIST_SCAN_IN:
2668 clause_code = OMP_CLAUSE_INCLUSIVE;
2669 goto add_clause;
2670 case OMP_LIST_SCAN_EX:
2671 clause_code = OMP_CLAUSE_EXCLUSIVE;
2672 goto add_clause;
2673
2674 add_clause:
2675 omp_clauses
2676 = gfc_trans_omp_variable_list (clause_code, n, omp_clauses,
2677 declare_simd);
2678 break;
2679 case OMP_LIST_ALIGNED:
2680 for (; n != NULL__null; n = n->next)
2681 if (n->sym->attr.referenced || declare_simd)
2682 {
2683 tree t = gfc_trans_omp_variable (n->sym, declare_simd);
2684 if (t != error_mark_nodeglobal_trees[TI_ERROR_MARK])
2685 {
2686 tree node = build_omp_clause (input_location,
2687 OMP_CLAUSE_ALIGNED);
2688 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2688, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2688, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2688, __FUNCTION__)))
= t;
2689 if (n->expr)
2690 {
2691 tree alignment_var;
2692
2693 if (declare_simd)
2694 alignment_var = gfc_conv_constant_to_tree (n->expr);
2695 else
2696 {
2697 gfc_init_se (&se, NULL__null);
2698 gfc_conv_expr (&se, n->expr);
2699 gfc_add_block_to_block (block, &se.pre);
2700 alignment_var = gfc_evaluate_now (se.expr, block);
2701 gfc_add_block_to_block (block, &se.post);
2702 }
2703 OMP_CLAUSE_ALIGNED_ALIGNMENT (node)(*(omp_clause_elt_check (((omp_clause_subcode_check ((node), (
OMP_CLAUSE_ALIGNED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2703, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2703, __FUNCTION__)))
= alignment_var;
2704 }
2705 omp_clauses = gfc_trans_add_clause (node, omp_clauses);
2706 }
2707 }
2708 break;
2709 case OMP_LIST_ALLOCATE:
2710 for (; n != NULL__null; n = n->next)
2711 if (n->sym->attr.referenced)
2712 {
2713 tree t = gfc_trans_omp_variable (n->sym, false);
2714 if (t != error_mark_nodeglobal_trees[TI_ERROR_MARK])
2715 {
2716 tree node = build_omp_clause (input_location,
2717 OMP_CLAUSE_ALLOCATE);
2718 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2718, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2718, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2718, __FUNCTION__)))
= t;
2719 if (n->expr)
2720 {
2721 tree allocator_;
2722 gfc_init_se (&se, NULL__null);
2723 gfc_conv_expr (&se, n->expr);
2724 allocator_ = gfc_evaluate_now (se.expr, block);
2725 OMP_CLAUSE_ALLOCATE_ALLOCATOR (node)(*(omp_clause_elt_check (((omp_clause_subcode_check ((node), (
OMP_CLAUSE_ALLOCATE), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2725, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2725, __FUNCTION__)))
= allocator_;
2726 }
2727 if (n->u.align)
2728 {
2729 tree align_;
2730 gfc_init_se (&se, NULL__null);
2731 gfc_conv_expr (&se, n->u.align);
2732 align_ = gfc_evaluate_now (se.expr, block);
2733 OMP_CLAUSE_ALLOCATE_ALIGN (node)(*(omp_clause_elt_check (((omp_clause_subcode_check ((node), (
OMP_CLAUSE_ALLOCATE), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2733, __FUNCTION__))), (2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2733, __FUNCTION__)))
= align_;
2734 }
2735 omp_clauses = gfc_trans_add_clause (node, omp_clauses);
2736 }
2737 }
2738 break;
2739 case OMP_LIST_LINEAR:
2740 {
2741 gfc_expr *last_step_expr = NULL__null;
2742 tree last_step = NULL_TREE(tree) __null;
2743 bool last_step_parm = false;
2744
2745 for (; n != NULL__null; n = n->next)
2746 {
2747 if (n->expr)
2748 {
2749 last_step_expr = n->expr;
2750 last_step = NULL_TREE(tree) __null;
2751 last_step_parm = false;
2752 }
2753 if (n->sym->attr.referenced || declare_simd)
2754 {
2755 tree t = gfc_trans_omp_variable (n->sym, declare_simd);
2756 if (t != error_mark_nodeglobal_trees[TI_ERROR_MARK])
2757 {
2758 tree node = build_omp_clause (input_location,
2759 OMP_CLAUSE_LINEAR);
2760 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2760, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2760, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2760, __FUNCTION__)))
= t;
2761 omp_clause_linear_kind kind;
2762 switch (n->u.linear.op)
2763 {
2764 case OMP_LINEAR_DEFAULT:
2765 kind = OMP_CLAUSE_LINEAR_DEFAULT;
2766 break;
2767 case OMP_LINEAR_REF:
2768 kind = OMP_CLAUSE_LINEAR_REF;
2769 break;
2770 case OMP_LINEAR_VAL:
2771 kind = OMP_CLAUSE_LINEAR_VAL;
2772 break;
2773 case OMP_LINEAR_UVAL:
2774 kind = OMP_CLAUSE_LINEAR_UVAL;
2775 break;
2776 default:
2777 gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2777, __FUNCTION__))
;
2778 }
2779 OMP_CLAUSE_LINEAR_KIND (node)((omp_clause_subcode_check ((node), (OMP_CLAUSE_LINEAR), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2779, __FUNCTION__))->omp_clause.subcode.linear_kind)
= kind;
2780 OMP_CLAUSE_LINEAR_OLD_LINEAR_MODIFIER (node)((omp_clause_subcode_check ((node), (OMP_CLAUSE_LINEAR), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2780, __FUNCTION__))->base.addressable_flag)
2781 = n->u.linear.old_modifier;
2782 if (last_step_expr && last_step == NULL_TREE(tree) __null)
2783 {
2784 if (!declare_simd)
2785 {
2786 gfc_init_se (&se, NULL__null);
2787 gfc_conv_expr (&se, last_step_expr);
2788 gfc_add_block_to_block (block, &se.pre);
2789 last_step = gfc_evaluate_now (se.expr, block);
2790 gfc_add_block_to_block (block, &se.post);
2791 }
2792 else if (last_step_expr->expr_type == EXPR_VARIABLE)
2793 {
2794 gfc_symbol *s = last_step_expr->symtree->n.sym;
2795 last_step = gfc_trans_omp_variable (s, true);
2796 last_step_parm = true;
2797 }
2798 else
2799 last_step
2800 = gfc_conv_constant_to_tree (last_step_expr);
2801 }
2802 if (last_step_parm)
2803 {
2804 OMP_CLAUSE_LINEAR_VARIABLE_STRIDE (node)(((omp_clause_subcode_check ((node), (OMP_CLAUSE_LINEAR), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2804, __FUNCTION__)))->base.protected_flag)
= 1;
2805 OMP_CLAUSE_LINEAR_STEP (node)(*(omp_clause_elt_check (((omp_clause_subcode_check ((node), (
OMP_CLAUSE_LINEAR), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2805, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2805, __FUNCTION__)))
= last_step;
2806 }
2807 else
2808 {
2809 if (kind == OMP_CLAUSE_LINEAR_REF)
2810 {
2811 tree type;
2812 if (n->sym->attr.flavor == FL_PROCEDURE)
2813 {
2814 type = gfc_get_function_type (n->sym);
2815 type = build_pointer_type (type);
2816 }
2817 else
2818 type = gfc_sym_type (n->sym);
2819 if (POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || (
(enum tree_code) (type)->base.code) == REFERENCE_TYPE)
)
2820 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2820, __FUNCTION__))->typed.type)
;
2821 /* Otherwise to be determined what exactly
2822 should be done. */
2823 tree t = fold_convert (sizetype, last_step)fold_convert_loc (((location_t) 0), sizetype_tab[(int) stk_sizetype
], last_step)
;
2824 t = size_binop (MULT_EXPR, t,size_binop_loc (((location_t) 0), MULT_EXPR, t, ((tree_class_check
((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2825, __FUNCTION__))->type_common.size_unit))
2825 TYPE_SIZE_UNIT (type))size_binop_loc (((location_t) 0), MULT_EXPR, t, ((tree_class_check
((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2825, __FUNCTION__))->type_common.size_unit))
;
2826 OMP_CLAUSE_LINEAR_STEP (node)(*(omp_clause_elt_check (((omp_clause_subcode_check ((node), (
OMP_CLAUSE_LINEAR), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2826, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2826, __FUNCTION__)))
= t;
2827 }
2828 else
2829 {
2830 tree type
2831 = gfc_typenode_for_spec (&n->sym->ts);
2832 OMP_CLAUSE_LINEAR_STEP (node)(*(omp_clause_elt_check (((omp_clause_subcode_check ((node), (
OMP_CLAUSE_LINEAR), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2832, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2832, __FUNCTION__)))
2833 = fold_convert (type, last_step)fold_convert_loc (((location_t) 0), type, last_step);
2834 }
2835 }
2836 if (n->sym->attr.dimension || n->sym->attr.allocatable)
2837 OMP_CLAUSE_LINEAR_ARRAY (node)((omp_clause_subcode_check ((node), (OMP_CLAUSE_LINEAR), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2837, __FUNCTION__))->base.deprecated_flag)
= 1;
2838 omp_clauses = gfc_trans_add_clause (node, omp_clauses);
2839 }
2840 }
2841 }
2842 }
2843 break;
2844 case OMP_LIST_AFFINITY:
2845 case OMP_LIST_DEPEND:
2846 iterator = NULL_TREE(tree) __null;
2847 prev = NULL__null;
2848 prev_clauses = omp_clauses;
2849 for (; n != NULL__null; n = n->next)
2850 {
2851 if (iterator && prev->u2.ns != n->u2.ns)
2852 {
2853 BLOCK_SUBBLOCKS (tree_block)((tree_check ((tree_block), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2853, __FUNCTION__, (BLOCK)))->block.subblocks)
= gfc_finish_block (&iter_block);
2854 TREE_VEC_ELT (iterator, 5)(*((const_cast<tree *> (tree_vec_elt_check ((iterator),
(5), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2854, __FUNCTION__)))))
= tree_block;
2855 for (tree c = omp_clauses; c != prev_clauses;
2856 c = OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2856, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2856, __FUNCTION__))->common.chain)
)
2857 OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2857, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2857, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2857, __FUNCTION__)))
= build_tree_list (iterator,
2858 OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2858, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2858, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2858, __FUNCTION__)))
);
2859 prev_clauses = omp_clauses;
2860 iterator = NULL_TREE(tree) __null;
2861 }
2862 if (n->u2.ns && (!prev || prev->u2.ns != n->u2.ns))
2863 {
2864 gfc_init_block (&iter_block);
2865 tree_block = make_node (BLOCK);
2866 TREE_USED (tree_block)((tree_block)->base.used_flag) = 1;
2867 BLOCK_VARS (tree_block)((tree_check ((tree_block), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2867, __FUNCTION__, (BLOCK)))->block.vars)
= NULL_TREE(tree) __null;
2868 iterator = handle_iterator (n->u2.ns, block,
2869 tree_block);
2870 }
2871 if (!iterator)
2872 gfc_init_block (&iter_block);
2873 prev = n;
2874 if (list == OMP_LIST_DEPEND
2875 && (n->u.depend_doacross_op == OMP_DOACROSS_SINK_FIRST
2876 || n->u.depend_doacross_op == OMP_DEPEND_SINK_FIRST))
2877 {
2878 tree vec = NULL_TREE(tree) __null;
2879 unsigned int i;
2880 bool is_depend
2881 = n->u.depend_doacross_op == OMP_DEPEND_SINK_FIRST;
2882 for (i = 0; ; i++)
2883 {
2884 tree addend = integer_zero_nodeglobal_trees[TI_INTEGER_ZERO], t;
2885 bool neg = false;
2886 if (n->sym && n->expr)
2887 {
2888 addend = gfc_conv_constant_to_tree (n->expr);
2889 if (TREE_CODE (addend)((enum tree_code) (addend)->base.code) == INTEGER_CST
2890 && tree_int_cst_sgn (addend) == -1)
2891 {
2892 neg = true;
2893 addend = const_unop (NEGATE_EXPR,
2894 TREE_TYPE (addend)((contains_struct_check ((addend), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2894, __FUNCTION__))->typed.type)
, addend);
2895 }
2896 }
2897
2898 if (n->sym == NULL__null)
2899 t = null_pointer_nodeglobal_trees[TI_NULL_POINTER]; /* "omp_cur_iteration - 1". */
2900 else
2901 t = gfc_trans_omp_variable (n->sym, false);
2902 if (t != error_mark_nodeglobal_trees[TI_ERROR_MARK])
2903 {
2904 if (i < vec_safe_length (doacross_steps)
2905 && !integer_zerop (addend)
2906 && (*doacross_steps)[i])
2907 {
2908 tree step = (*doacross_steps)[i];
2909 addend = fold_convert (TREE_TYPE (step), addend)fold_convert_loc (((location_t) 0), ((contains_struct_check (
(step), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2909, __FUNCTION__))->typed.type), addend)
;
2910 addend = build2 (TRUNC_DIV_EXPR,
2911 TREE_TYPE (step)((contains_struct_check ((step), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2911, __FUNCTION__))->typed.type)
, addend, step);
2912 }
2913 vec = tree_cons (addend, t, vec);
2914 if (neg)
2915 OMP_CLAUSE_DOACROSS_SINK_NEGATIVE (vec)(((tree_check ((vec), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2915, __FUNCTION__, (TREE_LIST))))->base.public_flag)
= 1;
2916 }
2917 if (n->next == NULL__null
2918 || n->next->u.depend_doacross_op != OMP_DOACROSS_SINK)
2919 break;
2920 n = n->next;
2921 }
2922 if (vec == NULL_TREE(tree) __null)
2923 continue;
2924
2925 tree node = build_omp_clause (input_location,
2926 OMP_CLAUSE_DOACROSS);
2927 OMP_CLAUSE_DOACROSS_KIND (node)((omp_clause_subcode_check ((node), (OMP_CLAUSE_DOACROSS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2927, __FUNCTION__))->omp_clause.subcode.doacross_kind)
= OMP_CLAUSE_DOACROSS_SINK;
2928 OMP_CLAUSE_DOACROSS_DEPEND (node)(((omp_clause_subcode_check ((node), (OMP_CLAUSE_DOACROSS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2928, __FUNCTION__)))->base.protected_flag)
= is_depend;
2929 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2929, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2929, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2929, __FUNCTION__)))
= nreverse (vec);
2930 omp_clauses = gfc_trans_add_clause (node, omp_clauses);
2931 continue;
2932 }
2933
2934 if (n->sym && !n->sym->attr.referenced)
2935 continue;
2936
2937 tree node = build_omp_clause (input_location,
2938 list == OMP_LIST_DEPEND
2939 ? OMP_CLAUSE_DEPEND
2940 : OMP_CLAUSE_AFFINITY);
2941 if (n->sym == NULL__null) /* omp_all_memory */
2942 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2942, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2942, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2942, __FUNCTION__)))
= null_pointer_nodeglobal_trees[TI_NULL_POINTER];
2943 else if (n->expr == NULL__null || n->expr->ref->u.ar.type == AR_FULL)
2944 {
2945 tree decl = gfc_trans_omp_variable (n->sym, false);
2946 if (gfc_omp_privatize_by_reference (decl))
2947 decl = build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
2948 if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2948, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2948, __FUNCTION__))->type_common.lang_flag_1)
)
2949 {
2950 decl = gfc_conv_descriptor_data_get (decl);
2951 gcc_assert (POINTER_TYPE_P (TREE_TYPE (decl)))((void)(!((((enum tree_code) (((contains_struct_check ((decl)
, (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2951, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2951, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2951, __FUNCTION__), 0 : 0))
;
2952 decl = build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
2953 }
2954 else if (n->sym->attr.allocatable || n->sym->attr.pointer)
2955 decl = build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
2956 else if (DECL_P (decl)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (decl)->base.code))] == tcc_declaration)
)
2957 TREE_ADDRESSABLE (decl)((decl)->base.addressable_flag) = 1;
2958 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2958, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2958, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2958, __FUNCTION__)))
= decl;
2959 }
2960 else
2961 {
2962 tree ptr;
2963 gfc_init_se (&se, NULL__null);
2964 if (n->expr->ref->u.ar.type == AR_ELEMENT)
2965 {
2966 gfc_conv_expr_reference (&se, n->expr);
2967 ptr = se.expr;
2968 }
2969 else
2970 {
2971 gfc_conv_expr_descriptor (&se, n->expr);
2972 ptr = gfc_conv_array_data (se.expr);
2973 }
2974 gfc_add_block_to_block (&iter_block, &se.pre);
2975 gfc_add_block_to_block (&iter_block, &se.post);
2976 gcc_assert (POINTER_TYPE_P (TREE_TYPE (ptr)))((void)(!((((enum tree_code) (((contains_struct_check ((ptr),
(TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2976, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((ptr), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2976, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2976, __FUNCTION__), 0 : 0))
;
2977 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2977, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2977, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2977, __FUNCTION__)))
= build_fold_indirect_ref (ptr)build_fold_indirect_ref_loc (((location_t) 0), ptr);
2978 }
2979 if (list == OMP_LIST_DEPEND)
2980 switch (n->u.depend_doacross_op)
2981 {
2982 case OMP_DEPEND_IN:
2983 OMP_CLAUSE_DEPEND_KIND (node)((omp_clause_subcode_check ((node), (OMP_CLAUSE_DEPEND), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2983, __FUNCTION__))->omp_clause.subcode.depend_kind)
= OMP_CLAUSE_DEPEND_IN;
2984 break;
2985 case OMP_DEPEND_OUT:
2986 OMP_CLAUSE_DEPEND_KIND (node)((omp_clause_subcode_check ((node), (OMP_CLAUSE_DEPEND), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2986, __FUNCTION__))->omp_clause.subcode.depend_kind)
= OMP_CLAUSE_DEPEND_OUT;
2987 break;
2988 case OMP_DEPEND_INOUT:
2989 OMP_CLAUSE_DEPEND_KIND (node)((omp_clause_subcode_check ((node), (OMP_CLAUSE_DEPEND), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2989, __FUNCTION__))->omp_clause.subcode.depend_kind)
= OMP_CLAUSE_DEPEND_INOUT;
2990 break;
2991 case OMP_DEPEND_INOUTSET:
2992 OMP_CLAUSE_DEPEND_KIND (node)((omp_clause_subcode_check ((node), (OMP_CLAUSE_DEPEND), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2992, __FUNCTION__))->omp_clause.subcode.depend_kind)
= OMP_CLAUSE_DEPEND_INOUTSET;
2993 break;
2994 case OMP_DEPEND_MUTEXINOUTSET:
2995 OMP_CLAUSE_DEPEND_KIND (node)((omp_clause_subcode_check ((node), (OMP_CLAUSE_DEPEND), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2995, __FUNCTION__))->omp_clause.subcode.depend_kind)
2996 = OMP_CLAUSE_DEPEND_MUTEXINOUTSET;
2997 break;
2998 case OMP_DEPEND_DEPOBJ:
2999 OMP_CLAUSE_DEPEND_KIND (node)((omp_clause_subcode_check ((node), (OMP_CLAUSE_DEPEND), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 2999, __FUNCTION__))->omp_clause.subcode.depend_kind)
= OMP_CLAUSE_DEPEND_DEPOBJ;
3000 break;
3001 default:
3002 gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3002, __FUNCTION__))
;
3003 }
3004 if (!iterator)
3005 gfc_add_block_to_block (block, &iter_block);
3006 omp_clauses = gfc_trans_add_clause (node, omp_clauses);
3007 }
3008 if (iterator)
3009 {
3010 BLOCK_SUBBLOCKS (tree_block)((tree_check ((tree_block), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3010, __FUNCTION__, (BLOCK)))->block.subblocks)
= gfc_finish_block (&iter_block);
3011 TREE_VEC_ELT (iterator, 5)(*((const_cast<tree *> (tree_vec_elt_check ((iterator),
(5), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3011, __FUNCTION__)))))
= tree_block;
3012 for (tree c = omp_clauses; c != prev_clauses;
3013 c = OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3013, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3013, __FUNCTION__))->common.chain)
)
3014 OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3014, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3014, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3014, __FUNCTION__)))
= build_tree_list (iterator,
3015 OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3015, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3015, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3015, __FUNCTION__)))
);
3016 }
3017 break;
3018 case OMP_LIST_MAP:
3019 for (; n != NULL__null; n = n->next)
3020 {
3021 if (!n->sym->attr.referenced)
3022 continue;
3023
3024 bool always_modifier = false;
3025 tree node = build_omp_clause (input_location, OMP_CLAUSE_MAP);
3026 tree node2 = NULL_TREE(tree) __null;
3027 tree node3 = NULL_TREE(tree) __null;
3028 tree node4 = NULL_TREE(tree) __null;
3029
3030 /* OpenMP: automatically map pointer targets with the pointer;
3031 hence, always update the descriptor/pointer itself. */
3032 if (!openacc
3033 && ((n->expr == NULL__null && n->sym->attr.pointer)
3034 || (n->expr && gfc_expr_attr (n->expr).pointer)))
3035 always_modifier = true;
3036
3037 switch (n->u.map_op)
3038 {
3039 case OMP_MAP_ALLOC:
3040 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_ALLOC)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3040, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_ALLOC))
;
3041 break;
3042 case OMP_MAP_IF_PRESENT:
3043 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_IF_PRESENT)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3043, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_IF_PRESENT))
;
3044 break;
3045 case OMP_MAP_ATTACH:
3046 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_ATTACH)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3046, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_ATTACH))
;
3047 break;
3048 case OMP_MAP_TO:
3049 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_TO)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3049, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_TO))
;
3050 break;
3051 case OMP_MAP_FROM:
3052 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_FROM)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3052, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_FROM))
;
3053 break;
3054 case OMP_MAP_TOFROM:
3055 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_TOFROM)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3055, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_TOFROM))
;
3056 break;
3057 case OMP_MAP_ALWAYS_TO:
3058 always_modifier = true;
3059 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_ALWAYS_TO)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3059, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_ALWAYS_TO))
;
3060 break;
3061 case OMP_MAP_ALWAYS_FROM:
3062 always_modifier = true;
3063 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_ALWAYS_FROM)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3063, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_ALWAYS_FROM))
;
3064 break;
3065 case OMP_MAP_ALWAYS_TOFROM:
3066 always_modifier = true;
3067 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_ALWAYS_TOFROM)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3067, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_ALWAYS_TOFROM))
;
3068 break;
3069 case OMP_MAP_RELEASE:
3070 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_RELEASE)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3070, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_RELEASE))
;
3071 break;
3072 case OMP_MAP_DELETE:
3073 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_DELETE)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3073, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_DELETE))
;
3074 break;
3075 case OMP_MAP_DETACH:
3076 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_DETACH)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3076, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_DETACH))
;
3077 break;
3078 case OMP_MAP_FORCE_ALLOC:
3079 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_FORCE_ALLOC)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3079, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_FORCE_ALLOC))
;
3080 break;
3081 case OMP_MAP_FORCE_TO:
3082 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_FORCE_TO)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3082, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_FORCE_TO))
;
3083 break;
3084 case OMP_MAP_FORCE_FROM:
3085 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_FORCE_FROM)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3085, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_FORCE_FROM))
;
3086 break;
3087 case OMP_MAP_FORCE_TOFROM:
3088 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_FORCE_TOFROM)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3088, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_FORCE_TOFROM))
;
3089 break;
3090 case OMP_MAP_FORCE_PRESENT:
3091 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_FORCE_PRESENT)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3091, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_FORCE_PRESENT))
;
3092 break;
3093 case OMP_MAP_FORCE_DEVICEPTR:
3094 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_FORCE_DEVICEPTR)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3094, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_FORCE_DEVICEPTR))
;
3095 break;
3096 default:
3097 gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3097, __FUNCTION__))
;
3098 }
3099
3100 tree decl = gfc_trans_omp_variable (n->sym, false);
3101 if (DECL_P (decl)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (decl)->base.code))] == tcc_declaration)
)
3102 TREE_ADDRESSABLE (decl)((decl)->base.addressable_flag) = 1;
3103
3104 gfc_ref *lastref = NULL__null;
3105
3106 if (n->expr)
3107 for (gfc_ref *ref = n->expr->ref; ref; ref = ref->next)
3108 if (ref->type == REF_COMPONENT || ref->type == REF_ARRAY)
3109 lastref = ref;
3110
3111 bool allocatable = false, pointer = false;
3112
3113 if (lastref && lastref->type == REF_COMPONENT)
3114 {
3115 gfc_component *c = lastref->u.c.component;
3116
3117 if (c->ts.type == BT_CLASS)
3118 {
3119 pointer = CLASS_DATA (c)c->ts.u.derived->components->attr.class_pointer;
3120 allocatable = CLASS_DATA (c)c->ts.u.derived->components->attr.allocatable;
3121 }
3122 else
3123 {
3124 pointer = c->attr.pointer;
3125 allocatable = c->attr.allocatable;
3126 }
3127 }
3128
3129 if (n->expr == NULL__null
3130 || (n->expr->ref->type == REF_ARRAY
3131 && n->expr->ref->u.ar.type == AR_FULL))
3132 {
3133 tree present = gfc_omp_check_optional_argument (decl, true);
3134 if (openacc && n->sym->ts.type == BT_CLASS)
3135 {
3136 if (n->sym->attr.optional)
3137 sorry ("optional class parameter");
3138 tree ptr = gfc_class_data_get (decl);
3139 ptr = build_fold_indirect_ref (ptr)build_fold_indirect_ref_loc (((location_t) 0), ptr);
3140 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3140, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3140, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3140, __FUNCTION__)))
= ptr;
3141 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3141, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3141, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3141, __FUNCTION__)))
= gfc_class_vtab_size_get (decl);
3142 node2 = build_omp_clause (input_location, OMP_CLAUSE_MAP);
3143 OMP_CLAUSE_SET_MAP_KIND (node2, GOMP_MAP_ATTACH_DETACH)((omp_clause_subcode_check ((node2), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3143, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_ATTACH_DETACH))
;
3144 OMP_CLAUSE_DECL (node2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3144, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3144, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3144, __FUNCTION__)))
= gfc_class_data_get (decl);
3145 OMP_CLAUSE_SIZE (node2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3145, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3145, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3145, __FUNCTION__)))
= size_int (0)size_int_kind (0, stk_sizetype);
3146 goto finalize_map_clause;
3147 }
3148 else if (POINTER_TYPE_P (TREE_TYPE (decl))(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3148, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3148, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)
3149 && (gfc_omp_privatize_by_reference (decl)
3150 || GFC_DECL_GET_SCALAR_POINTER (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3150, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3150, __FUNCTION__))->decl_common.lang_specific)->scalar_pointer
) : 0)
3151 || GFC_DECL_GET_SCALAR_ALLOCATABLE (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3151, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3151, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
3152 || GFC_DECL_CRAY_POINTEE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3152, __FUNCTION__))->decl_common.lang_flag_4)
3153 || GFC_DESCRIPTOR_TYPE_P((tree_class_check ((((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3154, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3154, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3154, __FUNCTION__))->type_common.lang_flag_1)
3154 (TREE_TYPE (TREE_TYPE (decl)))((tree_class_check ((((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3154, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3154, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3154, __FUNCTION__))->type_common.lang_flag_1)
3155 || (n->sym->ts.type == BT_DERIVED
3156 && (n->sym->ts.u.derived->ts.f90_type
3157 != BT_VOID))))
3158 {
3159 tree orig_decl = decl;
3160
3161 /* For nonallocatable, nonpointer arrays, a temporary
3162 variable is generated, but this one is only defined if
3163 the variable is present; hence, we now set it to NULL
3164 to avoid accessing undefined variables. We cannot use
3165 a temporary variable here as otherwise the replacement
3166 of the variables in omp-low.cc will not work. */
3167 if (present && GFC_ARRAY_TYPE_P (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3167, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3167, __FUNCTION__))->type_common.lang_flag_2)
)
3168 {
3169 tree tmp = fold_build2_loc (input_location,
3170 MODIFY_EXPR,
3171 void_type_nodeglobal_trees[TI_VOID_TYPE], decl,
3172 null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
3173 tree cond = fold_build1_loc (input_location,
3174 TRUTH_NOT_EXPR,
3175 boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE],
3176 present);
3177 gfc_add_expr_to_block (block,
3178 build3_loc (input_location,
3179 COND_EXPR,
3180 void_type_nodeglobal_trees[TI_VOID_TYPE],
3181 cond, tmp,
3182 NULL_TREE(tree) __null));
3183 }
3184 node4 = build_omp_clause (input_location,
3185 OMP_CLAUSE_MAP);
3186 OMP_CLAUSE_SET_MAP_KIND (node4, GOMP_MAP_POINTER)((omp_clause_subcode_check ((node4), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3186, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_POINTER))
;
3187 OMP_CLAUSE_DECL (node4)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node4), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3187, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3187, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3187, __FUNCTION__)))
= decl;
3188 OMP_CLAUSE_SIZE (node4)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node4), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3188, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3188, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3188, __FUNCTION__)))
= size_int (0)size_int_kind (0, stk_sizetype);
3189 decl = build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
3190 if ((TREE_CODE (TREE_TYPE (orig_decl))((enum tree_code) (((contains_struct_check ((orig_decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3190, __FUNCTION__))->typed.type))->base.code)
== REFERENCE_TYPE
3191 || gfc_omp_is_optional_argument (orig_decl))
3192 && (GFC_DECL_GET_SCALAR_POINTER (orig_decl)(((contains_struct_check ((orig_decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3192, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((orig_decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3192, __FUNCTION__))->decl_common.lang_specific)->scalar_pointer
) : 0)
3193 || GFC_DECL_GET_SCALAR_ALLOCATABLE (orig_decl)(((contains_struct_check ((orig_decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3193, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((orig_decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3193, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
))
3194 {
3195 node3 = build_omp_clause (input_location,
3196 OMP_CLAUSE_MAP);
3197 OMP_CLAUSE_SET_MAP_KIND (node3, GOMP_MAP_POINTER)((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3197, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_POINTER))
;
3198 OMP_CLAUSE_DECL (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3198, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3198, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3198, __FUNCTION__)))
= decl;
3199 OMP_CLAUSE_SIZE (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3199, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3199, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3199, __FUNCTION__)))
= size_int (0)size_int_kind (0, stk_sizetype);
3200 decl = build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
3201 }
3202 }
3203 if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3203, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3203, __FUNCTION__))->type_common.lang_flag_1)
)
3204 {
3205 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3205, __FUNCTION__))->typed.type)
;
3206 tree ptr = gfc_conv_descriptor_data_get (decl);
3207 if (present)
3208 ptr = gfc_build_cond_assign_expr (block, present, ptr,
3209 null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
3210 gcc_assert (POINTER_TYPE_P (TREE_TYPE (ptr)))((void)(!((((enum tree_code) (((contains_struct_check ((ptr),
(TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3210, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((ptr), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3210, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3210, __FUNCTION__), 0 : 0))
;
3211 ptr = build_fold_indirect_ref (ptr)build_fold_indirect_ref_loc (((location_t) 0), ptr);
3212 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3212, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3212, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3212, __FUNCTION__)))
= ptr;
3213 node2 = build_omp_clause (input_location,
3214 OMP_CLAUSE_MAP);
3215 OMP_CLAUSE_SET_MAP_KIND (node2, GOMP_MAP_TO_PSET)((omp_clause_subcode_check ((node2), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3215, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_TO_PSET))
;
3216 OMP_CLAUSE_DECL (node2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3216, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3216, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3216, __FUNCTION__)))
= decl;
3217 OMP_CLAUSE_SIZE (node2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3217, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3217, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3217, __FUNCTION__)))
= TYPE_SIZE_UNIT (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3217, __FUNCTION__))->type_common.size_unit)
;
3218 node3 = build_omp_clause (input_location,
3219 OMP_CLAUSE_MAP);
3220 if (present)
3221 {
3222 ptr = gfc_conv_descriptor_data_get (decl);
3223 ptr = gfc_build_addr_expr (NULL__null, ptr);
3224 ptr = gfc_build_cond_assign_expr (block, present, ptr,
3225 null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
3226 ptr = build_fold_indirect_ref (ptr)build_fold_indirect_ref_loc (((location_t) 0), ptr);
3227 OMP_CLAUSE_DECL (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3227, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3227, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3227, __FUNCTION__)))
= ptr;
3228 }
3229 else
3230 OMP_CLAUSE_DECL (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3230, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3230, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3230, __FUNCTION__)))
3231 = gfc_conv_descriptor_data_get (decl);
3232 OMP_CLAUSE_SIZE (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3232, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3232, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3232, __FUNCTION__)))
= size_int (0)size_int_kind (0, stk_sizetype);
3233 if (n->u.map_op == OMP_MAP_ATTACH)
3234 {
3235 /* Standalone attach clauses used with arrays with
3236 descriptors must copy the descriptor to the target,
3237 else they won't have anything to perform the
3238 attachment onto (see OpenACC 2.6, "2.6.3. Data
3239 Structures with Pointers"). */
3240 OMP_CLAUSE_SET_MAP_KIND (node3, GOMP_MAP_ATTACH)((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3240, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_ATTACH))
;
3241 /* We don't want to map PTR at all in this case, so
3242 delete its node and shuffle the others down. */
3243 node = node2;
3244 node2 = node3;
3245 node3 = NULL__null;
3246 goto finalize_map_clause;
3247 }
3248 else if (n->u.map_op == OMP_MAP_DETACH)
3249 {
3250 OMP_CLAUSE_SET_MAP_KIND (node3, GOMP_MAP_DETACH)((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3250, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_DETACH))
;
3251 /* Similarly to above, we don't want to unmap PTR
3252 here. */
3253 node = node2;
3254 node2 = node3;
3255 node3 = NULL__null;
3256 goto finalize_map_clause;
3257 }
3258 else
3259 OMP_CLAUSE_SET_MAP_KIND (node3,((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3262, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (always_modifier ? GOMP_MAP_ALWAYS_POINTER : GOMP_MAP_POINTER
))
3260 always_modifier((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3262, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (always_modifier ? GOMP_MAP_ALWAYS_POINTER : GOMP_MAP_POINTER
))
3261 ? GOMP_MAP_ALWAYS_POINTER((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3262, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (always_modifier ? GOMP_MAP_ALWAYS_POINTER : GOMP_MAP_POINTER
))
3262 : GOMP_MAP_POINTER)((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3262, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (always_modifier ? GOMP_MAP_ALWAYS_POINTER : GOMP_MAP_POINTER
))
;
3263
3264 /* We have to check for n->sym->attr.dimension because
3265 of scalar coarrays. */
3266 if ((n->sym->attr.pointer || n->sym->attr.allocatable)
3267 && n->sym->attr.dimension)
3268 {
3269 stmtblock_t cond_block;
3270 tree size
3271 = gfc_create_var (gfc_array_index_type, NULL__null);
3272 tree tem, then_b, else_b, zero, cond;
3273
3274 gfc_init_block (&cond_block);
3275 tem
3276 = gfc_full_array_size (&cond_block, decl,
3277 GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3277, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
);
3278 gfc_add_modify (&cond_block, size, tem);
3279 then_b = gfc_finish_block (&cond_block);
3280 gfc_init_block (&cond_block);
3281 zero = build_int_cst (gfc_array_index_type, 0);
3282 gfc_add_modify (&cond_block, size, zero);
3283 else_b = gfc_finish_block (&cond_block);
3284 tem = gfc_conv_descriptor_data_get (decl);
3285 tem = fold_convert (pvoid_type_node, tem)fold_convert_loc (((location_t) 0), pvoid_type_node, tem);
3286 cond = fold_build2_loc (input_location, NE_EXPR,
3287 boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE],
3288 tem, null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
3289 if (present)
3290 cond = fold_build2_loc (input_location,
3291 TRUTH_ANDIF_EXPR,
3292 boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE],
3293 present, cond);
3294 gfc_add_expr_to_block (block,
3295 build3_loc (input_location,
3296 COND_EXPR,
3297 void_type_nodeglobal_trees[TI_VOID_TYPE],
3298 cond, then_b,
3299 else_b));
3300 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3300, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3300, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3300, __FUNCTION__)))
= size;
3301 }
3302 else if (n->sym->attr.dimension)
3303 {
3304 stmtblock_t cond_block;
3305 gfc_init_block (&cond_block);
3306 tree size = gfc_full_array_size (&cond_block, decl,
3307 GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3307, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
);
3308 if (present)
3309 {
3310 tree var = gfc_create_var (gfc_array_index_type,
3311 NULL__null);
3312 gfc_add_modify (&cond_block, var, size);
3313 tree cond_body = gfc_finish_block (&cond_block);
3314 tree cond = build3_loc (input_location, COND_EXPR,
3315 void_type_nodeglobal_trees[TI_VOID_TYPE], present,
3316 cond_body, NULL_TREE(tree) __null);
3317 gfc_add_expr_to_block (block, cond);
3318 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3318, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3318, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3318, __FUNCTION__)))
= var;
3319 }
3320 else
3321 {
3322 gfc_add_block_to_block (block, &cond_block);
3323 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3323, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3323, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3323, __FUNCTION__)))
= size;
3324 }
3325 }
3326 if (n->sym->attr.dimension)
3327 {
3328 tree elemsz
3329 = TYPE_SIZE_UNIT (gfc_get_element_type (type))((tree_class_check ((gfc_get_element_type (type)), (tcc_type)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3329, __FUNCTION__))->type_common.size_unit)
;
3330 elemsz = fold_convert (gfc_array_index_type, elemsz)fold_convert_loc (((location_t) 0), gfc_array_index_type, elemsz
)
;
3331 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3331, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3331, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3331, __FUNCTION__)))
3332 = fold_build2 (MULT_EXPR, gfc_array_index_type,fold_build2_loc (((location_t) 0), MULT_EXPR, gfc_array_index_type
, (*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3333, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3333, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3333, __FUNCTION__))), elemsz )
3333 OMP_CLAUSE_SIZE (node), elemsz)fold_build2_loc (((location_t) 0), MULT_EXPR, gfc_array_index_type
, (*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3333, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3333, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3333, __FUNCTION__))), elemsz )
;
3334 }
3335 }
3336 else if (present
3337 && TREE_CODE (decl)((enum tree_code) (decl)->base.code) == INDIRECT_REF
3338 && (TREE_CODE (TREE_OPERAND (decl, 0))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((decl), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3338, __FUNCTION__))))))->base.code)
3339 == INDIRECT_REF))
3340 {
3341 /* A single indirectref is handled by the middle end. */
3342 gcc_assert (!POINTER_TYPE_P (TREE_TYPE (decl)))((void)(!(!(((enum tree_code) (((contains_struct_check ((decl
), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3342, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3342, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3342, __FUNCTION__), 0 : 0))
;
3343 decl = TREE_OPERAND (decl, 0)(*((const_cast<tree*> (tree_operand_check ((decl), (0),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3343, __FUNCTION__)))))
;
3344 decl = gfc_build_cond_assign_expr (block, present, decl,
3345 null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
3346 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3346, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3346, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3346, __FUNCTION__)))
= build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
3347 }
3348 else
3349 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3349, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3349, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3349, __FUNCTION__)))
= decl;
3350 }
3351 else if (n->expr
3352 && n->expr->expr_type == EXPR_VARIABLE
3353 && n->expr->ref->type == REF_ARRAY
3354 && !n->expr->ref->next)
3355 {
3356 /* An array element or array section which is not part of a
3357 derived type, etc. */
3358 bool element = n->expr->ref->u.ar.type == AR_ELEMENT;
3359 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3359, __FUNCTION__))->typed.type)
;
3360 gomp_map_kind k = GOMP_MAP_POINTER;
3361 if (!openacc
3362 && !GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3362, __FUNCTION__))->type_common.lang_flag_1)
3363 && !(POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || (
(enum tree_code) (type)->base.code) == REFERENCE_TYPE)
3364 && GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (type))((tree_class_check ((((contains_struct_check ((type), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3364, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3364, __FUNCTION__))->type_common.lang_flag_1)
))
3365 k = GOMP_MAP_FIRSTPRIVATE_POINTER;
3366 gfc_trans_omp_array_section (block, n, decl, element, k,
3367 node, node2, node3, node4);
3368 }
3369 else if (n->expr
3370 && n->expr->expr_type == EXPR_VARIABLE
3371 && (n->expr->ref->type == REF_COMPONENT
3372 || n->expr->ref->type == REF_ARRAY)
3373 && lastref
3374 && lastref->type == REF_COMPONENT
3375 && lastref->u.c.component->ts.type != BT_CLASS
3376 && lastref->u.c.component->ts.type != BT_DERIVED
3377 && !lastref->u.c.component->attr.dimension)
3378 {
3379 /* Derived type access with last component being a scalar. */
3380 gfc_init_se (&se, NULL__null);
3381
3382 gfc_conv_expr (&se, n->expr);
3383 gfc_add_block_to_block (block, &se.pre);
3384 /* For BT_CHARACTER a pointer is returned. */
3385 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3385, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3385, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3385, __FUNCTION__)))
3386 = POINTER_TYPE_P (TREE_TYPE (se.expr))(((enum tree_code) (((contains_struct_check ((se.expr), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3386, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((se.expr), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3386, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)
3387 ? build_fold_indirect_ref (se.expr)build_fold_indirect_ref_loc (((location_t) 0), se.expr) : se.expr;
3388 gfc_add_block_to_block (block, &se.post);
3389 if (pointer || allocatable)
3390 {
3391 node2 = build_omp_clause (input_location,
3392 OMP_CLAUSE_MAP);
3393 gomp_map_kind kind
3394 = (openacc ? GOMP_MAP_ATTACH_DETACH
3395 : GOMP_MAP_ALWAYS_POINTER);
3396 OMP_CLAUSE_SET_MAP_KIND (node2, kind)((omp_clause_subcode_check ((node2), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3396, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (kind))
;
3397 OMP_CLAUSE_DECL (node2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3397, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3397, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3397, __FUNCTION__)))
3398 = POINTER_TYPE_P (TREE_TYPE (se.expr))(((enum tree_code) (((contains_struct_check ((se.expr), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3398, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((se.expr), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3398, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)
3399 ? se.expr
3400 : gfc_build_addr_expr (NULL__null, se.expr);
3401 OMP_CLAUSE_SIZE (node2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3401, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3401, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3401, __FUNCTION__)))
= size_int (0)size_int_kind (0, stk_sizetype);
3402 if (!openacc
3403 && n->expr->ts.type == BT_CHARACTER
3404 && n->expr->ts.deferred)
3405 {
3406 gcc_assert (se.string_length)((void)(!(se.string_length) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3406, __FUNCTION__), 0 : 0))
;
3407 tree tmp
3408 = gfc_get_char_type (n->expr->ts.kind);
3409 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3409, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3409, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3409, __FUNCTION__)))
3410 = fold_build2 (MULT_EXPR, size_type_node,fold_build2_loc (((location_t) 0), MULT_EXPR, global_trees[TI_SIZE_TYPE
], fold_convert_loc (((location_t) 0), global_trees[TI_SIZE_TYPE
], se.string_length), ((tree_class_check ((tmp), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3413, __FUNCTION__))->type_common.size_unit) )
3411 fold_convert (size_type_node,fold_build2_loc (((location_t) 0), MULT_EXPR, global_trees[TI_SIZE_TYPE
], fold_convert_loc (((location_t) 0), global_trees[TI_SIZE_TYPE
], se.string_length), ((tree_class_check ((tmp), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3413, __FUNCTION__))->type_common.size_unit) )
3412 se.string_length),fold_build2_loc (((location_t) 0), MULT_EXPR, global_trees[TI_SIZE_TYPE
], fold_convert_loc (((location_t) 0), global_trees[TI_SIZE_TYPE
], se.string_length), ((tree_class_check ((tmp), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3413, __FUNCTION__))->type_common.size_unit) )
3413 TYPE_SIZE_UNIT (tmp))fold_build2_loc (((location_t) 0), MULT_EXPR, global_trees[TI_SIZE_TYPE
], fold_convert_loc (((location_t) 0), global_trees[TI_SIZE_TYPE
], se.string_length), ((tree_class_check ((tmp), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3413, __FUNCTION__))->type_common.size_unit) )
;
3414 node3 = build_omp_clause (input_location,
3415 OMP_CLAUSE_MAP);
3416 OMP_CLAUSE_SET_MAP_KIND (node3, GOMP_MAP_TO)((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3416, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_TO))
;
3417 OMP_CLAUSE_DECL (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3417, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3417, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3417, __FUNCTION__)))
= se.string_length;
3418 OMP_CLAUSE_SIZE (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3418, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3418, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3418, __FUNCTION__)))
3419 = TYPE_SIZE_UNIT (gfc_charlen_type_node)((tree_class_check ((gfc_charlen_type_node), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3419, __FUNCTION__))->type_common.size_unit)
;
3420 }
3421 }
3422 }
3423 else if (n->expr
3424 && n->expr->expr_type == EXPR_VARIABLE
3425 && (n->expr->ref->type == REF_COMPONENT
3426 || n->expr->ref->type == REF_ARRAY))
3427 {
3428 gfc_init_se (&se, NULL__null);
3429 se.expr = gfc_maybe_dereference_var (n->sym, decl);
3430
3431 for (gfc_ref *ref = n->expr->ref; ref; ref = ref->next)
3432 {
3433 if (ref->type == REF_COMPONENT)
3434 {
3435 if (ref->u.c.sym->attr.extension)
3436 conv_parent_component_references (&se, ref);
3437
3438 gfc_conv_component_ref (&se, ref);
3439 }
3440 else if (ref->type == REF_ARRAY)
3441 {
3442 if (ref->u.ar.type == AR_ELEMENT && ref->next)
3443 gfc_conv_array_ref (&se, &ref->u.ar, n->expr,
3444 &n->expr->where);
3445 else
3446 gcc_assert (!ref->next)((void)(!(!ref->next) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3446, __FUNCTION__), 0 : 0))
;
3447 }
3448 else
3449 sorry ("unhandled expression type");
3450 }
3451
3452 tree inner = se.expr;
3453
3454 /* Last component is a derived type or class pointer. */
3455 if (lastref->type == REF_COMPONENT
3456 && (lastref->u.c.component->ts.type == BT_DERIVED
3457 || lastref->u.c.component->ts.type == BT_CLASS))
3458 {
3459 if (pointer || (openacc && allocatable))
3460 {
3461 tree data, size;
3462
3463 if (lastref->u.c.component->ts.type == BT_CLASS)
3464 {
3465 data = gfc_class_data_get (inner);
3466 gcc_assert (POINTER_TYPE_P (TREE_TYPE (data)))((void)(!((((enum tree_code) (((contains_struct_check ((data)
, (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3466, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((data), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3466, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3466, __FUNCTION__), 0 : 0))
;
3467 data = build_fold_indirect_ref (data)build_fold_indirect_ref_loc (((location_t) 0), data);
3468 size = gfc_class_vtab_size_get (inner);
3469 }
3470 else /* BT_DERIVED. */
3471 {
3472 data = inner;
3473 size = TYPE_SIZE_UNIT (TREE_TYPE (inner))((tree_class_check ((((contains_struct_check ((inner), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3473, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3473, __FUNCTION__))->type_common.size_unit)
;
3474 }
3475
3476 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3476, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3476, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3476, __FUNCTION__)))
= data;
3477 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3477, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3477, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3477, __FUNCTION__)))
= size;
3478 node2 = build_omp_clause (input_location,
3479 OMP_CLAUSE_MAP);
3480 OMP_CLAUSE_SET_MAP_KIND (node2,((omp_clause_subcode_check ((node2), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3483, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (openacc ? GOMP_MAP_ATTACH_DETACH : GOMP_MAP_ALWAYS_POINTER
))
3481 openacc((omp_clause_subcode_check ((node2), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3483, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (openacc ? GOMP_MAP_ATTACH_DETACH : GOMP_MAP_ALWAYS_POINTER
))
3482 ? GOMP_MAP_ATTACH_DETACH((omp_clause_subcode_check ((node2), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3483, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (openacc ? GOMP_MAP_ATTACH_DETACH : GOMP_MAP_ALWAYS_POINTER
))
3483 : GOMP_MAP_ALWAYS_POINTER)((omp_clause_subcode_check ((node2), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3483, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (openacc ? GOMP_MAP_ATTACH_DETACH : GOMP_MAP_ALWAYS_POINTER
))
;
3484 OMP_CLAUSE_DECL (node2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3484, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3484, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3484, __FUNCTION__)))
= build_fold_addr_expr (data)build_fold_addr_expr_loc (((location_t) 0), (data));
3485 OMP_CLAUSE_SIZE (node2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3485, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3485, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3485, __FUNCTION__)))
= size_int (0)size_int_kind (0, stk_sizetype);
3486 }
3487 else
3488 {
3489 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3489, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3489, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3489, __FUNCTION__)))
= inner;
3490 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3490, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3490, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3490, __FUNCTION__)))
3491 = TYPE_SIZE_UNIT (TREE_TYPE (inner))((tree_class_check ((((contains_struct_check ((inner), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3491, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3491, __FUNCTION__))->type_common.size_unit)
;
3492 }
3493 }
3494 else if (lastref->type == REF_ARRAY
3495 && lastref->u.ar.type == AR_FULL)
3496 {
3497 /* Just pass the (auto-dereferenced) decl through for
3498 bare attach and detach clauses. */
3499 if (n->u.map_op == OMP_MAP_ATTACH
3500 || n->u.map_op == OMP_MAP_DETACH)
3501 {
3502 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3502, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3502, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3502, __FUNCTION__)))
= inner;
3503 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3503, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3503, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3503, __FUNCTION__)))
= size_zero_nodeglobal_trees[TI_SIZE_ZERO];
3504 goto finalize_map_clause;
3505 }
3506
3507 if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (inner))((tree_class_check ((((contains_struct_check ((inner), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3507, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3507, __FUNCTION__))->type_common.lang_flag_1)
)
3508 {
3509 gomp_map_kind map_kind;
3510 tree desc_node;
3511 tree type = TREE_TYPE (inner)((contains_struct_check ((inner), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3511, __FUNCTION__))->typed.type)
;
3512 tree ptr = gfc_conv_descriptor_data_get (inner);
3513 ptr = build_fold_indirect_ref (ptr)build_fold_indirect_ref_loc (((location_t) 0), ptr);
3514 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3514, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3514, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3514, __FUNCTION__)))
= ptr;
3515 int rank = GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3515, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
;
3516 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3516, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3516, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3516, __FUNCTION__)))
3517 = gfc_full_array_size (block, inner, rank);
3518 tree elemsz
3519 = TYPE_SIZE_UNIT (gfc_get_element_type (type))((tree_class_check ((gfc_get_element_type (type)), (tcc_type)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3519, __FUNCTION__))->type_common.size_unit)
;
3520 if (GOMP_MAP_COPY_TO_P (OMP_CLAUSE_MAP_KIND (node))(!((((enum gomp_map_kind) (omp_clause_subcode_check ((node), (
OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3520, __FUNCTION__))->omp_clause.subcode.map_kind)) &
((1 << 3) | (1 << 2))) && ((((enum gomp_map_kind
) (omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3520, __FUNCTION__))->omp_clause.subcode.map_kind)) &
(1 << 0)))
)
3521 map_kind = GOMP_MAP_TO;
3522 else if (n->u.map_op == OMP_MAP_RELEASE
3523 || n->u.map_op == OMP_MAP_DELETE)
3524 map_kind = OMP_CLAUSE_MAP_KIND (node)((enum gomp_map_kind) (omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3524, __FUNCTION__))->omp_clause.subcode.map_kind)
;
3525 else
3526 map_kind = GOMP_MAP_ALLOC;
3527 if (!openacc
3528 && n->expr->ts.type == BT_CHARACTER
3529 && n->expr->ts.deferred)
3530 {
3531 gcc_assert (se.string_length)((void)(!(se.string_length) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3531, __FUNCTION__), 0 : 0))
;
3532 tree len = fold_convert (size_type_node,fold_convert_loc (((location_t) 0), global_trees[TI_SIZE_TYPE
], se.string_length)
3533 se.string_length)fold_convert_loc (((location_t) 0), global_trees[TI_SIZE_TYPE
], se.string_length)
;
3534 elemsz = gfc_get_char_type (n->expr->ts.kind);
3535 elemsz = TYPE_SIZE_UNIT (elemsz)((tree_class_check ((elemsz), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3535, __FUNCTION__))->type_common.size_unit)
;
3536 elemsz = fold_build2 (MULT_EXPR, size_type_node,fold_build2_loc (((location_t) 0), MULT_EXPR, global_trees[TI_SIZE_TYPE
], len, elemsz )
3537 len, elemsz)fold_build2_loc (((location_t) 0), MULT_EXPR, global_trees[TI_SIZE_TYPE
], len, elemsz )
;
3538 node4 = build_omp_clause (input_location,
3539 OMP_CLAUSE_MAP);
3540 OMP_CLAUSE_SET_MAP_KIND (node4, map_kind)((omp_clause_subcode_check ((node4), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3540, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (map_kind))
;
3541 OMP_CLAUSE_DECL (node4)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node4), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3541, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3541, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3541, __FUNCTION__)))
= se.string_length;
3542 OMP_CLAUSE_SIZE (node4)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node4), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3542, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3542, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3542, __FUNCTION__)))
3543 = TYPE_SIZE_UNIT (gfc_charlen_type_node)((tree_class_check ((gfc_charlen_type_node), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3543, __FUNCTION__))->type_common.size_unit)
;
3544 }
3545 elemsz = fold_convert (gfc_array_index_type, elemsz)fold_convert_loc (((location_t) 0), gfc_array_index_type, elemsz
)
;
3546 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3546, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3546, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3546, __FUNCTION__)))
3547 = fold_build2 (MULT_EXPR, gfc_array_index_type,fold_build2_loc (((location_t) 0), MULT_EXPR, gfc_array_index_type
, (*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3548, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3548, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3548, __FUNCTION__))), elemsz )
3548 OMP_CLAUSE_SIZE (node), elemsz)fold_build2_loc (((location_t) 0), MULT_EXPR, gfc_array_index_type
, (*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3548, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3548, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3548, __FUNCTION__))), elemsz )
;
3549 desc_node = build_omp_clause (input_location,
3550 OMP_CLAUSE_MAP);
3551 if (openacc)
3552 OMP_CLAUSE_SET_MAP_KIND (desc_node,((omp_clause_subcode_check ((desc_node), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3553, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_TO_PSET))
3553 GOMP_MAP_TO_PSET)((omp_clause_subcode_check ((desc_node), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3553, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_TO_PSET))
;
3554 else
3555 OMP_CLAUSE_SET_MAP_KIND (desc_node, map_kind)((omp_clause_subcode_check ((desc_node), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3555, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (map_kind))
;
3556 OMP_CLAUSE_DECL (desc_node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((desc_node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3556, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3556, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3556, __FUNCTION__)))
= inner;
3557 OMP_CLAUSE_SIZE (desc_node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((desc_node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3557, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3557, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3557, __FUNCTION__)))
= TYPE_SIZE_UNIT (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3557, __FUNCTION__))->type_common.size_unit)
;
3558 if (openacc)
3559 node2 = desc_node;
3560 else
3561 {
3562 node2 = node;
3563 node = desc_node; /* Put first. */
3564 }
3565 node3 = build_omp_clause (input_location,
3566 OMP_CLAUSE_MAP);
3567 OMP_CLAUSE_SET_MAP_KIND (node3,((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3570, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (openacc ? GOMP_MAP_ATTACH_DETACH : GOMP_MAP_ALWAYS_POINTER
))
3568 openacc((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3570, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (openacc ? GOMP_MAP_ATTACH_DETACH : GOMP_MAP_ALWAYS_POINTER
))
3569 ? GOMP_MAP_ATTACH_DETACH((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3570, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (openacc ? GOMP_MAP_ATTACH_DETACH : GOMP_MAP_ALWAYS_POINTER
))
3570 : GOMP_MAP_ALWAYS_POINTER)((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3570, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (openacc ? GOMP_MAP_ATTACH_DETACH : GOMP_MAP_ALWAYS_POINTER
))
;
3571 OMP_CLAUSE_DECL (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3571, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3571, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3571, __FUNCTION__)))
3572 = gfc_conv_descriptor_data_get (inner);
3573 /* Similar to gfc_trans_omp_array_section (details
3574 there), we add/keep the cast for OpenMP to prevent
3575 that an 'alloc:' gets added for node3 ('desc.data')
3576 as that is part of the whole descriptor (node3).
3577 TODO: Remove once the ME handles this properly. */
3578 if (!openacc)
3579 OMP_CLAUSE_DECL (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3579, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3579, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3579, __FUNCTION__)))
3580 = fold_convert (TREE_TYPE (TREE_OPERAND(ptr, 0)),fold_convert_loc (((location_t) 0), ((contains_struct_check (
((*((const_cast<tree*> (tree_operand_check ((ptr), (0),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3580, __FUNCTION__)))))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3580, __FUNCTION__))->typed.type), (*(omp_clause_elt_check
(((omp_clause_range_check (((tree_check ((node3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3581, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3581, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3581, __FUNCTION__))))
3581 OMP_CLAUSE_DECL (node3))fold_convert_loc (((location_t) 0), ((contains_struct_check (
((*((const_cast<tree*> (tree_operand_check ((ptr), (0),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3580, __FUNCTION__)))))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3580, __FUNCTION__))->typed.type), (*(omp_clause_elt_check
(((omp_clause_range_check (((tree_check ((node3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3581, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3581, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3581, __FUNCTION__))))
;
3582 else
3583 STRIP_NOPS (OMP_CLAUSE_DECL (node3))((*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3583, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3583, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3583, __FUNCTION__)))) = tree_strip_nop_conversions ((const_cast
<union tree_node *> ((((*(omp_clause_elt_check (((omp_clause_range_check
(((tree_check ((node3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3583, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3583, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3583, __FUNCTION__))))))))
;
3584 OMP_CLAUSE_SIZE (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3584, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3584, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3584, __FUNCTION__)))
= size_int (0)size_int_kind (0, stk_sizetype);
3585 }
3586 else
3587 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3587, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3587, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3587, __FUNCTION__)))
= inner;
3588 }
3589 else if (lastref->type == REF_ARRAY)
3590 {
3591 /* An array element or section. */
3592 bool element = lastref->u.ar.type == AR_ELEMENT;
3593 gomp_map_kind kind = (openacc ? GOMP_MAP_ATTACH_DETACH
3594 : GOMP_MAP_ALWAYS_POINTER);
3595 gfc_trans_omp_array_section (block, n, inner, element,
3596 kind, node, node2, node3,
3597 node4);
3598 }
3599 else
3600 gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3600, __FUNCTION__))
;
3601 }
3602 else
3603 sorry ("unhandled expression");
3604
3605 finalize_map_clause:
3606
3607 omp_clauses = gfc_trans_add_clause (node, omp_clauses);
3608 if (node2)
3609 omp_clauses = gfc_trans_add_clause (node2, omp_clauses);
3610 if (node3)
3611 omp_clauses = gfc_trans_add_clause (node3, omp_clauses);
3612 if (node4)
3613 omp_clauses = gfc_trans_add_clause (node4, omp_clauses);
3614 }
3615 break;
3616 case OMP_LIST_TO:
3617 case OMP_LIST_FROM:
3618 case OMP_LIST_CACHE:
3619 for (; n != NULL__null; n = n->next)
3620 {
3621 if (!n->sym->attr.referenced)
3622 continue;
3623
3624 switch (list)
3625 {
3626 case OMP_LIST_TO:
3627 clause_code = OMP_CLAUSE_TO;
3628 break;
3629 case OMP_LIST_FROM:
3630 clause_code = OMP_CLAUSE_FROM;
3631 break;
3632 case OMP_LIST_CACHE:
3633 clause_code = OMP_CLAUSE__CACHE_;
3634 break;
3635 default:
3636 gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3636, __FUNCTION__))
;
3637 }
3638 tree node = build_omp_clause (input_location, clause_code);
3639 if (n->expr == NULL__null
3640 || (n->expr->ref->type == REF_ARRAY
3641 && n->expr->ref->u.ar.type == AR_FULL
3642 && n->expr->ref->next == NULL__null))
3643 {
3644 tree decl = gfc_trans_omp_variable (n->sym, false);
3645 if (gfc_omp_privatize_by_reference (decl))
3646 {
3647 if (gfc_omp_is_allocatable_or_ptr (decl))
3648 decl = build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
3649 decl = build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
3650 }
3651 else if (DECL_P (decl)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (decl)->base.code))] == tcc_declaration)
)
3652 TREE_ADDRESSABLE (decl)((decl)->base.addressable_flag) = 1;
3653 if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3653, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3653, __FUNCTION__))->type_common.lang_flag_1)
)
3654 {
3655 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3655, __FUNCTION__))->typed.type)
;
3656 tree ptr = gfc_conv_descriptor_data_get (decl);
3657 gcc_assert (POINTER_TYPE_P (TREE_TYPE (ptr)))((void)(!((((enum tree_code) (((contains_struct_check ((ptr),
(TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3657, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((ptr), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3657, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3657, __FUNCTION__), 0 : 0))
;
3658 ptr = build_fold_indirect_ref (ptr)build_fold_indirect_ref_loc (((location_t) 0), ptr);
3659 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3659, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3659, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3659, __FUNCTION__)))
= ptr;
3660 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3660, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3660, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3660, __FUNCTION__)))
3661 = gfc_full_array_size (block, decl,
3662 GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3662, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
);
3663 tree elemsz
3664 = TYPE_SIZE_UNIT (gfc_get_element_type (type))((tree_class_check ((gfc_get_element_type (type)), (tcc_type)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3664, __FUNCTION__))->type_common.size_unit)
;
3665 elemsz = fold_convert (gfc_array_index_type, elemsz)fold_convert_loc (((location_t) 0), gfc_array_index_type, elemsz
)
;
3666 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3666, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3666, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3666, __FUNCTION__)))
3667 = fold_build2 (MULT_EXPR, gfc_array_index_type,fold_build2_loc (((location_t) 0), MULT_EXPR, gfc_array_index_type
, (*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3668, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3668, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3668, __FUNCTION__))), elemsz )
3668 OMP_CLAUSE_SIZE (node), elemsz)fold_build2_loc (((location_t) 0), MULT_EXPR, gfc_array_index_type
, (*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3668, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3668, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3668, __FUNCTION__))), elemsz )
;
3669 }
3670 else
3671 {
3672 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3672, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3672, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3672, __FUNCTION__)))
= decl;
3673 if (gfc_omp_is_allocatable_or_ptr (decl))
3674 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3674, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3674, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3674, __FUNCTION__)))
3675 = TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (decl)))((tree_class_check ((((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3675, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3675, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3675, __FUNCTION__))->type_common.size_unit)
;
3676 }
3677 }
3678 else
3679 {
3680 tree ptr;
3681 gfc_init_se (&se, NULL__null);
3682 if (n->expr->rank == 0)
3683 {
3684 gfc_conv_expr_reference (&se, n->expr);
3685 ptr = se.expr;
3686 gfc_add_block_to_block (block, &se.pre);
3687 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3687, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3687, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3687, __FUNCTION__)))
3688 = TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (ptr)))((tree_class_check ((((contains_struct_check ((((contains_struct_check
((ptr), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3688, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3688, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3688, __FUNCTION__))->type_common.size_unit)
;
3689 }
3690 else
3691 {
3692 gfc_conv_expr_descriptor (&se, n->expr);
3693 ptr = gfc_conv_array_data (se.expr);
3694 tree type = TREE_TYPE (se.expr)((contains_struct_check ((se.expr), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3694, __FUNCTION__))->typed.type)
;
3695 gfc_add_block_to_block (block, &se.pre);
3696 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3696, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3696, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3696, __FUNCTION__)))
3697 = gfc_full_array_size (block, se.expr,
3698 GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3698, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
);
3699 tree elemsz
3700 = TYPE_SIZE_UNIT (gfc_get_element_type (type))((tree_class_check ((gfc_get_element_type (type)), (tcc_type)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3700, __FUNCTION__))->type_common.size_unit)
;
3701 elemsz = fold_convert (gfc_array_index_type, elemsz)fold_convert_loc (((location_t) 0), gfc_array_index_type, elemsz
)
;
3702 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3702, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3702, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3702, __FUNCTION__)))
3703 = fold_build2 (MULT_EXPR, gfc_array_index_type,fold_build2_loc (((location_t) 0), MULT_EXPR, gfc_array_index_type
, (*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3704, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3704, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3704, __FUNCTION__))), elemsz )
3704 OMP_CLAUSE_SIZE (node), elemsz)fold_build2_loc (((location_t) 0), MULT_EXPR, gfc_array_index_type
, (*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3704, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3704, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3704, __FUNCTION__))), elemsz )
;
3705 }
3706 gfc_add_block_to_block (block, &se.post);
3707 gcc_assert (POINTER_TYPE_P (TREE_TYPE (ptr)))((void)(!((((enum tree_code) (((contains_struct_check ((ptr),
(TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3707, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((ptr), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3707, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3707, __FUNCTION__), 0 : 0))
;
3708 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3708, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3708, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3708, __FUNCTION__)))
= build_fold_indirect_ref (ptr)build_fold_indirect_ref_loc (((location_t) 0), ptr);
3709 }
3710 omp_clauses = gfc_trans_add_clause (node, omp_clauses);
3711 }
3712 break;
3713 default:
3714 break;
3715 }
3716 }
3717
3718 if (clauses->if_expr)
3719 {
3720 tree if_var;
3721
3722 gfc_init_se (&se, NULL__null);
3723 gfc_conv_expr (&se, clauses->if_expr);
3724 gfc_add_block_to_block (block, &se.pre);
3725 if_var = gfc_evaluate_now (se.expr, block);
3726 gfc_add_block_to_block (block, &se.post);
3727
3728 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_IF);
3729 OMP_CLAUSE_IF_MODIFIER (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3729, __FUNCTION__))->omp_clause.subcode.if_modifier)
= ERROR_MARK;
3730 OMP_CLAUSE_IF_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3730, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3730, __FUNCTION__)))
= if_var;
3731 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3732 }
3733 for (ifc = 0; ifc < OMP_IF_LAST; ifc++)
3734 if (clauses->if_exprs[ifc])
3735 {
3736 tree if_var;
3737
3738 gfc_init_se (&se, NULL__null);
3739 gfc_conv_expr (&se, clauses->if_exprs[ifc]);
3740 gfc_add_block_to_block (block, &se.pre);
3741 if_var = gfc_evaluate_now (se.expr, block);
3742 gfc_add_block_to_block (block, &se.post);
3743
3744 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_IF);
3745 switch (ifc)
3746 {
3747 case OMP_IF_CANCEL:
3748 OMP_CLAUSE_IF_MODIFIER (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3748, __FUNCTION__))->omp_clause.subcode.if_modifier)
= VOID_CST;
3749 break;
3750 case OMP_IF_PARALLEL:
3751 OMP_CLAUSE_IF_MODIFIER (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3751, __FUNCTION__))->omp_clause.subcode.if_modifier)
= OMP_PARALLEL;
3752 break;
3753 case OMP_IF_SIMD:
3754 OMP_CLAUSE_IF_MODIFIER (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3754, __FUNCTION__))->omp_clause.subcode.if_modifier)
= OMP_SIMD;
3755 break;
3756 case OMP_IF_TASK:
3757 OMP_CLAUSE_IF_MODIFIER (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3757, __FUNCTION__))->omp_clause.subcode.if_modifier)
= OMP_TASK;
3758 break;
3759 case OMP_IF_TASKLOOP:
3760 OMP_CLAUSE_IF_MODIFIER (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3760, __FUNCTION__))->omp_clause.subcode.if_modifier)
= OMP_TASKLOOP;
3761 break;
3762 case OMP_IF_TARGET:
3763 OMP_CLAUSE_IF_MODIFIER (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3763, __FUNCTION__))->omp_clause.subcode.if_modifier)
= OMP_TARGET;
3764 break;
3765 case OMP_IF_TARGET_DATA:
3766 OMP_CLAUSE_IF_MODIFIER (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3766, __FUNCTION__))->omp_clause.subcode.if_modifier)
= OMP_TARGET_DATA;
3767 break;
3768 case OMP_IF_TARGET_UPDATE:
3769 OMP_CLAUSE_IF_MODIFIER (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3769, __FUNCTION__))->omp_clause.subcode.if_modifier)
= OMP_TARGET_UPDATE;
3770 break;
3771 case OMP_IF_TARGET_ENTER_DATA:
3772 OMP_CLAUSE_IF_MODIFIER (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3772, __FUNCTION__))->omp_clause.subcode.if_modifier)
= OMP_TARGET_ENTER_DATA;
3773 break;
3774 case OMP_IF_TARGET_EXIT_DATA:
3775 OMP_CLAUSE_IF_MODIFIER (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3775, __FUNCTION__))->omp_clause.subcode.if_modifier)
= OMP_TARGET_EXIT_DATA;
3776 break;
3777 default:
3778 gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3778, __FUNCTION__))
;
3779 }
3780 OMP_CLAUSE_IF_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3780, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3780, __FUNCTION__)))
= if_var;
3781 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3782 }
3783
3784 if (clauses->final_expr)
3785 {
3786 tree final_var;
3787
3788 gfc_init_se (&se, NULL__null);
3789 gfc_conv_expr (&se, clauses->final_expr);
3790 gfc_add_block_to_block (block, &se.pre);
3791 final_var = gfc_evaluate_now (se.expr, block);
3792 gfc_add_block_to_block (block, &se.post);
3793
3794 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_FINAL);
3795 OMP_CLAUSE_FINAL_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_FINAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3795, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3795, __FUNCTION__)))
= final_var;
3796 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3797 }
3798
3799 if (clauses->num_threads)
3800 {
3801 tree num_threads;
3802
3803 gfc_init_se (&se, NULL__null);
3804 gfc_conv_expr (&se, clauses->num_threads);
3805 gfc_add_block_to_block (block, &se.pre);
3806 num_threads = gfc_evaluate_now (se.expr, block);
3807 gfc_add_block_to_block (block, &se.post);
3808
3809 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_NUM_THREADS);
3810 OMP_CLAUSE_NUM_THREADS_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_NUM_THREADS
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3810, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3810, __FUNCTION__)))
= num_threads;
3811 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3812 }
3813
3814 chunk_size = NULL_TREE(tree) __null;
3815 if (clauses->chunk_size)
3816 {
3817 gfc_init_se (&se, NULL__null);
3818 gfc_conv_expr (&se, clauses->chunk_size);
3819 gfc_add_block_to_block (block, &se.pre);
3820 chunk_size = gfc_evaluate_now (se.expr, block);
3821 gfc_add_block_to_block (block, &se.post);
3822 }
3823
3824 if (clauses->sched_kind != OMP_SCHED_NONE)
3825 {
3826 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_SCHEDULE);
3827 OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_SCHEDULE
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3827, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3827, __FUNCTION__)))
= chunk_size;
3828 switch (clauses->sched_kind)
3829 {
3830 case OMP_SCHED_STATIC:
3831 OMP_CLAUSE_SCHEDULE_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_SCHEDULE), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3831, __FUNCTION__))->omp_clause.subcode.schedule_kind)
= OMP_CLAUSE_SCHEDULE_STATIC;
3832 break;
3833 case OMP_SCHED_DYNAMIC:
3834 OMP_CLAUSE_SCHEDULE_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_SCHEDULE), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3834, __FUNCTION__))->omp_clause.subcode.schedule_kind)
= OMP_CLAUSE_SCHEDULE_DYNAMIC;
3835 break;
3836 case OMP_SCHED_GUIDED:
3837 OMP_CLAUSE_SCHEDULE_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_SCHEDULE), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3837, __FUNCTION__))->omp_clause.subcode.schedule_kind)
= OMP_CLAUSE_SCHEDULE_GUIDED;
3838 break;
3839 case OMP_SCHED_RUNTIME:
3840 OMP_CLAUSE_SCHEDULE_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_SCHEDULE), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3840, __FUNCTION__))->omp_clause.subcode.schedule_kind)
= OMP_CLAUSE_SCHEDULE_RUNTIME;
3841 break;
3842 case OMP_SCHED_AUTO:
3843 OMP_CLAUSE_SCHEDULE_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_SCHEDULE), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3843, __FUNCTION__))->omp_clause.subcode.schedule_kind)
= OMP_CLAUSE_SCHEDULE_AUTO;
3844 break;
3845 default:
3846 gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3846, __FUNCTION__))
;
3847 }
3848 if (clauses->sched_monotonic)
3849 OMP_CLAUSE_SCHEDULE_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_SCHEDULE), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3849, __FUNCTION__))->omp_clause.subcode.schedule_kind)
3850 = (omp_clause_schedule_kind) (OMP_CLAUSE_SCHEDULE_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_SCHEDULE), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3850, __FUNCTION__))->omp_clause.subcode.schedule_kind)
3851 | OMP_CLAUSE_SCHEDULE_MONOTONIC);
3852 else if (clauses->sched_nonmonotonic)
3853 OMP_CLAUSE_SCHEDULE_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_SCHEDULE), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3853, __FUNCTION__))->omp_clause.subcode.schedule_kind)
3854 = (omp_clause_schedule_kind) (OMP_CLAUSE_SCHEDULE_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_SCHEDULE), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3854, __FUNCTION__))->omp_clause.subcode.schedule_kind)
3855 | OMP_CLAUSE_SCHEDULE_NONMONOTONIC);
3856 if (clauses->sched_simd)
3857 OMP_CLAUSE_SCHEDULE_SIMD (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_SCHEDULE), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3857, __FUNCTION__))->base.public_flag)
= 1;
3858 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3859 }
3860
3861 if (clauses->default_sharing != OMP_DEFAULT_UNKNOWN)
3862 {
3863 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_DEFAULT);
3864 switch (clauses->default_sharing)
3865 {
3866 case OMP_DEFAULT_NONE:
3867 OMP_CLAUSE_DEFAULT_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_DEFAULT), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3867, __FUNCTION__))->omp_clause.subcode.default_kind)
= OMP_CLAUSE_DEFAULT_NONE;
3868 break;
3869 case OMP_DEFAULT_SHARED:
3870 OMP_CLAUSE_DEFAULT_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_DEFAULT), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3870, __FUNCTION__))->omp_clause.subcode.default_kind)
= OMP_CLAUSE_DEFAULT_SHARED;
3871 break;
3872 case OMP_DEFAULT_PRIVATE:
3873 OMP_CLAUSE_DEFAULT_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_DEFAULT), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3873, __FUNCTION__))->omp_clause.subcode.default_kind)
= OMP_CLAUSE_DEFAULT_PRIVATE;
3874 break;
3875 case OMP_DEFAULT_FIRSTPRIVATE:
3876 OMP_CLAUSE_DEFAULT_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_DEFAULT), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3876, __FUNCTION__))->omp_clause.subcode.default_kind)
= OMP_CLAUSE_DEFAULT_FIRSTPRIVATE;
3877 break;
3878 case OMP_DEFAULT_PRESENT:
3879 OMP_CLAUSE_DEFAULT_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_DEFAULT), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3879, __FUNCTION__))->omp_clause.subcode.default_kind)
= OMP_CLAUSE_DEFAULT_PRESENT;
3880 break;
3881 default:
3882 gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3882, __FUNCTION__))
;
3883 }
3884 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3885 }
3886
3887 if (clauses->nowait)
3888 {
3889 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_NOWAIT);
3890 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3891 }
3892
3893 if (clauses->ordered)
3894 {
3895 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_ORDERED);
3896 OMP_CLAUSE_ORDERED_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_ORDERED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3896, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3896, __FUNCTION__)))
3897 = clauses->orderedc ? build_int_cst (integer_type_nodeinteger_types[itk_int],
3898 clauses->orderedc) : NULL_TREE(tree) __null;
3899 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3900 }
3901
3902 if (clauses->order_concurrent)
3903 {
3904 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_ORDER);
3905 OMP_CLAUSE_ORDER_UNCONSTRAINED (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_ORDER), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3905, __FUNCTION__))->base.public_flag)
= clauses->order_unconstrained;
3906 OMP_CLAUSE_ORDER_REPRODUCIBLE (c)(((omp_clause_subcode_check ((c), (OMP_CLAUSE_ORDER), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3906, __FUNCTION__)))->base.protected_flag)
= clauses->order_reproducible;
3907 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3908 }
3909
3910 if (clauses->untied)
3911 {
3912 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_UNTIED);
3913 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3914 }
3915
3916 if (clauses->mergeable)
3917 {
3918 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_MERGEABLE);
3919 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3920 }
3921
3922 if (clauses->collapse)
3923 {
3924 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_COLLAPSE);
3925 OMP_CLAUSE_COLLAPSE_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_COLLAPSE
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3925, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3925, __FUNCTION__)))
3926 = build_int_cst (integer_type_nodeinteger_types[itk_int], clauses->collapse);
3927 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3928 }
3929
3930 if (clauses->inbranch)
3931 {
3932 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_INBRANCH);
3933 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3934 }
3935
3936 if (clauses->notinbranch)
3937 {
3938 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_NOTINBRANCH);
3939 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3940 }
3941
3942 switch (clauses->cancel)
3943 {
3944 case OMP_CANCEL_UNKNOWN:
3945 break;
3946 case OMP_CANCEL_PARALLEL:
3947 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_PARALLEL);
3948 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3949 break;
3950 case OMP_CANCEL_SECTIONS:
3951 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_SECTIONS);
3952 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3953 break;
3954 case OMP_CANCEL_DO:
3955 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_FOR);
3956 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3957 break;
3958 case OMP_CANCEL_TASKGROUP:
3959 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_TASKGROUP);
3960 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3961 break;
3962 }
3963
3964 if (clauses->proc_bind != OMP_PROC_BIND_UNKNOWN)
3965 {
3966 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_PROC_BIND);
3967 switch (clauses->proc_bind)
3968 {
3969 case OMP_PROC_BIND_PRIMARY:
3970 OMP_CLAUSE_PROC_BIND_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_PROC_BIND), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3970, __FUNCTION__))->omp_clause.subcode.proc_bind_kind)
= OMP_CLAUSE_PROC_BIND_PRIMARY;
3971 break;
3972 case OMP_PROC_BIND_MASTER:
3973 OMP_CLAUSE_PROC_BIND_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_PROC_BIND), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3973, __FUNCTION__))->omp_clause.subcode.proc_bind_kind)
= OMP_CLAUSE_PROC_BIND_MASTER;
3974 break;
3975 case OMP_PROC_BIND_SPREAD:
3976 OMP_CLAUSE_PROC_BIND_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_PROC_BIND), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3976, __FUNCTION__))->omp_clause.subcode.proc_bind_kind)
= OMP_CLAUSE_PROC_BIND_SPREAD;
3977 break;
3978 case OMP_PROC_BIND_CLOSE:
3979 OMP_CLAUSE_PROC_BIND_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_PROC_BIND), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3979, __FUNCTION__))->omp_clause.subcode.proc_bind_kind)
= OMP_CLAUSE_PROC_BIND_CLOSE;
3980 break;
3981 default:
3982 gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3982, __FUNCTION__))
;
3983 }
3984 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3985 }
3986
3987 if (clauses->safelen_expr)
3988 {
3989 tree safelen_var;
3990
3991 gfc_init_se (&se, NULL__null);
3992 gfc_conv_expr (&se, clauses->safelen_expr);
3993 gfc_add_block_to_block (block, &se.pre);
3994 safelen_var = gfc_evaluate_now (se.expr, block);
3995 gfc_add_block_to_block (block, &se.post);
3996
3997 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_SAFELEN);
3998 OMP_CLAUSE_SAFELEN_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_SAFELEN
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3998, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 3998, __FUNCTION__)))
= safelen_var;
3999 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4000 }
4001
4002 if (clauses->simdlen_expr)
4003 {
4004 if (declare_simd)
4005 {
4006 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_SIMDLEN);
4007 OMP_CLAUSE_SIMDLEN_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_SIMDLEN
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4007, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4007, __FUNCTION__)))
4008 = gfc_conv_constant_to_tree (clauses->simdlen_expr);
4009 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4010 }
4011 else
4012 {
4013 tree simdlen_var;
4014
4015 gfc_init_se (&se, NULL__null);
4016 gfc_conv_expr (&se, clauses->simdlen_expr);
4017 gfc_add_block_to_block (block, &se.pre);
4018 simdlen_var = gfc_evaluate_now (se.expr, block);
4019 gfc_add_block_to_block (block, &se.post);
4020
4021 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_SIMDLEN);
4022 OMP_CLAUSE_SIMDLEN_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_SIMDLEN
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4022, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4022, __FUNCTION__)))
= simdlen_var;
4023 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4024 }
4025 }
4026
4027 if (clauses->num_teams_upper)
4028 {
4029 tree num_teams_lower = NULL_TREE(tree) __null, num_teams_upper;
4030
4031 gfc_init_se (&se, NULL__null);
4032 gfc_conv_expr (&se, clauses->num_teams_upper);
4033 gfc_add_block_to_block (block, &se.pre);
4034 num_teams_upper = gfc_evaluate_now (se.expr, block);
4035 gfc_add_block_to_block (block, &se.post);
4036
4037 if (clauses->num_teams_lower)
4038 {
4039 gfc_init_se (&se, NULL__null);
4040 gfc_conv_expr (&se, clauses->num_teams_lower);
4041 gfc_add_block_to_block (block, &se.pre);
4042 num_teams_lower = gfc_evaluate_now (se.expr, block);
4043 gfc_add_block_to_block (block, &se.post);
4044 }
4045 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_NUM_TEAMS);
4046 OMP_CLAUSE_NUM_TEAMS_LOWER_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_NUM_TEAMS
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4046, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4046, __FUNCTION__)))
= num_teams_lower;
4047 OMP_CLAUSE_NUM_TEAMS_UPPER_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_NUM_TEAMS
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4047, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4047, __FUNCTION__)))
= num_teams_upper;
4048 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4049 }
4050
4051 if (clauses->device)
4052 {
4053 tree device;
4054
4055 gfc_init_se (&se, NULL__null);
4056 gfc_conv_expr (&se, clauses->device);
4057 gfc_add_block_to_block (block, &se.pre);
4058 device = gfc_evaluate_now (se.expr, block);
4059 gfc_add_block_to_block (block, &se.post);
4060
4061 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_DEVICE);
4062 OMP_CLAUSE_DEVICE_ID (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_DEVICE
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4062, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4062, __FUNCTION__)))
= device;
4063
4064 if (clauses->ancestor)
4065 OMP_CLAUSE_DEVICE_ANCESTOR (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_DEVICE), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4065, __FUNCTION__))->base.public_flag)
= 1;
4066
4067 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4068 }
4069
4070 if (clauses->thread_limit)
4071 {
4072 tree thread_limit;
4073
4074 gfc_init_se (&se, NULL__null);
4075 gfc_conv_expr (&se, clauses->thread_limit);
4076 gfc_add_block_to_block (block, &se.pre);
4077 thread_limit = gfc_evaluate_now (se.expr, block);
4078 gfc_add_block_to_block (block, &se.post);
4079
4080 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_THREAD_LIMIT);
4081 OMP_CLAUSE_THREAD_LIMIT_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_THREAD_LIMIT
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4081, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4081, __FUNCTION__)))
= thread_limit;
4082 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4083 }
4084
4085 chunk_size = NULL_TREE(tree) __null;
4086 if (clauses->dist_chunk_size)
4087 {
4088 gfc_init_se (&se, NULL__null);
4089 gfc_conv_expr (&se, clauses->dist_chunk_size);
4090 gfc_add_block_to_block (block, &se.pre);
4091 chunk_size = gfc_evaluate_now (se.expr, block);
4092 gfc_add_block_to_block (block, &se.post);
4093 }
4094
4095 if (clauses->dist_sched_kind != OMP_SCHED_NONE)
4096 {
4097 c = build_omp_clause (gfc_get_location (&where),
4098 OMP_CLAUSE_DIST_SCHEDULE);
4099 OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_DIST_SCHEDULE
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4099, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4099, __FUNCTION__)))
= chunk_size;
4100 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4101 }
4102
4103 if (clauses->grainsize)
4104 {
4105 tree grainsize;
4106
4107 gfc_init_se (&se, NULL__null);
4108 gfc_conv_expr (&se, clauses->grainsize);
4109 gfc_add_block_to_block (block, &se.pre);
4110 grainsize = gfc_evaluate_now (se.expr, block);
4111 gfc_add_block_to_block (block, &se.post);
4112
4113 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_GRAINSIZE);
4114 OMP_CLAUSE_GRAINSIZE_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_GRAINSIZE
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4114, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4114, __FUNCTION__)))
= grainsize;
4115 if (clauses->grainsize_strict)
4116 OMP_CLAUSE_GRAINSIZE_STRICT (c)(((omp_clause_subcode_check ((c), (OMP_CLAUSE_GRAINSIZE), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4116, __FUNCTION__)))->base.private_flag)
= 1;
4117 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4118 }
4119
4120 if (clauses->num_tasks)
4121 {
4122 tree num_tasks;
4123
4124 gfc_init_se (&se, NULL__null);
4125 gfc_conv_expr (&se, clauses->num_tasks);
4126 gfc_add_block_to_block (block, &se.pre);
4127 num_tasks = gfc_evaluate_now (se.expr, block);
4128 gfc_add_block_to_block (block, &se.post);
4129
4130 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_NUM_TASKS);
4131 OMP_CLAUSE_NUM_TASKS_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_NUM_TASKS
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4131, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4131, __FUNCTION__)))
= num_tasks;
4132 if (clauses->num_tasks_strict)
4133 OMP_CLAUSE_NUM_TASKS_STRICT (c)(((omp_clause_subcode_check ((c), (OMP_CLAUSE_NUM_TASKS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4133, __FUNCTION__)))->base.private_flag)
= 1;
4134 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4135 }
4136
4137 if (clauses->priority)
4138 {
4139 tree priority;
4140
4141 gfc_init_se (&se, NULL__null);
4142 gfc_conv_expr (&se, clauses->priority);
4143 gfc_add_block_to_block (block, &se.pre);
4144 priority = gfc_evaluate_now (se.expr, block);
4145 gfc_add_block_to_block (block, &se.post);
4146
4147 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_PRIORITY);
4148 OMP_CLAUSE_PRIORITY_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_PRIORITY
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4148, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4148, __FUNCTION__)))
= priority;
4149 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4150 }
4151
4152 if (clauses->detach)
4153 {
4154 tree detach;
4155
4156 gfc_init_se (&se, NULL__null);
4157 gfc_conv_expr (&se, clauses->detach);
4158 gfc_add_block_to_block (block, &se.pre);
4159 detach = se.expr;
4160 gfc_add_block_to_block (block, &se.post);
4161
4162 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_DETACH);
4163 TREE_ADDRESSABLE (detach)((detach)->base.addressable_flag) = 1;
4164 OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4164, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4164, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4164, __FUNCTION__)))
= detach;
4165 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4166 }
4167
4168 if (clauses->filter)
4169 {
4170 tree filter;
4171
4172 gfc_init_se (&se, NULL__null);
4173 gfc_conv_expr (&se, clauses->filter);
4174 gfc_add_block_to_block (block, &se.pre);
4175 filter = gfc_evaluate_now (se.expr, block);
4176 gfc_add_block_to_block (block, &se.post);
4177
4178 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_FILTER);
4179 OMP_CLAUSE_FILTER_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_FILTER
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4179, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4179, __FUNCTION__)))
= filter;
4180 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4181 }
4182
4183 if (clauses->hint)
4184 {
4185 tree hint;
4186
4187 gfc_init_se (&se, NULL__null);
4188 gfc_conv_expr (&se, clauses->hint);
4189 gfc_add_block_to_block (block, &se.pre);
4190 hint = gfc_evaluate_now (se.expr, block);
4191 gfc_add_block_to_block (block, &se.post);
4192
4193 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_HINT);
4194 OMP_CLAUSE_HINT_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_HINT
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4194, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4194, __FUNCTION__)))
= hint;
4195 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4196 }
4197
4198 if (clauses->simd)
4199 {
4200 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_SIMD);
4201 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4202 }
4203 if (clauses->threads)
4204 {
4205 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_THREADS);
4206 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4207 }
4208 if (clauses->nogroup)
4209 {
4210 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_NOGROUP);
4211 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4212 }
4213
4214 for (int i = 0; i < OMP_DEFAULTMAP_CAT_NUM; i++)
4215 {
4216 if (clauses->defaultmap[i] == OMP_DEFAULTMAP_UNSET)
4217 continue;
4218 enum omp_clause_defaultmap_kind behavior, category;
4219 switch ((gfc_omp_defaultmap_category) i)
4220 {
4221 case OMP_DEFAULTMAP_CAT_UNCATEGORIZED:
4222 category = OMP_CLAUSE_DEFAULTMAP_CATEGORY_UNSPECIFIED;
4223 break;
4224 case OMP_DEFAULTMAP_CAT_SCALAR:
4225 category = OMP_CLAUSE_DEFAULTMAP_CATEGORY_SCALAR;
4226 break;
4227 case OMP_DEFAULTMAP_CAT_AGGREGATE:
4228 category = OMP_CLAUSE_DEFAULTMAP_CATEGORY_AGGREGATE;
4229 break;
4230 case OMP_DEFAULTMAP_CAT_ALLOCATABLE:
4231 category = OMP_CLAUSE_DEFAULTMAP_CATEGORY_ALLOCATABLE;
4232 break;
4233 case OMP_DEFAULTMAP_CAT_POINTER:
4234 category = OMP_CLAUSE_DEFAULTMAP_CATEGORY_POINTER;
4235 break;
4236 default: gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4236, __FUNCTION__))
;
4237 }
4238 switch (clauses->defaultmap[i])
4239 {
4240 case OMP_DEFAULTMAP_ALLOC:
4241 behavior = OMP_CLAUSE_DEFAULTMAP_ALLOC;
4242 break;
4243 case OMP_DEFAULTMAP_TO: behavior = OMP_CLAUSE_DEFAULTMAP_TO; break;
4244 case OMP_DEFAULTMAP_FROM: behavior = OMP_CLAUSE_DEFAULTMAP_FROM; break;
4245 case OMP_DEFAULTMAP_TOFROM:
4246 behavior = OMP_CLAUSE_DEFAULTMAP_TOFROM;
4247 break;
4248 case OMP_DEFAULTMAP_FIRSTPRIVATE:
4249 behavior = OMP_CLAUSE_DEFAULTMAP_FIRSTPRIVATE;
4250 break;
4251 case OMP_DEFAULTMAP_NONE: behavior = OMP_CLAUSE_DEFAULTMAP_NONE; break;
4252 case OMP_DEFAULTMAP_DEFAULT:
4253 behavior = OMP_CLAUSE_DEFAULTMAP_DEFAULT;
4254 break;
4255 default: gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4255, __FUNCTION__))
;
4256 }
4257 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_DEFAULTMAP);
4258 OMP_CLAUSE_DEFAULTMAP_SET_KIND (c, behavior, category)(((omp_clause_subcode_check ((c), (OMP_CLAUSE_DEFAULTMAP), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4258, __FUNCTION__))->omp_clause.subcode.defaultmap_kind
) = (enum omp_clause_defaultmap_kind) (category | behavior))
;
4259 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4260 }
4261
4262 if (clauses->doacross_source)
4263 {
4264 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_DOACROSS);
4265 OMP_CLAUSE_DOACROSS_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_DOACROSS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4265, __FUNCTION__))->omp_clause.subcode.doacross_kind)
= OMP_CLAUSE_DOACROSS_SOURCE;
4266 OMP_CLAUSE_DOACROSS_DEPEND (c)(((omp_clause_subcode_check ((c), (OMP_CLAUSE_DOACROSS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4266, __FUNCTION__)))->base.protected_flag)
= clauses->depend_source;
4267 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4268 }
4269
4270 if (clauses->async)
4271 {
4272 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_ASYNC);
4273 if (clauses->async_expr)
4274 OMP_CLAUSE_ASYNC_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_ASYNC
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4274, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4274, __FUNCTION__)))
4275 = gfc_convert_expr_to_tree (block, clauses->async_expr);
4276 else
4277 OMP_CLAUSE_ASYNC_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_ASYNC
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4277, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4277, __FUNCTION__)))
= NULL__null;
4278 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4279 }
4280 if (clauses->seq)
4281 {
4282 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_SEQ);
4283 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4284 }
4285 if (clauses->par_auto)
4286 {
4287 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_AUTO);
4288 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4289 }
4290 if (clauses->if_present)
4291 {
4292 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_IF_PRESENT);
4293 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4294 }
4295 if (clauses->finalize)
4296 {
4297 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_FINALIZE);
4298 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4299 }
4300 if (clauses->independent)
4301 {
4302 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_INDEPENDENT);
4303 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4304 }
4305 if (clauses->wait_list)
4306 {
4307 gfc_expr_list *el;
4308
4309 for (el = clauses->wait_list; el; el = el->next)
4310 {
4311 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_WAIT);
4312 OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4312, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4312, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4312, __FUNCTION__)))
= gfc_convert_expr_to_tree (block, el->expr);
4313 OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4313, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4313, __FUNCTION__))->common.chain)
= omp_clauses;
4314 omp_clauses = c;
4315 }
4316 }
4317 if (clauses->num_gangs_expr)
4318 {
4319 tree num_gangs_var
4320 = gfc_convert_expr_to_tree (block, clauses->num_gangs_expr);
4321 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_NUM_GANGS);
4322 OMP_CLAUSE_NUM_GANGS_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_NUM_GANGS
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4322, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4322, __FUNCTION__)))
= num_gangs_var;
4323 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4324 }
4325 if (clauses->num_workers_expr)
4326 {
4327 tree num_workers_var
4328 = gfc_convert_expr_to_tree (block, clauses->num_workers_expr);
4329 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_NUM_WORKERS);
4330 OMP_CLAUSE_NUM_WORKERS_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_NUM_WORKERS
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4330, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4330, __FUNCTION__)))
= num_workers_var;
4331 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4332 }
4333 if (clauses->vector_length_expr)
4334 {
4335 tree vector_length_var
4336 = gfc_convert_expr_to_tree (block, clauses->vector_length_expr);
4337 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_VECTOR_LENGTH);
4338 OMP_CLAUSE_VECTOR_LENGTH_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_VECTOR_LENGTH
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4338, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4338, __FUNCTION__)))
= vector_length_var;
4339 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4340 }
4341 if (clauses->tile_list)
4342 {
4343 vec<tree, va_gc> *tvec;
4344 gfc_expr_list *el;
4345
4346 vec_alloc (tvec, 4);
4347
4348 for (el = clauses->tile_list; el; el = el->next)
4349 vec_safe_push (tvec, gfc_convert_expr_to_tree (block, el->expr));
4350
4351 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_TILE);
4352 OMP_CLAUSE_TILE_LIST (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_TILE
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4352, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4352, __FUNCTION__)))
= build_tree_list_vec (tvec);
4353 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4354 tvec->truncate (0);
4355 }
4356 if (clauses->vector)
4357 {
4358 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_VECTOR);
4359 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4360
4361 if (clauses->vector_expr)
4362 {
4363 tree vector_var
4364 = gfc_convert_expr_to_tree (block, clauses->vector_expr);
4365 OMP_CLAUSE_VECTOR_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_VECTOR
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4365, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4365, __FUNCTION__)))
= vector_var;
4366
4367 /* TODO: We're not capturing location information for individual
4368 clauses. However, if we have an expression attached to the
4369 clause, that one provides better location information. */
4370 OMP_CLAUSE_LOCATION (c)((tree_check ((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4370, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.locus
4371 = gfc_get_location (&clauses->vector_expr->where);
4372 }
4373 }
4374 if (clauses->worker)
4375 {
4376 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_WORKER);
4377 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4378
4379 if (clauses->worker_expr)
4380 {
4381 tree worker_var
4382 = gfc_convert_expr_to_tree (block, clauses->worker_expr);
4383 OMP_CLAUSE_WORKER_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_WORKER
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4383, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4383, __FUNCTION__)))
= worker_var;
4384
4385 /* TODO: We're not capturing location information for individual
4386 clauses. However, if we have an expression attached to the
4387 clause, that one provides better location information. */
4388 OMP_CLAUSE_LOCATION (c)((tree_check ((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4388, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.locus
4389 = gfc_get_location (&clauses->worker_expr->where);
4390 }
4391 }
4392 if (clauses->gang)
4393 {
4394 tree arg;
4395 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_GANG);
4396 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4397
4398 if (clauses->gang_num_expr)
4399 {
4400 arg = gfc_convert_expr_to_tree (block, clauses->gang_num_expr);
4401 OMP_CLAUSE_GANG_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_GANG
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4401, __FUNCTION__))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4401, __FUNCTION__)))
= arg;
4402
4403 /* TODO: We're not capturing location information for individual
4404 clauses. However, if we have an expression attached to the
4405 clause, that one provides better location information. */
4406 OMP_CLAUSE_LOCATION (c)((tree_check ((c), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4406, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.locus
4407 = gfc_get_location (&clauses->gang_num_expr->where);
4408 }
4409
4410 if (clauses->gang_static)
4411 {
4412 arg = clauses->gang_static_expr
4413 ? gfc_convert_expr_to_tree (block, clauses->gang_static_expr)
4414 : integer_minus_one_nodeglobal_trees[TI_INTEGER_MINUS_ONE];
4415 OMP_CLAUSE_GANG_STATIC_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_GANG
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4415, __FUNCTION__))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4415, __FUNCTION__)))
= arg;
4416 }
4417 }
4418 if (clauses->bind != OMP_BIND_UNSET)
4419 {
4420 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_BIND);
4421 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
4422 switch (clauses->bind)
4423 {
4424 case OMP_BIND_TEAMS:
4425 OMP_CLAUSE_BIND_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_BIND), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4425, __FUNCTION__))->omp_clause.subcode.bind_kind)
= OMP_CLAUSE_BIND_TEAMS;
4426 break;
4427 case OMP_BIND_PARALLEL:
4428 OMP_CLAUSE_BIND_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_BIND), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4428, __FUNCTION__))->omp_clause.subcode.bind_kind)
= OMP_CLAUSE_BIND_PARALLEL;
4429 break;
4430 case OMP_BIND_THREAD:
4431 OMP_CLAUSE_BIND_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_BIND), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4431, __FUNCTION__))->omp_clause.subcode.bind_kind)
= OMP_CLAUSE_BIND_THREAD;
4432 break;
4433 default:
4434 gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4434, __FUNCTION__))
;
4435 }
4436 }
4437 /* OpenACC 'nohost' clauses cannot appear here. */
4438 gcc_checking_assert (!clauses->nohost)((void)(!(!clauses->nohost) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4438, __FUNCTION__), 0 : 0))
;
4439
4440 return nreverse (omp_clauses);
4441}
4442
4443/* Like gfc_trans_code, but force creation of a BIND_EXPR around it. */
4444
4445static tree
4446gfc_trans_omp_code (gfc_code *code, bool force_empty)
4447{
4448 tree stmt;
4449
4450 pushlevel ();
4451 stmt = gfc_trans_code (code);
4452 if (TREE_CODE (stmt)((enum tree_code) (stmt)->base.code) != BIND_EXPR)
4453 {
4454 if (!IS_EMPTY_STMT (stmt)(((enum tree_code) (stmt)->base.code) == NOP_EXPR &&
(((enum tree_code) (((contains_struct_check ((stmt), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4454, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
) && integer_zerop ((*((const_cast<tree*> (tree_operand_check
((stmt), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.cc"
, 4454, __FUNCTION__)))))))
|| force_empty)
4455 {
4456 tree block = poplevel (1, 0);
4457 stmt = build3_v (BIND_EXPR, NULL, stmt, block)fold_build3_loc (input_location, BIND_EXPR, global_trees[TI_VOID_TYPE
], __null, stmt, block)
;
4458 }
4459 else
4460 poplevel (0, 0);
4461 }
4462 else
4463 poplevel (0, 0);
4464 return stmt;
4465}
4466
4467/* Translate OpenACC 'parallel', 'kernels', 'serial', 'data', 'host_data'
4468 construct. */
4469
4470static tree
4471gfc_trans_oacc_construct (gfc_code *code)
4472{
4473 stmtblock_t block;
4474 tree stmt, oacc_clauses;
4475 enum tree_code construct_code;
4476
4477 switch (code->op)
4478 {
4479 case EXEC_OACC_PARALLEL:
4480 construct_code = OACC_PARALLEL;
4481 break;
4482 case EXEC_OACC_KERNELS:
4483 construct_code = OACC_KERNELS;
4484 break;
4485 case EXEC_OACC_SERIAL:
4486 construct_code = OACC