Bug Summary

File:build/gcc/fortran/trans-openmp.c
Warning:line 1334, 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-unknown-linux-gnu -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name trans-openmp.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -analyzer-config-compatibility-mode=true -mrelocation-model static -mframe-pointer=none -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -fno-split-dwarf-inlining -debugger-tuning=gdb -resource-dir /usr/lib64/clang/11.0.0 -D IN_GCC_FRONTEND -D IN_GCC -D HAVE_CONFIG_H -I . -I fortran -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../include -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libcpp/include -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libcody -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libdecnumber -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libdecnumber/bid -I ../libdecnumber -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libbacktrace -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10 -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/x86_64-suse-linux -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/backward -internal-isystem /usr/local/include -internal-isystem /usr/lib64/clang/11.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-narrowing -Wwrite-strings -Wno-error=format-diag -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fdeprecated-macro -fdebug-compilation-dir /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/objdir/gcc -ferror-limit 19 -fno-rtti -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-output=plist-html -analyzer-config silence-checkers=core.NullDereference -faddrsig -o /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/objdir/clang-static-analyzer/2021-01-16-135054-17580-1/report-wkdAES.plist -x c++ /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c
1/* OpenMP directive translation -- generate GCC trees from gfc_code.
2 Copyright (C) 2005-2021 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 "gomp-constants.h"
39#include "omp-general.h"
40#include "omp-low.h"
41#include "memmodel.h" /* For MEMMODEL_ enums. */
42
43#undef GCC_DIAG_STYLE__gcc_gfc__
44#define GCC_DIAG_STYLE__gcc_gfc__ __gcc_tdiag__
45#include "diagnostic-core.h"
46#undef GCC_DIAG_STYLE__gcc_gfc__
47#define GCC_DIAG_STYLE__gcc_gfc__ __gcc_gfc__
48#include "attribs.h"
49#include "function.h"
50
51int ompws_flags;
52
53/* True if OpenMP should regard this DECL as being a scalar which has Fortran's
54 allocatable or pointer attribute. */
55
56bool
57gfc_omp_is_allocatable_or_ptr (const_tree decl)
58{
59 return (DECL_P (decl)(tree_code_type[(int) (((enum tree_code) (decl)->base.code
))] == tcc_declaration)
60 && (GFC_DECL_GET_SCALAR_POINTER (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 60, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 60, __FUNCTION__))->decl_common.lang_specific)->scalar_pointer
) : 0)
61 || GFC_DECL_GET_SCALAR_ALLOCATABLE (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 61, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 61, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
));
62}
63
64/* True if the argument is an optional argument; except that false is also
65 returned for arguments with the value attribute (nonpointers) and for
66 assumed-shape variables (decl is a local variable containing arg->data).
67 Note that pvoid_type_node is for 'type(c_ptr), value. */
68
69static bool
70gfc_omp_is_optional_argument (const_tree decl)
71{
72 return (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == PARM_DECL
73 && DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 73, __FUNCTION__))->decl_common.lang_specific)
74 && TREE_CODE (TREE_TYPE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 74, __FUNCTION__))->typed.type))->base.code)
== POINTER_TYPE
75 && !VOID_TYPE_P (TREE_TYPE (TREE_TYPE (decl)))(((enum tree_code) (((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 75, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 75, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
)
76 && GFC_DECL_OPTIONAL_ARGUMENT (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 76, __FUNCTION__))->decl_common.lang_specific)->optional_arg
)
);
77}
78
79/* Check whether this DECL belongs to a Fortran optional argument.
80 With 'for_present_check' set to false, decls which are optional parameters
81 themselve are returned as tree - or a NULL_TREE otherwise. Those decls are
82 always pointers. With 'for_present_check' set to true, the decl for checking
83 whether an argument is present is returned; for arguments with value
84 attribute this is the hidden argument and of BOOLEAN_TYPE. If the decl is
85 unrelated to optional arguments, NULL_TREE is returned. */
86
87tree
88gfc_omp_check_optional_argument (tree decl, bool for_present_check)
89{
90 if (!for_present_check)
91 return gfc_omp_is_optional_argument (decl) ? decl : NULL_TREE(tree) __null;
92
93 if (!DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 93, __FUNCTION__))->decl_common.lang_specific)
)
94 return NULL_TREE(tree) __null;
95
96 tree orig_decl = decl;
97
98 /* For assumed-shape arrays, a local decl with arg->data is used. */
99 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != PARM_DECL
100 && (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 100, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 100, __FUNCTION__))->type_common.lang_flag_1)
101 || GFC_ARRAY_TYPE_P (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 101, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 101, __FUNCTION__))->type_common.lang_flag_2)
))
102 decl = GFC_DECL_SAVED_DESCRIPTOR (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 102, __FUNCTION__))->decl_common.lang_specific)->saved_descriptor
)
;
103
104 if (decl == NULL_TREE(tree) __null
105 || TREE_CODE (decl)((enum tree_code) (decl)->base.code) != PARM_DECL
106 || !DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 106, __FUNCTION__))->decl_common.lang_specific)
107 || !GFC_DECL_OPTIONAL_ARGUMENT (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 107, __FUNCTION__))->decl_common.lang_specific)->optional_arg
)
)
108 return NULL_TREE(tree) __null;
109
110 /* Scalars with VALUE attribute which are passed by value use a hidden
111 argument to denote the present status. They are passed as nonpointer type
112 with one exception: 'type(c_ptr), value' as 'void*'. */
113 /* Cf. trans-expr.c's gfc_conv_expr_present. */
114 if (TREE_CODE (TREE_TYPE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 114, __FUNCTION__))->typed.type))->base.code)
!= POINTER_TYPE
115 || VOID_TYPE_P (TREE_TYPE (TREE_TYPE (decl)))(((enum tree_code) (((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 115, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 115, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
)
)
116 {
117 char name[GFC_MAX_SYMBOL_LEN63 + 2];
118 tree tree_name;
119
120 name[0] = '_';
121 strcpy (&name[1], IDENTIFIER_POINTER (DECL_NAME (decl))((const char *) (tree_check ((((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 121, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 121, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str
)
);
122 tree_name = get_identifier (name)(__builtin_constant_p (name) ? get_identifier_with_length ((name
), strlen (name)) : get_identifier (name))
;
123
124 /* Walk function argument list to find the hidden arg. */
125 decl = DECL_ARGUMENTS (DECL_CONTEXT (decl))((tree_check ((((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 125, __FUNCTION__))->decl_minimal.context)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 125, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments
)
;
126 for ( ; decl != NULL_TREE(tree) __null; decl = TREE_CHAIN (decl)((contains_struct_check ((decl), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 126, __FUNCTION__))->common.chain)
)
127 if (DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 127, __FUNCTION__))->decl_minimal.name)
== tree_name
128 && DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 128, __FUNCTION__))->decl_common.artificial_flag)
)
129 break;
130
131 gcc_assert (decl)((void)(!(decl) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 131, __FUNCTION__), 0 : 0))
;
132 return decl;
133 }
134
135 return fold_build2_loc (input_location, NE_EXPR, boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE],
136 orig_decl, null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
137}
138
139
140/* Returns tree with NULL if it is not an array descriptor and with the tree to
141 access the 'data' component otherwise. With type_only = true, it returns the
142 TREE_TYPE without creating a new tree. */
143
144tree
145gfc_omp_array_data (tree decl, bool type_only)
146{
147 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 147, __FUNCTION__))->typed.type)
;
148
149 if (POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || (
(enum tree_code) (type)->base.code) == REFERENCE_TYPE)
)
150 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 150, __FUNCTION__))->typed.type)
;
151
152 if (!GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 152, __FUNCTION__))->type_common.lang_flag_1)
)
153 return NULL_TREE(tree) __null;
154
155 if (type_only)
156 return GFC_TYPE_ARRAY_DATAPTR_TYPE (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 156, __FUNCTION__))->type_with_lang_specific.lang_specific
)->dataptr_type)
;
157
158 if (POINTER_TYPE_P (TREE_TYPE (decl))(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 158, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 158, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)
)
159 decl = build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
160
161 decl = gfc_conv_descriptor_data_get (decl);
162 STRIP_NOPS (decl)(decl) = tree_strip_nop_conversions ((const_cast<union tree_node
*> (((decl)))))
;
163 return decl;
164}
165
166/* True if OpenMP should privatize what this DECL points to rather
167 than the DECL itself. */
168
169bool
170gfc_omp_privatize_by_reference (const_tree decl)
171{
172 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 172, __FUNCTION__))->typed.type)
;
173
174 if (TREE_CODE (type)((enum tree_code) (type)->base.code) == REFERENCE_TYPE
175 && (!DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 175, __FUNCTION__))->decl_common.artificial_flag)
|| TREE_CODE (decl)((enum tree_code) (decl)->base.code) == PARM_DECL))
176 return true;
177
178 if (TREE_CODE (type)((enum tree_code) (type)->base.code) == POINTER_TYPE
179 && gfc_omp_is_optional_argument (decl))
180 return true;
181
182 if (TREE_CODE (type)((enum tree_code) (type)->base.code) == POINTER_TYPE)
183 {
184 while (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == COMPONENT_REF)
185 decl = TREE_OPERAND (decl, 1)(*((const_cast<tree*> (tree_operand_check ((decl), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 185, __FUNCTION__)))))
;
186
187 /* Array POINTER/ALLOCATABLE have aggregate types, all user variables
188 that have POINTER_TYPE type and aren't scalar pointers, scalar
189 allocatables, Cray pointees or C pointers are supposed to be
190 privatized by reference. */
191 if (GFC_DECL_GET_SCALAR_POINTER (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 191, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 191, __FUNCTION__))->decl_common.lang_specific)->scalar_pointer
) : 0)
192 || GFC_DECL_GET_SCALAR_ALLOCATABLE (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 192, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 192, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
193 || GFC_DECL_CRAY_POINTEE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 193, __FUNCTION__))->decl_common.lang_flag_4)
194 || GFC_DECL_ASSOCIATE_VAR_P (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 194, __FUNCTION__))->decl_common.lang_flag_7)
195 || VOID_TYPE_P (TREE_TYPE (TREE_TYPE (decl)))(((enum tree_code) (((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 195, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 195, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
)
)
196 return false;
197
198 if (!DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 198, __FUNCTION__))->decl_common.artificial_flag)
199 && TREE_CODE (TREE_TYPE (type))((enum tree_code) (((contains_struct_check ((type), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 199, __FUNCTION__))->typed.type))->base.code)
!= FUNCTION_TYPE)
200 return true;
201
202 /* Some arrays are expanded as DECL_ARTIFICIAL pointers
203 by the frontend. */
204 if (DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 204, __FUNCTION__))->decl_common.lang_specific)
205 && GFC_DECL_SAVED_DESCRIPTOR (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 205, __FUNCTION__))->decl_common.lang_specific)->saved_descriptor
)
)
206 return true;
207 }
208
209 return false;
210}
211
212/* OMP_CLAUSE_DEFAULT_UNSPECIFIED unless OpenMP sharing attribute
213 of DECL is predetermined. */
214
215enum omp_clause_default_kind
216gfc_omp_predetermined_sharing (tree decl)
217{
218 /* Associate names preserve the association established during ASSOCIATE.
219 As they are implemented either as pointers to the selector or array
220 descriptor and shouldn't really change in the ASSOCIATE region,
221 this decl can be either shared or firstprivate. If it is a pointer,
222 use firstprivate, as it is cheaper that way, otherwise make it shared. */
223 if (GFC_DECL_ASSOCIATE_VAR_P (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 223, __FUNCTION__))->decl_common.lang_flag_7)
)
224 {
225 if (TREE_CODE (TREE_TYPE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 225, __FUNCTION__))->typed.type))->base.code)
== POINTER_TYPE)
226 return OMP_CLAUSE_DEFAULT_FIRSTPRIVATE;
227 else
228 return OMP_CLAUSE_DEFAULT_SHARED;
229 }
230
231 if (DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 231, __FUNCTION__))->decl_common.artificial_flag)
232 && ! GFC_DECL_RESULT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 232, __FUNCTION__))->decl_common.lang_flag_5)
233 && ! (DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 233, __FUNCTION__))->decl_common.lang_specific)
234 && GFC_DECL_SAVED_DESCRIPTOR (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 234, __FUNCTION__))->decl_common.lang_specific)->saved_descriptor
)
))
235 return OMP_CLAUSE_DEFAULT_SHARED;
236
237 /* Cray pointees shouldn't be listed in any clauses and should be
238 gimplified to dereference of the corresponding Cray pointer.
239 Make them all private, so that they are emitted in the debug
240 information. */
241 if (GFC_DECL_CRAY_POINTEE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 241, __FUNCTION__))->decl_common.lang_flag_4)
)
242 return OMP_CLAUSE_DEFAULT_PRIVATE;
243
244 /* Assumed-size arrays are predetermined shared. */
245 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == PARM_DECL
246 && GFC_ARRAY_TYPE_P (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 246, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 246, __FUNCTION__))->type_common.lang_flag_2)
247 && GFC_TYPE_ARRAY_AKIND (TREE_TYPE (decl))(((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 247, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 247, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_UNKNOWN
248 && GFC_TYPE_ARRAY_UBOUND (TREE_TYPE (decl),(((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 248, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 249, __FUNCTION__))->type_with_lang_specific.lang_specific
)->ubound[(((tree_class_check ((((contains_struct_check ((
decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 249, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 249, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank) - 1])
249 GFC_TYPE_ARRAY_RANK (TREE_TYPE (decl)) - 1)(((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 248, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 249, __FUNCTION__))->type_with_lang_specific.lang_specific
)->ubound[(((tree_class_check ((((contains_struct_check ((
decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 249, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 249, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank) - 1])
250 == NULL__null)
251 return OMP_CLAUSE_DEFAULT_SHARED;
252
253 /* Dummy procedures aren't considered variables by OpenMP, thus are
254 disallowed in OpenMP clauses. They are represented as PARM_DECLs
255 in the middle-end, so return OMP_CLAUSE_DEFAULT_FIRSTPRIVATE here
256 to avoid complaining about their uses with default(none). */
257 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == PARM_DECL
258 && TREE_CODE (TREE_TYPE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 258, __FUNCTION__))->typed.type))->base.code)
== POINTER_TYPE
259 && TREE_CODE (TREE_TYPE (TREE_TYPE (decl)))((enum tree_code) (((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 259, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 259, __FUNCTION__))->typed.type))->base.code)
== FUNCTION_TYPE)
260 return OMP_CLAUSE_DEFAULT_FIRSTPRIVATE;
261
262 /* COMMON and EQUIVALENCE decls are shared. They
263 are only referenced through DECL_VALUE_EXPR of the variables
264 contained in them. If those are privatized, they will not be
265 gimplified to the COMMON or EQUIVALENCE decls. */
266 if (GFC_DECL_COMMON_OR_EQUIV (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 266, __FUNCTION__))->decl_common.lang_flag_3)
&& ! DECL_HAS_VALUE_EXPR_P (decl)((tree_check3 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 266, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL)))
->decl_common.decl_flag_2)
)
267 return OMP_CLAUSE_DEFAULT_SHARED;
268
269 if (GFC_DECL_RESULT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 269, __FUNCTION__))->decl_common.lang_flag_5)
&& ! DECL_HAS_VALUE_EXPR_P (decl)((tree_check3 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 269, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL)))
->decl_common.decl_flag_2)
)
270 return OMP_CLAUSE_DEFAULT_SHARED;
271
272 /* These are either array or derived parameters, or vtables.
273 In the former cases, the OpenMP standard doesn't consider them to be
274 variables at all (they can't be redefined), but they can nevertheless appear
275 in parallel/task regions and for default(none) purposes treat them as shared.
276 For vtables likely the same handling is desirable. */
277 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && TREE_READONLY (decl)((non_type_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 277, __FUNCTION__))->base.readonly_flag)
278 && (TREE_STATIC (decl)((decl)->base.static_flag) || DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 278, __FUNCTION__))->decl_common.decl_flag_1)
))
279 return OMP_CLAUSE_DEFAULT_SHARED;
280
281 return OMP_CLAUSE_DEFAULT_UNSPECIFIED;
282}
283
284
285/* OMP_CLAUSE_DEFAULTMAP_CATEGORY_UNSPECIFIED unless OpenMP mapping attribute
286 of DECL is predetermined. */
287
288enum omp_clause_defaultmap_kind
289gfc_omp_predetermined_mapping (tree decl)
290{
291 if (DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 291, __FUNCTION__))->decl_common.artificial_flag)
292 && ! GFC_DECL_RESULT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 292, __FUNCTION__))->decl_common.lang_flag_5)
293 && ! (DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 293, __FUNCTION__))->decl_common.lang_specific)
294 && GFC_DECL_SAVED_DESCRIPTOR (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 294, __FUNCTION__))->decl_common.lang_specific)->saved_descriptor
)
))
295 return OMP_CLAUSE_DEFAULTMAP_TO;
296
297 /* These are either array or derived parameters, or vtables. */
298 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && TREE_READONLY (decl)((non_type_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 298, __FUNCTION__))->base.readonly_flag)
299 && (TREE_STATIC (decl)((decl)->base.static_flag) || DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 299, __FUNCTION__))->decl_common.decl_flag_1)
))
300 return OMP_CLAUSE_DEFAULTMAP_TO;
301
302 return OMP_CLAUSE_DEFAULTMAP_CATEGORY_UNSPECIFIED;
303}
304
305
306/* Return decl that should be used when reporting DEFAULT(NONE)
307 diagnostics. */
308
309tree
310gfc_omp_report_decl (tree decl)
311{
312 if (DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 312, __FUNCTION__))->decl_common.artificial_flag)
313 && DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 313, __FUNCTION__))->decl_common.lang_specific)
314 && GFC_DECL_SAVED_DESCRIPTOR (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 314, __FUNCTION__))->decl_common.lang_specific)->saved_descriptor
)
)
315 return GFC_DECL_SAVED_DESCRIPTOR (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 315, __FUNCTION__))->decl_common.lang_specific)->saved_descriptor
)
;
316
317 return decl;
318}
319
320/* Return true if TYPE has any allocatable components. */
321
322static bool
323gfc_has_alloc_comps (tree type, tree decl)
324{
325 tree field, ftype;
326
327 if (POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || (
(enum tree_code) (type)->base.code) == REFERENCE_TYPE)
)
328 {
329 if (GFC_DECL_GET_SCALAR_ALLOCATABLE (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 329, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 329, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
)
330 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 330, __FUNCTION__))->typed.type)
;
331 else if (GFC_DECL_GET_SCALAR_POINTER (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 331, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 331, __FUNCTION__))->decl_common.lang_specific)->scalar_pointer
) : 0)
)
332 return false;
333 }
334
335 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 335, __FUNCTION__))->type_common.lang_flag_1)
336 && (GFC_TYPE_ARRAY_AKIND (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 336, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_POINTER
337 || GFC_TYPE_ARRAY_AKIND (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 337, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_POINTER_CONT))
338 return false;
339
340 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 340, __FUNCTION__))->type_common.lang_flag_1)
|| GFC_ARRAY_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 340, __FUNCTION__))->type_common.lang_flag_2)
)
341 type = gfc_get_element_type (type);
342
343 if (TREE_CODE (type)((enum tree_code) (type)->base.code) != RECORD_TYPE)
344 return false;
345
346 for (field = TYPE_FIELDS (type)((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 346, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 346, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 346, __FUNCTION__))->common.chain))
)
347 {
348 ftype = TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 348, __FUNCTION__))->typed.type)
;
349 if (GFC_DECL_GET_SCALAR_ALLOCATABLE (field)(((contains_struct_check ((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 349, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 349, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
)
350 return true;
351 if (GFC_DESCRIPTOR_TYPE_P (ftype)((tree_class_check ((ftype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 351, __FUNCTION__))->type_common.lang_flag_1)
352 && GFC_TYPE_ARRAY_AKIND (ftype)(((tree_class_check ((ftype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 352, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_ALLOCATABLE)
353 return true;
354 if (gfc_has_alloc_comps (ftype, field))
355 return true;
356 }
357 return false;
358}
359
360/* Return true if DECL in private clause needs
361 OMP_CLAUSE_PRIVATE_OUTER_REF on the private clause. */
362bool
363gfc_omp_private_outer_ref (tree decl)
364{
365 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 365, __FUNCTION__))->typed.type)
;
366
367 if (gfc_omp_privatize_by_reference (decl))
368 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 368, __FUNCTION__))->typed.type)
;
369
370 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 370, __FUNCTION__))->type_common.lang_flag_1)
371 && GFC_TYPE_ARRAY_AKIND (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 371, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_ALLOCATABLE)
372 return true;
373
374 if (GFC_DECL_GET_SCALAR_ALLOCATABLE (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 374, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 374, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
)
375 return true;
376
377 if (gfc_has_alloc_comps (type, decl))
378 return true;
379
380 return false;
381}
382
383/* Callback for gfc_omp_unshare_expr. */
384
385static tree
386gfc_omp_unshare_expr_r (tree *tp, int *walk_subtrees, void *)
387{
388 tree t = *tp;
389 enum tree_code code = TREE_CODE (t)((enum tree_code) (t)->base.code);
390
391 /* Stop at types, decls, constants like copy_tree_r. */
392 if (TREE_CODE_CLASS (code)tree_code_type[(int) (code)] == tcc_type
393 || TREE_CODE_CLASS (code)tree_code_type[(int) (code)] == tcc_declaration
394 || TREE_CODE_CLASS (code)tree_code_type[(int) (code)] == tcc_constant
395 || code == BLOCK)
396 *walk_subtrees = 0;
397 else if (handled_component_p (t)
398 || TREE_CODE (t)((enum tree_code) (t)->base.code) == MEM_REF)
399 {
400 *tp = unshare_expr (t);
401 *walk_subtrees = 0;
402 }
403
404 return NULL_TREE(tree) __null;
405}
406
407/* Unshare in expr anything that the FE which normally doesn't
408 care much about tree sharing (because during gimplification
409 everything is unshared) could cause problems with tree sharing
410 at omp-low.c time. */
411
412static tree
413gfc_omp_unshare_expr (tree expr)
414{
415 walk_tree (&expr, gfc_omp_unshare_expr_r, NULL, NULL)walk_tree_1 (&expr, gfc_omp_unshare_expr_r, __null, __null
, __null)
;
416 return expr;
417}
418
419enum walk_alloc_comps
420{
421 WALK_ALLOC_COMPS_DTOR,
422 WALK_ALLOC_COMPS_DEFAULT_CTOR,
423 WALK_ALLOC_COMPS_COPY_CTOR
424};
425
426/* Handle allocatable components in OpenMP clauses. */
427
428static tree
429gfc_walk_alloc_comps (tree decl, tree dest, tree var,
430 enum walk_alloc_comps kind)
431{
432 stmtblock_t block, tmpblock;
433 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 433, __FUNCTION__))->typed.type)
, then_b, tem, field;
434 gfc_init_block (&block);
435
436 if (GFC_ARRAY_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 436, __FUNCTION__))->type_common.lang_flag_2)
|| GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 436, __FUNCTION__))->type_common.lang_flag_1)
)
437 {
438 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 438, __FUNCTION__))->type_common.lang_flag_1)
)
439 {
440 gfc_init_block (&tmpblock);
441 tem = gfc_full_array_size (&tmpblock, decl,
442 GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 442, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
);
443 then_b = gfc_finish_block (&tmpblock);
444 gfc_add_expr_to_block (&block, gfc_omp_unshare_expr (then_b));
445 tem = gfc_omp_unshare_expr (tem);
446 tem = fold_build2_loc (input_location, MINUS_EXPR,
447 gfc_array_index_type, tem,
448 gfc_index_one_nodegfc_rank_cst[1]);
449 }
450 else
451 {
452 bool compute_nelts = false;
453 if (!TYPE_DOMAIN (type)((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 453, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
454 || TYPE_MAX_VALUE (TYPE_DOMAIN (type))((tree_check5 ((((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 454, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 454, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)
== NULL_TREE(tree) __null
455 || TYPE_MIN_VALUE (TYPE_DOMAIN (type))((tree_check5 ((((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 455, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 455, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.minval
)
== error_mark_nodeglobal_trees[TI_ERROR_MARK]
456 || TYPE_MAX_VALUE (TYPE_DOMAIN (type))((tree_check5 ((((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 456, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 456, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)
== error_mark_nodeglobal_trees[TI_ERROR_MARK])
457 compute_nelts = true;
458 else if (VAR_P (TYPE_MAX_VALUE (TYPE_DOMAIN (type)))(((enum tree_code) (((tree_check5 ((((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 458, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 458, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
))->base.code) == VAR_DECL)
)
459 {
460 tree a = DECL_ATTRIBUTES (TYPE_MAX_VALUE (TYPE_DOMAIN (type)))((contains_struct_check ((((tree_check5 ((((tree_check ((type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 460, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 460, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 460, __FUNCTION__))->decl_common.attributes)
;
461 if (lookup_attribute ("omp dummy var", a))
462 compute_nelts = true;
463 }
464 if (compute_nelts)
465 {
466 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),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 467, __FUNCTION__))->type_common.size_unit), ((tree_class_check
((((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 468, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 468, __FUNCTION__))->type_common.size_unit) )
467 TYPE_SIZE_UNIT (type),fold_build2_loc (((location_t) 0), EXACT_DIV_EXPR, sizetype_tab
[(int) stk_sizetype], ((tree_class_check ((type), (tcc_type),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 467, __FUNCTION__))->type_common.size_unit), ((tree_class_check
((((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 468, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 468, __FUNCTION__))->type_common.size_unit) )
468 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),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 467, __FUNCTION__))->type_common.size_unit), ((tree_class_check
((((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 468, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 468, __FUNCTION__))->type_common.size_unit) )
;
469 tem = size_binop (MINUS_EXPR, tem, size_one_node)size_binop_loc (((location_t) 0), MINUS_EXPR, tem, global_trees
[TI_SIZE_ONE])
;
470 }
471 else
472 tem = array_type_nelts (type);
473 tem = fold_convert (gfc_array_index_type, tem)fold_convert_loc (((location_t) 0), gfc_array_index_type, tem
)
;
474 }
475
476 tree nelems = gfc_evaluate_now (tem, &block);
477 tree index = gfc_create_var (gfc_array_index_type, "S");
478
479 gfc_init_block (&tmpblock);
480 tem = gfc_conv_array_data (decl);
481 tree declvar = build_fold_indirect_ref_loc (input_location, tem);
482 tree declvref = gfc_build_array_ref (declvar, index, NULL__null);
483 tree destvar, destvref = NULL_TREE(tree) __null;
484 if (dest)
485 {
486 tem = gfc_conv_array_data (dest);
487 destvar = build_fold_indirect_ref_loc (input_location, tem);
488 destvref = gfc_build_array_ref (destvar, index, NULL__null);
489 }
490 gfc_add_expr_to_block (&tmpblock,
491 gfc_walk_alloc_comps (declvref, destvref,
492 var, kind));
493
494 gfc_loopinfo loop;
495 gfc_init_loopinfo (&loop);
496 loop.dimen = 1;
497 loop.from[0] = gfc_index_zero_nodegfc_rank_cst[0];
498 loop.loopvar[0] = index;
499 loop.to[0] = nelems;
500 gfc_trans_scalarizing_loops (&loop, &tmpblock);
501 gfc_add_block_to_block (&block, &loop.pre);
502 return gfc_finish_block (&block);
503 }
504 else if (GFC_DECL_GET_SCALAR_ALLOCATABLE (var)(((contains_struct_check ((var), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 504, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((var), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 504, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
)
505 {
506 decl = build_fold_indirect_ref_loc (input_location, decl);
507 if (dest)
508 dest = build_fold_indirect_ref_loc (input_location, dest);
509 type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 509, __FUNCTION__))->typed.type)
;
510 }
511
512 gcc_assert (TREE_CODE (type) == RECORD_TYPE)((void)(!(((enum tree_code) (type)->base.code) == RECORD_TYPE
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 512, __FUNCTION__), 0 : 0))
;
513 for (field = TYPE_FIELDS (type)((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 513, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 513, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 513, __FUNCTION__))->common.chain))
)
514 {
515 tree ftype = TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 515, __FUNCTION__))->typed.type)
;
516 tree declf, destf = NULL_TREE(tree) __null;
517 bool has_alloc_comps = gfc_has_alloc_comps (ftype, field);
518 if ((!GFC_DESCRIPTOR_TYPE_P (ftype)((tree_class_check ((ftype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 518, __FUNCTION__))->type_common.lang_flag_1)
519 || GFC_TYPE_ARRAY_AKIND (ftype)(((tree_class_check ((ftype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 519, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
!= GFC_ARRAY_ALLOCATABLE)
520 && !GFC_DECL_GET_SCALAR_ALLOCATABLE (field)(((contains_struct_check ((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 520, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 520, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
521 && !has_alloc_comps)
522 continue;
523 declf = fold_build3_loc (input_location, COMPONENT_REF, ftype,
524 decl, field, NULL_TREE(tree) __null);
525 if (dest)
526 destf = fold_build3_loc (input_location, COMPONENT_REF, ftype,
527 dest, field, NULL_TREE(tree) __null);
528
529 tem = NULL_TREE(tree) __null;
530 switch (kind)
531 {
532 case WALK_ALLOC_COMPS_DTOR:
533 break;
534 case WALK_ALLOC_COMPS_DEFAULT_CTOR:
535 if (GFC_DESCRIPTOR_TYPE_P (ftype)((tree_class_check ((ftype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 535, __FUNCTION__))->type_common.lang_flag_1)
536 && GFC_TYPE_ARRAY_AKIND (ftype)(((tree_class_check ((ftype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 536, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_ALLOCATABLE)
537 {
538 gfc_add_modify (&block, unshare_expr (destf),
539 unshare_expr (declf));
540 tem = gfc_duplicate_allocatable_nocopy
541 (destf, declf, ftype,
542 GFC_TYPE_ARRAY_RANK (ftype)(((tree_class_check ((ftype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 542, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
);
543 }
544 else if (GFC_DECL_GET_SCALAR_ALLOCATABLE (field)(((contains_struct_check ((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 544, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 544, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
)
545 tem = gfc_duplicate_allocatable_nocopy (destf, declf, ftype, 0);
546 break;
547 case WALK_ALLOC_COMPS_COPY_CTOR:
548 if (GFC_DESCRIPTOR_TYPE_P (ftype)((tree_class_check ((ftype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 548, __FUNCTION__))->type_common.lang_flag_1)
549 && GFC_TYPE_ARRAY_AKIND (ftype)(((tree_class_check ((ftype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 549, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_ALLOCATABLE)
550 tem = gfc_duplicate_allocatable (destf, declf, ftype,
551 GFC_TYPE_ARRAY_RANK (ftype)(((tree_class_check ((ftype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 551, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
,
552 NULL_TREE(tree) __null);
553 else if (GFC_DECL_GET_SCALAR_ALLOCATABLE (field)(((contains_struct_check ((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 553, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 553, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
)
554 tem = gfc_duplicate_allocatable (destf, declf, ftype, 0,
555 NULL_TREE(tree) __null);
556 break;
557 }
558 if (tem)
559 gfc_add_expr_to_block (&block, gfc_omp_unshare_expr (tem));
560 if (has_alloc_comps)
561 {
562 gfc_init_block (&tmpblock);
563 gfc_add_expr_to_block (&tmpblock,
564 gfc_walk_alloc_comps (declf, destf,
565 field, kind));
566 then_b = gfc_finish_block (&tmpblock);
567 if (GFC_DESCRIPTOR_TYPE_P (ftype)((tree_class_check ((ftype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 567, __FUNCTION__))->type_common.lang_flag_1)
568 && GFC_TYPE_ARRAY_AKIND (ftype)(((tree_class_check ((ftype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 568, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_ALLOCATABLE)
569 tem = gfc_conv_descriptor_data_get (unshare_expr (declf));
570 else if (GFC_DECL_GET_SCALAR_ALLOCATABLE (field)(((contains_struct_check ((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 570, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 570, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
)
571 tem = unshare_expr (declf);
572 else
573 tem = NULL_TREE(tree) __null;
574 if (tem)
575 {
576 tem = fold_convert (pvoid_type_node, tem)fold_convert_loc (((location_t) 0), pvoid_type_node, tem);
577 tem = fold_build2_loc (input_location, NE_EXPR,
578 logical_type_node, tem,
579 null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
580 then_b = build3_loc (input_location, COND_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE],
581 tem, then_b,
582 build_empty_stmt (input_location));
583 }
584 gfc_add_expr_to_block (&block, then_b);
585 }
586 if (kind == WALK_ALLOC_COMPS_DTOR)
587 {
588 if (GFC_DESCRIPTOR_TYPE_P (ftype)((tree_class_check ((ftype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 588, __FUNCTION__))->type_common.lang_flag_1)
589 && GFC_TYPE_ARRAY_AKIND (ftype)(((tree_class_check ((ftype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 589, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_ALLOCATABLE)
590 {
591 tem = gfc_conv_descriptor_data_get (unshare_expr (declf));
592 tem = gfc_deallocate_with_status (tem, NULL_TREE(tree) __null, NULL_TREE(tree) __null,
593 NULL_TREE(tree) __null, NULL_TREE(tree) __null, true,
594 NULL__null,
595 GFC_CAF_COARRAY_NOCOARRAY);
596 gfc_add_expr_to_block (&block, gfc_omp_unshare_expr (tem));
597 }
598 else if (GFC_DECL_GET_SCALAR_ALLOCATABLE (field)(((contains_struct_check ((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 598, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 598, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
)
599 {
600 tem = gfc_call_free (unshare_expr (declf));
601 gfc_add_expr_to_block (&block, gfc_omp_unshare_expr (tem));
602 }
603 }
604 }
605
606 return gfc_finish_block (&block);
607}
608
609/* Return code to initialize DECL with its default constructor, or
610 NULL if there's nothing to do. */
611
612tree
613gfc_omp_clause_default_ctor (tree clause, tree decl, tree outer)
614{
615 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 615, __FUNCTION__))->typed.type)
, size, ptr, cond, then_b, else_b;
616 stmtblock_t block, cond_block;
617
618 switch (OMP_CLAUSE_CODE (clause)((tree_check ((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 618, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code
)
619 {
620 case OMP_CLAUSE__LOOPTEMP_:
621 case OMP_CLAUSE__REDUCTEMP_:
622 case OMP_CLAUSE__CONDTEMP_:
623 case OMP_CLAUSE__SCANTEMP_:
624 return NULL__null;
625 case OMP_CLAUSE_PRIVATE:
626 case OMP_CLAUSE_LASTPRIVATE:
627 case OMP_CLAUSE_LINEAR:
628 case OMP_CLAUSE_REDUCTION:
629 case OMP_CLAUSE_IN_REDUCTION:
630 case OMP_CLAUSE_TASK_REDUCTION:
631 break;
632 default:
633 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 633, __FUNCTION__))
;
634 }
635
636 if ((! GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 636, __FUNCTION__))->type_common.lang_flag_1)
637 || GFC_TYPE_ARRAY_AKIND (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 637, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
!= GFC_ARRAY_ALLOCATABLE)
638 && (!GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause))(((contains_struct_check (((*(omp_clause_elt_check (((omp_clause_range_check
(((tree_check ((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 638, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 638, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 638, __FUNCTION__)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 638, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
(((*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 638, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 638, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 638, __FUNCTION__)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 638, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
639 || !POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || (
(enum tree_code) (type)->base.code) == REFERENCE_TYPE)
))
640 {
641 if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 641, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 641, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 641, __FUNCTION__)))
))
642 {
643 gcc_assert (outer)((void)(!(outer) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 643, __FUNCTION__), 0 : 0))
;
644 gfc_start_block (&block);
645 tree tem = gfc_walk_alloc_comps (outer, decl,
646 OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 646, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 646, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 646, __FUNCTION__)))
,
647 WALK_ALLOC_COMPS_DEFAULT_CTOR);
648 gfc_add_expr_to_block (&block, tem);
649 return gfc_finish_block (&block);
650 }
651 return NULL_TREE(tree) __null;
652 }
653
654 gcc_assert (outer != NULL_TREE)((void)(!(outer != (tree) __null) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 654, __FUNCTION__), 0 : 0))
;
655
656 /* Allocatable arrays and scalars in PRIVATE clauses need to be set to
657 "not currently allocated" allocation status if outer
658 array is "not currently allocated", otherwise should be allocated. */
659 gfc_start_block (&block);
660
661 gfc_init_block (&cond_block);
662
663 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 663, __FUNCTION__))->type_common.lang_flag_1)
)
664 {
665 gfc_add_modify (&cond_block, decl, outer);
666 tree rank = gfc_rank_cst[GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 666, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
- 1];
667 size = gfc_conv_descriptor_ubound_get (decl, rank);
668 size = fold_build2_loc (input_location, MINUS_EXPR, gfc_array_index_type,
669 size,
670 gfc_conv_descriptor_lbound_get (decl, rank));
671 size = fold_build2_loc (input_location, PLUS_EXPR, gfc_array_index_type,
672 size, gfc_index_one_nodegfc_rank_cst[1]);
673 if (GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 673, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
> 1)
674 size = fold_build2_loc (input_location, MULT_EXPR,
675 gfc_array_index_type, size,
676 gfc_conv_descriptor_stride_get (decl, rank));
677 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 678, __FUNCTION__))->type_common.size_unit))
678 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 678, __FUNCTION__))->type_common.size_unit))
;
679 size = fold_build2_loc (input_location, MULT_EXPR, gfc_array_index_type,
680 size, esize);
681 size = unshare_expr (size);
682 size = gfc_evaluate_now (fold_convert (size_type_node, size)fold_convert_loc (((location_t) 0), global_trees[TI_SIZE_TYPE
], size)
,
683 &cond_block);
684 }
685 else
686 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
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 686, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 686, __FUNCTION__))->type_common.size_unit))
;
687 ptr = gfc_create_var (pvoid_type_node, NULL__null);
688 gfc_allocate_using_malloc (&cond_block, ptr, size, NULL_TREE(tree) __null);
689 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 689, __FUNCTION__))->type_common.lang_flag_1)
)
690 gfc_conv_descriptor_data_set (&cond_block, unshare_expr (decl), ptr);
691 else
692 gfc_add_modify (&cond_block, unshare_expr (decl),
693 fold_convert (TREE_TYPE (decl), ptr)fold_convert_loc (((location_t) 0), ((contains_struct_check (
(decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 693, __FUNCTION__))->typed.type), ptr)
);
694 if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 694, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 694, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 694, __FUNCTION__)))
))
695 {
696 tree tem = gfc_walk_alloc_comps (outer, decl,
697 OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 697, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 697, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 697, __FUNCTION__)))
,
698 WALK_ALLOC_COMPS_DEFAULT_CTOR);
699 gfc_add_expr_to_block (&cond_block, tem);
700 }
701 then_b = gfc_finish_block (&cond_block);
702
703 /* Reduction clause requires allocated ALLOCATABLE. */
704 if (OMP_CLAUSE_CODE (clause)((tree_check ((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 704, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code
!= OMP_CLAUSE_REDUCTION
705 && OMP_CLAUSE_CODE (clause)((tree_check ((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 705, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code
!= OMP_CLAUSE_IN_REDUCTION
706 && OMP_CLAUSE_CODE (clause)((tree_check ((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 706, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code
!= OMP_CLAUSE_TASK_REDUCTION)
707 {
708 gfc_init_block (&cond_block);
709 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 709, __FUNCTION__))->type_common.lang_flag_1)
)
710 gfc_conv_descriptor_data_set (&cond_block, unshare_expr (decl),
711 null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
712 else
713 gfc_add_modify (&cond_block, unshare_expr (decl),
714 build_zero_cst (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 714, __FUNCTION__))->typed.type)
));
715 else_b = gfc_finish_block (&cond_block);
716
717 tree tem = fold_convert (pvoid_type_node,fold_convert_loc (((location_t) 0), pvoid_type_node, ((tree_class_check
((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 718, __FUNCTION__))->type_common.lang_flag_1) ? gfc_conv_descriptor_data_get
(outer) : outer)
718 GFC_DESCRIPTOR_TYPE_P (type)fold_convert_loc (((location_t) 0), pvoid_type_node, ((tree_class_check
((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 718, __FUNCTION__))->type_common.lang_flag_1) ? gfc_conv_descriptor_data_get
(outer) : outer)
719 ? gfc_conv_descriptor_data_get (outer) : outer)fold_convert_loc (((location_t) 0), pvoid_type_node, ((tree_class_check
((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 718, __FUNCTION__))->type_common.lang_flag_1) ? gfc_conv_descriptor_data_get
(outer) : outer)
;
720 tem = unshare_expr (tem);
721 cond = fold_build2_loc (input_location, NE_EXPR, logical_type_node,
722 tem, null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
723 gfc_add_expr_to_block (&block,
724 build3_loc (input_location, COND_EXPR,
725 void_type_nodeglobal_trees[TI_VOID_TYPE], cond, then_b,
726 else_b));
727 /* Avoid -W*uninitialized warnings. */
728 if (DECL_P (decl)(tree_code_type[(int) (((enum tree_code) (decl)->base.code
))] == tcc_declaration)
)
729 TREE_NO_WARNING (decl)((decl)->base.nowarning_flag) = 1;
730 }
731 else
732 gfc_add_expr_to_block (&block, then_b);
733
734 return gfc_finish_block (&block);
735}
736
737/* Build and return code for a copy constructor from SRC to DEST. */
738
739tree
740gfc_omp_clause_copy_ctor (tree clause, tree dest, tree src)
741{
742 tree type = TREE_TYPE (dest)((contains_struct_check ((dest), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 742, __FUNCTION__))->typed.type)
, ptr, size, call;
743 tree cond, then_b, else_b;
744 stmtblock_t block, cond_block;
745
746 gcc_assert (OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_FIRSTPRIVATE((void)(!(((tree_check ((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 746, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_FIRSTPRIVATE
|| ((tree_check ((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 747, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_LINEAR
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 747, __FUNCTION__), 0 : 0))
747 || OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_LINEAR)((void)(!(((tree_check ((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 746, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_FIRSTPRIVATE
|| ((tree_check ((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 747, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_LINEAR
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 747, __FUNCTION__), 0 : 0))
;
748
749 if ((! GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 749, __FUNCTION__))->type_common.lang_flag_1)
750 || GFC_TYPE_ARRAY_AKIND (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 750, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
!= GFC_ARRAY_ALLOCATABLE)
751 && (!GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause))(((contains_struct_check (((*(omp_clause_elt_check (((omp_clause_range_check
(((tree_check ((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 751, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 751, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 751, __FUNCTION__)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 751, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
(((*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 751, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 751, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 751, __FUNCTION__)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 751, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
752 || !POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || (
(enum tree_code) (type)->base.code) == REFERENCE_TYPE)
))
753 {
754 if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 754, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 754, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 754, __FUNCTION__)))
))
755 {
756 gfc_start_block (&block);
757 gfc_add_modify (&block, dest, src);
758 tree tem = gfc_walk_alloc_comps (src, dest, OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 758, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 758, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 758, __FUNCTION__)))
,
759 WALK_ALLOC_COMPS_COPY_CTOR);
760 gfc_add_expr_to_block (&block, tem);
761 return gfc_finish_block (&block);
762 }
763 else
764 return build2_v (MODIFY_EXPR, dest, src)fold_build2_loc (input_location, MODIFY_EXPR, global_trees[TI_VOID_TYPE
], dest, src)
;
765 }
766
767 /* Allocatable arrays in FIRSTPRIVATE clauses need to be allocated
768 and copied from SRC. */
769 gfc_start_block (&block);
770
771 gfc_init_block (&cond_block);
772
773 gfc_add_modify (&cond_block, dest, src);
774 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 774, __FUNCTION__))->type_common.lang_flag_1)
)
775 {
776 tree rank = gfc_rank_cst[GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 776, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
- 1];
777 size = gfc_conv_descriptor_ubound_get (dest, rank);
778 size = fold_build2_loc (input_location, MINUS_EXPR, gfc_array_index_type,
779 size,
780 gfc_conv_descriptor_lbound_get (dest, rank));
781 size = fold_build2_loc (input_location, PLUS_EXPR, gfc_array_index_type,
782 size, gfc_index_one_nodegfc_rank_cst[1]);
783 if (GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 783, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
> 1)
784 size = fold_build2_loc (input_location, MULT_EXPR,
785 gfc_array_index_type, size,
786 gfc_conv_descriptor_stride_get (dest, rank));
787 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 788, __FUNCTION__))->type_common.size_unit))
788 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 788, __FUNCTION__))->type_common.size_unit))
;
789 size = fold_build2_loc (input_location, MULT_EXPR, gfc_array_index_type,
790 size, esize);
791 size = unshare_expr (size);
792 size = gfc_evaluate_now (fold_convert (size_type_node, size)fold_convert_loc (((location_t) 0), global_trees[TI_SIZE_TYPE
], size)
,
793 &cond_block);
794 }
795 else
796 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
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 796, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 796, __FUNCTION__))->type_common.size_unit))
;
797 ptr = gfc_create_var (pvoid_type_node, NULL__null);
798 gfc_allocate_using_malloc (&cond_block, ptr, size, NULL_TREE(tree) __null);
799 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 799, __FUNCTION__))->type_common.lang_flag_1)
)
800 gfc_conv_descriptor_data_set (&cond_block, unshare_expr (dest), ptr);
801 else
802 gfc_add_modify (&cond_block, unshare_expr (dest),
803 fold_convert (TREE_TYPE (dest), ptr)fold_convert_loc (((location_t) 0), ((contains_struct_check (
(dest), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 803, __FUNCTION__))->typed.type), ptr)
);
804
805 tree srcptr = GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 805, __FUNCTION__))->type_common.lang_flag_1)
806 ? gfc_conv_descriptor_data_get (src) : src;
807 srcptr = unshare_expr (srcptr);
808 srcptr = fold_convert (pvoid_type_node, srcptr)fold_convert_loc (((location_t) 0), pvoid_type_node, srcptr);
809 call = build_call_expr_loc (input_location,
810 builtin_decl_explicit (BUILT_IN_MEMCPY), 3, ptr,
811 srcptr, size);
812 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)
);
813 if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 813, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 813, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 813, __FUNCTION__)))
))
814 {
815 tree tem = gfc_walk_alloc_comps (src, dest,
816 OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 816, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 816, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 816, __FUNCTION__)))
,
817 WALK_ALLOC_COMPS_COPY_CTOR);
818 gfc_add_expr_to_block (&cond_block, tem);
819 }
820 then_b = gfc_finish_block (&cond_block);
821
822 gfc_init_block (&cond_block);
823 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 823, __FUNCTION__))->type_common.lang_flag_1)
)
824 gfc_conv_descriptor_data_set (&cond_block, unshare_expr (dest),
825 null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
826 else
827 gfc_add_modify (&cond_block, unshare_expr (dest),
828 build_zero_cst (TREE_TYPE (dest)((contains_struct_check ((dest), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 828, __FUNCTION__))->typed.type)
));
829 else_b = gfc_finish_block (&cond_block);
830
831 cond = fold_build2_loc (input_location, NE_EXPR, logical_type_node,
832 unshare_expr (srcptr), null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
833 gfc_add_expr_to_block (&block,
834 build3_loc (input_location, COND_EXPR,
835 void_type_nodeglobal_trees[TI_VOID_TYPE], cond, then_b, else_b));
836 /* Avoid -W*uninitialized warnings. */
837 if (DECL_P (dest)(tree_code_type[(int) (((enum tree_code) (dest)->base.code
))] == tcc_declaration)
)
838 TREE_NO_WARNING (dest)((dest)->base.nowarning_flag) = 1;
839
840 return gfc_finish_block (&block);
841}
842
843/* Similarly, except use an intrinsic or pointer assignment operator
844 instead. */
845
846tree
847gfc_omp_clause_assign_op (tree clause, tree dest, tree src)
848{
849 tree type = TREE_TYPE (dest)((contains_struct_check ((dest), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 849, __FUNCTION__))->typed.type)
, ptr, size, call, nonalloc;
850 tree cond, then_b, else_b;
851 stmtblock_t block, cond_block, cond_block2, inner_block;
852
853 if ((! GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 853, __FUNCTION__))->type_common.lang_flag_1)
854 || GFC_TYPE_ARRAY_AKIND (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 854, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
!= GFC_ARRAY_ALLOCATABLE)
855 && (!GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause))(((contains_struct_check (((*(omp_clause_elt_check (((omp_clause_range_check
(((tree_check ((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 855, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 855, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 855, __FUNCTION__)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 855, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
(((*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 855, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 855, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 855, __FUNCTION__)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 855, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
856 || !POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || (
(enum tree_code) (type)->base.code) == REFERENCE_TYPE)
))
857 {
858 if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 858, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 858, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 858, __FUNCTION__)))
))
859 {
860 gfc_start_block (&block);
861 /* First dealloc any allocatable components in DEST. */
862 tree tem = gfc_walk_alloc_comps (dest, NULL_TREE(tree) __null,
863 OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 863, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 863, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 863, __FUNCTION__)))
,
864 WALK_ALLOC_COMPS_DTOR);
865 gfc_add_expr_to_block (&block, tem);
866 /* Then copy over toplevel data. */
867 gfc_add_modify (&block, dest, src);
868 /* Finally allocate any allocatable components and copy. */
869 tem = gfc_walk_alloc_comps (src, dest, OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 869, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 869, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 869, __FUNCTION__)))
,
870 WALK_ALLOC_COMPS_COPY_CTOR);
871 gfc_add_expr_to_block (&block, tem);
872 return gfc_finish_block (&block);
873 }
874 else
875 return build2_v (MODIFY_EXPR, dest, src)fold_build2_loc (input_location, MODIFY_EXPR, global_trees[TI_VOID_TYPE
], dest, src)
;
876 }
877
878 gfc_start_block (&block);
879
880 if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 880, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 880, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 880, __FUNCTION__)))
))
881 {
882 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 882, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 882, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 882, __FUNCTION__)))
,
883 WALK_ALLOC_COMPS_DTOR);
884 tree tem = fold_convert (pvoid_type_node,fold_convert_loc (((location_t) 0), pvoid_type_node, ((tree_class_check
((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 885, __FUNCTION__))->type_common.lang_flag_1) ? gfc_conv_descriptor_data_get
(dest) : dest)
885 GFC_DESCRIPTOR_TYPE_P (type)fold_convert_loc (((location_t) 0), pvoid_type_node, ((tree_class_check
((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 885, __FUNCTION__))->type_common.lang_flag_1) ? gfc_conv_descriptor_data_get
(dest) : dest)
886 ? gfc_conv_descriptor_data_get (dest) : dest)fold_convert_loc (((location_t) 0), pvoid_type_node, ((tree_class_check
((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 885, __FUNCTION__))->type_common.lang_flag_1) ? gfc_conv_descriptor_data_get
(dest) : dest)
;
887 tem = unshare_expr (tem);
888 cond = fold_build2_loc (input_location, NE_EXPR, logical_type_node,
889 tem, null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
890 tem = build3_loc (input_location, COND_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE], cond,
891 then_b, build_empty_stmt (input_location));
892 gfc_add_expr_to_block (&block, tem);
893 }
894
895 gfc_init_block (&cond_block);
896
897 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 897, __FUNCTION__))->type_common.lang_flag_1)
)
898 {
899 tree rank = gfc_rank_cst[GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 899, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
- 1];
900 size = gfc_conv_descriptor_ubound_get (src, rank);
901 size = fold_build2_loc (input_location, MINUS_EXPR, gfc_array_index_type,
902 size,
903 gfc_conv_descriptor_lbound_get (src, rank));
904 size = fold_build2_loc (input_location, PLUS_EXPR, gfc_array_index_type,
905 size, gfc_index_one_nodegfc_rank_cst[1]);
906 if (GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 906, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
> 1)
907 size = fold_build2_loc (input_location, MULT_EXPR,
908 gfc_array_index_type, size,
909 gfc_conv_descriptor_stride_get (src, rank));
910 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 911, __FUNCTION__))->type_common.size_unit))
911 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 911, __FUNCTION__))->type_common.size_unit))
;
912 size = fold_build2_loc (input_location, MULT_EXPR, gfc_array_index_type,
913 size, esize);
914 size = unshare_expr (size);
915 size = gfc_evaluate_now (fold_convert (size_type_node, size)fold_convert_loc (((location_t) 0), global_trees[TI_SIZE_TYPE
], size)
,
916 &cond_block);
917 }
918 else
919 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
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 919, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 919, __FUNCTION__))->type_common.size_unit))
;
920 ptr = gfc_create_var (pvoid_type_node, NULL__null);
921
922 tree destptr = GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 922, __FUNCTION__))->type_common.lang_flag_1)
923 ? gfc_conv_descriptor_data_get (dest) : dest;
924 destptr = unshare_expr (destptr);
925 destptr = fold_convert (pvoid_type_node, destptr)fold_convert_loc (((location_t) 0), pvoid_type_node, destptr);
926 gfc_add_modify (&cond_block, ptr, destptr);
927
928 nonalloc = fold_build2_loc (input_location, EQ_EXPR, logical_type_node,
929 destptr, null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
930 cond = nonalloc;
931 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 931, __FUNCTION__))->type_common.lang_flag_1)
)
932 {
933 int i;
934 for (i = 0; i < GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 934, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
; i++)
935 {
936 tree rank = gfc_rank_cst[i];
937 tree tem = gfc_conv_descriptor_ubound_get (src, rank);
938 tem = fold_build2_loc (input_location, MINUS_EXPR,
939 gfc_array_index_type, tem,
940 gfc_conv_descriptor_lbound_get (src, rank));
941 tem = fold_build2_loc (input_location, PLUS_EXPR,
942 gfc_array_index_type, tem,
943 gfc_conv_descriptor_lbound_get (dest, rank));
944 tem = fold_build2_loc (input_location, NE_EXPR, logical_type_node,
945 tem, gfc_conv_descriptor_ubound_get (dest,
946 rank));
947 cond = fold_build2_loc (input_location, TRUTH_ORIF_EXPR,
948 logical_type_node, cond, tem);
949 }
950 }
951
952 gfc_init_block (&cond_block2);
953
954 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 954, __FUNCTION__))->type_common.lang_flag_1)
)
955 {
956 gfc_init_block (&inner_block);
957 gfc_allocate_using_malloc (&inner_block, ptr, size, NULL_TREE(tree) __null);
958 then_b = gfc_finish_block (&inner_block);
959
960 gfc_init_block (&inner_block);
961 gfc_add_modify (&inner_block, ptr,
962 gfc_call_realloc (&inner_block, ptr, size));
963 else_b = gfc_finish_block (&inner_block);
964
965 gfc_add_expr_to_block (&cond_block2,
966 build3_loc (input_location, COND_EXPR,
967 void_type_nodeglobal_trees[TI_VOID_TYPE],
968 unshare_expr (nonalloc),
969 then_b, else_b));
970 gfc_add_modify (&cond_block2, dest, src);
971 gfc_conv_descriptor_data_set (&cond_block2, unshare_expr (dest), ptr);
972 }
973 else
974 {
975 gfc_allocate_using_malloc (&cond_block2, ptr, size, NULL_TREE(tree) __null);
976 gfc_add_modify (&cond_block2, unshare_expr (dest),
977 fold_convert (type, ptr)fold_convert_loc (((location_t) 0), type, ptr));
978 }
979 then_b = gfc_finish_block (&cond_block2);
980 else_b = build_empty_stmt (input_location);
981
982 gfc_add_expr_to_block (&cond_block,
983 build3_loc (input_location, COND_EXPR,
984 void_type_nodeglobal_trees[TI_VOID_TYPE], unshare_expr (cond),
985 then_b, else_b));
986
987 tree srcptr = GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 987, __FUNCTION__))->type_common.lang_flag_1)
988 ? gfc_conv_descriptor_data_get (src) : src;
989 srcptr = unshare_expr (srcptr);
990 srcptr = fold_convert (pvoid_type_node, srcptr)fold_convert_loc (((location_t) 0), pvoid_type_node, srcptr);
991 call = build_call_expr_loc (input_location,
992 builtin_decl_explicit (BUILT_IN_MEMCPY), 3, ptr,
993 srcptr, size);
994 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)
);
995 if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 995, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 995, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 995, __FUNCTION__)))
))
996 {
997 tree tem = gfc_walk_alloc_comps (src, dest,
998 OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 998, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 998, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 998, __FUNCTION__)))
,
999 WALK_ALLOC_COMPS_COPY_CTOR);
1000 gfc_add_expr_to_block (&cond_block, tem);
1001 }
1002 then_b = gfc_finish_block (&cond_block);
1003
1004 if (OMP_CLAUSE_CODE (clause)((tree_check ((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1004, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code
== OMP_CLAUSE_COPYIN)
1005 {
1006 gfc_init_block (&cond_block);
1007 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1007, __FUNCTION__))->type_common.lang_flag_1)
)
1008 {
1009 tree tmp = gfc_conv_descriptor_data_get (unshare_expr (dest));
1010 tmp = gfc_deallocate_with_status (tmp, NULL_TREE(tree) __null, NULL_TREE(tree) __null,
1011 NULL_TREE(tree) __null, NULL_TREE(tree) __null, true, NULL__null,
1012 GFC_CAF_COARRAY_NOCOARRAY);
1013 gfc_add_expr_to_block (&cond_block, tmp);
1014 }
1015 else
1016 {
1017 destptr = gfc_evaluate_now (destptr, &cond_block);
1018 gfc_add_expr_to_block (&cond_block, gfc_call_free (destptr));
1019 gfc_add_modify (&cond_block, unshare_expr (dest),
1020 build_zero_cst (TREE_TYPE (dest)((contains_struct_check ((dest), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1020, __FUNCTION__))->typed.type)
));
1021 }
1022 else_b = gfc_finish_block (&cond_block);
1023
1024 cond = fold_build2_loc (input_location, NE_EXPR, logical_type_node,
1025 unshare_expr (srcptr), null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
1026 gfc_add_expr_to_block (&block,
1027 build3_loc (input_location, COND_EXPR,
1028 void_type_nodeglobal_trees[TI_VOID_TYPE], cond,
1029 then_b, else_b));
1030 }
1031 else
1032 gfc_add_expr_to_block (&block, then_b);
1033
1034 return gfc_finish_block (&block);
1035}
1036
1037static void
1038gfc_omp_linear_clause_add_loop (stmtblock_t *block, tree dest, tree src,
1039 tree add, tree nelems)
1040{
1041 stmtblock_t tmpblock;
1042 tree desta, srca, index = gfc_create_var (gfc_array_index_type, "S");
1043 nelems = gfc_evaluate_now (nelems, block);
1044
1045 gfc_init_block (&tmpblock);
1046 if (TREE_CODE (TREE_TYPE (dest))((enum tree_code) (((contains_struct_check ((dest), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1046, __FUNCTION__))->typed.type))->base.code)
== ARRAY_TYPE)
1047 {
1048 desta = gfc_build_array_ref (dest, index, NULL__null);
1049 srca = gfc_build_array_ref (src, index, NULL__null);
1050 }
1051 else
1052 {
1053 gcc_assert (POINTER_TYPE_P (TREE_TYPE (dest)))((void)(!((((enum tree_code) (((contains_struct_check ((dest)
, (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1053, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((dest), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1053, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1053, __FUNCTION__), 0 : 0))
;
1054 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1056, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1056, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1056, __FUNCTION__))->type_common.size_unit) )
1055 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1056, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1056, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1056, __FUNCTION__))->type_common.size_unit) )
1056 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1056, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1056, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1056, __FUNCTION__))->type_common.size_unit) )
;
1057 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1058, __FUNCTION__))->typed.type), dest, idx ))
1058 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1058, __FUNCTION__))->typed.type), dest, idx ))
1059 idx))build_fold_indirect_ref_loc (((location_t) 0), fold_build2_loc
(((location_t) 0), POINTER_PLUS_EXPR, ((contains_struct_check
((dest), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1058, __FUNCTION__))->typed.type), dest, idx ))
;
1060 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1061, __FUNCTION__))->typed.type), src, idx ))
1061 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1061, __FUNCTION__))->typed.type), src, idx ))
1062 idx))build_fold_indirect_ref_loc (((location_t) 0), fold_build2_loc
(((location_t) 0), POINTER_PLUS_EXPR, ((contains_struct_check
((src), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1061, __FUNCTION__))->typed.type), src, idx ))
;
1063 }
1064 gfc_add_modify (&tmpblock, desta,
1065 fold_build2 (PLUS_EXPR, TREE_TYPE (desta),fold_build2_loc (((location_t) 0), PLUS_EXPR, ((contains_struct_check
((desta), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1065, __FUNCTION__))->typed.type), srca, add )
1066 srca, add)fold_build2_loc (((location_t) 0), PLUS_EXPR, ((contains_struct_check
((desta), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1065, __FUNCTION__))->typed.type), srca, add )
);
1067
1068 gfc_loopinfo loop;
1069 gfc_init_loopinfo (&loop);
1070 loop.dimen = 1;
1071 loop.from[0] = gfc_index_zero_nodegfc_rank_cst[0];
1072 loop.loopvar[0] = index;
1073 loop.to[0] = nelems;
1074 gfc_trans_scalarizing_loops (&loop, &tmpblock);
1075 gfc_add_block_to_block (block, &loop.pre);
1076}
1077
1078/* Build and return code for a constructor of DEST that initializes
1079 it to SRC plus ADD (ADD is scalar integer). */
1080
1081tree
1082gfc_omp_clause_linear_ctor (tree clause, tree dest, tree src, tree add)
1083{
1084 tree type = TREE_TYPE (dest)((contains_struct_check ((dest), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1084, __FUNCTION__))->typed.type)
, ptr, size, nelems = NULL_TREE(tree) __null;
1085 stmtblock_t block;
1086
1087 gcc_assert (OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_LINEAR)((void)(!(((tree_check ((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1087, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code == OMP_CLAUSE_LINEAR
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1087, __FUNCTION__), 0 : 0))
;
1088
1089 gfc_start_block (&block);
1090 add = gfc_evaluate_now (add, &block);
1091
1092 if ((! GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1092, __FUNCTION__))->type_common.lang_flag_1)
1093 || GFC_TYPE_ARRAY_AKIND (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1093, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
!= GFC_ARRAY_ALLOCATABLE)
1094 && (!GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause))(((contains_struct_check (((*(omp_clause_elt_check (((omp_clause_range_check
(((tree_check ((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1094, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1094, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1094, __FUNCTION__)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1094, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
(((*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1094, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1094, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1094, __FUNCTION__)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1094, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
1095 || !POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || (
(enum tree_code) (type)->base.code) == REFERENCE_TYPE)
))
1096 {
1097 bool compute_nelts = false;
1098 gcc_assert (TREE_CODE (type) == ARRAY_TYPE)((void)(!(((enum tree_code) (type)->base.code) == ARRAY_TYPE
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1098, __FUNCTION__), 0 : 0))
;
1099 if (!TYPE_DOMAIN (type)((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1099, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
1100 || TYPE_MAX_VALUE (TYPE_DOMAIN (type))((tree_check5 ((((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1100, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1100, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)
== NULL_TREE(tree) __null
1101 || TYPE_MIN_VALUE (TYPE_DOMAIN (type))((tree_check5 ((((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1101, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1101, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.minval
)
== error_mark_nodeglobal_trees[TI_ERROR_MARK]
1102 || TYPE_MAX_VALUE (TYPE_DOMAIN (type))((tree_check5 ((((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1102, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1102, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)
== error_mark_nodeglobal_trees[TI_ERROR_MARK])
1103 compute_nelts = true;
1104 else if (VAR_P (TYPE_MAX_VALUE (TYPE_DOMAIN (type)))(((enum tree_code) (((tree_check5 ((((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1104, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1104, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
))->base.code) == VAR_DECL)
)
1105 {
1106 tree a = DECL_ATTRIBUTES (TYPE_MAX_VALUE (TYPE_DOMAIN (type)))((contains_struct_check ((((tree_check5 ((((tree_check ((type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1106, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1106, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1106, __FUNCTION__))->decl_common.attributes)
;
1107 if (lookup_attribute ("omp dummy var", a))
1108 compute_nelts = true;
1109 }
1110 if (compute_nelts)
1111 {
1112 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),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1113, __FUNCTION__))->type_common.size_unit), ((tree_class_check
((((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1114, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1114, __FUNCTION__))->type_common.size_unit) )
1113 TYPE_SIZE_UNIT (type),fold_build2_loc (((location_t) 0), EXACT_DIV_EXPR, sizetype_tab
[(int) stk_sizetype], ((tree_class_check ((type), (tcc_type),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1113, __FUNCTION__))->type_common.size_unit), ((tree_class_check
((((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1114, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1114, __FUNCTION__))->type_common.size_unit) )
1114 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),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1113, __FUNCTION__))->type_common.size_unit), ((tree_class_check
((((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1114, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1114, __FUNCTION__))->type_common.size_unit) )
;
1115 nelems = size_binop (MINUS_EXPR, nelems, size_one_node)size_binop_loc (((location_t) 0), MINUS_EXPR, nelems, global_trees
[TI_SIZE_ONE])
;
1116 }
1117 else
1118 nelems = array_type_nelts (type);
1119 nelems = fold_convert (gfc_array_index_type, nelems)fold_convert_loc (((location_t) 0), gfc_array_index_type, nelems
)
;
1120
1121 gfc_omp_linear_clause_add_loop (&block, dest, src, add, nelems);
1122 return gfc_finish_block (&block);
1123 }
1124
1125 /* Allocatable arrays in LINEAR clauses need to be allocated
1126 and copied from SRC. */
1127 gfc_add_modify (&block, dest, src);
1128 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1128, __FUNCTION__))->type_common.lang_flag_1)
)
1129 {
1130 tree rank = gfc_rank_cst[GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1130, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
- 1];
1131 size = gfc_conv_descriptor_ubound_get (dest, rank);
1132 size = fold_build2_loc (input_location, MINUS_EXPR, gfc_array_index_type,
1133 size,
1134 gfc_conv_descriptor_lbound_get (dest, rank));
1135 size = fold_build2_loc (input_location, PLUS_EXPR, gfc_array_index_type,
1136 size, gfc_index_one_nodegfc_rank_cst[1]);
1137 if (GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1137, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
> 1)
1138 size = fold_build2_loc (input_location, MULT_EXPR,
1139 gfc_array_index_type, size,
1140 gfc_conv_descriptor_stride_get (dest, rank));
1141 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1142, __FUNCTION__))->type_common.size_unit))
1142 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1142, __FUNCTION__))->type_common.size_unit))
;
1143 nelems = gfc_evaluate_now (unshare_expr (size), &block);
1144 size = fold_build2_loc (input_location, MULT_EXPR, gfc_array_index_type,
1145 nelems, unshare_expr (esize));
1146 size = gfc_evaluate_now (fold_convert (size_type_node, size)fold_convert_loc (((location_t) 0), global_trees[TI_SIZE_TYPE
], size)
,
1147 &block);
1148 nelems = fold_build2_loc (input_location, MINUS_EXPR,
1149 gfc_array_index_type, nelems,
1150 gfc_index_one_nodegfc_rank_cst[1]);
1151 }
1152 else
1153 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
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1153, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1153, __FUNCTION__))->type_common.size_unit))
;
1154 ptr = gfc_create_var (pvoid_type_node, NULL__null);
1155 gfc_allocate_using_malloc (&block, ptr, size, NULL_TREE(tree) __null);
1156 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1156, __FUNCTION__))->type_common.lang_flag_1)
)
1157 {
1158 gfc_conv_descriptor_data_set (&block, unshare_expr (dest), ptr);
1159 tree etype = gfc_get_element_type (type);
1160 ptr = fold_convert (build_pointer_type (etype), ptr)fold_convert_loc (((location_t) 0), build_pointer_type (etype
), ptr)
;
1161 tree srcptr = gfc_conv_descriptor_data_get (unshare_expr (src));
1162 srcptr = fold_convert (build_pointer_type (etype), srcptr)fold_convert_loc (((location_t) 0), build_pointer_type (etype
), srcptr)
;
1163 gfc_omp_linear_clause_add_loop (&block, ptr, srcptr, add, nelems);
1164 }
1165 else
1166 {
1167 gfc_add_modify (&block, unshare_expr (dest),
1168 fold_convert (TREE_TYPE (dest), ptr)fold_convert_loc (((location_t) 0), ((contains_struct_check (
(dest), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1168, __FUNCTION__))->typed.type), ptr)
);
1169 ptr = fold_convert (TREE_TYPE (dest), ptr)fold_convert_loc (((location_t) 0), ((contains_struct_check (
(dest), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1169, __FUNCTION__))->typed.type), ptr)
;
1170 tree dstm = build_fold_indirect_ref (ptr)build_fold_indirect_ref_loc (((location_t) 0), ptr);
1171 tree srcm = build_fold_indirect_ref (unshare_expr (src))build_fold_indirect_ref_loc (((location_t) 0), unshare_expr (
src))
;
1172 gfc_add_modify (&block, dstm,
1173 fold_build2 (PLUS_EXPR, TREE_TYPE (add), srcm, add)fold_build2_loc (((location_t) 0), PLUS_EXPR, ((contains_struct_check
((add), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1173, __FUNCTION__))->typed.type), srcm, add )
);
1174 }
1175 return gfc_finish_block (&block);
1176}
1177
1178/* Build and return code destructing DECL. Return NULL if nothing
1179 to be done. */
1180
1181tree
1182gfc_omp_clause_dtor (tree clause, tree decl)
1183{
1184 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1184, __FUNCTION__))->typed.type)
, tem;
1185
1186 if ((! GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1186, __FUNCTION__))->type_common.lang_flag_1)
1187 || GFC_TYPE_ARRAY_AKIND (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1187, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
!= GFC_ARRAY_ALLOCATABLE)
1188 && (!GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause))(((contains_struct_check (((*(omp_clause_elt_check (((omp_clause_range_check
(((tree_check ((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1188, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1188, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1188, __FUNCTION__)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1188, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
(((*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1188, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1188, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1188, __FUNCTION__)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1188, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
1189 || !POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || (
(enum tree_code) (type)->base.code) == REFERENCE_TYPE)
))
1190 {
1191 if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1191, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1191, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1191, __FUNCTION__)))
))
1192 return gfc_walk_alloc_comps (decl, NULL_TREE(tree) __null,
1193 OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1193, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1193, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1193, __FUNCTION__)))
,
1194 WALK_ALLOC_COMPS_DTOR);
1195 return NULL_TREE(tree) __null;
1196 }
1197
1198 if (GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1198, __FUNCTION__))->type_common.lang_flag_1)
)
1199 {
1200 /* Allocatable arrays in FIRSTPRIVATE/LASTPRIVATE etc. clauses need
1201 to be deallocated if they were allocated. */
1202 tem = gfc_conv_descriptor_data_get (decl);
1203 tem = gfc_deallocate_with_status (tem, NULL_TREE(tree) __null, NULL_TREE(tree) __null, NULL_TREE(tree) __null,
1204 NULL_TREE(tree) __null, true, NULL__null,
1205 GFC_CAF_COARRAY_NOCOARRAY);
1206 }
1207 else
1208 tem = gfc_call_free (decl);
1209 tem = gfc_omp_unshare_expr (tem);
1210
1211 if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1211, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1211, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1211, __FUNCTION__)))
))
1212 {
1213 stmtblock_t block;
1214 tree then_b;
1215
1216 gfc_init_block (&block);
1217 gfc_add_expr_to_block (&block,
1218 gfc_walk_alloc_comps (decl, NULL_TREE(tree) __null,
1219 OMP_CLAUSE_DECL (clause)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((clause), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1219, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1219, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1219, __FUNCTION__)))
,
1220 WALK_ALLOC_COMPS_DTOR));
1221 gfc_add_expr_to_block (&block, tem);
1222 then_b = gfc_finish_block (&block);
1223
1224 tem = fold_convert (pvoid_type_node,fold_convert_loc (((location_t) 0), pvoid_type_node, ((tree_class_check
((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1225, __FUNCTION__))->type_common.lang_flag_1) ? gfc_conv_descriptor_data_get
(decl) : decl)
1225 GFC_DESCRIPTOR_TYPE_P (type)fold_convert_loc (((location_t) 0), pvoid_type_node, ((tree_class_check
((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1225, __FUNCTION__))->type_common.lang_flag_1) ? gfc_conv_descriptor_data_get
(decl) : decl)
1226 ? gfc_conv_descriptor_data_get (decl) : decl)fold_convert_loc (((location_t) 0), pvoid_type_node, ((tree_class_check
((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1225, __FUNCTION__))->type_common.lang_flag_1) ? gfc_conv_descriptor_data_get
(decl) : decl)
;
1227 tem = unshare_expr (tem);
1228 tree cond = fold_build2_loc (input_location, NE_EXPR, logical_type_node,
1229 tem, null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
1230 tem = build3_loc (input_location, COND_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE], cond,
1231 then_b, build_empty_stmt (input_location));
1232 }
1233 return tem;
1234}
1235
1236/* Build a conditional expression in BLOCK. If COND_VAL is not
1237 null, then the block THEN_B is executed, otherwise ELSE_VAL
1238 is assigned to VAL. */
1239
1240static void
1241gfc_build_cond_assign (stmtblock_t *block, tree val, tree cond_val,
1242 tree then_b, tree else_val)
1243{
1244 stmtblock_t cond_block;
1245 tree else_b = NULL_TREE(tree) __null;
1246 tree val_ty = TREE_TYPE (val)((contains_struct_check ((val), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1246, __FUNCTION__))->typed.type)
;
1247
1248 if (else_val)
1249 {
1250 gfc_init_block (&cond_block);
1251 gfc_add_modify (&cond_block, val, fold_convert (val_ty, else_val)fold_convert_loc (((location_t) 0), val_ty, else_val));
1252 else_b = gfc_finish_block (&cond_block);
1253 }
1254 gfc_add_expr_to_block (block,
1255 build3_loc (input_location, COND_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE],
1256 cond_val, then_b, else_b));
1257}
1258
1259/* Build a conditional expression in BLOCK, returning a temporary
1260 variable containing the result. If COND_VAL is not null, then
1261 THEN_VAL will be assigned to the variable, otherwise ELSE_VAL
1262 is assigned.
1263 */
1264
1265static tree
1266gfc_build_cond_assign_expr (stmtblock_t *block, tree cond_val,
1267 tree then_val, tree else_val)
1268{
1269 tree val;
1270 tree val_ty = TREE_TYPE (then_val)((contains_struct_check ((then_val), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1270, __FUNCTION__))->typed.type)
;
1271 stmtblock_t cond_block;
1272
1273 val = create_tmp_var (val_ty);
1274
1275 gfc_init_block (&cond_block);
1276 gfc_add_modify (&cond_block, val, then_val);
1277 tree then_b = gfc_finish_block (&cond_block);
1278
1279 gfc_build_cond_assign (block, val, cond_val, then_b, else_val);
1280
1281 return val;
1282}
1283
1284void
1285gfc_omp_finish_clause (tree c, gimple_seq *pre_p, bool openacc)
1286{
1287 if (OMP_CLAUSE_CODE (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1287, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.code
!= OMP_CLAUSE_MAP)
1288 return;
1289
1290 tree decl = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1290, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1290, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1290, __FUNCTION__)))
;
1291
1292 /* Assumed-size arrays can't be mapped implicitly, they have to be
1293 mapped explicitly using array sections. */
1294 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == PARM_DECL
1295 && GFC_ARRAY_TYPE_P (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1295, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1295, __FUNCTION__))->type_common.lang_flag_2)
1296 && GFC_TYPE_ARRAY_AKIND (TREE_TYPE (decl))(((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1296, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1296, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_UNKNOWN
1297 && GFC_TYPE_ARRAY_UBOUND (TREE_TYPE (decl),(((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1297, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1298, __FUNCTION__))->type_with_lang_specific.lang_specific
)->ubound[(((tree_class_check ((((contains_struct_check ((
decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1298, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1298, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank) - 1])
1298 GFC_TYPE_ARRAY_RANK (TREE_TYPE (decl)) - 1)(((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1297, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1298, __FUNCTION__))->type_with_lang_specific.lang_specific
)->ubound[(((tree_class_check ((((contains_struct_check ((
decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1298, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1298, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank) - 1])
1299 == NULL__null)
1300 {
1301 error_at (OMP_CLAUSE_LOCATION (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1301, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.locus
,
1302 "implicit mapping of assumed size array %qD", decl);
1303 return;
1304 }
1305
1306 tree c2 = NULL_TREE(tree) __null, c3 = NULL_TREE(tree) __null, c4 = NULL_TREE(tree) __null;
1307 tree present = gfc_omp_check_optional_argument (decl, true);
1308 if (POINTER_TYPE_P (TREE_TYPE (decl))(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1308, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1308, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)
)
1309 {
1310 if (!gfc_omp_privatize_by_reference (decl)
1311 && !GFC_DECL_GET_SCALAR_POINTER (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1311, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1311, __FUNCTION__))->decl_common.lang_specific)->scalar_pointer
) : 0)
1312 && !GFC_DECL_GET_SCALAR_ALLOCATABLE (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1312, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1312, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
1313 && !GFC_DECL_CRAY_POINTEE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1313, __FUNCTION__))->decl_common.lang_flag_4)
1314 && !GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (TREE_TYPE (decl)))((tree_class_check ((((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1314, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1314, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1314, __FUNCTION__))->type_common.lang_flag_1)
)
1315 return;
1316 tree orig_decl = decl;
1317
1318 c4 = build_omp_clause (OMP_CLAUSE_LOCATION (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1318, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.locus
, OMP_CLAUSE_MAP);
1319 OMP_CLAUSE_SET_MAP_KIND (c4, GOMP_MAP_POINTER)((omp_clause_subcode_check ((c4), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1319, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_POINTER))
;
1320 OMP_CLAUSE_DECL (c4)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c4), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1320, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1320, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1320, __FUNCTION__)))
= decl;
1321 OMP_CLAUSE_SIZE (c4)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c4), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1321, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1321, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1321, __FUNCTION__)))
= size_int (0)size_int_kind (0, stk_sizetype);
1322 decl = build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
1323 if (present
1324 && (GFC_DECL_GET_SCALAR_POINTER (orig_decl)(((contains_struct_check ((orig_decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1324, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((orig_decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1324, __FUNCTION__))->decl_common.lang_specific)->scalar_pointer
) : 0)
1325 || GFC_DECL_GET_SCALAR_ALLOCATABLE (orig_decl)(((contains_struct_check ((orig_decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1325, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((orig_decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1325, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
))
1326 {
1327 c2 = build_omp_clause (input_location, OMP_CLAUSE_MAP);
1328 OMP_CLAUSE_SET_MAP_KIND (c2, GOMP_MAP_POINTER)((omp_clause_subcode_check ((c2), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1328, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_POINTER))
;
1329 OMP_CLAUSE_DECL (c2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1329, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1329, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1329, __FUNCTION__)))
= decl;
1330 OMP_CLAUSE_SIZE (c2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1330, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1330, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1330, __FUNCTION__)))
= size_int (0)size_int_kind (0, stk_sizetype);
1331
1332 stmtblock_t block;
1333 gfc_start_block (&block);
1334 tree ptr = decl;
Value stored to 'ptr' during its initialization is never read
1335 ptr = gfc_build_cond_assign_expr (&block, present, decl,
1336 null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
1337 gimplify_and_add (gfc_finish_block (&block), pre_p);
1338 ptr = build_fold_indirect_ref (ptr)build_fold_indirect_ref_loc (((location_t) 0), ptr);
1339 OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1339, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1339, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1339, __FUNCTION__)))
= ptr;
1340 OMP_CLAUSE_SIZE (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1340, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1340, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1340, __FUNCTION__)))
= TYPE_SIZE_UNIT (TREE_TYPE (ptr))((tree_class_check ((((contains_struct_check ((ptr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1340, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1340, __FUNCTION__))->type_common.size_unit)
;
1341 }
1342 else
1343 {
1344 OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1344, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1344, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1344, __FUNCTION__)))
= decl;
1345 OMP_CLAUSE_SIZE (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1345, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1345, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1345, __FUNCTION__)))
= NULL_TREE(tree) __null;
1346 }
1347 if (TREE_CODE (TREE_TYPE (orig_decl))((enum tree_code) (((contains_struct_check ((orig_decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1347, __FUNCTION__))->typed.type))->base.code)
== REFERENCE_TYPE
1348 && (GFC_DECL_GET_SCALAR_POINTER (orig_decl)(((contains_struct_check ((orig_decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1348, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((orig_decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1348, __FUNCTION__))->decl_common.lang_specific)->scalar_pointer
) : 0)
1349 || GFC_DECL_GET_SCALAR_ALLOCATABLE (orig_decl)(((contains_struct_check ((orig_decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1349, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((orig_decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1349, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
))
1350 {
1351 c3 = build_omp_clause (OMP_CLAUSE_LOCATION (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1351, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.locus
, OMP_CLAUSE_MAP);
1352 OMP_CLAUSE_SET_MAP_KIND (c3, GOMP_MAP_POINTER)((omp_clause_subcode_check ((c3), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1352, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_POINTER))
;
1353 OMP_CLAUSE_DECL (c3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1353, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1353, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1353, __FUNCTION__)))
= unshare_expr (decl);
1354 OMP_CLAUSE_SIZE (c3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1354, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1354, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1354, __FUNCTION__)))
= size_int (0)size_int_kind (0, stk_sizetype);
1355 decl = build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
1356 OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1356, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1356, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1356, __FUNCTION__)))
= decl;
1357 }
1358 }
1359 if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1359, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1359, __FUNCTION__))->type_common.lang_flag_1)
)
1360 {
1361 stmtblock_t block;
1362 gfc_start_block (&block);
1363 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1363, __FUNCTION__))->typed.type)
;
1364 tree ptr = gfc_conv_descriptor_data_get (decl);
1365
1366 /* OpenMP: automatically map pointer targets with the pointer;
1367 hence, always update the descriptor/pointer itself.
1368 NOTE: This also remaps the pointer for allocatable arrays with
1369 'target' attribute which also don't have the 'restrict' qualifier. */
1370 bool always_modifier = false;
1371
1372 if (!openacc
1373 && !(TYPE_QUALS (TREE_TYPE (ptr))((int) ((((tree_class_check ((((contains_struct_check ((ptr),
(TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1373, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1373, __FUNCTION__))->base.readonly_flag) * TYPE_QUAL_CONST
) | (((tree_class_check ((((contains_struct_check ((ptr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1373, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1373, __FUNCTION__))->base.volatile_flag) * TYPE_QUAL_VOLATILE
) | (((tree_class_check ((((contains_struct_check ((ptr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1373, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1373, __FUNCTION__))->base.u.bits.atomic_flag) * TYPE_QUAL_ATOMIC
) | (((tree_class_check ((((contains_struct_check ((ptr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1373, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1373, __FUNCTION__))->type_common.restrict_flag) * TYPE_QUAL_RESTRICT
) | (((((tree_class_check ((((contains_struct_check ((ptr), (
TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1373, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1373, __FUNCTION__))->base.u.bits.address_space) & 0xFF
) << 8))))
& TYPE_QUAL_RESTRICT))
1374 always_modifier = true;
1375
1376 if (present)
1377 ptr = gfc_build_cond_assign_expr (&block, present, ptr,
1378 null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
1379 ptr = fold_convert (build_pointer_type (char_type_node), ptr)fold_convert_loc (((location_t) 0), build_pointer_type (integer_types
[itk_char]), ptr)
;
1380 ptr = build_fold_indirect_ref (ptr)build_fold_indirect_ref_loc (((location_t) 0), ptr);
1381 OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1381, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1381, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1381, __FUNCTION__)))
= ptr;
1382 c2 = build_omp_clause (input_location, OMP_CLAUSE_MAP);
1383 OMP_CLAUSE_SET_MAP_KIND (c2, GOMP_MAP_TO_PSET)((omp_clause_subcode_check ((c2), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1383, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_TO_PSET))
;
1384 if (present)
1385 {
1386 ptr = create_tmp_var (TREE_TYPE (TREE_OPERAND (decl, 0))((contains_struct_check (((*((const_cast<tree*> (tree_operand_check
((decl), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1386, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1386, __FUNCTION__))->typed.type)
);
1387 gfc_add_modify (&block, ptr, TREE_OPERAND (decl, 0)(*((const_cast<tree*> (tree_operand_check ((decl), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1387, __FUNCTION__)))))
);
1388
1389 OMP_CLAUSE_DECL (c2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1389, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1389, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1389, __FUNCTION__)))
= build_fold_indirect_ref (ptr)build_fold_indirect_ref_loc (((location_t) 0), ptr);
1390 }
1391 else
1392 OMP_CLAUSE_DECL (c2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1392, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1392, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1392, __FUNCTION__)))
= decl;
1393 OMP_CLAUSE_SIZE (c2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1393, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1393, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1393, __FUNCTION__)))
= TYPE_SIZE_UNIT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1393, __FUNCTION__))->type_common.size_unit)
;
1394 c3 = build_omp_clause (OMP_CLAUSE_LOCATION (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1394, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.locus
, OMP_CLAUSE_MAP);
1395 OMP_CLAUSE_SET_MAP_KIND (c3, always_modifier ? GOMP_MAP_ALWAYS_POINTER((omp_clause_subcode_check ((c3), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1396, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (always_modifier ? GOMP_MAP_ALWAYS_POINTER : GOMP_MAP_POINTER
))
1396 : GOMP_MAP_POINTER)((omp_clause_subcode_check ((c3), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1396, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (always_modifier ? GOMP_MAP_ALWAYS_POINTER : GOMP_MAP_POINTER
))
;
1397 if (present)
1398 {
1399 ptr = gfc_conv_descriptor_data_get (decl);
1400 ptr = gfc_build_addr_expr (NULL__null, ptr);
1401 ptr = gfc_build_cond_assign_expr (&block, present,
1402 ptr, null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
1403 ptr = build_fold_indirect_ref (ptr)build_fold_indirect_ref_loc (((location_t) 0), ptr);
1404 OMP_CLAUSE_DECL (c3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1404, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1404, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1404, __FUNCTION__)))
= ptr;
1405 }
1406 else
1407 OMP_CLAUSE_DECL (c3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1407, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1407, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1407, __FUNCTION__)))
= gfc_conv_descriptor_data_get (decl);
1408 OMP_CLAUSE_SIZE (c3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1408, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1408, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1408, __FUNCTION__)))
= size_int (0)size_int_kind (0, stk_sizetype);
1409 tree size = create_tmp_var (gfc_array_index_type);
1410 tree elemsz = TYPE_SIZE_UNIT (gfc_get_element_type (type))((tree_class_check ((gfc_get_element_type (type)), (tcc_type)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1410, __FUNCTION__))->type_common.size_unit)
;
1411 elemsz = fold_convert (gfc_array_index_type, elemsz)fold_convert_loc (((location_t) 0), gfc_array_index_type, elemsz
)
;
1412 if (GFC_TYPE_ARRAY_AKIND (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1412, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_POINTER
1413 || GFC_TYPE_ARRAY_AKIND (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1413, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_POINTER_CONT)
1414 {
1415 stmtblock_t cond_block;
1416 tree tem, then_b, else_b, zero, cond;
1417
1418 gfc_init_block (&cond_block);
1419 tem = gfc_full_array_size (&cond_block, decl,
1420 GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1420, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
);
1421 gfc_add_modify (&cond_block, size, tem);
1422 gfc_add_modify (&cond_block, size,
1423 fold_build2 (MULT_EXPR, gfc_array_index_type,fold_build2_loc (((location_t) 0), MULT_EXPR, gfc_array_index_type
, size, elemsz )
1424 size, elemsz)fold_build2_loc (((location_t) 0), MULT_EXPR, gfc_array_index_type
, size, elemsz )
);
1425 then_b = gfc_finish_block (&cond_block);
1426 gfc_init_block (&cond_block);
1427 zero = build_int_cst (gfc_array_index_type, 0);
1428 gfc_add_modify (&cond_block, size, zero);
1429 else_b = gfc_finish_block (&cond_block);
1430 tem = gfc_conv_descriptor_data_get (decl);
1431 tem = fold_convert (pvoid_type_node, tem)fold_convert_loc (((location_t) 0), pvoid_type_node, tem);
1432 cond = fold_build2_loc (input_location, NE_EXPR,
1433 boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE], tem, null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
1434 if (present)
1435 {
1436 cond = fold_build2_loc (input_location, TRUTH_ANDIF_EXPR,
1437 boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE], present, cond);
1438 }
1439 gfc_add_expr_to_block (&block, build3_loc (input_location, COND_EXPR,
1440 void_type_nodeglobal_trees[TI_VOID_TYPE], cond,
1441 then_b, else_b));
1442 }
1443 else if (present)
1444 {
1445 stmtblock_t cond_block;
1446 tree then_b;
1447
1448 gfc_init_block (&cond_block);
1449 gfc_add_modify (&cond_block, size,
1450 gfc_full_array_size (&cond_block, decl,
1451 GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1451, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
));
1452 gfc_add_modify (&cond_block, size,
1453 fold_build2 (MULT_EXPR, gfc_array_index_type,fold_build2_loc (((location_t) 0), MULT_EXPR, gfc_array_index_type
, size, elemsz )
1454 size, elemsz)fold_build2_loc (((location_t) 0), MULT_EXPR, gfc_array_index_type
, size, elemsz )
);
1455 then_b = gfc_finish_block (&cond_block);
1456
1457 gfc_build_cond_assign (&block, size, present, then_b,
1458 build_int_cst (gfc_array_index_type, 0));
1459 }
1460 else
1461 {
1462 gfc_add_modify (&block, size,
1463 gfc_full_array_size (&block, decl,
1464 GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1464, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
));
1465 gfc_add_modify (&block, size,
1466 fold_build2 (MULT_EXPR, gfc_array_index_type,fold_build2_loc (((location_t) 0), MULT_EXPR, gfc_array_index_type
, size, elemsz )
1467 size, elemsz)fold_build2_loc (((location_t) 0), MULT_EXPR, gfc_array_index_type
, size, elemsz )
);
1468 }
1469 OMP_CLAUSE_SIZE (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1469, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1469, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1469, __FUNCTION__)))
= size;
1470 tree stmt = gfc_finish_block (&block);
1471 gimplify_and_add (stmt, pre_p);
1472 }
1473 tree last = c;
1474 if (OMP_CLAUSE_SIZE (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1474, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1474, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1474, __FUNCTION__)))
== NULL_TREE(tree) __null)
1475 OMP_CLAUSE_SIZE (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1475, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1475, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1475, __FUNCTION__)))
1476 = DECL_P (decl)(tree_code_type[(int) (((enum tree_code) (decl)->base.code
))] == tcc_declaration)
? DECL_SIZE_UNIT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1476, __FUNCTION__))->decl_common.size_unit)
1477 : TYPE_SIZE_UNIT (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1477, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1477, __FUNCTION__))->type_common.size_unit)
;
1478 if (c2)
1479 {
1480 OMP_CLAUSE_CHAIN (c2)((contains_struct_check (((tree_check ((c2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1480, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1480, __FUNCTION__))->common.chain)
= OMP_CLAUSE_CHAIN (last)((contains_struct_check (((tree_check ((last), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1480, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1480, __FUNCTION__))->common.chain)
;
1481 OMP_CLAUSE_CHAIN (last)((contains_struct_check (((tree_check ((last), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1481, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1481, __FUNCTION__))->common.chain)
= c2;
1482 last = c2;
1483 }
1484 if (c3)
1485 {
1486 OMP_CLAUSE_CHAIN (c3)((contains_struct_check (((tree_check ((c3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1486, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1486, __FUNCTION__))->common.chain)
= OMP_CLAUSE_CHAIN (last)((contains_struct_check (((tree_check ((last), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1486, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1486, __FUNCTION__))->common.chain)
;
1487 OMP_CLAUSE_CHAIN (last)((contains_struct_check (((tree_check ((last), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1487, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1487, __FUNCTION__))->common.chain)
= c3;
1488 last = c3;
1489 }
1490 if (c4)
1491 {
1492 OMP_CLAUSE_CHAIN (c4)((contains_struct_check (((tree_check ((c4), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1492, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1492, __FUNCTION__))->common.chain)
= OMP_CLAUSE_CHAIN (last)((contains_struct_check (((tree_check ((last), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1492, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1492, __FUNCTION__))->common.chain)
;
1493 OMP_CLAUSE_CHAIN (last)((contains_struct_check (((tree_check ((last), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1493, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1493, __FUNCTION__))->common.chain)
= c4;
1494 }
1495}
1496
1497
1498/* Return true if DECL is a scalar variable (for the purpose of
1499 implicit firstprivatization). */
1500
1501bool
1502gfc_omp_scalar_p (tree decl)
1503{
1504 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1504, __FUNCTION__))->typed.type)
;
1505 if (TREE_CODE (type)((enum tree_code) (type)->base.code) == REFERENCE_TYPE)
1506 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1506, __FUNCTION__))->typed.type)
;
1507 if (TREE_CODE (type)((enum tree_code) (type)->base.code) == POINTER_TYPE)
1508 {
1509 if (GFC_DECL_GET_SCALAR_ALLOCATABLE (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1509, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1509, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
1510 || GFC_DECL_GET_SCALAR_POINTER (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1510, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1510, __FUNCTION__))->decl_common.lang_specific)->scalar_pointer
) : 0)
)
1511 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1511, __FUNCTION__))->typed.type)
;
1512 if (GFC_ARRAY_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1512, __FUNCTION__))->type_common.lang_flag_2)
1513 || GFC_CLASS_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1513, __FUNCTION__))->type_common.lang_flag_4)
)
1514 return false;
1515 }
1516 if ((TREE_CODE (type)((enum tree_code) (type)->base.code) == ARRAY_TYPE || TREE_CODE (type)((enum tree_code) (type)->base.code) == INTEGER_TYPE)
1517 && TYPE_STRING_FLAG (type)((tree_check2 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1517, __FUNCTION__, (ARRAY_TYPE), (INTEGER_TYPE)))->type_common
.string_flag)
)
1518 return false;
1519 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)
1520 || SCALAR_FLOAT_TYPE_P (type)(((enum tree_code) (type)->base.code) == REAL_TYPE)
1521 || COMPLEX_FLOAT_TYPE_P (type)(((enum tree_code) (type)->base.code) == COMPLEX_TYPE &&
((enum tree_code) (((contains_struct_check ((type), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1521, __FUNCTION__))->typed.type))->base.code) == REAL_TYPE
)
)
1522 return true;
1523 return false;
1524}
1525
1526
1527/* Return true if DECL's DECL_VALUE_EXPR (if any) should be
1528 disregarded in OpenMP construct, because it is going to be
1529 remapped during OpenMP lowering. SHARED is true if DECL
1530 is going to be shared, false if it is going to be privatized. */
1531
1532bool
1533gfc_omp_disregard_value_expr (tree decl, bool shared)
1534{
1535 if (GFC_DECL_COMMON_OR_EQUIV (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1535, __FUNCTION__))->decl_common.lang_flag_3)
1536 && DECL_HAS_VALUE_EXPR_P (decl)((tree_check3 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1536, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL))
) ->decl_common.decl_flag_2)
)
1537 {
1538 tree value = DECL_VALUE_EXPR (decl)(decl_value_expr_lookup ((contains_struct_check ((decl), (TS_DECL_WRTL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1538, __FUNCTION__))))
;
1539
1540 if (TREE_CODE (value)((enum tree_code) (value)->base.code) == COMPONENT_REF
1541 && VAR_P (TREE_OPERAND (value, 0))(((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((value), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1541, __FUNCTION__))))))->base.code) == VAR_DECL)
1542 && GFC_DECL_COMMON_OR_EQUIV (TREE_OPERAND (value, 0))((contains_struct_check (((*((const_cast<tree*> (tree_operand_check
((value), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1542, __FUNCTION__)))))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1542, __FUNCTION__))->decl_common.lang_flag_3)
)
1543 {
1544 /* If variable in COMMON or EQUIVALENCE is privatized, return
1545 true, as just that variable is supposed to be privatized,
1546 not the whole COMMON or whole EQUIVALENCE.
1547 For shared variables in COMMON or EQUIVALENCE, let them be
1548 gimplified to DECL_VALUE_EXPR, so that for multiple shared vars
1549 from the same COMMON or EQUIVALENCE just one sharing of the
1550 whole COMMON or EQUIVALENCE is enough. */
1551 return ! shared;
1552 }
1553 }
1554
1555 if (GFC_DECL_RESULT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1555, __FUNCTION__))->decl_common.lang_flag_5)
&& DECL_HAS_VALUE_EXPR_P (decl)((tree_check3 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1555, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL))
) ->decl_common.decl_flag_2)
)
1556 return ! shared;
1557
1558 return false;
1559}
1560
1561/* Return true if DECL that is shared iff SHARED is true should
1562 be put into OMP_CLAUSE_PRIVATE with OMP_CLAUSE_PRIVATE_DEBUG
1563 flag set. */
1564
1565bool
1566gfc_omp_private_debug_clause (tree decl, bool shared)
1567{
1568 if (GFC_DECL_CRAY_POINTEE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1568, __FUNCTION__))->decl_common.lang_flag_4)
)
1569 return true;
1570
1571 if (GFC_DECL_COMMON_OR_EQUIV (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1571, __FUNCTION__))->decl_common.lang_flag_3)
1572 && DECL_HAS_VALUE_EXPR_P (decl)((tree_check3 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1572, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL))
) ->decl_common.decl_flag_2)
)
1573 {
1574 tree value = DECL_VALUE_EXPR (decl)(decl_value_expr_lookup ((contains_struct_check ((decl), (TS_DECL_WRTL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1574, __FUNCTION__))))
;
1575
1576 if (TREE_CODE (value)((enum tree_code) (value)->base.code) == COMPONENT_REF
1577 && VAR_P (TREE_OPERAND (value, 0))(((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((value), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1577, __FUNCTION__))))))->base.code) == VAR_DECL)
1578 && GFC_DECL_COMMON_OR_EQUIV (TREE_OPERAND (value, 0))((contains_struct_check (((*((const_cast<tree*> (tree_operand_check
((value), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1578, __FUNCTION__)))))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1578, __FUNCTION__))->decl_common.lang_flag_3)
)
1579 return shared;
1580 }
1581
1582 return false;
1583}
1584
1585/* Register language specific type size variables as potentially OpenMP
1586 firstprivate variables. */
1587
1588void
1589gfc_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *ctx, tree type)
1590{
1591 if (GFC_ARRAY_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1591, __FUNCTION__))->type_common.lang_flag_2)
|| GFC_DESCRIPTOR_TYPE_P (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1591, __FUNCTION__))->type_common.lang_flag_1)
)
1592 {
1593 int r;
1594
1595 gcc_assert (TYPE_LANG_SPECIFIC (type) != NULL)((void)(!(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1595, __FUNCTION__))->type_with_lang_specific.lang_specific
) != __null) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1595, __FUNCTION__), 0 : 0))
;
1596 for (r = 0; r < GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1596, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
; r++)
1597 {
1598 omp_firstprivatize_variable (ctx, GFC_TYPE_ARRAY_LBOUND (type, r)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1598, __FUNCTION__))->type_with_lang_specific.lang_specific
)->lbound[r])
);
1599 omp_firstprivatize_variable (ctx, GFC_TYPE_ARRAY_UBOUND (type, r)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1599, __FUNCTION__))->type_with_lang_specific.lang_specific
)->ubound[r])
);
1600 omp_firstprivatize_variable (ctx, GFC_TYPE_ARRAY_STRIDE (type, r)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1600, __FUNCTION__))->type_with_lang_specific.lang_specific
)->stride[r])
);
1601 }
1602 omp_firstprivatize_variable (ctx, GFC_TYPE_ARRAY_SIZE (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1602, __FUNCTION__))->type_with_lang_specific.lang_specific
)->size)
);
1603 omp_firstprivatize_variable (ctx, GFC_TYPE_ARRAY_OFFSET (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1603, __FUNCTION__))->type_with_lang_specific.lang_specific
)->offset)
);
1604 }
1605}
1606
1607
1608static inline tree
1609gfc_trans_add_clause (tree node, tree tail)
1610{
1611 OMP_CLAUSE_CHAIN (node)((contains_struct_check (((tree_check ((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1611, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1611, __FUNCTION__))->common.chain)
= tail;
1612 return node;
1613}
1614
1615static tree
1616gfc_trans_omp_variable (gfc_symbol *sym, bool declare_simd)
1617{
1618 if (declare_simd)
1619 {
1620 int cnt = 0;
1621 gfc_symbol *proc_sym;
1622 gfc_formal_arglist *f;
1623
1624 gcc_assert (sym->attr.dummy)((void)(!(sym->attr.dummy) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1624, __FUNCTION__), 0 : 0))
;
1625 proc_sym = sym->ns->proc_name;
1626 if (proc_sym->attr.entry_master)
1627 ++cnt;
1628 if (gfc_return_by_reference (proc_sym))
1629 {
1630 ++cnt;
1631 if (proc_sym->ts.type == BT_CHARACTER)
1632 ++cnt;
1633 }
1634 for (f = gfc_sym_get_dummy_args (proc_sym); f; f = f->next)
1635 if (f->sym == sym)
1636 break;
1637 else if (f->sym)
1638 ++cnt;
1639 gcc_assert (f)((void)(!(f) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1639, __FUNCTION__), 0 : 0))
;
1640 return build_int_cst (integer_type_nodeinteger_types[itk_int], cnt);
1641 }
1642
1643 tree t = gfc_get_symbol_decl (sym);
1644 tree parent_decl;
1645 int parent_flag;
1646 bool return_value;
1647 bool alternate_entry;
1648 bool entry_master;
1649
1650 return_value = sym->attr.function && sym->result == sym;
1651 alternate_entry = sym->attr.function && sym->attr.entry
1652 && sym->result == sym;
1653 entry_master = sym->attr.result
1654 && sym->ns->proc_name->attr.entry_master
1655 && !gfc_return_by_reference (sym->ns->proc_name);
1656 parent_decl = current_function_decl
1657 ? DECL_CONTEXT (current_function_decl)((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1657, __FUNCTION__))->decl_minimal.context)
: NULL_TREE(tree) __null;
1658
1659 if ((t == parent_decl && return_value)
1660 || (sym->ns && sym->ns->proc_name
1661 && sym->ns->proc_name->backend_decl == parent_decl
1662 && (alternate_entry || entry_master)))
1663 parent_flag = 1;
1664 else
1665 parent_flag = 0;
1666
1667 /* Special case for assigning the return value of a function.
1668 Self recursive functions must have an explicit return value. */
1669 if (return_value && (t == current_function_decl || parent_flag))
1670 t = gfc_get_fake_result_decl (sym, parent_flag);
1671
1672 /* Similarly for alternate entry points. */
1673 else if (alternate_entry
1674 && (sym->ns->proc_name->backend_decl == current_function_decl
1675 || parent_flag))
1676 {
1677 gfc_entry_list *el = NULL__null;
1678
1679 for (el = sym->ns->entries; el; el = el->next)
1680 if (sym == el->sym)
1681 {
1682 t = gfc_get_fake_result_decl (sym, parent_flag);
1683 break;
1684 }
1685 }
1686
1687 else if (entry_master
1688 && (sym->ns->proc_name->backend_decl == current_function_decl
1689 || parent_flag))
1690 t = gfc_get_fake_result_decl (sym, parent_flag);
1691
1692 return t;
1693}
1694
1695static tree
1696gfc_trans_omp_variable_list (enum omp_clause_code code,
1697 gfc_omp_namelist *namelist, tree list,
1698 bool declare_simd)
1699{
1700 for (; namelist != NULL__null; namelist = namelist->next)
1701 if (namelist->sym->attr.referenced || declare_simd)
1702 {
1703 tree t = gfc_trans_omp_variable (namelist->sym, declare_simd);
1704 if (t != error_mark_nodeglobal_trees[TI_ERROR_MARK])
1705 {
1706 tree node = build_omp_clause (input_location, code);
1707 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1707, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1707, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1707, __FUNCTION__)))
= t;
1708 list = gfc_trans_add_clause (node, list);
1709
1710 if (code == OMP_CLAUSE_LASTPRIVATE
1711 && namelist->u.lastprivate_conditional)
1712 OMP_CLAUSE_LASTPRIVATE_CONDITIONAL (node)(((omp_clause_subcode_check ((node), (OMP_CLAUSE_LASTPRIVATE)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1712, __FUNCTION__)))->base.private_flag)
= 1;
1713 }
1714 }
1715 return list;
1716}
1717
1718struct omp_udr_find_orig_data
1719{
1720 gfc_omp_udr *omp_udr;
1721 bool omp_orig_seen;
1722};
1723
1724static int
1725omp_udr_find_orig (gfc_expr **e, int *walk_subtrees ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
1726 void *data)
1727{
1728 struct omp_udr_find_orig_data *cd = (struct omp_udr_find_orig_data *) data;
1729 if ((*e)->expr_type == EXPR_VARIABLE
1730 && (*e)->symtree->n.sym == cd->omp_udr->omp_orig)
1731 cd->omp_orig_seen = true;
1732
1733 return 0;
1734}
1735
1736static void
1737gfc_trans_omp_array_reduction_or_udr (tree c, gfc_omp_namelist *n, locus where)
1738{
1739 gfc_symbol *sym = n->sym;
1740 gfc_symtree *root1 = NULL__null, *root2 = NULL__null, *root3 = NULL__null, *root4 = NULL__null;
1741 gfc_symtree *symtree1, *symtree2, *symtree3, *symtree4 = NULL__null;
1742 gfc_symbol init_val_sym, outer_sym, intrinsic_sym;
1743 gfc_symbol omp_var_copy[4];
1744 gfc_expr *e1, *e2, *e3, *e4;
1745 gfc_ref *ref;
1746 tree decl, backend_decl, stmt, type, outer_decl;
1747 locus old_loc = gfc_current_locus;
1748 const char *iname;
1749 bool t;
1750 gfc_omp_udr *udr = n->udr ? n->udr->udr : NULL__null;
1751
1752 decl = OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1752, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1752, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1752, __FUNCTION__)))
;
1753 gfc_current_locus = where;
1754 type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1754, __FUNCTION__))->typed.type)
;
1755 outer_decl = create_tmp_var_raw (type);
1756 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == PARM_DECL
1757 && TREE_CODE (type)((enum tree_code) (type)->base.code) == REFERENCE_TYPE
1758 && GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (type))((tree_class_check ((((contains_struct_check ((type), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1758, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1758, __FUNCTION__))->type_common.lang_flag_1)
1759 && GFC_TYPE_ARRAY_AKIND (TREE_TYPE (type))(((tree_class_check ((((contains_struct_check ((type), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1759, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1759, __FUNCTION__))->type_with_lang_specific.lang_specific
)->akind)
== GFC_ARRAY_ALLOCATABLE)
1760 {
1761 decl = build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
1762 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1762, __FUNCTION__))->typed.type)
;
1763 }
1764
1765 /* Create a fake symbol for init value. */
1766 memset (&init_val_sym, 0, sizeof (init_val_sym));
1767 init_val_sym.ns = sym->ns;
1768 init_val_sym.name = sym->name;
1769 init_val_sym.ts = sym->ts;
1770 init_val_sym.attr.referenced = 1;
1771 init_val_sym.declared_at = where;
1772 init_val_sym.attr.flavor = FL_VARIABLE;
1773 if (OMP_CLAUSE_REDUCTION_CODE (c)((omp_clause_range_check ((c), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1773, __FUNCTION__))->omp_clause.subcode.reduction_code)
!= ERROR_MARK)
1774 backend_decl = omp_reduction_init (c, gfc_sym_type (&init_val_sym));
1775 else if (udr->initializer_ns)
1776 backend_decl = NULL__null;
1777 else
1778 switch (sym->ts.type)
1779 {
1780 case BT_LOGICAL:
1781 case BT_INTEGER:
1782 case BT_REAL:
1783 case BT_COMPLEX:
1784 backend_decl = build_zero_cst (gfc_sym_type (&init_val_sym));
1785 break;
1786 default:
1787 backend_decl = NULL_TREE(tree) __null;
1788 break;
1789 }
1790 init_val_sym.backend_decl = backend_decl;
1791
1792 /* Create a fake symbol for the outer array reference. */
1793 outer_sym = *sym;
1794 if (sym->as)
1795 outer_sym.as = gfc_copy_array_spec (sym->as);
1796 outer_sym.attr.dummy = 0;
1797 outer_sym.attr.result = 0;
1798 outer_sym.attr.flavor = FL_VARIABLE;
1799 outer_sym.backend_decl = outer_decl;
1800 if (decl != OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1800, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1800, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1800, __FUNCTION__)))
)
1801 outer_sym.backend_decl = build_fold_indirect_ref (outer_decl)build_fold_indirect_ref_loc (((location_t) 0), outer_decl);
1802
1803 /* Create fake symtrees for it. */
1804 symtree1 = gfc_new_symtree (&root1, sym->name);
1805 symtree1->n.sym = sym;
1806 gcc_assert (symtree1 == root1)((void)(!(symtree1 == root1) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1806, __FUNCTION__), 0 : 0))
;
1807
1808 symtree2 = gfc_new_symtree (&root2, sym->name);
1809 symtree2->n.sym = &init_val_sym;
1810 gcc_assert (symtree2 == root2)((void)(!(symtree2 == root2) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1810, __FUNCTION__), 0 : 0))
;
1811
1812 symtree3 = gfc_new_symtree (&root3, sym->name);
1813 symtree3->n.sym = &outer_sym;
1814 gcc_assert (symtree3 == root3)((void)(!(symtree3 == root3) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1814, __FUNCTION__), 0 : 0))
;
1815
1816 memset (omp_var_copy, 0, sizeof omp_var_copy);
1817 if (udr)
1818 {
1819 omp_var_copy[0] = *udr->omp_out;
1820 omp_var_copy[1] = *udr->omp_in;
1821 *udr->omp_out = outer_sym;
1822 *udr->omp_in = *sym;
1823 if (udr->initializer_ns)
1824 {
1825 omp_var_copy[2] = *udr->omp_priv;
1826 omp_var_copy[3] = *udr->omp_orig;
1827 *udr->omp_priv = *sym;
1828 *udr->omp_orig = outer_sym;
1829 }
1830 }
1831
1832 /* Create expressions. */
1833 e1 = gfc_get_expr ();
1834 e1->expr_type = EXPR_VARIABLE;
1835 e1->where = where;
1836 e1->symtree = symtree1;
1837 e1->ts = sym->ts;
1838 if (sym->attr.dimension)
1839 {
1840 e1->ref = ref = gfc_get_ref ()((gfc_ref *) xcalloc (1, sizeof (gfc_ref)));
1841 ref->type = REF_ARRAY;
1842 ref->u.ar.where = where;
1843 ref->u.ar.as = sym->as;
1844 ref->u.ar.type = AR_FULL;
1845 ref->u.ar.dimen = 0;
1846 }
1847 t = gfc_resolve_expr (e1);
1848 gcc_assert (t)((void)(!(t) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1848, __FUNCTION__), 0 : 0))
;
1849
1850 e2 = NULL__null;
1851 if (backend_decl != NULL_TREE(tree) __null)
1852 {
1853 e2 = gfc_get_expr ();
1854 e2->expr_type = EXPR_VARIABLE;
1855 e2->where = where;
1856 e2->symtree = symtree2;
1857 e2->ts = sym->ts;
1858 t = gfc_resolve_expr (e2);
1859 gcc_assert (t)((void)(!(t) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1859, __FUNCTION__), 0 : 0))
;
1860 }
1861 else if (udr->initializer_ns == NULL__null)
1862 {
1863 gcc_assert (sym->ts.type == BT_DERIVED)((void)(!(sym->ts.type == BT_DERIVED) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1863, __FUNCTION__), 0 : 0))
;
1864 e2 = gfc_default_initializer (&sym->ts);
1865 gcc_assert (e2)((void)(!(e2) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1865, __FUNCTION__), 0 : 0))
;
1866 t = gfc_resolve_expr (e2);
1867 gcc_assert (t)((void)(!(t) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1867, __FUNCTION__), 0 : 0))
;
1868 }
1869 else if (n->udr->initializer->op == EXEC_ASSIGN)
1870 {
1871 e2 = gfc_copy_expr (n->udr->initializer->expr2);
1872 t = gfc_resolve_expr (e2);
1873 gcc_assert (t)((void)(!(t) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1873, __FUNCTION__), 0 : 0))
;
1874 }
1875 if (udr && udr->initializer_ns)
1876 {
1877 struct omp_udr_find_orig_data cd;
1878 cd.omp_udr = udr;
1879 cd.omp_orig_seen = false;
1880 gfc_code_walker (&n->udr->initializer,
1881 gfc_dummy_code_callback, omp_udr_find_orig, &cd);
1882 if (cd.omp_orig_seen)
1883 OMP_CLAUSE_REDUCTION_OMP_ORIG_REF (c)((omp_clause_range_check ((c), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1883, __FUNCTION__))->base.public_flag)
= 1;
1884 }
1885
1886 e3 = gfc_copy_expr (e1);
1887 e3->symtree = symtree3;
1888 t = gfc_resolve_expr (e3);
1889 gcc_assert (t)((void)(!(t) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1889, __FUNCTION__), 0 : 0))
;
1890
1891 iname = NULL__null;
1892 e4 = NULL__null;
1893 switch (OMP_CLAUSE_REDUCTION_CODE (c)((omp_clause_range_check ((c), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1893, __FUNCTION__))->omp_clause.subcode.reduction_code)
)
1894 {
1895 case PLUS_EXPR:
1896 case MINUS_EXPR:
1897 e4 = gfc_add (e3, e1);
1898 break;
1899 case MULT_EXPR:
1900 e4 = gfc_multiply (e3, e1);
1901 break;
1902 case TRUTH_ANDIF_EXPR:
1903 e4 = gfc_and (e3, e1);
1904 break;
1905 case TRUTH_ORIF_EXPR:
1906 e4 = gfc_or (e3, e1);
1907 break;
1908 case EQ_EXPR:
1909 e4 = gfc_eqv (e3, e1);
1910 break;
1911 case NE_EXPR:
1912 e4 = gfc_neqv (e3, e1);
1913 break;
1914 case MIN_EXPR:
1915 iname = "min";
1916 break;
1917 case MAX_EXPR:
1918 iname = "max";
1919 break;
1920 case BIT_AND_EXPR:
1921 iname = "iand";
1922 break;
1923 case BIT_IOR_EXPR:
1924 iname = "ior";
1925 break;
1926 case BIT_XOR_EXPR:
1927 iname = "ieor";
1928 break;
1929 case ERROR_MARK:
1930 if (n->udr->combiner->op == EXEC_ASSIGN)
1931 {
1932 gfc_free_expr (e3);
1933 e3 = gfc_copy_expr (n->udr->combiner->expr1);
1934 e4 = gfc_copy_expr (n->udr->combiner->expr2);
1935 t = gfc_resolve_expr (e3);
1936 gcc_assert (t)((void)(!(t) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1936, __FUNCTION__), 0 : 0))
;
1937 t = gfc_resolve_expr (e4);
1938 gcc_assert (t)((void)(!(t) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1938, __FUNCTION__), 0 : 0))
;
1939 }
1940 break;
1941 default:
1942 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1942, __FUNCTION__))
;
1943 }
1944 if (iname != NULL__null)
1945 {
1946 memset (&intrinsic_sym, 0, sizeof (intrinsic_sym));
1947 intrinsic_sym.ns = sym->ns;
1948 intrinsic_sym.name = iname;
1949 intrinsic_sym.ts = sym->ts;
1950 intrinsic_sym.attr.referenced = 1;
1951 intrinsic_sym.attr.intrinsic = 1;
1952 intrinsic_sym.attr.function = 1;
1953 intrinsic_sym.attr.implicit_type = 1;
1954 intrinsic_sym.result = &intrinsic_sym;
1955 intrinsic_sym.declared_at = where;
1956
1957 symtree4 = gfc_new_symtree (&root4, iname);
1958 symtree4->n.sym = &intrinsic_sym;
1959 gcc_assert (symtree4 == root4)((void)(!(symtree4 == root4) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1959, __FUNCTION__), 0 : 0))
;
1960
1961 e4 = gfc_get_expr ();
1962 e4->expr_type = EXPR_FUNCTION;
1963 e4->where = where;
1964 e4->symtree = symtree4;
1965 e4->value.function.actual = gfc_get_actual_arglist ()((gfc_actual_arglist *) xcalloc (1, sizeof (gfc_actual_arglist
)))
;
1966 e4->value.function.actual->expr = e3;
1967 e4->value.function.actual->next = gfc_get_actual_arglist ()((gfc_actual_arglist *) xcalloc (1, sizeof (gfc_actual_arglist
)))
;
1968 e4->value.function.actual->next->expr = e1;
1969 }
1970 if (OMP_CLAUSE_REDUCTION_CODE (c)((omp_clause_range_check ((c), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1970, __FUNCTION__))->omp_clause.subcode.reduction_code)
!= ERROR_MARK)
1971 {
1972 /* e1 and e3 have been stored as arguments of e4, avoid sharing. */
1973 e1 = gfc_copy_expr (e1);
1974 e3 = gfc_copy_expr (e3);
1975 t = gfc_resolve_expr (e4);
1976 gcc_assert (t)((void)(!(t) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1976, __FUNCTION__), 0 : 0))
;
1977 }
1978
1979 /* Create the init statement list. */
1980 pushlevel ();
1981 if (e2)
1982 stmt = gfc_trans_assignment (e1, e2, false, false);
1983 else
1984 stmt = gfc_trans_call (n->udr->initializer, false,
1985 NULL_TREE(tree) __null, NULL_TREE(tree) __null, false);
1986 if (TREE_CODE (stmt)((enum tree_code) (stmt)->base.code) != BIND_EXPR)
1987 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))
;
1988 else
1989 poplevel (0, 0);
1990 OMP_CLAUSE_REDUCTION_INIT (c)(*(omp_clause_elt_check (((omp_clause_range_check ((c), (OMP_CLAUSE_REDUCTION
), (OMP_CLAUSE_IN_REDUCTION), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1990, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 1990, __FUNCTION__)))
= stmt;
1991
1992 /* Create the merge statement list. */
1993 pushlevel ();
1994 if (e4)
1995 stmt = gfc_trans_assignment (e3, e4, false, true);
1996 else
1997 stmt = gfc_trans_call (n->udr->combiner, false,
1998 NULL_TREE(tree) __null, NULL_TREE(tree) __null, false);
1999 if (TREE_CODE (stmt)((enum tree_code) (stmt)->base.code) != BIND_EXPR)
2000 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))
;
2001 else
2002 poplevel (0, 0);
2003 OMP_CLAUSE_REDUCTION_MERGE (c)(*(omp_clause_elt_check (((omp_clause_range_check ((c), (OMP_CLAUSE_REDUCTION
), (OMP_CLAUSE_IN_REDUCTION), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2003, __FUNCTION__))), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2003, __FUNCTION__)))
= stmt;
2004
2005 /* And stick the placeholder VAR_DECL into the clause as well. */
2006 OMP_CLAUSE_REDUCTION_PLACEHOLDER (c)(*(omp_clause_elt_check (((omp_clause_range_check ((c), (OMP_CLAUSE_REDUCTION
), (OMP_CLAUSE_IN_REDUCTION), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2006, __FUNCTION__))), (3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2006, __FUNCTION__)))
= outer_decl;
2007
2008 gfc_current_locus = old_loc;
2009
2010 gfc_free_expr (e1);
2011 if (e2)
2012 gfc_free_expr (e2);
2013 gfc_free_expr (e3);
2014 if (e4)
2015 gfc_free_expr (e4);
2016 free (symtree1);
2017 free (symtree2);
2018 free (symtree3);
2019 free (symtree4);
2020 if (outer_sym.as)
2021 gfc_free_array_spec (outer_sym.as);
2022
2023 if (udr)
2024 {
2025 *udr->omp_out = omp_var_copy[0];
2026 *udr->omp_in = omp_var_copy[1];
2027 if (udr->initializer_ns)
2028 {
2029 *udr->omp_priv = omp_var_copy[2];
2030 *udr->omp_orig = omp_var_copy[3];
2031 }
2032 }
2033}
2034
2035static tree
2036gfc_trans_omp_reduction_list (int kind, gfc_omp_namelist *namelist, tree list,
2037 locus where, bool mark_addressable)
2038{
2039 omp_clause_code clause = OMP_CLAUSE_REDUCTION;
2040 switch (kind)
2041 {
2042 case OMP_LIST_REDUCTION:
2043 case OMP_LIST_REDUCTION_INSCAN:
2044 case OMP_LIST_REDUCTION_TASK:
2045 break;
2046 case OMP_LIST_IN_REDUCTION:
2047 clause = OMP_CLAUSE_IN_REDUCTION;
2048 break;
2049 case OMP_LIST_TASK_REDUCTION:
2050 clause = OMP_CLAUSE_TASK_REDUCTION;
2051 break;
2052 default:
2053 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2053, __FUNCTION__))
;
2054 }
2055 for (; namelist != NULL__null; namelist = namelist->next)
2056 if (namelist->sym->attr.referenced)
2057 {
2058 tree t = gfc_trans_omp_variable (namelist->sym, false);
2059 if (t != error_mark_nodeglobal_trees[TI_ERROR_MARK])
2060 {
2061 tree node = build_omp_clause (gfc_get_location (&namelist->where),
2062 clause);
2063 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2063, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2063, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2063, __FUNCTION__)))
= t;
2064 if (mark_addressable)
2065 TREE_ADDRESSABLE (t)((t)->base.addressable_flag) = 1;
2066 if (kind == OMP_LIST_REDUCTION_INSCAN)
2067 OMP_CLAUSE_REDUCTION_INSCAN (node)(((omp_clause_subcode_check ((node), (OMP_CLAUSE_REDUCTION), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2067, __FUNCTION__)))->base.private_flag)
= 1;
2068 if (kind == OMP_LIST_REDUCTION_TASK)
2069 OMP_CLAUSE_REDUCTION_TASK (node)(((omp_clause_subcode_check ((node), (OMP_CLAUSE_REDUCTION), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2069, __FUNCTION__)))->base.protected_flag)
= 1;
2070 switch (namelist->u.reduction_op)
2071 {
2072 case OMP_REDUCTION_PLUS:
2073 OMP_CLAUSE_REDUCTION_CODE (node)((omp_clause_range_check ((node), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2073, __FUNCTION__))->omp_clause.subcode.reduction_code)
= PLUS_EXPR;
2074 break;
2075 case OMP_REDUCTION_MINUS:
2076 OMP_CLAUSE_REDUCTION_CODE (node)((omp_clause_range_check ((node), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2076, __FUNCTION__))->omp_clause.subcode.reduction_code)
= MINUS_EXPR;
2077 break;
2078 case OMP_REDUCTION_TIMES:
2079 OMP_CLAUSE_REDUCTION_CODE (node)((omp_clause_range_check ((node), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2079, __FUNCTION__))->omp_clause.subcode.reduction_code)
= MULT_EXPR;
2080 break;
2081 case OMP_REDUCTION_AND:
2082 OMP_CLAUSE_REDUCTION_CODE (node)((omp_clause_range_check ((node), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2082, __FUNCTION__))->omp_clause.subcode.reduction_code)
= TRUTH_ANDIF_EXPR;
2083 break;
2084 case OMP_REDUCTION_OR:
2085 OMP_CLAUSE_REDUCTION_CODE (node)((omp_clause_range_check ((node), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2085, __FUNCTION__))->omp_clause.subcode.reduction_code)
= TRUTH_ORIF_EXPR;
2086 break;
2087 case OMP_REDUCTION_EQV:
2088 OMP_CLAUSE_REDUCTION_CODE (node)((omp_clause_range_check ((node), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2088, __FUNCTION__))->omp_clause.subcode.reduction_code)
= EQ_EXPR;
2089 break;
2090 case OMP_REDUCTION_NEQV:
2091 OMP_CLAUSE_REDUCTION_CODE (node)((omp_clause_range_check ((node), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2091, __FUNCTION__))->omp_clause.subcode.reduction_code)
= NE_EXPR;
2092 break;
2093 case OMP_REDUCTION_MAX:
2094 OMP_CLAUSE_REDUCTION_CODE (node)((omp_clause_range_check ((node), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2094, __FUNCTION__))->omp_clause.subcode.reduction_code)
= MAX_EXPR;
2095 break;
2096 case OMP_REDUCTION_MIN:
2097 OMP_CLAUSE_REDUCTION_CODE (node)((omp_clause_range_check ((node), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2097, __FUNCTION__))->omp_clause.subcode.reduction_code)
= MIN_EXPR;
2098 break;
2099 case OMP_REDUCTION_IAND:
2100 OMP_CLAUSE_REDUCTION_CODE (node)((omp_clause_range_check ((node), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2100, __FUNCTION__))->omp_clause.subcode.reduction_code)
= BIT_AND_EXPR;
2101 break;
2102 case OMP_REDUCTION_IOR:
2103 OMP_CLAUSE_REDUCTION_CODE (node)((omp_clause_range_check ((node), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2103, __FUNCTION__))->omp_clause.subcode.reduction_code)
= BIT_IOR_EXPR;
2104 break;
2105 case OMP_REDUCTION_IEOR:
2106 OMP_CLAUSE_REDUCTION_CODE (node)((omp_clause_range_check ((node), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2106, __FUNCTION__))->omp_clause.subcode.reduction_code)
= BIT_XOR_EXPR;
2107 break;
2108 case OMP_REDUCTION_USER:
2109 OMP_CLAUSE_REDUCTION_CODE (node)((omp_clause_range_check ((node), (OMP_CLAUSE_REDUCTION), (OMP_CLAUSE_IN_REDUCTION
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2109, __FUNCTION__))->omp_clause.subcode.reduction_code)
= ERROR_MARK;
2110 break;
2111 default:
2112 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2112, __FUNCTION__))
;
2113 }
2114 if (namelist->sym->attr.dimension
2115 || namelist->u.reduction_op == OMP_REDUCTION_USER
2116 || namelist->sym->attr.allocatable)
2117 gfc_trans_omp_array_reduction_or_udr (node, namelist, where);
2118 list = gfc_trans_add_clause (node, list);
2119 }
2120 }
2121 return list;
2122}
2123
2124static inline tree
2125gfc_convert_expr_to_tree (stmtblock_t *block, gfc_expr *expr)
2126{
2127 gfc_se se;
2128 tree result;
2129
2130 gfc_init_se (&se, NULL__null );
2131 gfc_conv_expr (&se, expr);
2132 gfc_add_block_to_block (block, &se.pre);
2133 result = gfc_evaluate_now (se.expr, block);
2134 gfc_add_block_to_block (block, &se.post);
2135
2136 return result;
2137}
2138
2139static vec<tree, va_heap, vl_embed> *doacross_steps;
2140
2141
2142/* Translate an array section or array element. */
2143
2144static void
2145gfc_trans_omp_array_section (stmtblock_t *block, gfc_omp_namelist *n,
2146 tree decl, bool element, gomp_map_kind ptr_kind,
2147 tree &node, tree &node2, tree &node3, tree &node4)
2148{
2149 gfc_se se;
2150 tree ptr, ptr2;
2151 tree elemsz = NULL_TREE(tree) __null;
2152
2153 gfc_init_se (&se, NULL__null);
2154
2155 if (element)
2156 {
2157 gfc_conv_expr_reference (&se, n->expr);
2158 gfc_add_block_to_block (block, &se.pre);
2159 ptr = se.expr;
2160 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2160, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2160, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2160, __FUNCTION__)))
= TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (ptr)))((tree_class_check ((((contains_struct_check ((((contains_struct_check
((ptr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2160, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2160, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2160, __FUNCTION__))->type_common.size_unit)
;
2161 elemsz = OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2161, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2161, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2161, __FUNCTION__)))
;
2162 }
2163 else
2164 {
2165 gfc_conv_expr_descriptor (&se, n->expr);
2166 ptr = gfc_conv_array_data (se.expr);
2167 tree type = TREE_TYPE (se.expr)((contains_struct_check ((se.expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2167, __FUNCTION__))->typed.type)
;
2168 gfc_add_block_to_block (block, &se.pre);
2169 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2169, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2169, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2169, __FUNCTION__)))
= gfc_full_array_size (block, se.expr,
2170 GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2170, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
);
2171 elemsz = TYPE_SIZE_UNIT (gfc_get_element_type (type))((tree_class_check ((gfc_get_element_type (type)), (tcc_type)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2171, __FUNCTION__))->type_common.size_unit)
;
2172 elemsz = fold_convert (gfc_array_index_type, elemsz)fold_convert_loc (((location_t) 0), gfc_array_index_type, elemsz
)
;
2173 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2173, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2173, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2173, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2174, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2174, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2174, __FUNCTION__))), elemsz )
2174 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2174, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2174, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2174, __FUNCTION__))), elemsz )
;
2175 }
2176 gcc_assert (se.post.head == NULL_TREE)((void)(!(se.post.head == (tree) __null) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2176, __FUNCTION__), 0 : 0))
;
2177 ptr = fold_convert (build_pointer_type (char_type_node), ptr)fold_convert_loc (((location_t) 0), build_pointer_type (integer_types
[itk_char]), ptr)
;
2178 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2178, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2178, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2178, __FUNCTION__)))
= build_fold_indirect_ref (ptr)build_fold_indirect_ref_loc (((location_t) 0), ptr);
2179 ptr = fold_convert (ptrdiff_type_node, ptr)fold_convert_loc (((location_t) 0), global_trees[TI_PTRDIFF_TYPE
], ptr)
;
2180
2181 if (POINTER_TYPE_P (TREE_TYPE (decl))(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2181, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2181, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)
2182 && GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (TREE_TYPE (decl)))((tree_class_check ((((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2182, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2182, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2182, __FUNCTION__))->type_common.lang_flag_1)
2183 && ptr_kind == GOMP_MAP_POINTER)
2184 {
2185 node4 = build_omp_clause (input_location,
2186 OMP_CLAUSE_MAP);
2187 OMP_CLAUSE_SET_MAP_KIND (node4, GOMP_MAP_POINTER)((omp_clause_subcode_check ((node4), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2187, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_POINTER))
;
2188 OMP_CLAUSE_DECL (node4)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node4), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2188, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2188, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2188, __FUNCTION__)))
= decl;
2189 OMP_CLAUSE_SIZE (node4)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node4), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2189, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2189, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2189, __FUNCTION__)))
= size_int (0)size_int_kind (0, stk_sizetype);
2190 decl = build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
2191 }
2192 else if (ptr_kind == GOMP_MAP_ALWAYS_POINTER
2193 && n->expr->ts.type == BT_CHARACTER
2194 && n->expr->ts.deferred)
2195 {
2196 gomp_map_kind map_kind;
2197 if (GOMP_MAP_COPY_TO_P (OMP_CLAUSE_MAP_KIND (node))(!((((enum gomp_map_kind) (omp_clause_subcode_check ((node), (
OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2197, __FUNCTION__))->omp_clause.subcode.map_kind)) &
((1 << 3) | (1 << 2))) && ((((enum gomp_map_kind
) (omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2197, __FUNCTION__))->omp_clause.subcode.map_kind)) &
(1 << 0)))
)
2198 map_kind = GOMP_MAP_TO;
2199 else if (OMP_CLAUSE_MAP_KIND (node)((enum gomp_map_kind) (omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2199, __FUNCTION__))->omp_clause.subcode.map_kind)
== GOMP_MAP_RELEASE
2200 || OMP_CLAUSE_MAP_KIND (node)((enum gomp_map_kind) (omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2200, __FUNCTION__))->omp_clause.subcode.map_kind)
== GOMP_MAP_DELETE)
2201 map_kind = OMP_CLAUSE_MAP_KIND (node)((enum gomp_map_kind) (omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2201, __FUNCTION__))->omp_clause.subcode.map_kind)
;
2202 else
2203 map_kind = GOMP_MAP_ALLOC;
2204 gcc_assert (se.string_length)((void)(!(se.string_length) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2204, __FUNCTION__), 0 : 0))
;
2205 node4 = build_omp_clause (input_location, OMP_CLAUSE_MAP);
2206 OMP_CLAUSE_SET_MAP_KIND (node4, map_kind)((omp_clause_subcode_check ((node4), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2206, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (map_kind))
;
2207 OMP_CLAUSE_DECL (node4)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node4), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2207, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2207, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2207, __FUNCTION__)))
= se.string_length;
2208 OMP_CLAUSE_SIZE (node4)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node4), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2208, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2208, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2208, __FUNCTION__)))
= TYPE_SIZE_UNIT (gfc_charlen_type_node)((tree_class_check ((gfc_charlen_type_node), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2208, __FUNCTION__))->type_common.size_unit)
;
2209 }
2210 if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2210, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2210, __FUNCTION__))->type_common.lang_flag_1)
)
2211 {
2212 tree desc_node;
2213 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2213, __FUNCTION__))->typed.type)
;
2214 ptr2 = gfc_conv_descriptor_data_get (decl);
2215 desc_node = build_omp_clause (input_location, OMP_CLAUSE_MAP);
2216 OMP_CLAUSE_DECL (desc_node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((desc_node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2216, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2216, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2216, __FUNCTION__)))
= decl;
2217 OMP_CLAUSE_SIZE (desc_node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((desc_node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2217, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2217, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2217, __FUNCTION__)))
= TYPE_SIZE_UNIT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2217, __FUNCTION__))->type_common.size_unit)
;
2218 if (ptr_kind == GOMP_MAP_ALWAYS_POINTER)
2219 {
2220 OMP_CLAUSE_SET_MAP_KIND (desc_node, GOMP_MAP_TO)((omp_clause_subcode_check ((desc_node), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2220, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_TO))
;
2221 node2 = node;
2222 node = desc_node; /* Needs to come first. */
2223 }
2224 else
2225 {
2226 OMP_CLAUSE_SET_MAP_KIND (desc_node, GOMP_MAP_TO_PSET)((omp_clause_subcode_check ((desc_node), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2226, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_TO_PSET))
;
2227 node2 = desc_node;
2228 }
2229 node3 = build_omp_clause (input_location,
2230 OMP_CLAUSE_MAP);
2231 OMP_CLAUSE_SET_MAP_KIND (node3, ptr_kind)((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2231, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (ptr_kind))
;
2232 OMP_CLAUSE_DECL (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2232, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2232, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2232, __FUNCTION__)))
2233 = gfc_conv_descriptor_data_get (decl);
2234 /* This purposely does not include GOMP_MAP_ALWAYS_POINTER. The extra
2235 cast prevents gimplify.c from recognising it as being part of the
2236 struct – and adding an 'alloc: for the 'desc.data' pointer, which
2237 would break as the 'desc' (the descriptor) is also mapped
2238 (see node4 above). */
2239 if (ptr_kind == GOMP_MAP_ATTACH_DETACH)
2240 STRIP_NOPS (OMP_CLAUSE_DECL (node3))((*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2240, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2240, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2240, __FUNCTION__)))) = tree_strip_nop_conversions ((const_cast
<union tree_node *> ((((*(omp_clause_elt_check (((omp_clause_range_check
(((tree_check ((node3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2240, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2240, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2240, __FUNCTION__))))))))
;
2241 }
2242 else
2243 {
2244 if (TREE_CODE (TREE_TYPE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2244, __FUNCTION__))->typed.type))->base.code)
== ARRAY_TYPE)
2245 {
2246 tree offset;
2247 ptr2 = build_fold_addr_expr (decl)build_fold_addr_expr_loc (((location_t) 0), (decl));
2248 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) )
2249 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) )
;
2250 offset = build2 (TRUNC_DIV_EXPR, ptrdiff_type_nodeglobal_trees[TI_PTRDIFF_TYPE],
2251 offset, fold_convert (ptrdiff_type_node, elemsz)fold_convert_loc (((location_t) 0), global_trees[TI_PTRDIFF_TYPE
], elemsz)
);
2252 offset = build4_loc (input_location, ARRAY_REF,
2253 TREE_TYPE (TREE_TYPE (decl))((contains_struct_check ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2253, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2253, __FUNCTION__))->typed.type)
,
2254 decl, offset, NULL_TREE(tree) __null, NULL_TREE(tree) __null);
2255 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2255, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2255, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2255, __FUNCTION__)))
= offset;
2256 }
2257 else
2258 {
2259 gcc_assert (POINTER_TYPE_P (TREE_TYPE (decl)))((void)(!((((enum tree_code) (((contains_struct_check ((decl)
, (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2259, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2259, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2259, __FUNCTION__), 0 : 0))
;
2260 ptr2 = decl;
2261 }
2262 node3 = build_omp_clause (input_location,
2263 OMP_CLAUSE_MAP);
2264 OMP_CLAUSE_SET_MAP_KIND (node3, ptr_kind)((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2264, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (ptr_kind))
;
2265 OMP_CLAUSE_DECL (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2265, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2265, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2265, __FUNCTION__)))
= decl;
2266 }
2267 ptr2 = fold_convert (ptrdiff_type_node, ptr2)fold_convert_loc (((location_t) 0), global_trees[TI_PTRDIFF_TYPE
], ptr2)
;
2268 OMP_CLAUSE_SIZE (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2268, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2268, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2268, __FUNCTION__)))
= fold_build2 (MINUS_EXPR, ptrdiff_type_node,fold_build2_loc (((location_t) 0), MINUS_EXPR, global_trees[TI_PTRDIFF_TYPE
], ptr, ptr2 )
2269 ptr, ptr2)fold_build2_loc (((location_t) 0), MINUS_EXPR, global_trees[TI_PTRDIFF_TYPE
], ptr, ptr2 )
;
2270}
2271
2272static tree
2273gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
2274 locus where, bool declare_simd = false,
2275 bool openacc = false)
2276{
2277 tree omp_clauses = NULL_TREE(tree) __null, chunk_size, c;
2278 int list, ifc;
2279 enum omp_clause_code clause_code;
2280 gfc_se se;
2281
2282 if (clauses == NULL__null)
2283 return NULL_TREE(tree) __null;
2284
2285 for (list = 0; list < OMP_LIST_NUM; list++)
2286 {
2287 gfc_omp_namelist *n = clauses->lists[list];
2288
2289 if (n == NULL__null)
2290 continue;
2291 switch (list)
2292 {
2293 case OMP_LIST_REDUCTION:
2294 case OMP_LIST_REDUCTION_INSCAN:
2295 case OMP_LIST_REDUCTION_TASK:
2296 case OMP_LIST_IN_REDUCTION:
2297 case OMP_LIST_TASK_REDUCTION:
2298 /* An OpenACC async clause indicates the need to set reduction
2299 arguments addressable, to allow asynchronous copy-out. */
2300 omp_clauses = gfc_trans_omp_reduction_list (list, n, omp_clauses,
2301 where, clauses->async);
2302 break;
2303 case OMP_LIST_PRIVATE:
2304 clause_code = OMP_CLAUSE_PRIVATE;
2305 goto add_clause;
2306 case OMP_LIST_SHARED:
2307 clause_code = OMP_CLAUSE_SHARED;
2308 goto add_clause;
2309 case OMP_LIST_FIRSTPRIVATE:
2310 clause_code = OMP_CLAUSE_FIRSTPRIVATE;
2311 goto add_clause;
2312 case OMP_LIST_LASTPRIVATE:
2313 clause_code = OMP_CLAUSE_LASTPRIVATE;
2314 goto add_clause;
2315 case OMP_LIST_COPYIN:
2316 clause_code = OMP_CLAUSE_COPYIN;
2317 goto add_clause;
2318 case OMP_LIST_COPYPRIVATE:
2319 clause_code = OMP_CLAUSE_COPYPRIVATE;
2320 goto add_clause;
2321 case OMP_LIST_UNIFORM:
2322 clause_code = OMP_CLAUSE_UNIFORM;
2323 goto add_clause;
2324 case OMP_LIST_USE_DEVICE:
2325 case OMP_LIST_USE_DEVICE_PTR:
2326 clause_code = OMP_CLAUSE_USE_DEVICE_PTR;
2327 goto add_clause;
2328 case OMP_LIST_USE_DEVICE_ADDR:
2329 clause_code = OMP_CLAUSE_USE_DEVICE_ADDR;
2330 goto add_clause;
2331 case OMP_LIST_IS_DEVICE_PTR:
2332 clause_code = OMP_CLAUSE_IS_DEVICE_PTR;
2333 goto add_clause;
2334 case OMP_LIST_NONTEMPORAL:
2335 clause_code = OMP_CLAUSE_NONTEMPORAL;
2336 goto add_clause;
2337 case OMP_LIST_SCAN_IN:
2338 clause_code = OMP_CLAUSE_INCLUSIVE;
2339 goto add_clause;
2340 case OMP_LIST_SCAN_EX:
2341 clause_code = OMP_CLAUSE_EXCLUSIVE;
2342 goto add_clause;
2343
2344 add_clause:
2345 omp_clauses
2346 = gfc_trans_omp_variable_list (clause_code, n, omp_clauses,
2347 declare_simd);
2348 break;
2349 case OMP_LIST_ALIGNED:
2350 for (; n != NULL__null; n = n->next)
2351 if (n->sym->attr.referenced || declare_simd)
2352 {
2353 tree t = gfc_trans_omp_variable (n->sym, declare_simd);
2354 if (t != error_mark_nodeglobal_trees[TI_ERROR_MARK])
2355 {
2356 tree node = build_omp_clause (input_location,
2357 OMP_CLAUSE_ALIGNED);
2358 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2358, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2358, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2358, __FUNCTION__)))
= t;
2359 if (n->expr)
2360 {
2361 tree alignment_var;
2362
2363 if (declare_simd)
2364 alignment_var = gfc_conv_constant_to_tree (n->expr);
2365 else
2366 {
2367 gfc_init_se (&se, NULL__null);
2368 gfc_conv_expr (&se, n->expr);
2369 gfc_add_block_to_block (block, &se.pre);
2370 alignment_var = gfc_evaluate_now (se.expr, block);
2371 gfc_add_block_to_block (block, &se.post);
2372 }
2373 OMP_CLAUSE_ALIGNED_ALIGNMENT (node)(*(omp_clause_elt_check (((omp_clause_subcode_check ((node), (
OMP_CLAUSE_ALIGNED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2373, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2373, __FUNCTION__)))
= alignment_var;
2374 }
2375 omp_clauses = gfc_trans_add_clause (node, omp_clauses);
2376 }
2377 }
2378 break;
2379 case OMP_LIST_LINEAR:
2380 {
2381 gfc_expr *last_step_expr = NULL__null;
2382 tree last_step = NULL_TREE(tree) __null;
2383 bool last_step_parm = false;
2384
2385 for (; n != NULL__null; n = n->next)
2386 {
2387 if (n->expr)
2388 {
2389 last_step_expr = n->expr;
2390 last_step = NULL_TREE(tree) __null;
2391 last_step_parm = false;
2392 }
2393 if (n->sym->attr.referenced || declare_simd)
2394 {
2395 tree t = gfc_trans_omp_variable (n->sym, declare_simd);
2396 if (t != error_mark_nodeglobal_trees[TI_ERROR_MARK])
2397 {
2398 tree node = build_omp_clause (input_location,
2399 OMP_CLAUSE_LINEAR);
2400 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2400, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2400, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2400, __FUNCTION__)))
= t;
2401 omp_clause_linear_kind kind;
2402 switch (n->u.linear_op)
2403 {
2404 case OMP_LINEAR_DEFAULT:
2405 kind = OMP_CLAUSE_LINEAR_DEFAULT;
2406 break;
2407 case OMP_LINEAR_REF:
2408 kind = OMP_CLAUSE_LINEAR_REF;
2409 break;
2410 case OMP_LINEAR_VAL:
2411 kind = OMP_CLAUSE_LINEAR_VAL;
2412 break;
2413 case OMP_LINEAR_UVAL:
2414 kind = OMP_CLAUSE_LINEAR_UVAL;
2415 break;
2416 default:
2417 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2417, __FUNCTION__))
;
2418 }
2419 OMP_CLAUSE_LINEAR_KIND (node)((omp_clause_subcode_check ((node), (OMP_CLAUSE_LINEAR), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2419, __FUNCTION__))->omp_clause.subcode.linear_kind)
= kind;
2420 if (last_step_expr && last_step == NULL_TREE(tree) __null)
2421 {
2422 if (!declare_simd)
2423 {
2424 gfc_init_se (&se, NULL__null);
2425 gfc_conv_expr (&se, last_step_expr);
2426 gfc_add_block_to_block (block, &se.pre);
2427 last_step = gfc_evaluate_now (se.expr, block);
2428 gfc_add_block_to_block (block, &se.post);
2429 }
2430 else if (last_step_expr->expr_type == EXPR_VARIABLE)
2431 {
2432 gfc_symbol *s = last_step_expr->symtree->n.sym;
2433 last_step = gfc_trans_omp_variable (s, true);
2434 last_step_parm = true;
2435 }
2436 else
2437 last_step
2438 = gfc_conv_constant_to_tree (last_step_expr);
2439 }
2440 if (last_step_parm)
2441 {
2442 OMP_CLAUSE_LINEAR_VARIABLE_STRIDE (node)(((omp_clause_subcode_check ((node), (OMP_CLAUSE_LINEAR), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2442, __FUNCTION__)))->base.protected_flag)
= 1;
2443 OMP_CLAUSE_LINEAR_STEP (node)(*(omp_clause_elt_check (((omp_clause_subcode_check ((node), (
OMP_CLAUSE_LINEAR), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2443, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2443, __FUNCTION__)))
= last_step;
2444 }
2445 else
2446 {
2447 if (kind == OMP_CLAUSE_LINEAR_REF)
2448 {
2449 tree type;
2450 if (n->sym->attr.flavor == FL_PROCEDURE)
2451 {
2452 type = gfc_get_function_type (n->sym);
2453 type = build_pointer_type (type);
2454 }
2455 else
2456 type = gfc_sym_type (n->sym);
2457 if (POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || (
(enum tree_code) (type)->base.code) == REFERENCE_TYPE)
)
2458 type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2458, __FUNCTION__))->typed.type)
;
2459 /* Otherwise to be determined what exactly
2460 should be done. */
2461 tree t = fold_convert (sizetype, last_step)fold_convert_loc (((location_t) 0), sizetype_tab[(int) stk_sizetype
], last_step)
;
2462 t = size_binop (MULT_EXPR, t,size_binop_loc (((location_t) 0), MULT_EXPR, t, ((tree_class_check
((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2463, __FUNCTION__))->type_common.size_unit))
2463 TYPE_SIZE_UNIT (type))size_binop_loc (((location_t) 0), MULT_EXPR, t, ((tree_class_check
((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2463, __FUNCTION__))->type_common.size_unit))
;
2464 OMP_CLAUSE_LINEAR_STEP (node)(*(omp_clause_elt_check (((omp_clause_subcode_check ((node), (
OMP_CLAUSE_LINEAR), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2464, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2464, __FUNCTION__)))
= t;
2465 }
2466 else
2467 {
2468 tree type
2469 = gfc_typenode_for_spec (&n->sym->ts);
2470 OMP_CLAUSE_LINEAR_STEP (node)(*(omp_clause_elt_check (((omp_clause_subcode_check ((node), (
OMP_CLAUSE_LINEAR), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2470, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2470, __FUNCTION__)))
2471 = fold_convert (type, last_step)fold_convert_loc (((location_t) 0), type, last_step);
2472 }
2473 }
2474 if (n->sym->attr.dimension || n->sym->attr.allocatable)
2475 OMP_CLAUSE_LINEAR_ARRAY (node)((omp_clause_subcode_check ((node), (OMP_CLAUSE_LINEAR), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2475, __FUNCTION__))->base.deprecated_flag)
= 1;
2476 omp_clauses = gfc_trans_add_clause (node, omp_clauses);
2477 }
2478 }
2479 }
2480 }
2481 break;
2482 case OMP_LIST_DEPEND:
2483 for (; n != NULL__null; n = n->next)
2484 {
2485 if (n->u.depend_op == OMP_DEPEND_SINK_FIRST)
2486 {
2487 tree vec = NULL_TREE(tree) __null;
2488 unsigned int i;
2489 for (i = 0; ; i++)
2490 {
2491 tree addend = integer_zero_nodeglobal_trees[TI_INTEGER_ZERO], t;
2492 bool neg = false;
2493 if (n->expr)
2494 {
2495 addend = gfc_conv_constant_to_tree (n->expr);
2496 if (TREE_CODE (addend)((enum tree_code) (addend)->base.code) == INTEGER_CST
2497 && tree_int_cst_sgn (addend) == -1)
2498 {
2499 neg = true;
2500 addend = const_unop (NEGATE_EXPR,
2501 TREE_TYPE (addend)((contains_struct_check ((addend), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2501, __FUNCTION__))->typed.type)
, addend);
2502 }
2503 }
2504 t = gfc_trans_omp_variable (n->sym, false);
2505 if (t != error_mark_nodeglobal_trees[TI_ERROR_MARK])
2506 {
2507 if (i < vec_safe_length (doacross_steps)
2508 && !integer_zerop (addend)
2509 && (*doacross_steps)[i])
2510 {
2511 tree step = (*doacross_steps)[i];
2512 addend = fold_convert (TREE_TYPE (step), addend)fold_convert_loc (((location_t) 0), ((contains_struct_check (
(step), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2512, __FUNCTION__))->typed.type), addend)
;
2513 addend = build2 (TRUNC_DIV_EXPR,
2514 TREE_TYPE (step)((contains_struct_check ((step), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2514, __FUNCTION__))->typed.type)
, addend, step);
2515 }
2516 vec = tree_cons (addend, t, vec);
2517 if (neg)
2518 OMP_CLAUSE_DEPEND_SINK_NEGATIVE (vec)(((tree_check ((vec), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2518, __FUNCTION__, (TREE_LIST))))->base.public_flag)
= 1;
2519 }
2520 if (n->next == NULL__null
2521 || n->next->u.depend_op != OMP_DEPEND_SINK)
2522 break;
2523 n = n->next;
2524 }
2525 if (vec == NULL_TREE(tree) __null)
2526 continue;
2527
2528 tree node = build_omp_clause (input_location,
2529 OMP_CLAUSE_DEPEND);
2530 OMP_CLAUSE_DEPEND_KIND (node)((omp_clause_subcode_check ((node), (OMP_CLAUSE_DEPEND), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2530, __FUNCTION__))->omp_clause.subcode.depend_kind)
= OMP_CLAUSE_DEPEND_SINK;
2531 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2531, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2531, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2531, __FUNCTION__)))
= nreverse (vec);
2532 omp_clauses = gfc_trans_add_clause (node, omp_clauses);
2533 continue;
2534 }
2535
2536 if (!n->sym->attr.referenced)
2537 continue;
2538
2539 tree node = build_omp_clause (input_location, OMP_CLAUSE_DEPEND);
2540 if (n->expr == NULL__null || n->expr->ref->u.ar.type == AR_FULL)
2541 {
2542 tree decl = gfc_trans_omp_variable (n->sym, false);
2543 if (gfc_omp_privatize_by_reference (decl))
2544 decl = build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
2545 if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2545, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2545, __FUNCTION__))->type_common.lang_flag_1)
)
2546 {
2547 decl = gfc_conv_descriptor_data_get (decl);
2548 decl = fold_convert (build_pointer_type (char_type_node),fold_convert_loc (((location_t) 0), build_pointer_type (integer_types
[itk_char]), decl)
2549 decl)fold_convert_loc (((location_t) 0), build_pointer_type (integer_types
[itk_char]), decl)
;
2550 decl = build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
2551 }
2552 else if (DECL_P (decl)(tree_code_type[(int) (((enum tree_code) (decl)->base.code
))] == tcc_declaration)
)
2553 TREE_ADDRESSABLE (decl)((decl)->base.addressable_flag) = 1;
2554 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2554, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2554, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2554, __FUNCTION__)))
= decl;
2555 }
2556 else
2557 {
2558 tree ptr;
2559 gfc_init_se (&se, NULL__null);
2560 if (n->expr->ref->u.ar.type == AR_ELEMENT)
2561 {
2562 gfc_conv_expr_reference (&se, n->expr);
2563 ptr = se.expr;
2564 }
2565 else
2566 {
2567 gfc_conv_expr_descriptor (&se, n->expr);
2568 ptr = gfc_conv_array_data (se.expr);
2569 }
2570 gfc_add_block_to_block (block, &se.pre);
2571 gfc_add_block_to_block (block, &se.post);
2572 ptr = fold_convert (build_pointer_type (char_type_node),fold_convert_loc (((location_t) 0), build_pointer_type (integer_types
[itk_char]), ptr)
2573 ptr)fold_convert_loc (((location_t) 0), build_pointer_type (integer_types
[itk_char]), ptr)
;
2574 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2574, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2574, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2574, __FUNCTION__)))
= build_fold_indirect_ref (ptr)build_fold_indirect_ref_loc (((location_t) 0), ptr);
2575 }
2576 switch (n->u.depend_op)
2577 {
2578 case OMP_DEPEND_IN:
2579 OMP_CLAUSE_DEPEND_KIND (node)((omp_clause_subcode_check ((node), (OMP_CLAUSE_DEPEND), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2579, __FUNCTION__))->omp_clause.subcode.depend_kind)
= OMP_CLAUSE_DEPEND_IN;
2580 break;
2581 case OMP_DEPEND_OUT:
2582 OMP_CLAUSE_DEPEND_KIND (node)((omp_clause_subcode_check ((node), (OMP_CLAUSE_DEPEND), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2582, __FUNCTION__))->omp_clause.subcode.depend_kind)
= OMP_CLAUSE_DEPEND_OUT;
2583 break;
2584 case OMP_DEPEND_INOUT:
2585 OMP_CLAUSE_DEPEND_KIND (node)((omp_clause_subcode_check ((node), (OMP_CLAUSE_DEPEND), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2585, __FUNCTION__))->omp_clause.subcode.depend_kind)
= OMP_CLAUSE_DEPEND_INOUT;
2586 break;
2587 default:
2588 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2588, __FUNCTION__))
;
2589 }
2590 omp_clauses = gfc_trans_add_clause (node, omp_clauses);
2591 }
2592 break;
2593 case OMP_LIST_MAP:
2594 for (; n != NULL__null; n = n->next)
2595 {
2596 if (!n->sym->attr.referenced)
2597 continue;
2598
2599 bool always_modifier = false;
2600 tree node = build_omp_clause (input_location, OMP_CLAUSE_MAP);
2601 tree node2 = NULL_TREE(tree) __null;
2602 tree node3 = NULL_TREE(tree) __null;
2603 tree node4 = NULL_TREE(tree) __null;
2604
2605 /* OpenMP: automatically map pointer targets with the pointer;
2606 hence, always update the descriptor/pointer itself. */
2607 if (!openacc
2608 && ((n->expr == NULL__null && n->sym->attr.pointer)
2609 || (n->expr && gfc_expr_attr (n->expr).pointer)))
2610 always_modifier = true;
2611
2612 switch (n->u.map_op)
2613 {
2614 case OMP_MAP_ALLOC:
2615 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_ALLOC)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2615, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_ALLOC))
;
2616 break;
2617 case OMP_MAP_IF_PRESENT:
2618 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_IF_PRESENT)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2618, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_IF_PRESENT))
;
2619 break;
2620 case OMP_MAP_ATTACH:
2621 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_ATTACH)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2621, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_ATTACH))
;
2622 break;
2623 case OMP_MAP_TO:
2624 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_TO)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2624, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_TO))
;
2625 break;
2626 case OMP_MAP_FROM:
2627 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_FROM)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2627, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_FROM))
;
2628 break;
2629 case OMP_MAP_TOFROM:
2630 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_TOFROM)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2630, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_TOFROM))
;
2631 break;
2632 case OMP_MAP_ALWAYS_TO:
2633 always_modifier = true;
2634 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_ALWAYS_TO)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2634, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_ALWAYS_TO))
;
2635 break;
2636 case OMP_MAP_ALWAYS_FROM:
2637 always_modifier = true;
2638 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_ALWAYS_FROM)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2638, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_ALWAYS_FROM))
;
2639 break;
2640 case OMP_MAP_ALWAYS_TOFROM:
2641 always_modifier = true;
2642 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_ALWAYS_TOFROM)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2642, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_ALWAYS_TOFROM))
;
2643 break;
2644 case OMP_MAP_RELEASE:
2645 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_RELEASE)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2645, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_RELEASE))
;
2646 break;
2647 case OMP_MAP_DELETE:
2648 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_DELETE)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2648, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_DELETE))
;
2649 break;
2650 case OMP_MAP_DETACH:
2651 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_DETACH)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2651, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_DETACH))
;
2652 break;
2653 case OMP_MAP_FORCE_ALLOC:
2654 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_FORCE_ALLOC)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2654, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_FORCE_ALLOC))
;
2655 break;
2656 case OMP_MAP_FORCE_TO:
2657 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_FORCE_TO)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2657, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_FORCE_TO))
;
2658 break;
2659 case OMP_MAP_FORCE_FROM:
2660 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_FORCE_FROM)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2660, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_FORCE_FROM))
;
2661 break;
2662 case OMP_MAP_FORCE_TOFROM:
2663 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_FORCE_TOFROM)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2663, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_FORCE_TOFROM))
;
2664 break;
2665 case OMP_MAP_FORCE_PRESENT:
2666 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_FORCE_PRESENT)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2666, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_FORCE_PRESENT))
;
2667 break;
2668 case OMP_MAP_FORCE_DEVICEPTR:
2669 OMP_CLAUSE_SET_MAP_KIND (node, GOMP_MAP_FORCE_DEVICEPTR)((omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2669, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_FORCE_DEVICEPTR))
;
2670 break;
2671 default:
2672 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2672, __FUNCTION__))
;
2673 }
2674
2675 tree decl = gfc_trans_omp_variable (n->sym, false);
2676 if (DECL_P (decl)(tree_code_type[(int) (((enum tree_code) (decl)->base.code
))] == tcc_declaration)
)
2677 TREE_ADDRESSABLE (decl)((decl)->base.addressable_flag) = 1;
2678 if (n->expr == NULL__null
2679 || (n->expr->ref->type == REF_ARRAY
2680 && n->expr->ref->u.ar.type == AR_FULL))
2681 {
2682 tree present = gfc_omp_check_optional_argument (decl, true);
2683 if (openacc && n->sym->ts.type == BT_CLASS)
2684 {
2685 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2685, __FUNCTION__))->typed.type)
;
2686 if (n->sym->attr.optional)
2687 sorry ("optional class parameter");
2688 if (POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || (
(enum tree_code) (type)->base.code) == REFERENCE_TYPE)
)
2689 {
2690 node4 = build_omp_clause (input_location,
2691 OMP_CLAUSE_MAP);
2692 OMP_CLAUSE_SET_MAP_KIND (node4, GOMP_MAP_POINTER)((omp_clause_subcode_check ((node4), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2692, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_POINTER))
;
2693 OMP_CLAUSE_DECL (node4)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node4), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2693, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2693, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2693, __FUNCTION__)))
= decl;
2694 OMP_CLAUSE_SIZE (node4)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node4), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2694, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2694, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2694, __FUNCTION__)))
= size_int (0)size_int_kind (0, stk_sizetype);
2695 decl = build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
2696 }
2697 tree ptr = gfc_class_data_get (decl);
2698 ptr = build_fold_indirect_ref (ptr)build_fold_indirect_ref_loc (((location_t) 0), ptr);
2699 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2699, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2699, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2699, __FUNCTION__)))
= ptr;
2700 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2700, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2700, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2700, __FUNCTION__)))
= gfc_class_vtab_size_get (decl);
2701 node2 = build_omp_clause (input_location, OMP_CLAUSE_MAP);
2702 OMP_CLAUSE_SET_MAP_KIND (node2, GOMP_MAP_TO_PSET)((omp_clause_subcode_check ((node2), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2702, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_TO_PSET))
;
2703 OMP_CLAUSE_DECL (node2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2703, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2703, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2703, __FUNCTION__)))
= decl;
2704 OMP_CLAUSE_SIZE (node2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2704, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2704, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2704, __FUNCTION__)))
= TYPE_SIZE_UNIT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2704, __FUNCTION__))->type_common.size_unit)
;
2705 node3 = build_omp_clause (input_location, OMP_CLAUSE_MAP);
2706 OMP_CLAUSE_SET_MAP_KIND (node3, GOMP_MAP_ATTACH_DETACH)((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2706, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_ATTACH_DETACH))
;
2707 OMP_CLAUSE_DECL (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2707, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2707, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2707, __FUNCTION__)))
= gfc_class_data_get (decl);
2708 OMP_CLAUSE_SIZE (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2708, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2708, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2708, __FUNCTION__)))
= size_int (0)size_int_kind (0, stk_sizetype);
2709 goto finalize_map_clause;
2710 }
2711 else if (POINTER_TYPE_P (TREE_TYPE (decl))(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2711, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2711, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)
2712 && (gfc_omp_privatize_by_reference (decl)
2713 || GFC_DECL_GET_SCALAR_POINTER (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2713, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2713, __FUNCTION__))->decl_common.lang_specific)->scalar_pointer
) : 0)
2714 || GFC_DECL_GET_SCALAR_ALLOCATABLE (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2714, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2714, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
2715 || GFC_DECL_CRAY_POINTEE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2715, __FUNCTION__))->decl_common.lang_flag_4)
2716 || GFC_DESCRIPTOR_TYPE_P((tree_class_check ((((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2717, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2717, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2717, __FUNCTION__))->type_common.lang_flag_1)
2717 (TREE_TYPE (TREE_TYPE (decl)))((tree_class_check ((((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2717, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2717, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2717, __FUNCTION__))->type_common.lang_flag_1)
2718 || n->sym->ts.type == BT_DERIVED))
2719 {
2720 tree orig_decl = decl;
2721
2722 /* For nonallocatable, nonpointer arrays, a temporary
2723 variable is generated, but this one is only defined if
2724 the variable is present; hence, we now set it to NULL
2725 to avoid accessing undefined variables. We cannot use
2726 a temporary variable here as otherwise the replacement
2727 of the variables in omp-low.c will not work. */
2728 if (present && GFC_ARRAY_TYPE_P (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2728, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2728, __FUNCTION__))->type_common.lang_flag_2)
)
2729 {
2730 tree tmp = fold_build2_loc (input_location,
2731 MODIFY_EXPR,
2732 void_type_nodeglobal_trees[TI_VOID_TYPE], decl,
2733 null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
2734 tree cond = fold_build1_loc (input_location,
2735 TRUTH_NOT_EXPR,
2736 boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE],
2737 present);
2738 gfc_add_expr_to_block (block,
2739 build3_loc (input_location,
2740 COND_EXPR,
2741 void_type_nodeglobal_trees[TI_VOID_TYPE],
2742 cond, tmp,
2743 NULL_TREE(tree) __null));
2744 }
2745 node4 = build_omp_clause (input_location,
2746 OMP_CLAUSE_MAP);
2747 OMP_CLAUSE_SET_MAP_KIND (node4, GOMP_MAP_POINTER)((omp_clause_subcode_check ((node4), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2747, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_POINTER))
;
2748 OMP_CLAUSE_DECL (node4)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node4), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2748, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2748, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2748, __FUNCTION__)))
= decl;
2749 OMP_CLAUSE_SIZE (node4)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node4), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2749, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2749, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2749, __FUNCTION__)))
= size_int (0)size_int_kind (0, stk_sizetype);
2750 decl = build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
2751 if ((TREE_CODE (TREE_TYPE (orig_decl))((enum tree_code) (((contains_struct_check ((orig_decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2751, __FUNCTION__))->typed.type))->base.code)
== REFERENCE_TYPE
2752 || gfc_omp_is_optional_argument (orig_decl))
2753 && (GFC_DECL_GET_SCALAR_POINTER (orig_decl)(((contains_struct_check ((orig_decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2753, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((orig_decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2753, __FUNCTION__))->decl_common.lang_specific)->scalar_pointer
) : 0)
2754 || GFC_DECL_GET_SCALAR_ALLOCATABLE (orig_decl)(((contains_struct_check ((orig_decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2754, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((orig_decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2754, __FUNCTION__))->decl_common.lang_specific)->scalar_allocatable
) : 0)
))
2755 {
2756 node3 = build_omp_clause (input_location,
2757 OMP_CLAUSE_MAP);
2758 OMP_CLAUSE_SET_MAP_KIND (node3, GOMP_MAP_POINTER)((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2758, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_POINTER))
;
2759 OMP_CLAUSE_DECL (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2759, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2759, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2759, __FUNCTION__)))
= decl;
2760 OMP_CLAUSE_SIZE (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2760, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2760, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2760, __FUNCTION__)))
= size_int (0)size_int_kind (0, stk_sizetype);
2761 decl = build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
2762 }
2763 }
2764 if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2764, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2764, __FUNCTION__))->type_common.lang_flag_1)
)
2765 {
2766 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2766, __FUNCTION__))->typed.type)
;
2767 tree ptr = gfc_conv_descriptor_data_get (decl);
2768 if (present)
2769 ptr = gfc_build_cond_assign_expr (block, present, ptr,
2770 null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
2771 ptr = fold_convert (build_pointer_type (char_type_node),fold_convert_loc (((location_t) 0), build_pointer_type (integer_types
[itk_char]), ptr)
2772 ptr)fold_convert_loc (((location_t) 0), build_pointer_type (integer_types
[itk_char]), ptr)
;
2773 ptr = build_fold_indirect_ref (ptr)build_fold_indirect_ref_loc (((location_t) 0), ptr);
2774 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2774, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2774, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2774, __FUNCTION__)))
= ptr;
2775 node2 = build_omp_clause (input_location,
2776 OMP_CLAUSE_MAP);
2777 OMP_CLAUSE_SET_MAP_KIND (node2, GOMP_MAP_TO_PSET)((omp_clause_subcode_check ((node2), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2777, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_TO_PSET))
;
2778 OMP_CLAUSE_DECL (node2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2778, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2778, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2778, __FUNCTION__)))
= decl;
2779 OMP_CLAUSE_SIZE (node2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2779, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2779, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2779, __FUNCTION__)))
= TYPE_SIZE_UNIT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2779, __FUNCTION__))->type_common.size_unit)
;
2780 node3 = build_omp_clause (input_location,
2781 OMP_CLAUSE_MAP);
2782 if (present)
2783 {
2784 ptr = gfc_conv_descriptor_data_get (decl);
2785 ptr = gfc_build_addr_expr (NULL__null, ptr);
2786 ptr = gfc_build_cond_assign_expr (block, present, ptr,
2787 null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
2788 ptr = build_fold_indirect_ref (ptr)build_fold_indirect_ref_loc (((location_t) 0), ptr);
2789 OMP_CLAUSE_DECL (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2789, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2789, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2789, __FUNCTION__)))
= ptr;
2790 }
2791 else
2792 OMP_CLAUSE_DECL (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2792, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2792, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2792, __FUNCTION__)))
2793 = gfc_conv_descriptor_data_get (decl);
2794 OMP_CLAUSE_SIZE (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2794, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2794, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2794, __FUNCTION__)))
= size_int (0)size_int_kind (0, stk_sizetype);
2795 if (n->u.map_op == OMP_MAP_ATTACH)
2796 {
2797 /* Standalone attach clauses used with arrays with
2798 descriptors must copy the descriptor to the target,
2799 else they won't have anything to perform the
2800 attachment onto (see OpenACC 2.6, "2.6.3. Data
2801 Structures with Pointers"). */
2802 OMP_CLAUSE_SET_MAP_KIND (node3, GOMP_MAP_ATTACH)((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2802, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_ATTACH))
;
2803 /* We don't want to map PTR at all in this case, so
2804 delete its node and shuffle the others down. */
2805 node = node2;
2806 node2 = node3;
2807 node3 = NULL__null;
2808 goto finalize_map_clause;
2809 }
2810 else if (n->u.map_op == OMP_MAP_DETACH)
2811 {
2812 OMP_CLAUSE_SET_MAP_KIND (node3, GOMP_MAP_DETACH)((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2812, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_DETACH))
;
2813 /* Similarly to above, we don't want to unmap PTR
2814 here. */
2815 node = node2;
2816 node2 = node3;
2817 node3 = NULL__null;
2818 goto finalize_map_clause;
2819 }
2820 else
2821 OMP_CLAUSE_SET_MAP_KIND (node3,((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2824, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (always_modifier ? GOMP_MAP_ALWAYS_POINTER : GOMP_MAP_POINTER
))
2822 always_modifier((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2824, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (always_modifier ? GOMP_MAP_ALWAYS_POINTER : GOMP_MAP_POINTER
))
2823 ? GOMP_MAP_ALWAYS_POINTER((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2824, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (always_modifier ? GOMP_MAP_ALWAYS_POINTER : GOMP_MAP_POINTER
))
2824 : GOMP_MAP_POINTER)((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2824, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (always_modifier ? GOMP_MAP_ALWAYS_POINTER : GOMP_MAP_POINTER
))
;
2825
2826 /* We have to check for n->sym->attr.dimension because
2827 of scalar coarrays. */
2828 if (n->sym->attr.pointer && n->sym->attr.dimension)
2829 {
2830 stmtblock_t cond_block;
2831 tree size
2832 = gfc_create_var (gfc_array_index_type, NULL__null);
2833 tree tem, then_b, else_b, zero, cond;
2834
2835 gfc_init_block (&cond_block);
2836 tem
2837 = gfc_full_array_size (&cond_block, decl,
2838 GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2838, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
);
2839 gfc_add_modify (&cond_block, size, tem);
2840 then_b = gfc_finish_block (&cond_block);
2841 gfc_init_block (&cond_block);
2842 zero = build_int_cst (gfc_array_index_type, 0);
2843 gfc_add_modify (&cond_block, size, zero);
2844 else_b = gfc_finish_block (&cond_block);
2845 tem = gfc_conv_descriptor_data_get (decl);
2846 tem = fold_convert (pvoid_type_node, tem)fold_convert_loc (((location_t) 0), pvoid_type_node, tem);
2847 cond = fold_build2_loc (input_location, NE_EXPR,
2848 boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE],
2849 tem, null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
2850 if (present)
2851 cond = fold_build2_loc (input_location,
2852 TRUTH_ANDIF_EXPR,
2853 boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE],
2854 present, cond);
2855 gfc_add_expr_to_block (block,
2856 build3_loc (input_location,
2857 COND_EXPR,
2858 void_type_nodeglobal_trees[TI_VOID_TYPE],
2859 cond, then_b,
2860 else_b));
2861 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2861, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2861, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2861, __FUNCTION__)))
= size;
2862 }
2863 else if (n->sym->attr.dimension)
2864 {
2865 stmtblock_t cond_block;
2866 gfc_init_block (&cond_block);
2867 tree size = gfc_full_array_size (&cond_block, decl,
2868 GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2868, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
);
2869 if (present)
2870 {
2871 tree var = gfc_create_var (gfc_array_index_type,
2872 NULL__null);
2873 gfc_add_modify (&cond_block, var, size);
2874 tree cond_body = gfc_finish_block (&cond_block);
2875 tree cond = build3_loc (input_location, COND_EXPR,
2876 void_type_nodeglobal_trees[TI_VOID_TYPE], present,
2877 cond_body, NULL_TREE(tree) __null);
2878 gfc_add_expr_to_block (block, cond);
2879 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2879, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2879, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2879, __FUNCTION__)))
= var;
2880 }
2881 else
2882 {
2883 gfc_add_block_to_block (block, &cond_block);
2884 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2884, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2884, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2884, __FUNCTION__)))
= size;
2885 }
2886 }
2887 if (n->sym->attr.dimension)
2888 {
2889 tree elemsz
2890 = TYPE_SIZE_UNIT (gfc_get_element_type (type))((tree_class_check ((gfc_get_element_type (type)), (tcc_type)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2890, __FUNCTION__))->type_common.size_unit)
;
2891 elemsz = fold_convert (gfc_array_index_type, elemsz)fold_convert_loc (((location_t) 0), gfc_array_index_type, elemsz
)
;
2892 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2892, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2892, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2892, __FUNCTION__)))
2893 = 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2894, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2894, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2894, __FUNCTION__))), elemsz )
2894 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2894, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2894, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2894, __FUNCTION__))), elemsz )
;
2895 }
2896 }
2897 else if (present
2898 && TREE_CODE (decl)((enum tree_code) (decl)->base.code) == INDIRECT_REF
2899 && (TREE_CODE (TREE_OPERAND (decl, 0))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((decl), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2899, __FUNCTION__))))))->base.code)
2900 == INDIRECT_REF))
2901 {
2902 /* A single indirectref is handled by the middle end. */
2903 gcc_assert (!POINTER_TYPE_P (TREE_TYPE (decl)))((void)(!(!(((enum tree_code) (((contains_struct_check ((decl
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2903, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2903, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2903, __FUNCTION__), 0 : 0))
;
2904 decl = TREE_OPERAND (decl, 0)(*((const_cast<tree*> (tree_operand_check ((decl), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2904, __FUNCTION__)))))
;
2905 decl = gfc_build_cond_assign_expr (block, present, decl,
2906 null_pointer_nodeglobal_trees[TI_NULL_POINTER]);
2907 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2907, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2907, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2907, __FUNCTION__)))
= build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
2908 }
2909 else
2910 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2910, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2910, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2910, __FUNCTION__)))
= decl;
2911 }
2912 else if (n->expr
2913 && n->expr->expr_type == EXPR_VARIABLE
2914 && n->expr->ref->type == REF_COMPONENT)
2915 {
2916 gfc_ref *lastcomp;
2917
2918 for (gfc_ref *ref = n->expr->ref; ref; ref = ref->next)
2919 if (ref->type == REF_COMPONENT)
2920 lastcomp = ref;
2921
2922 symbol_attribute sym_attr;
2923
2924 if (lastcomp->u.c.component->ts.type == BT_CLASS)
2925 sym_attr = CLASS_DATA (lastcomp->u.c.component)lastcomp->u.c.component->ts.u.derived->components->attr;
2926 else
2927 sym_attr = lastcomp->u.c.component->attr;
2928
2929 gfc_init_se (&se, NULL__null);
2930
2931 if (!sym_attr.dimension
2932 && lastcomp->u.c.component->ts.type != BT_CLASS
2933 && lastcomp->u.c.component->ts.type != BT_DERIVED)
2934 {
2935 /* Last component is a scalar. */
2936 gfc_conv_expr (&se, n->expr);
2937 gfc_add_block_to_block (block, &se.pre);
2938 /* For BT_CHARACTER a pointer is returned. */
2939 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2939, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2939, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2939, __FUNCTION__)))
2940 = POINTER_TYPE_P (TREE_TYPE (se.expr))(((enum tree_code) (((contains_struct_check ((se.expr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2940, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((se.expr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2940, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)
2941 ? build_fold_indirect_ref (se.expr)build_fold_indirect_ref_loc (((location_t) 0), se.expr) : se.expr;
2942 gfc_add_block_to_block (block, &se.post);
2943 if (sym_attr.pointer || sym_attr.allocatable)
2944 {
2945 node2 = build_omp_clause (input_location,
2946 OMP_CLAUSE_MAP);
2947 OMP_CLAUSE_SET_MAP_KIND (node2,((omp_clause_subcode_check ((node2), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2950, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (openacc ? GOMP_MAP_ATTACH_DETACH : GOMP_MAP_ALWAYS_POINTER
))
2948 openacc((omp_clause_subcode_check ((node2), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2950, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (openacc ? GOMP_MAP_ATTACH_DETACH : GOMP_MAP_ALWAYS_POINTER
))
2949 ? GOMP_MAP_ATTACH_DETACH((omp_clause_subcode_check ((node2), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2950, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (openacc ? GOMP_MAP_ATTACH_DETACH : GOMP_MAP_ALWAYS_POINTER
))
2950 : GOMP_MAP_ALWAYS_POINTER)((omp_clause_subcode_check ((node2), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2950, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (openacc ? GOMP_MAP_ATTACH_DETACH : GOMP_MAP_ALWAYS_POINTER
))
;
2951 OMP_CLAUSE_DECL (node2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2951, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2951, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2951, __FUNCTION__)))
2952 = POINTER_TYPE_P (TREE_TYPE (se.expr))(((enum tree_code) (((contains_struct_check ((se.expr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2952, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
|| ((enum tree_code) (((contains_struct_check ((se.expr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2952, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)
2953 ? se.expr : gfc_build_addr_expr (NULL__null, se.expr);
2954 OMP_CLAUSE_SIZE (node2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2954, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2954, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2954, __FUNCTION__)))
= size_int (0)size_int_kind (0, stk_sizetype);
2955 if (!openacc
2956 && n->expr->ts.type == BT_CHARACTER
2957 && n->expr->ts.deferred)
2958 {
2959 gcc_assert (se.string_length)((void)(!(se.string_length) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2959, __FUNCTION__), 0 : 0))
;
2960 tree tmp = gfc_get_char_type (n->expr->ts.kind);
2961 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2961, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2961, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2961, __FUNCTION__)))
2962 = 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2965, __FUNCTION__))->type_common.size_unit) )
2963 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2965, __FUNCTION__))->type_common.size_unit) )
2964 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2965, __FUNCTION__))->type_common.size_unit) )
2965 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2965, __FUNCTION__))->type_common.size_unit) )
;
2966 node3 = build_omp_clause (input_location,
2967 OMP_CLAUSE_MAP);
2968 OMP_CLAUSE_SET_MAP_KIND (node3, GOMP_MAP_TO)((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2968, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_TO))
;
2969 OMP_CLAUSE_DECL (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2969, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2969, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2969, __FUNCTION__)))
= se.string_length;
2970 OMP_CLAUSE_SIZE (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2970, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2970, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2970, __FUNCTION__)))
2971 = TYPE_SIZE_UNIT (gfc_charlen_type_node)((tree_class_check ((gfc_charlen_type_node), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 2971, __FUNCTION__))->type_common.size_unit)
;
2972 }
2973 }
2974 goto finalize_map_clause;
2975 }
2976
2977 se.expr = gfc_maybe_dereference_var (n->sym, decl);
2978
2979 for (gfc_ref *ref = n->expr->ref;
2980 ref && ref != lastcomp->next;
2981 ref = ref->next)
2982 {
2983 if (ref->type == REF_COMPONENT)
2984 {
2985 if (ref->u.c.sym->attr.extension)
2986 conv_parent_component_references (&se, ref);
2987
2988 gfc_conv_component_ref (&se, ref);
2989 }
2990 else
2991 sorry ("unhandled derived-type component");
2992 }
2993
2994 tree inner = se.expr;
2995
2996 /* Last component is a derived type or class pointer. */
2997 if (lastcomp->u.c.component->ts.type == BT_DERIVED
2998 || lastcomp->u.c.component->ts.type == BT_CLASS)
2999 {
3000 if (sym_attr.pointer || (openacc && sym_attr.allocatable))
3001 {
3002 tree data, size;
3003
3004 if (lastcomp->u.c.component->ts.type == BT_CLASS)
3005 {
3006 data = gfc_class_data_get (inner);
3007 size = gfc_class_vtab_size_get (inner);
3008 }
3009 else /* BT_DERIVED. */
3010 {
3011 data = inner;
3012 size = TYPE_SIZE_UNIT (TREE_TYPE (inner))((tree_class_check ((((contains_struct_check ((inner), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3012, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3012, __FUNCTION__))->type_common.size_unit)
;
3013 }
3014
3015 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3015, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3015, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3015, __FUNCTION__)))
3016 = build_fold_indirect_ref (data)build_fold_indirect_ref_loc (((location_t) 0), data);
3017 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3017, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3017, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3017, __FUNCTION__)))
= size;
3018 node2 = build_omp_clause (input_location,
3019 OMP_CLAUSE_MAP);
3020 OMP_CLAUSE_SET_MAP_KIND (node2,((omp_clause_subcode_check ((node2), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3023, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (openacc ? GOMP_MAP_ATTACH_DETACH : GOMP_MAP_ALWAYS_POINTER
))
3021 openacc((omp_clause_subcode_check ((node2), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3023, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (openacc ? GOMP_MAP_ATTACH_DETACH : GOMP_MAP_ALWAYS_POINTER
))
3022 ? GOMP_MAP_ATTACH_DETACH((omp_clause_subcode_check ((node2), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3023, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (openacc ? GOMP_MAP_ATTACH_DETACH : GOMP_MAP_ALWAYS_POINTER
))
3023 : GOMP_MAP_ALWAYS_POINTER)((omp_clause_subcode_check ((node2), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3023, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (openacc ? GOMP_MAP_ATTACH_DETACH : GOMP_MAP_ALWAYS_POINTER
))
;
3024 OMP_CLAUSE_DECL (node2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3024, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3024, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3024, __FUNCTION__)))
= data;
3025 OMP_CLAUSE_SIZE (node2)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3025, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3025, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3025, __FUNCTION__)))
= size_int (0)size_int_kind (0, stk_sizetype);
3026 }
3027 else
3028 {
3029 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3029, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3029, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3029, __FUNCTION__)))
= inner;
3030 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3030, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3030, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3030, __FUNCTION__)))
3031 = TYPE_SIZE_UNIT (TREE_TYPE (inner))((tree_class_check ((((contains_struct_check ((inner), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3031, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3031, __FUNCTION__))->type_common.size_unit)
;
3032 }
3033 }
3034 else if (lastcomp->next
3035 && lastcomp->next->type == REF_ARRAY
3036 && lastcomp->next->u.ar.type == AR_FULL)
3037 {
3038 /* Just pass the (auto-dereferenced) decl through for
3039 bare attach and detach clauses. */
3040 if (n->u.map_op == OMP_MAP_ATTACH
3041 || n->u.map_op == OMP_MAP_DETACH)
3042 {
3043 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3043, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3043, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3043, __FUNCTION__)))
= inner;
3044 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3044, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3044, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3044, __FUNCTION__)))
= size_zero_nodeglobal_trees[TI_SIZE_ZERO];
3045 goto finalize_map_clause;
3046 }
3047
3048 if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (inner))((tree_class_check ((((contains_struct_check ((inner), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3048, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3048, __FUNCTION__))->type_common.lang_flag_1)
)
3049 {
3050 gomp_map_kind map_kind;
3051 tree desc_node;
3052 tree type = TREE_TYPE (inner)((contains_struct_check ((inner), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3052, __FUNCTION__))->typed.type)
;
3053 tree ptr = gfc_conv_descriptor_data_get (inner);
3054 ptr = build_fold_indirect_ref (ptr)build_fold_indirect_ref_loc (((location_t) 0), ptr);
3055 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3055, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3055, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3055, __FUNCTION__)))
= ptr;
3056 int rank = GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3056, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
;
3057 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3057, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3057, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3057, __FUNCTION__)))
3058 = gfc_full_array_size (block, inner, rank);
3059 tree elemsz
3060 = TYPE_SIZE_UNIT (gfc_get_element_type (type))((tree_class_check ((gfc_get_element_type (type)), (tcc_type)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3060, __FUNCTION__))->type_common.size_unit)
;
3061 if (GOMP_MAP_COPY_TO_P (OMP_CLAUSE_MAP_KIND (node))(!((((enum gomp_map_kind) (omp_clause_subcode_check ((node), (
OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3061, __FUNCTION__))->omp_clause.subcode.map_kind)) &
((1 << 3) | (1 << 2))) && ((((enum gomp_map_kind
) (omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3061, __FUNCTION__))->omp_clause.subcode.map_kind)) &
(1 << 0)))
)
3062 map_kind = GOMP_MAP_TO;
3063 else if (n->u.map_op == OMP_MAP_RELEASE
3064 || n->u.map_op == OMP_MAP_DELETE)
3065 map_kind = OMP_CLAUSE_MAP_KIND (node)((enum gomp_map_kind) (omp_clause_subcode_check ((node), (OMP_CLAUSE_MAP
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3065, __FUNCTION__))->omp_clause.subcode.map_kind)
;
3066 else
3067 map_kind = GOMP_MAP_ALLOC;
3068 if (!openacc
3069 && n->expr->ts.type == BT_CHARACTER
3070 && n->expr->ts.deferred)
3071 {
3072 gcc_assert (se.string_length)((void)(!(se.string_length) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3072, __FUNCTION__), 0 : 0))
;
3073 tree len = fold_convert (size_type_node,fold_convert_loc (((location_t) 0), global_trees[TI_SIZE_TYPE
], se.string_length)
3074 se.string_length)fold_convert_loc (((location_t) 0), global_trees[TI_SIZE_TYPE
], se.string_length)
;
3075 elemsz = gfc_get_char_type (n->expr->ts.kind);
3076 elemsz = TYPE_SIZE_UNIT (elemsz)((tree_class_check ((elemsz), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3076, __FUNCTION__))->type_common.size_unit)
;
3077 elemsz = fold_build2 (MULT_EXPR, size_type_node,fold_build2_loc (((location_t) 0), MULT_EXPR, global_trees[TI_SIZE_TYPE
], len, elemsz )
3078 len, elemsz)fold_build2_loc (((location_t) 0), MULT_EXPR, global_trees[TI_SIZE_TYPE
], len, elemsz )
;
3079 node4 = build_omp_clause (input_location,
3080 OMP_CLAUSE_MAP);
3081 OMP_CLAUSE_SET_MAP_KIND (node4, map_kind)((omp_clause_subcode_check ((node4), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3081, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (map_kind))
;
3082 OMP_CLAUSE_DECL (node4)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node4), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3082, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3082, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3082, __FUNCTION__)))
= se.string_length;
3083 OMP_CLAUSE_SIZE (node4)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node4), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3083, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3083, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3083, __FUNCTION__)))
3084 = TYPE_SIZE_UNIT (gfc_charlen_type_node)((tree_class_check ((gfc_charlen_type_node), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3084, __FUNCTION__))->type_common.size_unit)
;
3085 }
3086 elemsz = fold_convert (gfc_array_index_type, elemsz)fold_convert_loc (((location_t) 0), gfc_array_index_type, elemsz
)
;
3087 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3087, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3087, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3087, __FUNCTION__)))
3088 = 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3089, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3089, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3089, __FUNCTION__))), elemsz )
3089 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3089, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3089, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3089, __FUNCTION__))), elemsz )
;
3090 desc_node = build_omp_clause (input_location,
3091 OMP_CLAUSE_MAP);
3092 if (openacc)
3093 OMP_CLAUSE_SET_MAP_KIND (desc_node,((omp_clause_subcode_check ((desc_node), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3094, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_TO_PSET))
3094 GOMP_MAP_TO_PSET)((omp_clause_subcode_check ((desc_node), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3094, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (GOMP_MAP_TO_PSET))
;
3095 else
3096 OMP_CLAUSE_SET_MAP_KIND (desc_node, map_kind)((omp_clause_subcode_check ((desc_node), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3096, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (map_kind))
;
3097 OMP_CLAUSE_DECL (desc_node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((desc_node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3097, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3097, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3097, __FUNCTION__)))
= inner;
3098 OMP_CLAUSE_SIZE (desc_node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((desc_node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3098, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3098, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3098, __FUNCTION__)))
= TYPE_SIZE_UNIT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3098, __FUNCTION__))->type_common.size_unit)
;
3099 if (openacc)
3100 node2 = desc_node;
3101 else
3102 {
3103 node2 = node;
3104 node = desc_node; /* Put first. */
3105 }
3106 node3 = build_omp_clause (input_location,
3107 OMP_CLAUSE_MAP);
3108 OMP_CLAUSE_SET_MAP_KIND (node3,((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3111, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (openacc ? GOMP_MAP_ATTACH_DETACH : GOMP_MAP_ALWAYS_POINTER
))
3109 openacc((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3111, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (openacc ? GOMP_MAP_ATTACH_DETACH : GOMP_MAP_ALWAYS_POINTER
))
3110 ? GOMP_MAP_ATTACH_DETACH((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3111, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (openacc ? GOMP_MAP_ATTACH_DETACH : GOMP_MAP_ALWAYS_POINTER
))
3111 : GOMP_MAP_ALWAYS_POINTER)((omp_clause_subcode_check ((node3), (OMP_CLAUSE_MAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3111, __FUNCTION__))->omp_clause.subcode.map_kind = (unsigned
int) (openacc ? GOMP_MAP_ATTACH_DETACH : GOMP_MAP_ALWAYS_POINTER
))
;
3112 OMP_CLAUSE_DECL (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3112, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3112, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3112, __FUNCTION__)))
3113 = gfc_conv_descriptor_data_get (inner);
3114 /* Similar to gfc_trans_omp_array_section (details
3115 there), we add/keep the cast for OpenMP to prevent
3116 that an 'alloc:' gets added for node3 ('desc.data')
3117 as that is part of the whole descriptor (node3).
3118 TODO: Remove once the ME handles this properly. */
3119 if (!openacc)
3120 OMP_CLAUSE_DECL (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3120, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3120, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3120, __FUNCTION__)))
3121 = 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),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3121, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3121, __FUNCTION__))->typed.type), (*(omp_clause_elt_check
(((omp_clause_range_check (((tree_check ((node3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3122, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3122, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3122, __FUNCTION__))))
3122 OMP_CLAUSE_DECL (node3))fold_convert_loc (((location_t) 0), ((contains_struct_check (
((*((const_cast<tree*> (tree_operand_check ((ptr), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3121, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3121, __FUNCTION__))->typed.type), (*(omp_clause_elt_check
(((omp_clause_range_check (((tree_check ((node3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3122, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3122, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3122, __FUNCTION__))))
;
3123 else
3124 STRIP_NOPS (OMP_CLAUSE_DECL (node3))((*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3124, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3124, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3124, __FUNCTION__)))) = tree_strip_nop_conversions ((const_cast
<union tree_node *> ((((*(omp_clause_elt_check (((omp_clause_range_check
(((tree_check ((node3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3124, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3124, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3124, __FUNCTION__))))))))
;
3125 OMP_CLAUSE_SIZE (node3)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3125, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3125, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3125, __FUNCTION__)))
= size_int (0)size_int_kind (0, stk_sizetype);
3126 }
3127 else
3128 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3128, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3128, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3128, __FUNCTION__)))
= inner;
3129 }
3130 else /* An array element or section. */
3131 {
3132 bool element
3133 = (lastcomp->next
3134 && lastcomp->next->type == REF_ARRAY
3135 && lastcomp->next->u.ar.type == AR_ELEMENT);
3136
3137 gomp_map_kind kind = (openacc ? GOMP_MAP_ATTACH_DETACH
3138 : GOMP_MAP_ALWAYS_POINTER);
3139 gfc_trans_omp_array_section (block, n, inner, element,
3140 kind, node, node2, node3,
3141 node4);
3142 }
3143 }
3144 else /* An array element or array section. */
3145 {
3146 bool element = n->expr->ref->u.ar.type == AR_ELEMENT;
3147 gfc_trans_omp_array_section (block, n, decl, element,
3148 GOMP_MAP_POINTER, node, node2,
3149 node3, node4);
3150 }
3151
3152 finalize_map_clause:
3153
3154 omp_clauses = gfc_trans_add_clause (node, omp_clauses);
3155 if (node2)
3156 omp_clauses = gfc_trans_add_clause (node2, omp_clauses);
3157 if (node3)
3158 omp_clauses = gfc_trans_add_clause (node3, omp_clauses);
3159 if (node4)
3160 omp_clauses = gfc_trans_add_clause (node4, omp_clauses);
3161 }
3162 break;
3163 case OMP_LIST_TO:
3164 case OMP_LIST_FROM:
3165 case OMP_LIST_CACHE:
3166 for (; n != NULL__null; n = n->next)
3167 {
3168 if (!n->sym->attr.referenced)
3169 continue;
3170
3171 switch (list)
3172 {
3173 case OMP_LIST_TO:
3174 clause_code = OMP_CLAUSE_TO;
3175 break;
3176 case OMP_LIST_FROM:
3177 clause_code = OMP_CLAUSE_FROM;
3178 break;
3179 case OMP_LIST_CACHE:
3180 clause_code = OMP_CLAUSE__CACHE_;
3181 break;
3182 default:
3183 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3183, __FUNCTION__))
;
3184 }
3185 tree node = build_omp_clause (input_location, clause_code);
3186 if (n->expr == NULL__null || n->expr->ref->u.ar.type == AR_FULL)
3187 {
3188 tree decl = gfc_trans_omp_variable (n->sym, false);
3189 if (gfc_omp_privatize_by_reference (decl))
3190 {
3191 if (gfc_omp_is_allocatable_or_ptr (decl))
3192 decl = build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
3193 decl = build_fold_indirect_ref (decl)build_fold_indirect_ref_loc (((location_t) 0), decl);
3194 }
3195 else if (DECL_P (decl)(tree_code_type[(int) (((enum tree_code) (decl)->base.code
))] == tcc_declaration)
)
3196 TREE_ADDRESSABLE (decl)((decl)->base.addressable_flag) = 1;
3197 if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3197, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3197, __FUNCTION__))->type_common.lang_flag_1)
)
3198 {
3199 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3199, __FUNCTION__))->typed.type)
;
3200 tree ptr = gfc_conv_descriptor_data_get (decl);
3201 ptr = fold_convert (build_pointer_type (char_type_node),fold_convert_loc (((location_t) 0), build_pointer_type (integer_types
[itk_char]), ptr)
3202 ptr)fold_convert_loc (((location_t) 0), build_pointer_type (integer_types
[itk_char]), ptr)
;
3203 ptr = build_fold_indirect_ref (ptr)build_fold_indirect_ref_loc (((location_t) 0), ptr);
3204 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3204, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3204, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3204, __FUNCTION__)))
= ptr;
3205 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3205, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3205, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3205, __FUNCTION__)))
3206 = gfc_full_array_size (block, decl,
3207 GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3207, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
);
3208 tree elemsz
3209 = TYPE_SIZE_UNIT (gfc_get_element_type (type))((tree_class_check ((gfc_get_element_type (type)), (tcc_type)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3209, __FUNCTION__))->type_common.size_unit)
;
3210 elemsz = fold_convert (gfc_array_index_type, elemsz)fold_convert_loc (((location_t) 0), gfc_array_index_type, elemsz
)
;
3211 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3211, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3211, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3211, __FUNCTION__)))
3212 = 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3213, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3213, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3213, __FUNCTION__))), elemsz )
3213 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3213, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3213, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3213, __FUNCTION__))), elemsz )
;
3214 }
3215 else
3216 {
3217 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3217, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3217, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3217, __FUNCTION__)))
= decl;
3218 if (gfc_omp_is_allocatable_or_ptr (decl))
3219 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3219, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3219, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3219, __FUNCTION__)))
3220 = TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (decl)))((tree_class_check ((((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3220, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3220, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3220, __FUNCTION__))->type_common.size_unit)
;
3221 }
3222 }
3223 else
3224 {
3225 tree ptr;
3226 gfc_init_se (&se, NULL__null);
3227 if (n->expr->ref->u.ar.type == AR_ELEMENT)
3228 {
3229 gfc_conv_expr_reference (&se, n->expr);
3230 ptr = se.expr;
3231 gfc_add_block_to_block (block, &se.pre);
3232 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3232, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3232, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3232, __FUNCTION__)))
3233 = TYPE_SIZE_UNIT (TREE_TYPE (ptr))((tree_class_check ((((contains_struct_check ((ptr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3233, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3233, __FUNCTION__))->type_common.size_unit)
;
3234 }
3235 else
3236 {
3237 gfc_conv_expr_descriptor (&se, n->expr);
3238 ptr = gfc_conv_array_data (se.expr);
3239 tree type = TREE_TYPE (se.expr)((contains_struct_check ((se.expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3239, __FUNCTION__))->typed.type)
;
3240 gfc_add_block_to_block (block, &se.pre);
3241 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3241, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3241, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3241, __FUNCTION__)))
3242 = gfc_full_array_size (block, se.expr,
3243 GFC_TYPE_ARRAY_RANK (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3243, __FUNCTION__))->type_with_lang_specific.lang_specific
)->rank)
);
3244 tree elemsz
3245 = TYPE_SIZE_UNIT (gfc_get_element_type (type))((tree_class_check ((gfc_get_element_type (type)), (tcc_type)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3245, __FUNCTION__))->type_common.size_unit)
;
3246 elemsz = fold_convert (gfc_array_index_type, elemsz)fold_convert_loc (((location_t) 0), gfc_array_index_type, elemsz
)
;
3247 OMP_CLAUSE_SIZE (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3247, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3247, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3247, __FUNCTION__)))
3248 = 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3249, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3249, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3249, __FUNCTION__))), elemsz )
3249 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3249, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_FROM), (OMP_CLAUSE__CACHE_
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3249, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3249, __FUNCTION__))), elemsz )
;
3250 }
3251 gfc_add_block_to_block (block, &se.post);
3252 ptr = fold_convert (build_pointer_type (char_type_node),fold_convert_loc (((location_t) 0), build_pointer_type (integer_types
[itk_char]), ptr)
3253 ptr)fold_convert_loc (((location_t) 0), build_pointer_type (integer_types
[itk_char]), ptr)
;
3254 OMP_CLAUSE_DECL (node)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((node), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3254, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3254, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3254, __FUNCTION__)))
= build_fold_indirect_ref (ptr)build_fold_indirect_ref_loc (((location_t) 0), ptr);
3255 }
3256 omp_clauses = gfc_trans_add_clause (node, omp_clauses);
3257 }
3258 break;
3259 default:
3260 break;
3261 }
3262 }
3263
3264 if (clauses->if_expr)
3265 {
3266 tree if_var;
3267
3268 gfc_init_se (&se, NULL__null);
3269 gfc_conv_expr (&se, clauses->if_expr);
3270 gfc_add_block_to_block (block, &se.pre);
3271 if_var = gfc_evaluate_now (se.expr, block);
3272 gfc_add_block_to_block (block, &se.post);
3273
3274 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_IF);
3275 OMP_CLAUSE_IF_MODIFIER (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3275, __FUNCTION__))->omp_clause.subcode.if_modifier)
= ERROR_MARK;
3276 OMP_CLAUSE_IF_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3276, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3276, __FUNCTION__)))
= if_var;
3277 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3278 }
3279 for (ifc = 0; ifc < OMP_IF_LAST; ifc++)
3280 if (clauses->if_exprs[ifc])
3281 {
3282 tree if_var;
3283
3284 gfc_init_se (&se, NULL__null);
3285 gfc_conv_expr (&se, clauses->if_exprs[ifc]);
3286 gfc_add_block_to_block (block, &se.pre);
3287 if_var = gfc_evaluate_now (se.expr, block);
3288 gfc_add_block_to_block (block, &se.post);
3289
3290 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_IF);
3291 switch (ifc)
3292 {
3293 case OMP_IF_CANCEL:
3294 OMP_CLAUSE_IF_MODIFIER (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3294, __FUNCTION__))->omp_clause.subcode.if_modifier)
= VOID_CST;
3295 break;
3296 case OMP_IF_PARALLEL:
3297 OMP_CLAUSE_IF_MODIFIER (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3297, __FUNCTION__))->omp_clause.subcode.if_modifier)
= OMP_PARALLEL;
3298 break;
3299 case OMP_IF_SIMD:
3300 OMP_CLAUSE_IF_MODIFIER (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3300, __FUNCTION__))->omp_clause.subcode.if_modifier)
= OMP_SIMD;
3301 break;
3302 case OMP_IF_TASK:
3303 OMP_CLAUSE_IF_MODIFIER (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3303, __FUNCTION__))->omp_clause.subcode.if_modifier)
= OMP_TASK;
3304 break;
3305 case OMP_IF_TASKLOOP:
3306 OMP_CLAUSE_IF_MODIFIER (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3306, __FUNCTION__))->omp_clause.subcode.if_modifier)
= OMP_TASKLOOP;
3307 break;
3308 case OMP_IF_TARGET:
3309 OMP_CLAUSE_IF_MODIFIER (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3309, __FUNCTION__))->omp_clause.subcode.if_modifier)
= OMP_TARGET;
3310 break;
3311 case OMP_IF_TARGET_DATA:
3312 OMP_CLAUSE_IF_MODIFIER (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3312, __FUNCTION__))->omp_clause.subcode.if_modifier)
= OMP_TARGET_DATA;
3313 break;
3314 case OMP_IF_TARGET_UPDATE:
3315 OMP_CLAUSE_IF_MODIFIER (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3315, __FUNCTION__))->omp_clause.subcode.if_modifier)
= OMP_TARGET_UPDATE;
3316 break;
3317 case OMP_IF_TARGET_ENTER_DATA:
3318 OMP_CLAUSE_IF_MODIFIER (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3318, __FUNCTION__))->omp_clause.subcode.if_modifier)
= OMP_TARGET_ENTER_DATA;
3319 break;
3320 case OMP_IF_TARGET_EXIT_DATA:
3321 OMP_CLAUSE_IF_MODIFIER (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3321, __FUNCTION__))->omp_clause.subcode.if_modifier)
= OMP_TARGET_EXIT_DATA;
3322 break;
3323 default:
3324 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3324, __FUNCTION__))
;
3325 }
3326 OMP_CLAUSE_IF_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_IF
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3326, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3326, __FUNCTION__)))
= if_var;
3327 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3328 }
3329
3330 if (clauses->final_expr)
3331 {
3332 tree final_var;
3333
3334 gfc_init_se (&se, NULL__null);
3335 gfc_conv_expr (&se, clauses->final_expr);
3336 gfc_add_block_to_block (block, &se.pre);
3337 final_var = gfc_evaluate_now (se.expr, block);
3338 gfc_add_block_to_block (block, &se.post);
3339
3340 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_FINAL);
3341 OMP_CLAUSE_FINAL_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_FINAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3341, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3341, __FUNCTION__)))
= final_var;
3342 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3343 }
3344
3345 if (clauses->num_threads)
3346 {
3347 tree num_threads;
3348
3349 gfc_init_se (&se, NULL__null);
3350 gfc_conv_expr (&se, clauses->num_threads);
3351 gfc_add_block_to_block (block, &se.pre);
3352 num_threads = gfc_evaluate_now (se.expr, block);
3353 gfc_add_block_to_block (block, &se.post);
3354
3355 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_NUM_THREADS);
3356 OMP_CLAUSE_NUM_THREADS_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_NUM_THREADS
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3356, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3356, __FUNCTION__)))
= num_threads;
3357 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3358 }
3359
3360 chunk_size = NULL_TREE(tree) __null;
3361 if (clauses->chunk_size)
3362 {
3363 gfc_init_se (&se, NULL__null);
3364 gfc_conv_expr (&se, clauses->chunk_size);
3365 gfc_add_block_to_block (block, &se.pre);
3366 chunk_size = gfc_evaluate_now (se.expr, block);
3367 gfc_add_block_to_block (block, &se.post);
3368 }
3369
3370 if (clauses->sched_kind != OMP_SCHED_NONE)
3371 {
3372 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_SCHEDULE);
3373 OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_SCHEDULE
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3373, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3373, __FUNCTION__)))
= chunk_size;
3374 switch (clauses->sched_kind)
3375 {
3376 case OMP_SCHED_STATIC:
3377 OMP_CLAUSE_SCHEDULE_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_SCHEDULE), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3377, __FUNCTION__))->omp_clause.subcode.schedule_kind)
= OMP_CLAUSE_SCHEDULE_STATIC;
3378 break;
3379 case OMP_SCHED_DYNAMIC:
3380 OMP_CLAUSE_SCHEDULE_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_SCHEDULE), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3380, __FUNCTION__))->omp_clause.subcode.schedule_kind)
= OMP_CLAUSE_SCHEDULE_DYNAMIC;
3381 break;
3382 case OMP_SCHED_GUIDED:
3383 OMP_CLAUSE_SCHEDULE_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_SCHEDULE), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3383, __FUNCTION__))->omp_clause.subcode.schedule_kind)
= OMP_CLAUSE_SCHEDULE_GUIDED;
3384 break;
3385 case OMP_SCHED_RUNTIME:
3386 OMP_CLAUSE_SCHEDULE_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_SCHEDULE), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3386, __FUNCTION__))->omp_clause.subcode.schedule_kind)
= OMP_CLAUSE_SCHEDULE_RUNTIME;
3387 break;
3388 case OMP_SCHED_AUTO:
3389 OMP_CLAUSE_SCHEDULE_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_SCHEDULE), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3389, __FUNCTION__))->omp_clause.subcode.schedule_kind)
= OMP_CLAUSE_SCHEDULE_AUTO;
3390 break;
3391 default:
3392 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3392, __FUNCTION__))
;
3393 }
3394 if (clauses->sched_monotonic)
3395 OMP_CLAUSE_SCHEDULE_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_SCHEDULE), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3395, __FUNCTION__))->omp_clause.subcode.schedule_kind)
3396 = (omp_clause_schedule_kind) (OMP_CLAUSE_SCHEDULE_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_SCHEDULE), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3396, __FUNCTION__))->omp_clause.subcode.schedule_kind)
3397 | OMP_CLAUSE_SCHEDULE_MONOTONIC);
3398 else if (clauses->sched_nonmonotonic)
3399 OMP_CLAUSE_SCHEDULE_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_SCHEDULE), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3399, __FUNCTION__))->omp_clause.subcode.schedule_kind)
3400 = (omp_clause_schedule_kind) (OMP_CLAUSE_SCHEDULE_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_SCHEDULE), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3400, __FUNCTION__))->omp_clause.subcode.schedule_kind)
3401 | OMP_CLAUSE_SCHEDULE_NONMONOTONIC);
3402 if (clauses->sched_simd)
3403 OMP_CLAUSE_SCHEDULE_SIMD (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_SCHEDULE), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3403, __FUNCTION__))->base.public_flag)
= 1;
3404 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3405 }
3406
3407 if (clauses->default_sharing != OMP_DEFAULT_UNKNOWN)
3408 {
3409 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_DEFAULT);
3410 switch (clauses->default_sharing)
3411 {
3412 case OMP_DEFAULT_NONE:
3413 OMP_CLAUSE_DEFAULT_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_DEFAULT), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3413, __FUNCTION__))->omp_clause.subcode.default_kind)
= OMP_CLAUSE_DEFAULT_NONE;
3414 break;
3415 case OMP_DEFAULT_SHARED:
3416 OMP_CLAUSE_DEFAULT_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_DEFAULT), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3416, __FUNCTION__))->omp_clause.subcode.default_kind)
= OMP_CLAUSE_DEFAULT_SHARED;
3417 break;
3418 case OMP_DEFAULT_PRIVATE:
3419 OMP_CLAUSE_DEFAULT_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_DEFAULT), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3419, __FUNCTION__))->omp_clause.subcode.default_kind)
= OMP_CLAUSE_DEFAULT_PRIVATE;
3420 break;
3421 case OMP_DEFAULT_FIRSTPRIVATE:
3422 OMP_CLAUSE_DEFAULT_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_DEFAULT), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3422, __FUNCTION__))->omp_clause.subcode.default_kind)
= OMP_CLAUSE_DEFAULT_FIRSTPRIVATE;
3423 break;
3424 case OMP_DEFAULT_PRESENT:
3425 OMP_CLAUSE_DEFAULT_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_DEFAULT), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3425, __FUNCTION__))->omp_clause.subcode.default_kind)
= OMP_CLAUSE_DEFAULT_PRESENT;
3426 break;
3427 default:
3428 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3428, __FUNCTION__))
;
3429 }
3430 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3431 }
3432
3433 if (clauses->nowait)
3434 {
3435 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_NOWAIT);
3436 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3437 }
3438
3439 if (clauses->ordered)
3440 {
3441 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_ORDERED);
3442 OMP_CLAUSE_ORDERED_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_ORDERED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3442, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3442, __FUNCTION__)))
3443 = clauses->orderedc ? build_int_cst (integer_type_nodeinteger_types[itk_int],
3444 clauses->orderedc) : NULL_TREE(tree) __null;
3445 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3446 }
3447
3448 if (clauses->order_concurrent)
3449 {
3450 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_ORDER);
3451 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3452 }
3453
3454 if (clauses->untied)
3455 {
3456 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_UNTIED);
3457 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3458 }
3459
3460 if (clauses->mergeable)
3461 {
3462 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_MERGEABLE);
3463 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3464 }
3465
3466 if (clauses->collapse)
3467 {
3468 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_COLLAPSE);
3469 OMP_CLAUSE_COLLAPSE_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_COLLAPSE
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3469, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3469, __FUNCTION__)))
3470 = build_int_cst (integer_type_nodeinteger_types[itk_int], clauses->collapse);
3471 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3472 }
3473
3474 if (clauses->inbranch)
3475 {
3476 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_INBRANCH);
3477 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3478 }
3479
3480 if (clauses->notinbranch)
3481 {
3482 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_NOTINBRANCH);
3483 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3484 }
3485
3486 switch (clauses->cancel)
3487 {
3488 case OMP_CANCEL_UNKNOWN:
3489 break;
3490 case OMP_CANCEL_PARALLEL:
3491 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_PARALLEL);
3492 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3493 break;
3494 case OMP_CANCEL_SECTIONS:
3495 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_SECTIONS);
3496 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3497 break;
3498 case OMP_CANCEL_DO:
3499 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_FOR);
3500 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3501 break;
3502 case OMP_CANCEL_TASKGROUP:
3503 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_TASKGROUP);
3504 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3505 break;
3506 }
3507
3508 if (clauses->proc_bind != OMP_PROC_BIND_UNKNOWN)
3509 {
3510 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_PROC_BIND);
3511 switch (clauses->proc_bind)
3512 {
3513 case OMP_PROC_BIND_MASTER:
3514 OMP_CLAUSE_PROC_BIND_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_PROC_BIND), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3514, __FUNCTION__))->omp_clause.subcode.proc_bind_kind)
= OMP_CLAUSE_PROC_BIND_MASTER;
3515 break;
3516 case OMP_PROC_BIND_SPREAD:
3517 OMP_CLAUSE_PROC_BIND_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_PROC_BIND), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3517, __FUNCTION__))->omp_clause.subcode.proc_bind_kind)
= OMP_CLAUSE_PROC_BIND_SPREAD;
3518 break;
3519 case OMP_PROC_BIND_CLOSE:
3520 OMP_CLAUSE_PROC_BIND_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_PROC_BIND), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3520, __FUNCTION__))->omp_clause.subcode.proc_bind_kind)
= OMP_CLAUSE_PROC_BIND_CLOSE;
3521 break;
3522 default:
3523 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3523, __FUNCTION__))
;
3524 }
3525 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3526 }
3527
3528 if (clauses->safelen_expr)
3529 {
3530 tree safelen_var;
3531
3532 gfc_init_se (&se, NULL__null);
3533 gfc_conv_expr (&se, clauses->safelen_expr);
3534 gfc_add_block_to_block (block, &se.pre);
3535 safelen_var = gfc_evaluate_now (se.expr, block);
3536 gfc_add_block_to_block (block, &se.post);
3537
3538 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_SAFELEN);
3539 OMP_CLAUSE_SAFELEN_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_SAFELEN
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3539, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3539, __FUNCTION__)))
= safelen_var;
3540 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3541 }
3542
3543 if (clauses->simdlen_expr)
3544 {
3545 if (declare_simd)
3546 {
3547 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_SIMDLEN);
3548 OMP_CLAUSE_SIMDLEN_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_SIMDLEN
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3548, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3548, __FUNCTION__)))
3549 = gfc_conv_constant_to_tree (clauses->simdlen_expr);
3550 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3551 }
3552 else
3553 {
3554 tree simdlen_var;
3555
3556 gfc_init_se (&se, NULL__null);
3557 gfc_conv_expr (&se, clauses->simdlen_expr);
3558 gfc_add_block_to_block (block, &se.pre);
3559 simdlen_var = gfc_evaluate_now (se.expr, block);
3560 gfc_add_block_to_block (block, &se.post);
3561
3562 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_SIMDLEN);
3563 OMP_CLAUSE_SIMDLEN_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_SIMDLEN
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3563, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3563, __FUNCTION__)))
= simdlen_var;
3564 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3565 }
3566 }
3567
3568 if (clauses->num_teams)
3569 {
3570 tree num_teams;
3571
3572 gfc_init_se (&se, NULL__null);
3573 gfc_conv_expr (&se, clauses->num_teams);
3574 gfc_add_block_to_block (block, &se.pre);
3575 num_teams = gfc_evaluate_now (se.expr, block);
3576 gfc_add_block_to_block (block, &se.post);
3577
3578 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_NUM_TEAMS);
3579 OMP_CLAUSE_NUM_TEAMS_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_NUM_TEAMS
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3579, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3579, __FUNCTION__)))
= num_teams;
3580 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3581 }
3582
3583 if (clauses->device)
3584 {
3585 tree device;
3586
3587 gfc_init_se (&se, NULL__null);
3588 gfc_conv_expr (&se, clauses->device);
3589 gfc_add_block_to_block (block, &se.pre);
3590 device = gfc_evaluate_now (se.expr, block);
3591 gfc_add_block_to_block (block, &se.post);
3592
3593 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_DEVICE);
3594 OMP_CLAUSE_DEVICE_ID (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_DEVICE
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3594, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3594, __FUNCTION__)))
= device;
3595 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3596 }
3597
3598 if (clauses->thread_limit)
3599 {
3600 tree thread_limit;
3601
3602 gfc_init_se (&se, NULL__null);
3603 gfc_conv_expr (&se, clauses->thread_limit);
3604 gfc_add_block_to_block (block, &se.pre);
3605 thread_limit = gfc_evaluate_now (se.expr, block);
3606 gfc_add_block_to_block (block, &se.post);
3607
3608 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_THREAD_LIMIT);
3609 OMP_CLAUSE_THREAD_LIMIT_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_THREAD_LIMIT
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3609, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3609, __FUNCTION__)))
= thread_limit;
3610 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3611 }
3612
3613 chunk_size = NULL_TREE(tree) __null;
3614 if (clauses->dist_chunk_size)
3615 {
3616 gfc_init_se (&se, NULL__null);
3617 gfc_conv_expr (&se, clauses->dist_chunk_size);
3618 gfc_add_block_to_block (block, &se.pre);
3619 chunk_size = gfc_evaluate_now (se.expr, block);
3620 gfc_add_block_to_block (block, &se.post);
3621 }
3622
3623 if (clauses->dist_sched_kind != OMP_SCHED_NONE)
3624 {
3625 c = build_omp_clause (gfc_get_location (&where),
3626 OMP_CLAUSE_DIST_SCHEDULE);
3627 OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_DIST_SCHEDULE
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3627, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3627, __FUNCTION__)))
= chunk_size;
3628 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3629 }
3630
3631 if (clauses->grainsize)
3632 {
3633 tree grainsize;
3634
3635 gfc_init_se (&se, NULL__null);
3636 gfc_conv_expr (&se, clauses->grainsize);
3637 gfc_add_block_to_block (block, &se.pre);
3638 grainsize = gfc_evaluate_now (se.expr, block);
3639 gfc_add_block_to_block (block, &se.post);
3640
3641 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_GRAINSIZE);
3642 OMP_CLAUSE_GRAINSIZE_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_GRAINSIZE
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3642, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3642, __FUNCTION__)))
= grainsize;
3643 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3644 }
3645
3646 if (clauses->num_tasks)
3647 {
3648 tree num_tasks;
3649
3650 gfc_init_se (&se, NULL__null);
3651 gfc_conv_expr (&se, clauses->num_tasks);
3652 gfc_add_block_to_block (block, &se.pre);
3653 num_tasks = gfc_evaluate_now (se.expr, block);
3654 gfc_add_block_to_block (block, &se.post);
3655
3656 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_NUM_TASKS);
3657 OMP_CLAUSE_NUM_TASKS_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_NUM_TASKS
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3657, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3657, __FUNCTION__)))
= num_tasks;
3658 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3659 }
3660
3661 if (clauses->priority)
3662 {
3663 tree priority;
3664
3665 gfc_init_se (&se, NULL__null);
3666 gfc_conv_expr (&se, clauses->priority);
3667 gfc_add_block_to_block (block, &se.pre);
3668 priority = gfc_evaluate_now (se.expr, block);
3669 gfc_add_block_to_block (block, &se.post);
3670
3671 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_PRIORITY);
3672 OMP_CLAUSE_PRIORITY_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_PRIORITY
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3672, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3672, __FUNCTION__)))
= priority;
3673 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3674 }
3675
3676 if (clauses->hint)
3677 {
3678 tree hint;
3679
3680 gfc_init_se (&se, NULL__null);
3681 gfc_conv_expr (&se, clauses->hint);
3682 gfc_add_block_to_block (block, &se.pre);
3683 hint = gfc_evaluate_now (se.expr, block);
3684 gfc_add_block_to_block (block, &se.post);
3685
3686 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_HINT);
3687 OMP_CLAUSE_HINT_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_HINT
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3687, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3687, __FUNCTION__)))
= hint;
3688 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3689 }
3690
3691 if (clauses->simd)
3692 {
3693 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_SIMD);
3694 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3695 }
3696 if (clauses->threads)
3697 {
3698 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_THREADS);
3699 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3700 }
3701 if (clauses->nogroup)
3702 {
3703 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_NOGROUP);
3704 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3705 }
3706 if (clauses->defaultmap)
3707 {
3708 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_DEFAULTMAP);
3709 OMP_CLAUSE_DEFAULTMAP_SET_KIND (c, OMP_CLAUSE_DEFAULTMAP_TOFROM,(((omp_clause_subcode_check ((c), (OMP_CLAUSE_DEFAULTMAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3710, __FUNCTION__))->omp_clause.subcode.defaultmap_kind
) = (enum omp_clause_defaultmap_kind) (OMP_CLAUSE_DEFAULTMAP_CATEGORY_SCALAR
| OMP_CLAUSE_DEFAULTMAP_TOFROM))
3710 OMP_CLAUSE_DEFAULTMAP_CATEGORY_SCALAR)(((omp_clause_subcode_check ((c), (OMP_CLAUSE_DEFAULTMAP), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3710, __FUNCTION__))->omp_clause.subcode.defaultmap_kind
) = (enum omp_clause_defaultmap_kind) (OMP_CLAUSE_DEFAULTMAP_CATEGORY_SCALAR
| OMP_CLAUSE_DEFAULTMAP_TOFROM))
;
3711 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3712 }
3713 if (clauses->depend_source)
3714 {
3715 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_DEPEND);
3716 OMP_CLAUSE_DEPEND_KIND (c)((omp_clause_subcode_check ((c), (OMP_CLAUSE_DEPEND), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3716, __FUNCTION__))->omp_clause.subcode.depend_kind)
= OMP_CLAUSE_DEPEND_SOURCE;
3717 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3718 }
3719
3720 if (clauses->async)
3721 {
3722 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_ASYNC);
3723 if (clauses->async_expr)
3724 OMP_CLAUSE_ASYNC_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_ASYNC
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3724, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3724, __FUNCTION__)))
3725 = gfc_convert_expr_to_tree (block, clauses->async_expr);
3726 else
3727 OMP_CLAUSE_ASYNC_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_ASYNC
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3727, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3727, __FUNCTION__)))
= NULL__null;
3728 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3729 }
3730 if (clauses->seq)
3731 {
3732 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_SEQ);
3733 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3734 }
3735 if (clauses->par_auto)
3736 {
3737 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_AUTO);
3738 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3739 }
3740 if (clauses->if_present)
3741 {
3742 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_IF_PRESENT);
3743 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3744 }
3745 if (clauses->finalize)
3746 {
3747 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_FINALIZE);
3748 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3749 }
3750 if (clauses->independent)
3751 {
3752 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_INDEPENDENT);
3753 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3754 }
3755 if (clauses->wait_list)
3756 {
3757 gfc_expr_list *el;
3758
3759 for (el = clauses->wait_list; el; el = el->next)
3760 {
3761 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_WAIT);
3762 OMP_CLAUSE_DECL (c)(*(omp_clause_elt_check (((omp_clause_range_check (((tree_check
((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3762, __FUNCTION__, (OMP_CLAUSE)))), (OMP_CLAUSE_PRIVATE), (
OMP_CLAUSE__SCANTEMP_), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3762, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3762, __FUNCTION__)))
= gfc_convert_expr_to_tree (block, el->expr);
3763 OMP_CLAUSE_CHAIN (c)((contains_struct_check (((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3763, __FUNCTION__, (OMP_CLAUSE)))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3763, __FUNCTION__))->common.chain)
= omp_clauses;
3764 omp_clauses = c;
3765 }
3766 }
3767 if (clauses->num_gangs_expr)
3768 {
3769 tree num_gangs_var
3770 = gfc_convert_expr_to_tree (block, clauses->num_gangs_expr);
3771 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_NUM_GANGS);
3772 OMP_CLAUSE_NUM_GANGS_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_NUM_GANGS
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3772, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3772, __FUNCTION__)))
= num_gangs_var;
3773 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3774 }
3775 if (clauses->num_workers_expr)
3776 {
3777 tree num_workers_var
3778 = gfc_convert_expr_to_tree (block, clauses->num_workers_expr);
3779 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_NUM_WORKERS);
3780 OMP_CLAUSE_NUM_WORKERS_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_NUM_WORKERS
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3780, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3780, __FUNCTION__)))
= num_workers_var;
3781 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3782 }
3783 if (clauses->vector_length_expr)
3784 {
3785 tree vector_length_var
3786 = gfc_convert_expr_to_tree (block, clauses->vector_length_expr);
3787 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_VECTOR_LENGTH);
3788 OMP_CLAUSE_VECTOR_LENGTH_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_VECTOR_LENGTH
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3788, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3788, __FUNCTION__)))
= vector_length_var;
3789 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3790 }
3791 if (clauses->tile_list)
3792 {
3793 vec<tree, va_gc> *tvec;
3794 gfc_expr_list *el;
3795
3796 vec_alloc (tvec, 4);
3797
3798 for (el = clauses->tile_list; el; el = el->next)
3799 vec_safe_push (tvec, gfc_convert_expr_to_tree (block, el->expr));
3800
3801 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_TILE);
3802 OMP_CLAUSE_TILE_LIST (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_TILE
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3802, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3802, __FUNCTION__)))
= build_tree_list_vec (tvec);
3803 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3804 tvec->truncate (0);
3805 }
3806 if (clauses->vector)
3807 {
3808 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_VECTOR);
3809 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3810
3811 if (clauses->vector_expr)
3812 {
3813 tree vector_var
3814 = gfc_convert_expr_to_tree (block, clauses->vector_expr);
3815 OMP_CLAUSE_VECTOR_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_VECTOR
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3815, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3815, __FUNCTION__)))
= vector_var;
3816
3817 /* TODO: We're not capturing location information for individual
3818 clauses. However, if we have an expression attached to the
3819 clause, that one provides better location information. */
3820 OMP_CLAUSE_LOCATION (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3820, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.locus
3821 = gfc_get_location (&clauses->vector_expr->where);
3822 }
3823 }
3824 if (clauses->worker)
3825 {
3826 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_WORKER);
3827 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3828
3829 if (clauses->worker_expr)
3830 {
3831 tree worker_var
3832 = gfc_convert_expr_to_tree (block, clauses->worker_expr);
3833 OMP_CLAUSE_WORKER_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_WORKER
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3833, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3833, __FUNCTION__)))
= worker_var;
3834
3835 /* TODO: We're not capturing location information for individual
3836 clauses. However, if we have an expression attached to the
3837 clause, that one provides better location information. */
3838 OMP_CLAUSE_LOCATION (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3838, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.locus
3839 = gfc_get_location (&clauses->worker_expr->where);
3840 }
3841 }
3842 if (clauses->gang)
3843 {
3844 tree arg;
3845 c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_GANG);
3846 omp_clauses = gfc_trans_add_clause (c, omp_clauses);
3847
3848 if (clauses->gang_num_expr)
3849 {
3850 arg = gfc_convert_expr_to_tree (block, clauses->gang_num_expr);
3851 OMP_CLAUSE_GANG_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_GANG
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3851, __FUNCTION__))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3851, __FUNCTION__)))
= arg;
3852
3853 /* TODO: We're not capturing location information for individual
3854 clauses. However, if we have an expression attached to the
3855 clause, that one provides better location information. */
3856 OMP_CLAUSE_LOCATION (c)((tree_check ((c), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3856, __FUNCTION__, (OMP_CLAUSE))))->omp_clause.locus
3857 = gfc_get_location (&clauses->gang_num_expr->where);
3858 }
3859
3860 if (clauses->gang_static)
3861 {
3862 arg = clauses->gang_static_expr
3863 ? gfc_convert_expr_to_tree (block, clauses->gang_static_expr)
3864 : integer_minus_one_nodeglobal_trees[TI_INTEGER_MINUS_ONE];
3865 OMP_CLAUSE_GANG_STATIC_EXPR (c)(*(omp_clause_elt_check (((omp_clause_subcode_check ((c), (OMP_CLAUSE_GANG
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3865, __FUNCTION__))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3865, __FUNCTION__)))
= arg;
3866 }
3867 }
3868
3869 return nreverse (omp_clauses);
3870}
3871
3872/* Like gfc_trans_code, but force creation of a BIND_EXPR around it. */
3873
3874static tree
3875gfc_trans_omp_code (gfc_code *code, bool force_empty)
3876{
3877 tree stmt;
3878
3879 pushlevel ();
3880 stmt = gfc_trans_code (code);
3881 if (TREE_CODE (stmt)((enum tree_code) (stmt)->base.code) != BIND_EXPR)
3882 {
3883 if (!IS_EMPTY_STMT (stmt)(((enum tree_code) (stmt)->base.code) == NOP_EXPR &&
(((enum tree_code) (((contains_struct_check ((stmt), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3883, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
) && integer_zerop ((*((const_cast<tree*> (tree_operand_check
((stmt), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3883, __FUNCTION__)))))))
|| force_empty)
3884 {
3885 tree block = poplevel (1, 0);
3886 stmt = build3_v (BIND_EXPR, NULL, stmt, block)fold_build3_loc (input_location, BIND_EXPR, global_trees[TI_VOID_TYPE
], __null, stmt, block)
;
3887 }
3888 else
3889 poplevel (0, 0);
3890 }
3891 else
3892 poplevel (0, 0);
3893 return stmt;
3894}
3895
3896/* Translate OpenACC 'parallel', 'kernels', 'serial', 'data', 'host_data'
3897 construct. */
3898
3899static tree
3900gfc_trans_oacc_construct (gfc_code *code)
3901{
3902 stmtblock_t block;
3903 tree stmt, oacc_clauses;
3904 enum tree_code construct_code;
3905
3906 switch (code->op)
3907 {
3908 case EXEC_OACC_PARALLEL:
3909 construct_code = OACC_PARALLEL;
3910 break;
3911 case EXEC_OACC_KERNELS:
3912 construct_code = OACC_KERNELS;
3913 break;
3914 case EXEC_OACC_SERIAL:
3915 construct_code = OACC_SERIAL;
3916 break;
3917 case EXEC_OACC_DATA:
3918 construct_code = OACC_DATA;
3919 break;
3920 case EXEC_OACC_HOST_DATA:
3921 construct_code = OACC_HOST_DATA;
3922 break;
3923 default:
3924 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3924, __FUNCTION__))
;
3925 }
3926
3927 gfc_start_block (&block);
3928 oacc_clauses = gfc_trans_omp_clauses (&block, code->ext.omp_clauses,
3929 code->loc, false, true);
3930 stmt = gfc_trans_omp_code (code->block->next, true);
3931 stmt = build2_loc (gfc_get_location (&code->loc), construct_code,
3932 void_type_nodeglobal_trees[TI_VOID_TYPE], stmt, oacc_clauses);
3933 gfc_add_expr_to_block (&block, stmt);
3934 return gfc_finish_block (&block);
3935}
3936
3937/* update, enter_data, exit_data, cache. */
3938static tree
3939gfc_trans_oacc_executable_directive (gfc_code *code)
3940{
3941 stmtblock_t block;
3942 tree stmt, oacc_clauses;
3943 enum tree_code construct_code;
3944
3945 switch (code->op)
3946 {
3947 case EXEC_OACC_UPDATE:
3948 construct_code = OACC_UPDATE;
3949 break;
3950 case EXEC_OACC_ENTER_DATA:
3951 construct_code = OACC_ENTER_DATA;
3952 break;
3953 case EXEC_OACC_EXIT_DATA:
3954 construct_code = OACC_EXIT_DATA;
3955 break;
3956 case EXEC_OACC_CACHE:
3957 construct_code = OACC_CACHE;
3958 break;
3959 default:
3960 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 3960, __FUNCTION__))
;
3961 }
3962
3963 gfc_start_block (&block);
3964 oacc_clauses = gfc_trans_omp_clauses (&block, code->ext.omp_clauses,
3965 code->loc, false, true);
3966 stmt = build1_loc (input_location, construct_code, void_type_nodeglobal_trees[TI_VOID_TYPE],
3967 oacc_clauses);
3968 gfc_add_expr_to_block (&block, stmt);
3969 return gfc_finish_block (&block);
3970}
3971
3972static tree
3973gfc_trans_oacc_wait_directive (gfc_code *code)
3974{
3975 stmtblock_t block;
3976 tree stmt, t;
3977 vec<tree, va_gc> *args;
3978 int nparms = 0;
3979 gfc_expr_list *el;
3980 gfc_omp_clauses *clauses = code->ext.omp_clauses;
3981 location_t loc = input_location;
3982
3983 for (el = clauses->wait_list; el; el = el->next)
3984 nparms++;
3985
3986 vec_alloc (args, nparms + 2);
3987 stmt = builtin_decl_explicit (BUILT_IN_GOACC_WAIT);
3988
3989 gfc_start_block (&block);
3990
3991 if (clauses->async_expr)
3992 t = gfc_convert_expr_to_tree (&block, clauses->async_expr);
3993 else
3994 t = build_int_cst (integer_type_nodeinteger_types[itk_int], -2);
3995
3996 args->quick_push (t);
3997 args->quick_push (build_int_cst (integer_type_nodeinteger_types[itk_int], nparms));
3998
3999 for (el = clauses->wait_list; el; el = el->next)
4000 args->quick_push (gfc_convert_expr_to_tree (&block, el->expr));
4001
4002 stmt = build_call_expr_loc_vec (loc, stmt, args);
4003 gfc_add_expr_to_block (&block, stmt);
4004
4005 vec_free (args);
4006
4007 return gfc_finish_block (&block);
4008}
4009
4010static tree gfc_trans_omp_sections (gfc_code *, gfc_omp_clauses *);
4011static tree gfc_trans_omp_workshare (gfc_code *, gfc_omp_clauses *);
4012
4013static tree
4014gfc_trans_omp_atomic (gfc_code *code)
4015{
4016 gfc_code *atomic_code = code->block;
4017 gfc_se lse;
4018 gfc_se rse;
4019 gfc_se vse;
4020 gfc_expr *expr2, *e;
4021 gfc_symbol *var;
4022 stmtblock_t block;
4023 tree lhsaddr, type, rhs, x;
4024 enum tree_code op = ERROR_MARK;
4025 enum tree_code aop = OMP_ATOMIC;
4026 bool var_on_left = false;
4027 enum omp_memory_order mo;
4028 switch (atomic_code->ext.omp_clauses->memorder)
4029 {
4030 case OMP_MEMORDER_UNSET: mo = OMP_MEMORY_ORDER_UNSPECIFIED; break;
4031 case OMP_MEMORDER_ACQ_REL: mo = OMP_MEMORY_ORDER_ACQ_REL; break;
4032 case OMP_MEMORDER_ACQUIRE: mo = OMP_MEMORY_ORDER_ACQUIRE; break;
4033 case OMP_MEMORDER_RELAXED: mo = OMP_MEMORY_ORDER_RELAXED; break;
4034 case OMP_MEMORDER_RELEASE: mo = OMP_MEMORY_ORDER_RELEASE; break;
4035 case OMP_MEMORDER_SEQ_CST: mo = OMP_MEMORY_ORDER_SEQ_CST; break;
4036 default: gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4036, __FUNCTION__))
;
4037 }
4038
4039 code = code->block->next;
4040 gcc_assert (code->op == EXEC_ASSIGN)((void)(!(code->op == EXEC_ASSIGN) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4040, __FUNCTION__), 0 : 0))
;
4041 var = code->expr1->symtree->n.sym;
4042
4043 gfc_init_se (&lse, NULL__null);
4044 gfc_init_se (&rse, NULL__null);
4045 gfc_init_se (&vse, NULL__null);
4046 gfc_start_block (&block);
4047
4048 expr2 = code->expr2;
4049 if (((atomic_code->ext.omp_clauses->atomic_op & GFC_OMP_ATOMIC_MASK)
4050 != GFC_OMP_ATOMIC_WRITE)
4051 && expr2->expr_type == EXPR_FUNCTION
4052 && expr2->value.function.isym
4053 && expr2->value.function.isym->id == GFC_ISYM_CONVERSION)
4054 expr2 = expr2->value.function.actual->expr;
4055
4056 if ((atomic_code->ext.omp_clauses->atomic_op & GFC_OMP_ATOMIC_MASK)
4057 == GFC_OMP_ATOMIC_READ)
4058 {
4059 gfc_conv_expr (&vse, code->expr1);
4060 gfc_add_block_to_block (&block, &vse.pre);
4061
4062 gfc_conv_expr (&lse, expr2);
4063 gfc_add_block_to_block (&block, &lse.pre);
4064 type = TREE_TYPE (lse.expr)((contains_struct_check ((lse.expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4064, __FUNCTION__))->typed.type)
;
4065 lhsaddr = gfc_build_addr_expr (NULL__null, lse.expr);
4066
4067 x = build1 (OMP_ATOMIC_READ, type, lhsaddr);
4068 OMP_ATOMIC_MEMORY_ORDER (x)((tree_range_check ((x), (OMP_ATOMIC), (OMP_ATOMIC_CAPTURE_NEW
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4068, __FUNCTION__))->base.u.omp_atomic_memory_order)
= mo;
4069 x = convert (TREE_TYPE (vse.expr)((contains_struct_check ((vse.expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4069, __FUNCTION__))->typed.type)
, x);
4070 gfc_add_modify (&block, vse.expr, x);
4071
4072 gfc_add_block_to_block (&block, &lse.pre);
4073 gfc_add_block_to_block (&block, &rse.pre);
4074
4075 return gfc_finish_block (&block);
4076 }
4077 if (atomic_code->ext.omp_clauses->capture)
4078 {
4079 aop = OMP_ATOMIC_CAPTURE_NEW;
4080 if (expr2->expr_type == EXPR_VARIABLE)
4081 {
4082 aop = OMP_ATOMIC_CAPTURE_OLD;
4083 gfc_conv_expr (&vse, code->expr1);
4084 gfc_add_block_to_block (&block, &vse.pre);
4085
4086 gfc_conv_expr (&lse, expr2);
4087 gfc_add_block_to_block (&block, &lse.pre);
4088 gfc_init_se (&lse, NULL__null);
4089 code = code->next;
4090 var = code->expr1->symtree->n.sym;
4091 expr2 = code->expr2;
4092 if (expr2->expr_type == EXPR_FUNCTION
4093 && expr2->value.function.isym
4094 && expr2->value.function.isym->id == GFC_ISYM_CONVERSION)
4095 expr2 = expr2->value.function.actual->expr;
4096 }
4097 }
4098
4099 gfc_conv_expr (&lse, code->expr1);
4100 gfc_add_block_to_block (&block, &lse.pre);
4101 type = TREE_TYPE (lse.expr)((contains_struct_check ((lse.expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4101, __FUNCTION__))->typed.type)
;
4102 lhsaddr = gfc_build_addr_expr (NULL__null, lse.expr);
4103
4104 if (((atomic_code->ext.omp_clauses->atomic_op & GFC_OMP_ATOMIC_MASK)
4105 == GFC_OMP_ATOMIC_WRITE)
4106 || (atomic_code->ext.omp_clauses->atomic_op & GFC_OMP_ATOMIC_SWAP))
4107 {
4108 gfc_conv_expr (&rse, expr2);
4109 gfc_add_block_to_block (&block, &rse.pre);
4110 }
4111 else if (expr2->expr_type == EXPR_OP)
4112 {
4113 gfc_expr *e;
4114 switch (expr2->value.op.op)
4115 {
4116 case INTRINSIC_PLUS:
4117 op = PLUS_EXPR;
4118 break;
4119 case INTRINSIC_TIMES:
4120 op = MULT_EXPR;
4121 break;
4122 case INTRINSIC_MINUS:
4123 op = MINUS_EXPR;
4124 break;
4125 case INTRINSIC_DIVIDE:
4126 if (expr2->ts.type == BT_INTEGER)
4127 op = TRUNC_DIV_EXPR;
4128 else
4129 op = RDIV_EXPR;
4130 break;
4131 case INTRINSIC_AND:
4132 op = TRUTH_ANDIF_EXPR;
4133 break;
4134 case INTRINSIC_OR:
4135 op = TRUTH_ORIF_EXPR;
4136 break;
4137 case INTRINSIC_EQV:
4138 op = EQ_EXPR;
4139 break;
4140 case INTRINSIC_NEQV:
4141 op = NE_EXPR;
4142 break;
4143 default:
4144 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4144, __FUNCTION__))
;
4145 }
4146 e = expr2->value.op.op1;
4147 if (e->expr_type == EXPR_FUNCTION
4148 && e->value.function.isym
4149 && e->value.function.isym->id == GFC_ISYM_CONVERSION)
4150 e = e->value.function.actual->expr;
4151 if (e->expr_type == EXPR_VARIABLE
4152 && e->symtree != NULL__null
4153 && e->symtree->n.sym == var)
4154 {
4155 expr2 = expr2->value.op.op2;
4156 var_on_left = true;
4157 }
4158 else
4159 {
4160 e = expr2->value.op.op2;
4161 if (e->expr_type == EXPR_FUNCTION
4162 && e->value.function.isym
4163 && e->value.function.isym->id == GFC_ISYM_CONVERSION)
4164 e = e->value.function.actual->expr;
4165 gcc_assert (e->expr_type == EXPR_VARIABLE((void)(!(e->expr_type == EXPR_VARIABLE && e->symtree
!= __null && e->symtree->n.sym == var) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4167, __FUNCTION__), 0 : 0))
4166 && e->symtree != NULL((void)(!(e->expr_type == EXPR_VARIABLE && e->symtree
!= __null && e->symtree->n.sym == var) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4167, __FUNCTION__), 0 : 0))
4167 && e->symtree->n.sym == var)((void)(!(e->expr_type == EXPR_VARIABLE && e->symtree
!= __null && e->symtree->n.sym == var) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4167, __FUNCTION__), 0 : 0))
;
4168 expr2 = expr2->value.op.op1;
4169 var_on_left = false;
4170 }
4171 gfc_conv_expr (&rse, expr2);
4172 gfc_add_block_to_block (&block, &rse.pre);
4173 }
4174 else
4175 {
4176 gcc_assert (expr2->expr_type == EXPR_FUNCTION)((void)(!(expr2->expr_type == EXPR_FUNCTION) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4176, __FUNCTION__), 0 : 0))
;
4177 switch (expr2->value.function.isym->id)
4178 {
4179 case GFC_ISYM_MIN:
4180 op = MIN_EXPR;
4181 break;
4182 case GFC_ISYM_MAX:
4183 op = MAX_EXPR;
4184 break;
4185 case GFC_ISYM_IAND:
4186 op = BIT_AND_EXPR;
4187 break;
4188 case GFC_ISYM_IOR:
4189 op = BIT_IOR_EXPR;
4190 break;
4191 case GFC_ISYM_IEOR:
4192 op = BIT_XOR_EXPR;
4193 break;
4194 default:
4195 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4195, __FUNCTION__))
;
4196 }
4197 e = expr2->value.function.actual->expr;
4198 gcc_assert (e->expr_type == EXPR_VARIABLE((void)(!(e->expr_type == EXPR_VARIABLE && e->symtree
!= __null && e->symtree->n.sym == var) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4200, __FUNCTION__), 0 : 0))
4199 && e->symtree != NULL((void)(!(e->expr_type == EXPR_VARIABLE && e->symtree
!= __null && e->symtree->n.sym == var) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4200, __FUNCTION__), 0 : 0))
4200 && e->symtree->n.sym == var)((void)(!(e->expr_type == EXPR_VARIABLE && e->symtree
!= __null && e->symtree->n.sym == var) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4200, __FUNCTION__), 0 : 0))
;
4201
4202 gfc_conv_expr (&rse, expr2->value.function.actual->next->expr);
4203 gfc_add_block_to_block (&block, &rse.pre);
4204 if (expr2->value.function.actual->next->next != NULL__null)
4205 {
4206 tree accum = gfc_create_var (TREE_TYPE (rse.expr)((contains_struct_check ((rse.expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4206, __FUNCTION__))->typed.type)
, NULL__null);
4207 gfc_actual_arglist *arg;
4208
4209 gfc_add_modify (&block, accum, rse.expr);
4210 for (arg = expr2->value.function.actual->next->next; arg;
4211 arg = arg->next)
4212 {
4213 gfc_init_block (&rse.pre);
4214 gfc_conv_expr (&rse, arg->expr);
4215 gfc_add_block_to_block (&block, &rse.pre);
4216 x = fold_build2_loc (input_location, op, TREE_TYPE (accum)((contains_struct_check ((accum), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4216, __FUNCTION__))->typed.type)
,
4217 accum, rse.expr);
4218 gfc_add_modify (&block, accum, x);
4219 }
4220
4221 rse.expr = accum;
4222 }
4223
4224 expr2 = expr2->value.function.actual->next->expr;
4225 }
4226
4227 lhsaddr = save_expr (lhsaddr);
4228 if (TREE_CODE (lhsaddr)((enum tree_code) (lhsaddr)->base.code) != SAVE_EXPR
4229 && (TREE_CODE (lhsaddr)((enum tree_code) (lhsaddr)->base.code) != ADDR_EXPR
4230 || !VAR_P (TREE_OPERAND (lhsaddr, 0))(((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((lhsaddr), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4230, __FUNCTION__))))))->base.code) == VAR_DECL)
))
4231 {
4232 /* Make sure LHS is simple enough so that goa_lhs_expr_p can recognize
4233 it even after unsharing function body. */
4234 tree var = create_tmp_var_raw (TREE_TYPE (lhsaddr)((contains_struct_check ((lhsaddr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4234, __FUNCTION__))->typed.type)
);
4235 DECL_CONTEXT (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4235, __FUNCTION__))->decl_minimal.context)
= current_function_decl;
4236 lhsaddr = build4 (TARGET_EXPR, TREE_TYPE (lhsaddr)((contains_struct_check ((lhsaddr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4236, __FUNCTION__))->typed.type)
, var, lhsaddr,
4237 NULL_TREE(tree) __null, NULL_TREE(tree) __null);
4238 }
4239
4240 rhs = gfc_evaluate_now (rse.expr, &block);
4241
4242 if (((atomic_code->ext.omp_clauses->atomic_op & GFC_OMP_ATOMIC_MASK)
4243 == GFC_OMP_ATOMIC_WRITE)
4244 || (atomic_code->ext.omp_clauses->atomic_op & GFC_OMP_ATOMIC_SWAP))
4245 x = rhs;
4246 else
4247 {
4248 x = convert (TREE_TYPE (rhs)((contains_struct_check ((rhs), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4248, __FUNCTION__))->typed.type)
,
4249 build_fold_indirect_ref_loc (input_location, lhsaddr));
4250 if (var_on_left)
4251 x = fold_build2_loc (input_location, op, TREE_TYPE (rhs)((contains_struct_check ((rhs), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4251, __FUNCTION__))->typed.type)
, x, rhs);
4252 else
4253 x = fold_build2_loc (input_location, op, TREE_TYPE (rhs)((contains_struct_check ((rhs), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4253, __FUNCTION__))->typed.type)
, rhs, x);
4254 }
4255
4256 if (TREE_CODE (TREE_TYPE (rhs))((enum tree_code) (((contains_struct_check ((rhs), (TS_TYPED)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4256, __FUNCTION__))->typed.type))->base.code)
== COMPLEX_TYPE
4257 && TREE_CODE (type)((enum tree_code) (type)->base.code) != COMPLEX_TYPE)
4258 x = fold_build1_loc (input_location, REALPART_EXPR,
4259 TREE_TYPE (TREE_TYPE (rhs))((contains_struct_check ((((contains_struct_check ((rhs), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4259, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4259, __FUNCTION__))->typed.type)
, x);
4260
4261 gfc_add_block_to_block (&block, &lse.pre);
4262 gfc_add_block_to_block (&block, &rse.pre);
4263
4264 if (aop == OMP_ATOMIC)
4265 {
4266 x = build2_v (OMP_ATOMIC, lhsaddr, convert (type, x))fold_build2_loc (input_location, OMP_ATOMIC, global_trees[TI_VOID_TYPE
], lhsaddr, convert (type, x))
;
4267 OMP_ATOMIC_MEMORY_ORDER (x)((tree_range_check ((x), (OMP_ATOMIC), (OMP_ATOMIC_CAPTURE_NEW
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4267, __FUNCTION__))->base.u.omp_atomic_memory_order)
= mo;
4268 gfc_add_expr_to_block (&block, x);
4269 }
4270 else
4271 {
4272 if (aop == OMP_ATOMIC_CAPTURE_NEW)
4273 {
4274 code = code->next;
4275 expr2 = code->expr2;
4276 if (expr2->expr_type == EXPR_FUNCTION
4277 && expr2->value.function.isym
4278 && expr2->value.function.isym->id == GFC_ISYM_CONVERSION)
4279 expr2 = expr2->value.function.actual->expr;
4280
4281 gcc_assert (expr2->expr_type == EXPR_VARIABLE)((void)(!(expr2->expr_type == EXPR_VARIABLE) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4281, __FUNCTION__), 0 : 0))
;
4282 gfc_conv_expr (&vse, code->expr1);
4283 gfc_add_block_to_block (&block, &vse.pre);
4284
4285 gfc_init_se (&lse, NULL__null);
4286 gfc_conv_expr (&lse, expr2);
4287 gfc_add_block_to_block (&block, &lse.pre);
4288 }
4289 x = build2 (aop, type, lhsaddr, convert (type, x));
4290 OMP_ATOMIC_MEMORY_ORDER (x)((tree_range_check ((x), (OMP_ATOMIC), (OMP_ATOMIC_CAPTURE_NEW
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4290, __FUNCTION__))->base.u.omp_atomic_memory_order)
= mo;
4291 x = convert (TREE_TYPE (vse.expr)((contains_struct_check ((vse.expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4291, __FUNCTION__))->typed.type)
, x);
4292 gfc_add_modify (&block, vse.expr, x);
4293 }
4294
4295 return gfc_finish_block (&block);
4296}
4297
4298static tree
4299gfc_trans_omp_barrier (void)
4300{
4301 tree decl = builtin_decl_explicit (BUILT_IN_GOMP_BARRIER);
4302 return build_call_expr_loc (input_location, decl, 0);
4303}
4304
4305static tree
4306gfc_trans_omp_cancel (gfc_code *code)
4307{
4308 int mask = 0;
4309 tree ifc = boolean_true_nodeglobal_trees[TI_BOOLEAN_TRUE];
4310 stmtblock_t block;
4311 switch (code->ext.omp_clauses->cancel)
4312 {
4313 case OMP_CANCEL_PARALLEL: mask = 1; break;
4314 case OMP_CANCEL_DO: mask = 2; break;
4315 case OMP_CANCEL_SECTIONS: mask = 4; break;
4316 case OMP_CANCEL_TASKGROUP: mask = 8; break;
4317 default: gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4317, __FUNCTION__))
;
4318 }
4319 gfc_start_block (&block);
4320 if (code->ext.omp_clauses->if_expr
4321 || code->ext.omp_clauses->if_exprs[OMP_IF_CANCEL])
4322 {
4323 gfc_se se;
4324 tree if_var;
4325
4326 gcc_assert ((code->ext.omp_clauses->if_expr == NULL)((void)(!((code->ext.omp_clauses->if_expr == __null) ^ (
code->ext.omp_clauses->if_exprs[OMP_IF_CANCEL] == __null
)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4327, __FUNCTION__), 0 : 0))
4327 ^ (code->ext.omp_clauses->if_exprs[OMP_IF_CANCEL] == NULL))((void)(!((code->ext.omp_clauses->if_expr == __null) ^ (
code->ext.omp_clauses->if_exprs[OMP_IF_CANCEL] == __null
)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4327, __FUNCTION__), 0 : 0))
;
4328 gfc_init_se (&se, NULL__null);
4329 gfc_conv_expr (&se, code->ext.omp_clauses->if_expr != NULL__null
4330 ? code->ext.omp_clauses->if_expr
4331 : code->ext.omp_clauses->if_exprs[OMP_IF_CANCEL]);
4332 gfc_add_block_to_block (&block, &se.pre);
4333 if_var = gfc_evaluate_now (se.expr, &block);
4334 gfc_add_block_to_block (&block, &se.post);
4335 tree type = TREE_TYPE (if_var)((contains_struct_check ((if_var), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4335, __FUNCTION__))->typed.type)
;
4336 ifc = fold_build2_loc (input_location, NE_EXPR,
4337 boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE], if_var,
4338 build_zero_cst (type));
4339 }
4340 tree decl = builtin_decl_explicit (BUILT_IN_GOMP_CANCEL);
4341 tree c_bool_type = TREE_TYPE (TREE_TYPE (decl))((contains_struct_check ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4341, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4341, __FUNCTION__))->typed.type)
;
4342 ifc = fold_convert (c_bool_type, ifc)fold_convert_loc (((location_t) 0), c_bool_type, ifc);
4343 gfc_add_expr_to_block (&block,
4344 build_call_expr_loc (input_location, decl, 2,
4345 build_int_cst (integer_type_nodeinteger_types[itk_int],
4346 mask), ifc));
4347 return gfc_finish_block (&block);
4348}
4349
4350static tree
4351gfc_trans_omp_cancellation_point (gfc_code *code)
4352{
4353 int mask = 0;
4354 switch (code->ext.omp_clauses->cancel)
4355 {
4356 case OMP_CANCEL_PARALLEL: mask = 1; break;
4357 case OMP_CANCEL_DO: mask = 2; break;
4358 case OMP_CANCEL_SECTIONS: mask = 4; break;
4359 case OMP_CANCEL_TASKGROUP: mask = 8; break;
4360 default: gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4360, __FUNCTION__))
;
4361 }
4362 tree decl = builtin_decl_explicit (BUILT_IN_GOMP_CANCELLATION_POINT);
4363 return build_call_expr_loc (input_location, decl, 1,
4364 build_int_cst (integer_type_nodeinteger_types[itk_int], mask));
4365}
4366
4367static tree
4368gfc_trans_omp_critical (gfc_code *code)
4369{
4370 stmtblock_t block;
4371 tree stmt, name = NULL_TREE(tree) __null;
4372 if (code->ext.omp_clauses->critical_name != NULL__null)
4373 name = get_identifier (code->ext.omp_clauses->critical_name)(__builtin_constant_p (code->ext.omp_clauses->critical_name
) ? get_identifier_with_length ((code->ext.omp_clauses->
critical_name), strlen (code->ext.omp_clauses->critical_name
)) : get_identifier (code->ext.omp_clauses->critical_name
))
;
4374 gfc_start_block (&block);
4375 stmt = make_node (OMP_CRITICAL);
4376 TREE_TYPE (stmt)((contains_struct_check ((stmt), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4376, __FUNCTION__))->typed.type)
= void_type_nodeglobal_trees[TI_VOID_TYPE];
4377 OMP_CRITICAL_BODY (stmt)(*((const_cast<tree*> (tree_operand_check (((tree_check
((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4377, __FUNCTION__, (OMP_CRITICAL)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4377, __FUNCTION__)))))
= gfc_trans_code (code->block->next);
4378 OMP_CRITICAL_NAME (stmt)(*((const_cast<tree*> (tree_operand_check (((tree_check
((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4378, __FUNCTION__, (OMP_CRITICAL)))), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4378, __FUNCTION__)))))
= name;
4379 OMP_CRITICAL_CLAUSES (stmt)(*((const_cast<tree*> (tree_operand_check (((tree_check
((stmt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4379, __FUNCTION__, (OMP_CRITICAL)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4379, __FUNCTION__)))))
= gfc_trans_omp_clauses (&block,
4380 code->ext.omp_clauses,
4381 code->loc);
4382 gfc_add_expr_to_block (&block, stmt);
4383 return gfc_finish_block (&block);
4384}
4385
4386typedef struct dovar_init_d {
4387 tree var;
4388 tree init;
4389} dovar_init;
4390
4391
4392static tree
4393gfc_trans_omp_do (gfc_code *code, gfc_exec_op op, stmtblock_t *pblock,
4394 gfc_omp_clauses *do_clauses, tree par_clauses)
4395{
4396 gfc_se se;
4397 tree dovar, stmt, from, to, step, type, init, cond, incr, orig_decls;
4398 tree count = NULL_TREE(tree) __null, cycle_label, tmp, omp_clauses;
4399 stmtblock_t block;
4400 stmtblock_t body;
4401 gfc_omp_clauses *clauses = code->ext.omp_clauses;
4402 int i, collapse = clauses->collapse;
4403 vec<dovar_init> inits = vNULL;
4404 dovar_init *di;
4405 unsigned ix;
4406 vec<tree, va_heap, vl_embed> *saved_doacross_steps = doacross_steps;
4407 gfc_expr_list *tile = do_clauses ? do_clauses->tile_list : clauses->tile_list;
4408
4409 /* Both collapsed and tiled loops are lowered the same way. In
4410 OpenACC, those clauses are not compatible, so prioritize the tile
4411 clause, if present. */
4412 if (tile)
4413 {
4414 collapse = 0;
4415 for (gfc_expr_list *el = tile; el; el = el->next)
4416 collapse++;
4417 }
4418
4419 doacross_steps = NULL__null;
4420 if (clauses->orderedc)
4421 collapse = clauses->orderedc;
4422 if (collapse <= 0)
4423 collapse = 1;
4424
4425 code = code->block->next;
4426 gcc_assert (code->op == EXEC_DO)((void)(!(code->op == EXEC_DO) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4426, __FUNCTION__), 0 : 0))
;
4427
4428 init = make_tree_vec (collapse);
4429 cond = make_tree_vec (collapse);
4430 incr = make_tree_vec (collapse);
4431 orig_decls = clauses->orderedc ? make_tree_vec (collapse) : NULL_TREE(tree) __null;
4432
4433 if (pblock == NULL__null)
4434 {
4435 gfc_start_block (&block);
4436 pblock = &block;
4437 }
4438
4439 /* simd schedule modifier is only useful for composite do simd and other
4440 constructs including that, where gfc_trans_omp_do is only called
4441 on the simd construct and DO's clauses are translated elsewhere. */
4442 do_clauses->sched_simd = false;
4443
4444 omp_clauses = gfc_trans_omp_clauses (pblock, do_clauses, code->loc);
4445
4446 for (i = 0; i < collapse; i++)
4447 {
4448 int simple = 0;
4449 int dovar_found = 0;
4450 tree dovar_decl;
4451
4452 if (clauses)
4453 {
4454 gfc_omp_namelist *n = NULL__null;
4455 if (op == EXEC_OMP_SIMD && collapse == 1)
4456 for (n = clauses->lists[OMP_LIST_LINEAR];
4457 n != NULL__null; n = n->next)
4458 if (code->ext.iterator->var->symtree->n.sym == n->sym)
4459 {
4460 dovar_found = 3;
4461 break;
4462 }
4463 if (n == NULL__null && op != EXEC_OMP_DISTRIBUTE)
4464 for (n = clauses->lists[OMP_LIST_LASTPRIVATE];
4465 n != NULL__null; n = n->next)
4466 if (code->ext.iterator->var->symtree->n.sym == n->sym)
4467 {
4468 dovar_found = 2;
4469 break;
4470 }
4471 if (n == NULL__null)
4472 for (n = clauses->lists[OMP_LIST_PRIVATE]; n != NULL__null; n = n->next)
4473 if (code->ext.iterator->var->symtree->n.sym == n->sym)
4474 {
4475 dovar_found = 1;
4476 break;
4477 }
4478 }
4479
4480 /* Evaluate all the expressions in the iterator. */
4481 gfc_init_se (&se, NULL__null);
4482 gfc_conv_expr_lhs (&se, code->ext.iterator->var);
4483 gfc_add_block_to_block (pblock, &se.pre);
4484 dovar = se.expr;
4485 type = TREE_TYPE (dovar)((contains_struct_check ((dovar), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4485, __FUNCTION__))->typed.type)
;
4486 gcc_assert (TREE_CODE (type) == INTEGER_TYPE)((void)(!(((enum tree_code) (type)->base.code) == INTEGER_TYPE
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4486, __FUNCTION__), 0 : 0))
;
4487
4488 gfc_init_se (&se, NULL__null);
4489 gfc_conv_expr_val (&se, code->ext.iterator->start);
4490 gfc_add_block_to_block (pblock, &se.pre);
4491 from = gfc_evaluate_now (se.expr, pblock);
4492
4493 gfc_init_se (&se, NULL__null);
4494 gfc_conv_expr_val (&se, code->ext.iterator->end);
4495 gfc_add_block_to_block (pblock, &se.pre);
4496 to = gfc_evaluate_now (se.expr, pblock);
4497
4498 gfc_init_se (&se, NULL__null);
4499 gfc_conv_expr_val (&se, code->ext.iterator->step);
4500 gfc_add_block_to_block (pblock, &se.pre);
4501 step = gfc_evaluate_now (se.expr, pblock);
4502 dovar_decl = dovar;
4503
4504 /* Special case simple loops. */
4505 if (VAR_P (dovar)(((enum tree_code) (dovar)->base.code) == VAR_DECL))
4506 {
4507 if (integer_onep (step))
4508 simple = 1;
4509 else if (tree_int_cst_equal (step, integer_minus_one_nodeglobal_trees[TI_INTEGER_MINUS_ONE]))
4510 simple = -1;
4511 }
4512 else
4513 dovar_decl
4514 = gfc_trans_omp_variable (code->ext.iterator->var->symtree->n.sym,
4515 false);
4516
4517 /* Loop body. */
4518 if (simple)
4519 {
4520 TREE_VEC_ELT (init, i)(*((const_cast<tree *> (tree_vec_elt_check ((init), (i)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4520, __FUNCTION__)))))
= build2_v (MODIFY_EXPR, dovar, from)fold_build2_loc (input_location, MODIFY_EXPR, global_trees[TI_VOID_TYPE
], dovar, from)
;
4521 /* The condition should not be folded. */
4522 TREE_VEC_ELT (cond, i)(*((const_cast<tree *> (tree_vec_elt_check ((cond), (i)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4522, __FUNCTION__)))))
= build2_loc (input_location, simple > 0
4523 ? LE_EXPR : GE_EXPR,
4524 logical_type_node, dovar, to);
4525 TREE_VEC_ELT (incr, i)(*((const_cast<tree *> (tree_vec_elt_check ((incr), (i)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4525, __FUNCTION__)))))
= fold_build2_loc (input_location, PLUS_EXPR,
4526 type, dovar, step);
4527 TREE_VEC_ELT (incr, i)(*((const_cast<tree *> (tree_vec_elt_check ((incr), (i)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4527, __FUNCTION__)))))
= fold_build2_loc (input_location,
4528 MODIFY_EXPR,
4529 type, dovar,
4530 TREE_VEC_ELT (incr, i)(*((const_cast<tree *> (tree_vec_elt_check ((incr), (i)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4530, __FUNCTION__)))))
);
4531 }
4532 else
4533 {
4534 /* STEP is not 1 or -1. Use:
4535 for (count = 0; count < (to + step - from) / step; count++)
4536 {
4537 dovar = from + count * step;
4538 body;
4539 cycle_label:;
4540 } */
4541 tmp = fold_build2_loc (input_location, MINUS_EXPR, type, step, from);
4542 tmp = fold_build2_loc (input_location, PLUS_EXPR, type, to, tmp);
4543 tmp = fold_build2_loc (input_location, TRUNC_DIV_EXPR, type, tmp,
4544 step);
4545 tmp = gfc_evaluate_now (tmp, pblock);
4546 count = gfc_create_var (type, "count");
4547 TREE_VEC_ELT (init, i)(*((const_cast<tree *> (tree_vec_elt_check ((init), (i)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4547, __FUNCTION__)))))
= build2_v (MODIFY_EXPR, count,fold_build2_loc (input_location, MODIFY_EXPR, global_trees[TI_VOID_TYPE
], count, build_int_cst (type, 0))
4548 build_int_cst (type, 0))fold_build2_loc (input_location, MODIFY_EXPR, global_trees[TI_VOID_TYPE
], count, build_int_cst (type, 0))
;
4549 /* The condition should not be folded. */
4550 TREE_VEC_ELT (cond, i)(*((const_cast<tree *> (tree_vec_elt_check ((cond), (i)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4550, __FUNCTION__)))))
= build2_loc (input_location, LT_EXPR,
4551 logical_type_node,
4552 count, tmp);
4553 TREE_VEC_ELT (incr, i)(*((const_cast<tree *> (tree_vec_elt_check ((incr), (i)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4553, __FUNCTION__)))))
= fold_build2_loc (input_location, PLUS_EXPR,
4554 type, count,
4555 build_int_cst (type, 1));
4556 TREE_VEC_ELT (incr, i)(*((const_cast<tree *> (tree_vec_elt_check ((incr), (i)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4556, __FUNCTION__)))))
= fold_build2_loc (input_location,
4557 MODIFY_EXPR, type, count,
4558 TREE_VEC_ELT (incr, i)(*((const_cast<tree *> (tree_vec_elt_check ((incr), (i)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/fortran/trans-openmp.c"
, 4558, __FUNCTION__)))))
);
4559
4560 /* Initialize DOVAR. */
4561 tmp = fold_build2_loc (input_location, MULT_EXPR, type, count, step);
4562 tmp = fold_build2_loc (input_location, PLUS_EXPR, type, from, tmp);
4563 dovar_init e = {dovar, tmp};
4564 inits.safe_push (e);
4565