Replacing of a by-reference variable in a private clause by a local variable
makes sense; however, for arrays, the size is not directly known by the type.
This causes an ICE via create_tmp_var which indirectly invokes
force_constant_size in this case - but the latter only handled Ada.
gcc/ChangeLog:
* gimplify.cc (localize_reductions): Do not create local
variable for privatized arrays.
+2020-06-03 Tobias Burnus <tobias@codesourcery.com>
+
+ * gimplify.cc (localize_reductions): Do not create local
+ variable for privatized arrays.
+
2020-03-27 Sandra Loosemore <sandra@codesourcery.com>
* doc/invoke.texi (Option Summary): Add entries for
if (!lang_hooks.decls.omp_privatize_by_reference (var))
continue;
-
type = TREE_TYPE (TREE_TYPE (var));
+ if (TREE_CODE (type) == ARRAY_TYPE)
+ continue;
new_var = create_tmp_var (type, IDENTIFIER_POINTER (DECL_NAME (var)));
pr.ref_var = var;