diff options
Diffstat (limited to 'gcc/fortran/trans-openmp.c')
-rw-r--r-- | gcc/fortran/trans-openmp.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c index 2765561..1c4ae62 100644 --- a/gcc/fortran/trans-openmp.c +++ b/gcc/fortran/trans-openmp.c @@ -159,6 +159,9 @@ gfc_omp_clause_default_ctor (tree clause, tree decl, tree outer) || GFC_TYPE_ARRAY_AKIND (type) != GFC_ARRAY_ALLOCATABLE) return NULL; + if (OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_REDUCTION) + return NULL; + gcc_assert (outer != NULL); gcc_assert (OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_PRIVATE || OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_LASTPRIVATE); @@ -323,6 +326,9 @@ gfc_omp_clause_dtor (tree clause ATTRIBUTE_UNUSED, tree decl) || GFC_TYPE_ARRAY_AKIND (type) != GFC_ARRAY_ALLOCATABLE) return NULL; + if (OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_REDUCTION) + return NULL; + /* Allocatable arrays in FIRSTPRIVATE/LASTPRIVATE etc. clauses need to be deallocated if they were allocated. */ return gfc_trans_dealloc_allocated (decl, false, NULL); |