aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorChung-Lin Tang <cltang@codesourcery.com>2022-01-04 15:37:15 +0800
committerChung-Lin Tang <cltang@codesourcery.com>2022-01-04 15:37:15 +0800
commit62c8b21d48ab6012ddc50529a39071d902dba31a (patch)
tree39d2fda7e555f43b34f5f04ce9c5db6fd21b2b7c /gcc/gimplify.c
parent05da96886efa3ccdcc0e4e337ecd01b2827db213 (diff)
downloadgcc-62c8b21d48ab6012ddc50529a39071d902dba31a.zip
gcc-62c8b21d48ab6012ddc50529a39071d902dba31a.tar.gz
gcc-62c8b21d48ab6012ddc50529a39071d902dba31a.tar.bz2
openmp: Fix ICE in gimplify_omp_affinity [PR103643]
After the PR90030 patch, which removes the universal casting of all Fortran array pointers to 'c_char*', a Fortran descriptor based array passed into an affinity() clause now looks like: - #pragma omp task private(i) shared(b) affinity(*(c_char *) a.data) + #pragma omp task private(i) shared(b) affinity(*(integer(kind=4)[0:] * restrict) a.data) The 'integer(kind=4)[0:]' incomplete type appears to be causing ICE during gimplify_expr() due to 'is_gimple_val, fb_rvalue'. The ICE appears to be fixed just by adjusting to 'is_gimple_lvalue, fb_lvalue'. Considering the use of the affinity() clause, which should be specifying the location of a particular object in memory, this probably makes sense. gcc/ChangeLog: PR middle-end/103643 * gimplify.c (gimplify_omp_affinity): Adjust gimplify_expr of entire OMP_CLAUSE_DECL to use 'is_gimple_lvalue, fb_lvalue' gcc/testsuite/ChangeLog: * gfortran.dg/gomp/pr103643.f90: New test.
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 92b4e75..d1b27d7 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -8123,7 +8123,7 @@ gimplify_omp_affinity (tree *list_p, gimple_seq *pre_p)
if (error_operand_p (OMP_CLAUSE_DECL (c)))
return;
if (gimplify_expr (&OMP_CLAUSE_DECL (c), pre_p, NULL,
- is_gimple_val, fb_rvalue) == GS_ERROR)
+ is_gimple_lvalue, fb_lvalue) == GS_ERROR)
return;
gimplify_and_add (OMP_CLAUSE_DECL (c), pre_p);
}