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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #3)
> I suppose that's the OMP reduction function and that's always(?) inlined?

The reduction "function" is something artificial which holds some expressions
for the
OpenMP reductions; we just need to attach those statements to some decl for
name lookup purposes.
The problem is what to do with lambdas defined inside of those expressions, or
e.g. nested functions for the C case:
int q;

#pragma omp declare reduction (x : int : omp_out += omp_in + ({ int a = 1; void
foo () { a++; } foo (); a; }))

void bar (int *, int *);

void
foo ()
{
  int r = 0, s = 0;
  #pragma omp parallel reduction (x : r, s)
  bar (&r, &s);
}

ICEs too.  Lambdas are there certainly valid, we try to pretend the artificial
functions don't really exist for the debug info purposes, but apparently not
sufficiently.

Reply via email to