fortran: Apply if clause to all sub-constructs in combined OpenMP constructs
authorKwok Cheung Yeung <kcy@codesourcery.com>
Thu, 25 Jun 2020 11:40:16 +0000 (04:40 -0700)
committerKwok Cheung Yeung <kcy@codesourcery.com>
Thu, 25 Jun 2020 13:06:12 +0000 (06:06 -0700)
commit1dfa89b0355520ca501054726f25de9733796f48
tree47089ecdd09b8912077f847688deb360b81951d7
parentd2adb79eac663874593a28387db593fb4bb2995f
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>
gcc/fortran/trans-openmp.c
gcc/testsuite/gfortran.dg/gomp/combined-if.f90 [new file with mode: 0644]