[openmp] Set location for taskloop stmts
authorTom de Vries <tdevries@suse.de>
Fri, 18 Mar 2022 09:34:02 +0000 (10:34 +0100)
committerTom de Vries <tdevries@suse.de>
Fri, 18 Mar 2022 15:16:24 +0000 (16:16 +0100)
commit356e2720e9030927579024c2f060d665a0b9080f
tree9252b0b01116b5a9d156179f7b5266b09b286a56
parent093cdadbce30ce2d36846a05d979b8afc2eff618
[openmp] Set location for taskloop stmts

The test-case included in this patch contains:
...
  #pragma omp taskloop simd shared(a) lastprivate(myId)
...

This is translated to 3 taskloop statements in gimple, visible with
-fdump-tree-gimple:
...
  #pragma omp taskloop private(D.2124)
    #pragma omp taskloop shared(a) shared(myId) private(i.0) firstprivate(a_h)
      #pragma omp taskloop lastprivate(myId)
...

But when exposing the gimple statement locations using
-fdump-tree-gimple-lineno, we find that only the first one has location
information.

Fix this by adding the missing location information.

Tested gomp.exp on x86_64.

Tested libgomp testsuite on x86_64 with nvptx accelerator.

gcc/ChangeLog:

2022-03-18  Tom de Vries  <tdevries@suse.de>

* gimplify.cc (gimplify_omp_for): Set taskloop location.

gcc/testsuite/ChangeLog:

2022-03-18  Tom de Vries  <tdevries@suse.de>

* c-c++-common/gomp/pr104968.c: New test.
gcc/gimplify.cc
gcc/testsuite/c-c++-common/gomp/pr104968.c [new file with mode: 0644]