mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 06:49:09 +02:00
openmp: sorry instead of ICE for unimplemented mapper with iterator [PR122866]
Support for iterators on mapper functions is an OpenMP 5.2 feature that is not implemented yet. Presently attempting to use this feature results in an ICE; let's make it a more user-friendly "sorry" until we get around to implementing this. gcc/ChangeLog PR c/122866 * gimplify.cc (omp_instantiate_mapper): Give a sorry if there are iterators. gcc/testsuite/ChangeLog PR c/122866 * c-c++-common/gomp/pr122866.c: New. Co-authored-by: Sandra Loosemore <sloosemore@baylibre.com>
This commit is contained in:
committed by
Sandra Loosemore
parent
8e650f59f3
commit
25ffcf2197
@@ -13629,6 +13629,14 @@ omp_instantiate_mapper (gimple_seq *pre_p,
|
||||
continue;
|
||||
}
|
||||
|
||||
if (OMP_CLAUSE_HAS_ITERATORS (clause))
|
||||
{
|
||||
sorry_at (OMP_CLAUSE_LOCATION (clause),
|
||||
"user-defined mapper that uses a %<map%> clause "
|
||||
"with %<iterator%>");
|
||||
continue;
|
||||
}
|
||||
|
||||
tree decl = OMP_CLAUSE_DECL (clause);
|
||||
tree unshared, type;
|
||||
bool nonunit_array_with_mapper = false;
|
||||
|
||||
21
gcc/testsuite/c-c++-common/gomp/pr122866.c
Normal file
21
gcc/testsuite/c-c++-common/gomp/pr122866.c
Normal file
@@ -0,0 +1,21 @@
|
||||
/* { dg-do "compile" } */
|
||||
|
||||
struct test { int x; };
|
||||
|
||||
#pragma omp begin declare target
|
||||
void froggify (struct test);
|
||||
#pragma omp end declare target
|
||||
|
||||
#pragma omp declare mapper(struct test v) map(iterator(i = 0:1), tofrom: v.x)
|
||||
/* { dg-message "sorry, unimplemented: user-defined mapper that uses a .map. clause with .iterator." "" { target *-*-* } .-1 } */
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
struct test s;
|
||||
s.x = -1;
|
||||
#pragma omp target
|
||||
{
|
||||
froggify (s);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user