aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-openmp.c
diff options
context:
space:
mode:
authorKwok Cheung Yeung <kcy@codesourcery.com>2020-06-25 04:40:16 -0700
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-17 13:14:52 -0300
commitc0703630483d3a114583f1f4e2c622179d76b50d (patch)
tree959658a28ff5623c6ddc42d772e131718585ac24 /gcc/fortran/trans-openmp.c
parent1c6780a6186fb949f6906efea620a2f8c7336991 (diff)
downloadgcc-c0703630483d3a114583f1f4e2c622179d76b50d.zip
gcc-c0703630483d3a114583f1f4e2c622179d76b50d.tar.gz
gcc-c0703630483d3a114583f1f4e2c622179d76b50d.tar.bz2
fortran: Apply if clause to all sub-constructs in combined OpenMP constructs
The unmodified 'if' clause should be applied to all the sub-constructs that accept an 'if' clause in a combined OpenMP construct, and not just to the 'parallel' sub-construct. 2020-06-25 Kwok Cheung Yeung <kcy@codesourcery.com> gcc/fortran/ * trans-openmp.c (gfc_split_omp_clauses): Add if clause to target and simd sub-constructs. gcc/testsuite/ * gfortran.dg/gomp/combined-if.f90: New. Reviewed-by: Jakub Jelinek <jakub@redhat.com>
Diffstat (limited to 'gcc/fortran/trans-openmp.c')
-rw-r--r--gcc/fortran/trans-openmp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index 7e2f625..67b7094 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -4748,7 +4748,7 @@ gfc_split_omp_clauses (gfc_code *code,
clausesa[GFC_OMP_SPLIT_TARGET].if_exprs[OMP_IF_TARGET]
= code->ext.omp_clauses->if_exprs[OMP_IF_TARGET];
/* And this is copied to all. */
- clausesa[GFC_OMP_SPLIT_PARALLEL].if_expr
+ clausesa[GFC_OMP_SPLIT_TARGET].if_expr
= code->ext.omp_clauses->if_expr;
}
if (mask & GFC_OMP_MASK_TEAMS)
@@ -4832,6 +4832,9 @@ gfc_split_omp_clauses (gfc_code *code,
/* Duplicate collapse. */
clausesa[GFC_OMP_SPLIT_SIMD].collapse
= code->ext.omp_clauses->collapse;
+ /* And this is copied to all. */
+ clausesa[GFC_OMP_SPLIT_SIMD].if_expr
+ = code->ext.omp_clauses->if_expr;
}
if (mask & GFC_OMP_MASK_TASKLOOP)
{