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

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
It isn't sufficient though, consider:
#pragma omp declare target
void
foo (int x, int y, int *z)
{
  int j = 0;
  #pragma omp simd linear(j:x + y)
  for (int i = 0; i < 64; i++)
    j += x + y;
}
#pragma omp end declare target

-O2 -fopenmp with offloading to nvptx.

This is quite hard to deal with in scan_omp_simd, that calls
copy_gimple_seq_and_replace_locals and we do want to remap some stuff even in
the outermost construct's clauses, but apparently not all.
And copy_gimple_seq_and_replace_locals calls replace_locals_op which for
VAR_DECLs etc. checks if we have seen them in bind vars etc., but for SSA_NAMEs
always remaps them.

Reply via email to