From: Tobias Burnus Date: Wed, 3 Jun 2020 13:35:12 +0000 (+0200) Subject: OpenACC: fix privatization of by-reference arrays X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5190d7438a1a9cb93f49183de887b103bfd05c44;p=thirdparty%2Fgcc.git OpenACC: fix privatization of by-reference arrays 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. --- diff --git a/gcc/ChangeLog.omp b/gcc/ChangeLog.omp index 8558b83a1511..750f7a2aad29 100644 --- a/gcc/ChangeLog.omp +++ b/gcc/ChangeLog.omp @@ -1,3 +1,8 @@ +2020-06-03 Tobias Burnus + + * gimplify.cc (localize_reductions): Do not create local + variable for privatized arrays. + 2020-03-27 Sandra Loosemore * doc/invoke.texi (Option Summary): Add entries for diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc index 7fcf4e48da40..9248ca56b162 100644 --- a/gcc/gimplify.cc +++ b/gcc/gimplify.cc @@ -12622,8 +12622,9 @@ localize_reductions (tree clauses, tree body) 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;