diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2020-07-14 12:55:53 +0200 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2020-07-14 12:55:53 +0200 |
commit | 174e79bf73331b41b7a14dffd45ed8293487f0e0 (patch) | |
tree | f07e667a6df8fd524a8a44089519d655faacf644 /gcc/fortran/trans-openmp.c | |
parent | f418bd4b92a03ee0ec0fe4cfcd896e86e11ac2cf (diff) | |
download | gcc-174e79bf73331b41b7a14dffd45ed8293487f0e0.zip gcc-174e79bf73331b41b7a14dffd45ed8293487f0e0.tar.gz gcc-174e79bf73331b41b7a14dffd45ed8293487f0e0.tar.bz2 |
[Fortran, OpenMP] Fix allocatable-components check (PR67311)
gcc/fortran/ChangeLog:
PR fortran/67311
* trans-openmp.c (gfc_has_alloc_comps): Return false also for
pointers to arrays.
libgomp/ChangeLog:
PR fortran/67311
* testsuite/libgomp.fortran/target-map-1.f90: New test.
Diffstat (limited to 'gcc/fortran/trans-openmp.c')
-rw-r--r-- | gcc/fortran/trans-openmp.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c index 38e141d..b2645e7 100644 --- a/gcc/fortran/trans-openmp.c +++ b/gcc/fortran/trans-openmp.c @@ -330,6 +330,11 @@ gfc_has_alloc_comps (tree type, tree decl) return false; } + if (GFC_DESCRIPTOR_TYPE_P (type) + && (GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_POINTER + || GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_POINTER_CONT)) + return false; + if (GFC_DESCRIPTOR_TYPE_P (type) || GFC_ARRAY_TYPE_P (type)) type = gfc_get_element_type (type); |