diff options
author | Sandra Loosemore <sloosemore@baylibre.com> | 2024-04-22 18:24:25 +0000 |
---|---|---|
committer | Sandra Loosemore <sloosemore@baylibre.com> | 2024-05-06 14:37:14 +0000 |
commit | 80c03ac8041340b29325f86ed58ea8bd40a55b99 (patch) | |
tree | 5f06828766c07405c32976cbd8fa98f1dc86719c /gcc | |
parent | 7c469a9fc785505dc350aba60311812c2bb0c1b5 (diff) | |
download | gcc-80c03ac8041340b29325f86ed58ea8bd40a55b99.zip gcc-80c03ac8041340b29325f86ed58ea8bd40a55b99.tar.gz gcc-80c03ac8041340b29325f86ed58ea8bd40a55b99.tar.bz2 |
OpenMP: Fix for ICE in tree-nested.cc.
Use gimple_omp_target_clauses() instead of gimple_omp_taskreg_clauses()
when stmt is GIMPLE_OMP_TARGET, to avoid an as_a<> ICE. The code
immediately following this is already conditionalized in the same way.
gcc/ChangeLog
* tree-nested.cc (convert_tramp_reference_stmt): Use the correct
accessor for GIMPLE_OMP_TARGET clauses.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/tree-nested.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/tree-nested.cc b/gcc/tree-nested.cc index 4e5f3be..fc0495d 100644 --- a/gcc/tree-nested.cc +++ b/gcc/tree-nested.cc @@ -2906,9 +2906,11 @@ convert_tramp_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p, continue; decl = i ? get_chain_decl (info) : info->frame_decl; /* Don't add CHAIN.* or FRAME.* twice. */ - for (c = gimple_omp_taskreg_clauses (stmt); - c; - c = OMP_CLAUSE_CHAIN (c)) + if (gimple_code (stmt) == GIMPLE_OMP_TARGET) + c = gimple_omp_target_clauses (stmt); + else + c = gimple_omp_taskreg_clauses (stmt); + for (; c; c = OMP_CLAUSE_CHAIN (c)) if ((OMP_CLAUSE_CODE (c) == OMP_CLAUSE_FIRSTPRIVATE || OMP_CLAUSE_CODE (c) == OMP_CLAUSE_SHARED) && OMP_CLAUSE_DECL (c) == decl) |