https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122866
Bug ID: 122866
Summary: [OpenMP] map clauses with unused iterators cause an
ICE
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: arsen at gcc dot gnu.org
Target Milestone: ---
the following example:
struct test { int x; };
#pragma omp declare mapper(struct test v) map(iterator(i = 0:1), tofrom: v.x)
int
main ()
{
struct test s;
#pragma omp target
{ s; }
}
... ICEs the compiler:
0x251241d internal_error(char const*, ...)
gcc/diagnostic-global-context.cc:787
0xa5a071 fancy_abort(char const*, int, char const*)
gcc/diagnostics/context.cc:1805
0x88a2ad enter_omp_iterator_loop_context
gcc/gimplify.cc:10319
0xe91f77 gimplify_adjust_omp_clauses
gcc/gimplify.cc:15866
0xeaa9af gimplify_omp_workshare
gcc/gimplify.cc:18859
0xe85f4f gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
gcc/gimplify.cc:20921
0xe88916 gimplify_stmt(tree_node**, gimple**)
gcc/gimplify.cc:8658
0xe8698b gimplify_statement_list
gcc/gimplify.cc:2293
0xe8698b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
gcc/gimplify.cc:20818
0xe88916 gimplify_stmt(tree_node**, gimple**)
gcc/gimplify.cc:8658
0xe89e54 gimplify_bind_expr
gcc/gimplify.cc:1688
0xe8790b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
gcc/gimplify.cc:20568
0xe88916 gimplify_stmt(tree_node**, gimple**)
gcc/gimplify.cc:8658
0xe8698b gimplify_statement_list
gcc/gimplify.cc:2293
0xe8698b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
gcc/gimplify.cc:20818
0xeabfe0 gimplify_stmt(tree_node**, gimple**)
gcc/gimplify.cc:8658
0xeabfe0 gimplify_body(tree_node*, bool)
gcc/gimplify.cc:21674
0xeac4a3 gimplify_function_tree(tree_node*)
gcc/gimplify.cc:21883
0xc75207 cgraph_node::analyze()
gcc/cgraphunit.cc:689
0xc777a7 analyze_functions
gcc/cgraphunit.cc:1265
the line above was added in r16-3025-g8b8b0eada6ff03 (as was the support for
mapper iterators in general).