aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2020-07-14 12:55:53 +0200
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-17 13:17:38 -0300
commitab58aaaebed4dfbbfde932b3fb9047434632f53a (patch)
tree6095c35340b42eb5b0e24dc51bd6d2f6ebc16449 /gcc
parenta740cac67323ce6570f6da73aaff1d813a2d13ba (diff)
downloadgcc-ab58aaaebed4dfbbfde932b3fb9047434632f53a.zip
gcc-ab58aaaebed4dfbbfde932b3fb9047434632f53a.tar.gz
gcc-ab58aaaebed4dfbbfde932b3fb9047434632f53a.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')
-rw-r--r--gcc/fortran/trans-openmp.c5
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);