aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-openmp.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2021-06-09 10:48:41 +0200
committerJakub Jelinek <jakub@redhat.com>2021-06-09 10:48:41 +0200
commitd4d38135b3137f1d3148138340e67bdcd7ea8216 (patch)
treee9b084f02634272681f8ef241dbe37ee466d933e /gcc/fortran/trans-openmp.c
parent267dbd42f42c52a515f49c0875d296a9cf5988fe (diff)
downloadgcc-d4d38135b3137f1d3148138340e67bdcd7ea8216.zip
gcc-d4d38135b3137f1d3148138340e67bdcd7ea8216.tar.gz
gcc-d4d38135b3137f1d3148138340e67bdcd7ea8216.tar.bz2
openmp: Gimplify OMP_CLAUSE_SIZE during gfc_omp_finish_clause [PR100965]
As the testcase shows, we need to gimplify OMP_CLAUSE_SIZE, so that we don't end up with SAVE_EXPR or anything similar non-gimple in it. 2021-06-08 Jakub Jelinek <jakub@redhat.com> PR fortran/100965 * trans-openmp.c (gfc_omp_finish_clause): Gimplify OMP_CLAUSE_SIZE. * gfortran.dg/gomp/pr100965.f90: New test.
Diffstat (limited to 'gcc/fortran/trans-openmp.c')
-rw-r--r--gcc/fortran/trans-openmp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index c8c61a5..f466ab6 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -1639,6 +1639,9 @@ gfc_omp_finish_clause (tree c, gimple_seq *pre_p, bool openacc)
OMP_CLAUSE_SIZE (c)
= DECL_P (decl) ? DECL_SIZE_UNIT (decl)
: TYPE_SIZE_UNIT (TREE_TYPE (decl));
+ if (gimplify_expr (&OMP_CLAUSE_SIZE (c), pre_p,
+ NULL, is_gimple_val, fb_rvalue) == GS_ERROR)
+ OMP_CLAUSE_SIZE (c) = size_int (0);
if (c2)
{
OMP_CLAUSE_CHAIN (c2) = OMP_CLAUSE_CHAIN (last);