diff options
author | Prathamesh Kulkarni <prathameshk@nvidia.com> | 2024-09-05 18:52:53 +0530 |
---|---|---|
committer | Prathamesh Kulkarni <prathameshk@nvidia.com> | 2024-09-05 18:52:53 +0530 |
commit | ae88e91938af364ef5613e5461b12b484b578bc5 (patch) | |
tree | eae487ee33f8194b62861b9f69ac1d5096fca0fc /gcc | |
parent | 8f5aade15e595b288a2c4ec60ddde8dc80df1a80 (diff) | |
download | gcc-ae88e91938af364ef5613e5461b12b484b578bc5.zip gcc-ae88e91938af364ef5613e5461b12b484b578bc5.tar.gz gcc-ae88e91938af364ef5613e5461b12b484b578bc5.tar.bz2 |
Avoid ICE when passing VLA vector to accelerator.
gcc/ChangeLog:
* gimplify.cc (omp_add_variable): Check if decl size is not poly_int_tree_p.
(gimplify_adjust_omp_clauses): Likewise.
* omp-low.cc (scan_sharing_clauses): Likewise.
(lower_omp_target): Likewise.
Signed-off-by: Prathamesh Kulkarni <prathameshk@nvidia.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/gimplify.cc | 4 | ||||
-rw-r--r-- | gcc/omp-low.cc | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc index 9300138..ceb53e5 100644 --- a/gcc/gimplify.cc +++ b/gcc/gimplify.cc @@ -7799,7 +7799,7 @@ omp_add_variable (struct gimplify_omp_ctx *ctx, tree decl, unsigned int flags) /* When adding a variable-sized variable, we have to handle all sorts of additional bits of data: the pointer replacement variable, and the parameters of the type. */ - if (DECL_SIZE (decl) && TREE_CODE (DECL_SIZE (decl)) != INTEGER_CST) + if (DECL_SIZE (decl) && !poly_int_tree_p (DECL_SIZE (decl))) { /* Add the pointer replacement variable as PRIVATE if the variable replacement is private, else FIRSTPRIVATE since we'll need the @@ -14413,7 +14413,7 @@ gimplify_adjust_omp_clauses (gimple_seq *pre_p, gimple_seq body, tree *list_p, } } else if (DECL_SIZE (decl) - && TREE_CODE (DECL_SIZE (decl)) != INTEGER_CST + && !poly_int_tree_p (DECL_SIZE (decl)) && OMP_CLAUSE_MAP_KIND (c) != GOMP_MAP_POINTER && OMP_CLAUSE_MAP_KIND (c) != GOMP_MAP_FIRSTPRIVATE_POINTER && (OMP_CLAUSE_MAP_KIND (c) diff --git a/gcc/omp-low.cc b/gcc/omp-low.cc index 4d003f4..241f79e 100644 --- a/gcc/omp-low.cc +++ b/gcc/omp-low.cc @@ -1664,7 +1664,7 @@ scan_sharing_clauses (tree clauses, omp_context *ctx) if (DECL_P (decl)) { if (DECL_SIZE (decl) - && TREE_CODE (DECL_SIZE (decl)) != INTEGER_CST) + && !poly_int_tree_p (DECL_SIZE (decl))) { tree decl2 = DECL_VALUE_EXPR (decl); gcc_assert (INDIRECT_REF_P (decl2)); @@ -1906,7 +1906,7 @@ scan_sharing_clauses (tree clauses, omp_context *ctx) = remap_type (TREE_TYPE (decl), &ctx->cb); } else if (DECL_SIZE (decl) - && TREE_CODE (DECL_SIZE (decl)) != INTEGER_CST) + && !poly_int_tree_p (DECL_SIZE (decl))) { tree decl2 = DECL_VALUE_EXPR (decl); gcc_assert (INDIRECT_REF_P (decl2)); @@ -12750,7 +12750,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx) } if (DECL_SIZE (var) - && TREE_CODE (DECL_SIZE (var)) != INTEGER_CST) + && !poly_int_tree_p (DECL_SIZE (var))) { tree var2 = DECL_VALUE_EXPR (var); gcc_assert (TREE_CODE (var2) == INDIRECT_REF); @@ -13077,7 +13077,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx) else { if (DECL_SIZE (ovar) - && TREE_CODE (DECL_SIZE (ovar)) != INTEGER_CST) + && !poly_int_tree_p (DECL_SIZE (ovar))) { tree ovar2 = DECL_VALUE_EXPR (ovar); gcc_assert (TREE_CODE (ovar2) == INDIRECT_REF); |