https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102431

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
struct S { int s; } s;
void add (struct S *, struct S *);
void init (struct S *);
#pragma omp declare reduction (+:struct S:add (&omp_out, &omp_in)) initializer
(init (&omp_priv))

void
foo (void)
{
  int i;
  #pragma omp loop bind(teams) reduction(+:s)
  for (i = 0; i < 8; i++)
    ;
}

ICEs in both C++ (same spot) and C (different spot) and
struct S { S (); ~S (); S (const S &); void add (const S &); int s; } s;
#pragma omp declare reduction (+:S:omp_out.add (omp_in))

void
foo ()
{
  #pragma omp loop bind(teams) reduction(+:s)
  for (int i = 0; i < 8; i++)
    ;
}
ICEs in C++ too.
I guess gimplify_omp_loop when copying OMP_CLAUSE_REDUCTION_INIT and
OMP_CLAUSE_REDUCTION_MERGE (c) can't just unshare_expr those expressions and
replace the placeholders in there, but needs to also duplicate BLOCKs
referenced in there and adjust them.

Reply via email to