[Patch] Fortran: Fixes for OpenMP loop-iter privatization (PRs 95109 + 94690)

Tobias Burnus tobias@codesourcery.com
Tue Sep 8 10:22:57 GMT 2020


This patch fixes all known issues related to loop-iter privatization.

This patch removes the code added to gfc_resolve_do_iterator in commit
r11-349-gf884bef21cccc05d748fd7869cd641cbb4f6b6bb.

I added it to fix some issues in testsuite/libgomp.fortran/pr66199-*.f90
but it turned out that removing no longer causes fails; on the other hand,
while r11-349 caused target1.f90 to fail, just removing that changes did
not fix it.

Digging deeper, I found that for target1.f90's
   !$omp target teams ...
   !$omp distribute parallel do simd ...
the do-loop's i and j where added to '(target) teams'
instead of the 'distribute parallel do simd', causing
a middle-end ICE → resolve.c and openmp.c part of the patch.

Some testing and looking at dumps additionally showed
that for 'target parallel do simd', all loop variables
where 'shared' as the wrong function was called in trans-openmp.c.

The latter is also the reason that 'combined-if.f90' now has
a higher 'omp simd.*if' count.

Tested on x86-64-gnu-linux.

OK for the trunk and GCC 10?
(As r11-349 was not applied to GCC 10, the
gfc_resolve_do_iterator change is trunk only.)

Tobias

-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: omp-itervar.diff
Type: text/x-patch
Size: 5924 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200908/a3d49468/attachment-0001.bin>


More information about the Gcc-patches mailing list