https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108422
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org
Keywords| |ice-on-invalid-code
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
#pragma omp target parallel
#pragma omp target
++a;
This violates:
"Restrictions to the target construct are as follows:
• Device-affecting constructs, other than target constructs for which the
ancestor device-modifier is specified, must not be encountered during execution
of a target region."
And GCC should print (existing check):
warning: ‘target’ construct inside of ‘target’ region
However, when making it valid by adding
#pragma omp requires reverse_offload
+ adding 'device(ancestor:1)' to the second 'omp target',
it still fails with the ICE.
* * *
For the failing case,
Breakpoint 4, gimplify_scan_omp_clauses (list_p=0x7ffff6fc5570,
pre_p=0x7fffffffd7a0, region_type=ORT_TARGET, code=OMP_TARGET) at
../../repos/gcc/gcc/gimplify.cc:10771
10771 outlist = omp_tsort_mapping_groups (groups, grpmap);
(gdb) p debug(groups->m_vec->m_vecdata.grp_start[0])
map(to:*(const struct ._anon_0 *) __closure)
map(firstprivate:__closure [pointer assign, bias: 0])
map(tofrom:*__closure->__a [len: 4])
map(always_pointer:__closure->__a [pointer assign, bias: 0])
map(to:*__closure)
map(to:*(const struct ._anon_0 *) __closure)