diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2021-03-12 16:33:02 +0100 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2021-03-12 16:33:02 +0100 |
commit | 0b5437510c13dc0879349a4f259c800d2ce02eb2 (patch) | |
tree | e826db71f61bb4b8581652be07a4608d25025a3f /gcc | |
parent | a6e9633ccb593937fceec67fafc2afe5d518d735 (diff) | |
download | gcc-0b5437510c13dc0879349a4f259c800d2ce02eb2.zip gcc-0b5437510c13dc0879349a4f259c800d2ce02eb2.tar.gz gcc-0b5437510c13dc0879349a4f259c800d2ce02eb2.tar.bz2 |
Fortran/OpenMP: Fix use_device_{ptr,addr} with assumed-size array [PR98858]
gcc/ChangeLog:
PR fortran/98858
* gimplify.c (omp_add_variable): Handle NULL_TREE as size
occuring for assumed-size arrays in use_device_{ptr,addr}.
libgomp/ChangeLog:
PR fortran/98858
* testsuite/libgomp.fortran/use_device_ptr-3.f90: New test.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/gimplify.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index caf25cc..6da6698 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -7078,7 +7078,7 @@ omp_add_variable (struct gimplify_omp_ctx *ctx, tree decl, unsigned int flags) if ((flags & GOVD_SHARED) == 0) { t = TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (decl))); - if (DECL_P (t)) + if (t && DECL_P (t)) omp_notice_variable (ctx, t, true); } } |