aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-openmp.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-12-07 00:29:04 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2018-12-07 00:29:04 +0100
commitd4722625ae34641556c1b3ea281ea4cbb0293426 (patch)
treeefd4d5b91796bb86a89e390c743bf192b63d071d /gcc/fortran/trans-openmp.c
parentb8a003c16567ccecffce256a2b35c9210db933a4 (diff)
downloadgcc-d4722625ae34641556c1b3ea281ea4cbb0293426.zip
gcc-d4722625ae34641556c1b3ea281ea4cbb0293426.tar.gz
gcc-d4722625ae34641556c1b3ea281ea4cbb0293426.tar.bz2
re PR fortran/88377 (ICE in gfc_omp_clause_copy_ctor, at fortran/trans-openmp.c:614)
PR fortran/88377 * trans-openmp.c (gfc_omp_clause_default_ctor, gfc_omp_clause_copy_ctor, gfc_omp_clause_assign_op, gfc_omp_clause_linear_ctor, gfc_omp_clause_dtor): Only consider GFC_DECL_GET_SCALAR_ALLOCATABLE vars as scalar allocatables if they have pointer type. * gfortran.dg/gomp/pr88377.f90: New test. From-SVN: r266879
Diffstat (limited to 'gcc/fortran/trans-openmp.c')
-rw-r--r--gcc/fortran/trans-openmp.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index 483ca66..c9fc4e4 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -460,7 +460,8 @@ gfc_omp_clause_default_ctor (tree clause, tree decl, tree outer)
if ((! GFC_DESCRIPTOR_TYPE_P (type)
|| GFC_TYPE_ARRAY_AKIND (type) != GFC_ARRAY_ALLOCATABLE)
- && !GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause)))
+ && (!GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause))
+ || !POINTER_TYPE_P (type)))
{
if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)))
{
@@ -567,7 +568,8 @@ gfc_omp_clause_copy_ctor (tree clause, tree dest, tree src)
if ((! GFC_DESCRIPTOR_TYPE_P (type)
|| GFC_TYPE_ARRAY_AKIND (type) != GFC_ARRAY_ALLOCATABLE)
- && !GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause)))
+ && (!GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause))
+ || !POINTER_TYPE_P (type)))
{
if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)))
{
@@ -667,7 +669,8 @@ gfc_omp_clause_assign_op (tree clause, tree dest, tree src)
if ((! GFC_DESCRIPTOR_TYPE_P (type)
|| GFC_TYPE_ARRAY_AKIND (type) != GFC_ARRAY_ALLOCATABLE)
- && !GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause)))
+ && (!GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause))
+ || !POINTER_TYPE_P (type)))
{
if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)))
{
@@ -905,7 +908,8 @@ gfc_omp_clause_linear_ctor (tree clause, tree dest, tree src, tree add)
if ((! GFC_DESCRIPTOR_TYPE_P (type)
|| GFC_TYPE_ARRAY_AKIND (type) != GFC_ARRAY_ALLOCATABLE)
- && !GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause)))
+ && (!GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause))
+ || !POINTER_TYPE_P (type)))
{
gcc_assert (TREE_CODE (type) == ARRAY_TYPE);
if (!TYPE_DOMAIN (type)
@@ -989,7 +993,8 @@ gfc_omp_clause_dtor (tree clause, tree decl)
if ((! GFC_DESCRIPTOR_TYPE_P (type)
|| GFC_TYPE_ARRAY_AKIND (type) != GFC_ARRAY_ALLOCATABLE)
- && !GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause)))
+ && (!GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause))
+ || !POINTER_TYPE_P (type)))
{
if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)))
return gfc_walk_alloc_comps (decl, NULL_TREE,