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

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Follow up note: the following all fails (on nvptx with -Og, -Os, -O1 or
higher); the first two are nearly identical on dump level:
  - omp loop
  - omp simd
  - omp for simd

while the following works:
  - omp for

With -O0, the original code is used:
          a[i] = 2*i + 1;
          b[i] = a[i];
which works.

With -Og, there is initially in the nvptx:

  int D.1717[1024];

  _20 = .GOMP_SIMT_ENTER (simduid.1_18(D), &D.1717);
  _22 = .GOMP_SIMT_ENTER_ALLOC (_20);
  _23 = .GOMP_SIMT_LANE ();

* * *

My suspicion is that this causes an out-of-stack memory:

.func compute$_omp_fn$0$impl (.param.u64 %in_ar0)
{
        .local.align 8 .b8 %simtstack_ar[4096];


Indication for this is also that it works with N=100.

Reply via email to