diff options
author | Kwok Cheung Yeung <kcy@codesourcery.com> | 2019-10-02 10:31:02 +0000 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2019-10-02 12:31:02 +0200 |
commit | 73a28634098cb1aba4a1773e62b6387af120dd9e (patch) | |
tree | 04b74614812eb5badf5bd35f2fc3ad29ff83bd08 /gcc/omp-low.c | |
parent | 68710ac7da29c2ed111755351936d1956f64de7c (diff) | |
download | gcc-73a28634098cb1aba4a1773e62b6387af120dd9e.zip gcc-73a28634098cb1aba4a1773e62b6387af120dd9e.tar.gz gcc-73a28634098cb1aba4a1773e62b6387af120dd9e.tar.bz2 |
f95-lang.c (LANG_HOOKS_OMP_IS_OPTIONAL_ARGUMENT): Define to gfc_omp_is_optional_argument.
2019-10-02 Kwok Cheung Yeung <kcy@codesourcery.com>
gcc/fortran/
* f95-lang.c (LANG_HOOKS_OMP_IS_OPTIONAL_ARGUMENT): Define to
gfc_omp_is_optional_argument.
* trans-decl.c (create_function_arglist): Set
GFC_DECL_OPTIONAL_ARGUMENT in the generated decl if the parameter is
optional.
* trans-openmp.c (gfc_omp_is_optional_argument): New.
(gfc_omp_privatize_by_reference): Return true if the decl is an
optional pass-by-reference argument.
* trans.h (gfc_omp_is_optional_argument): New declaration.
(lang_decl): Add new optional_arg field.
(GFC_DECL_OPTIONAL_ARGUMENT): New macro.
gcc/
* langhooks-def.h (LANG_HOOKS_OMP_IS_OPTIONAL_ARGUMENT): Default to
false.
(LANG_HOOKS_DECLS): Add LANG_HOOKS_OMP_IS_OPTIONAL_ARGUMENT.
* langhooks.h (omp_is_optional_argument): New hook.
* omp-general.c (omp_is_optional_argument): New.
* omp-general.h (omp_is_optional_argument): New declaration.
* omp-low.c (lower_omp_target): Create temporary for received value
and take the address for new_var if the original variable was a
DECL_BY_REFERENCE. Use size of referenced object when a
pass-by-reference optional argument used as argument to firstprivate.
From-SVN: r276444
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r-- | gcc/omp-low.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 5db182c..a0e5041 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -11395,7 +11395,8 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx) { gcc_assert (is_gimple_omp_oacc (ctx->stmt)); if (omp_is_reference (new_var) - && TREE_CODE (TREE_TYPE (new_var)) != POINTER_TYPE) + && (TREE_CODE (TREE_TYPE (new_var)) != POINTER_TYPE + || DECL_BY_REFERENCE (var))) { /* Create a local object to hold the instance value. */ |