diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2019-10-02 10:33:42 +0000 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2019-10-02 12:33:42 +0200 |
commit | 67c259509c0ab6475a27e871afdf12434ac34d48 (patch) | |
tree | 4059685457e50ba972a2fc329e18d9e2a647346d /gcc | |
parent | 73a28634098cb1aba4a1773e62b6387af120dd9e (diff) | |
download | gcc-67c259509c0ab6475a27e871afdf12434ac34d48.zip gcc-67c259509c0ab6475a27e871afdf12434ac34d48.tar.gz gcc-67c259509c0ab6475a27e871afdf12434ac34d48.tar.bz2 |
Fix omp target issue with Fortran optional arguments
gcc/
* omp-low.c (lower_omp_target): Dereference optional argument
to work with the right pointer.
gcc/testsuite/
* libgomp/testsuite/libgomp.fortran/use_device_ptr-optional-1.f90: New.
From-SVN: r276445
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/omp-low.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 |
3 files changed, 10 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7e46703..6f577c3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-10-02 Tobias Burnus <tobias@codesourcery.com> + + * omp-low.c (lower_omp_target): Dereference optional argument + to work with the right pointer. + 2019-10-02 Kwok Cheung Yeung <kcy@codesourcery.com> * langhooks-def.h (LANG_HOOKS_OMP_IS_OPTIONAL_ARGUMENT): Default to diff --git a/gcc/omp-low.c b/gcc/omp-low.c index a0e5041..ca7dfdb 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -11870,7 +11870,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx) var = build_fold_addr_expr (var); else { - if (omp_is_reference (ovar)) + if (omp_is_reference (ovar) || omp_is_optional_argument (ovar)) { type = TREE_TYPE (type); if (TREE_CODE (type) != ARRAY_TYPE diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4cb4303..d95e6e7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2019-10-02 Tobias Burnus <tobias@codesourcery.com> + + * libgomp/testsuite/libgomp.fortran/use_device_ptr-optional-1.f90: New. + 2019-10-02 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/91940 |