[Bug fortran/109622] [13/14 regression][OpenACC] internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set.

2023-05-08 Thread burnus at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109622

Tobias Burnus  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |FIXED

--- Comment #17 from Tobias Burnus  ---
Close as FIXED, based on what the patch does and Patrick's comments.
The issue affected GCC 13 (after 13.1, i.e. it will be in 13.2) and 14
(mainline) - and has been fixed on both branches.

Thanks for the report!

[Bug fortran/109622] [13/14 regression][OpenACC] internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set.

2023-05-08 Thread patrick.begou--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109622

--- Comment #16 from Patrick Bégou  ---
Hi Thomas,

yes, it solves the problem on my side.
>From my point of view it can be marked as solved.

Thanks

Patrick

[Bug fortran/109622] [13/14 regression][OpenACC] internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set.

2023-05-08 Thread tschwinge at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109622

Thomas Schwinge  changed:

   What|Removed |Added

 Status|NEW |WAITING
   Assignee|unassigned at gcc dot gnu.org  |jules at gcc dot gnu.org

--- Comment #15 from Thomas Schwinge  ---
Julian, Patrick, is this now all resolved?

[Bug fortran/109622] [13/14 regression][OpenACC] internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set.

2023-05-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109622

--- Comment #14 from CVS Commits  ---
The releases/gcc-13 branch has been updated by Julian Brown
:

https://gcc.gnu.org/g:a4cc474b15ecd148f5bb13a1db3bc3e40a4ff86e

commit r13-7299-ga4cc474b15ecd148f5bb13a1db3bc3e40a4ff86e
Author: Julian Brown 
Date:   Fri Apr 28 22:27:54 2023 +

OpenACC: Further attach/detach clause fixes for Fortran [PR109622]

This patch moves several tests introduced by the following patch:

  https://gcc.gnu.org/pipermail/gcc-patches/2023-April/616939.html
  commit r14-325-gcacf65d74463600815773255e8b82b4043432bd7

into the proper location for OpenACC testing (thanks to Thomas for
spotting my mistake!), and also fixes a few additional problems --
missing diagnostics for non-pointer attaches, and a case where a pointer
was incorrectly dereferenced. Tests are also adjusted for vector-length
warnings on nvidia accelerators.

2023-04-29  Julian Brown  

PR fortran/109622

gcc/fortran/
* openmp.cc (resolve_omp_clauses): Add diagnostic for
non-pointer/non-allocatable attach/detach.
* trans-openmp.cc (gfc_trans_omp_clauses): Remove dereference for
pointer-to-scalar derived type component attach/detach.  Fix
attach/detach handling for descriptors.

gcc/testsuite/
* gfortran.dg/goacc/pr109622-5.f90: New test.
* gfortran.dg/goacc/pr109622-6.f90: New test.

libgomp/
* testsuite/libgomp.fortran/pr109622.f90: Move test...
* testsuite/libgomp.oacc-fortran/pr109622.f90: ...to here. Ignore
vector length warning.
* testsuite/libgomp.fortran/pr109622-2.f90: Move test...
* testsuite/libgomp.oacc-fortran/pr109622-2.f90: ...to here.  Add
missing copyin/copyout variable. Ignore vector length warnings.
* testsuite/libgomp.fortran/pr109622-3.f90: Move test...
* testsuite/libgomp.oacc-fortran/pr109622-3.f90: ...to here. 
Ignore
vector length warnings.
* testsuite/libgomp.oacc-fortran/pr109622-4.f90: New test.

(cherry picked from commit 0a26a42b237bada32165e61867a2bf4461c5fab2)

[Bug fortran/109622] [13/14 regression][OpenACC] internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set.

2023-05-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109622

--- Comment #13 from CVS Commits  ---
The releases/gcc-13 branch has been updated by Julian Brown
:

https://gcc.gnu.org/g:fa7c4ab36585ba128733265fb626ff3f4066400f

commit r13-7298-gfa7c4ab36585ba128733265fb626ff3f4066400f
Author: Julian Brown 
Date:   Wed Apr 26 14:31:53 2023 +

OpenACC: Stand-alone attach/detach clause fixes for Fortran [PR109622]

This patch fixes several cases where multiple attach or detach mapping
nodes were being created for stand-alone attach or detach clauses
in Fortran.  After the introduction of stricter checking later during
compilation, these extra nodes could cause ICEs, as seen in the PR.

The patch also fixes cases that "happened to work" previously where
the user attaches/detaches a pointer to array using a descriptor, and
(I think!) the "_data" field has offset zero, hence the same address as
the descriptor as a whole.

2023-04-27  Julian Brown  

PR fortran/109622

gcc/fortran/
* trans-openmp.cc (gfc_trans_omp_clauses): Attach/detach clause
fixes.

gcc/testsuite/
* gfortran.dg/goacc/attach-descriptor.f90: Adjust expected output.

libgomp/
* testsuite/libgomp.fortran/pr109622.f90: New test.
* testsuite/libgomp.fortran/pr109622-2.f90: New test.
* testsuite/libgomp.fortran/pr109622-3.f90: New test.

(cherry picked from commit cacf65d74463600815773255e8b82b4043432bd7)

[Bug fortran/109622] [13/14 regression][OpenACC] internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set.

2023-05-04 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109622

--- Comment #12 from CVS Commits  ---
The master branch has been updated by Julian Brown :

https://gcc.gnu.org/g:0a26a42b237bada32165e61867a2bf4461c5fab2

commit r14-481-g0a26a42b237bada32165e61867a2bf4461c5fab2
Author: Julian Brown 
Date:   Fri Apr 28 22:27:54 2023 +

OpenACC: Further attach/detach clause fixes for Fortran [PR109622]

This patch moves several tests introduced by the following patch:

  https://gcc.gnu.org/pipermail/gcc-patches/2023-April/616939.html
  commit r14-325-gcacf65d74463600815773255e8b82b4043432bd7

into the proper location for OpenACC testing (thanks to Thomas for
spotting my mistake!), and also fixes a few additional problems --
missing diagnostics for non-pointer attaches, and a case where a pointer
was incorrectly dereferenced. Tests are also adjusted for vector-length
warnings on nvidia accelerators.

2023-04-29  Julian Brown  

PR fortran/109622

gcc/fortran/
* openmp.cc (resolve_omp_clauses): Add diagnostic for
non-pointer/non-allocatable attach/detach.
* trans-openmp.cc (gfc_trans_omp_clauses): Remove dereference for
pointer-to-scalar derived type component attach/detach.  Fix
attach/detach handling for descriptors.

gcc/testsuite/
* gfortran.dg/goacc/pr109622-5.f90: New test.
* gfortran.dg/goacc/pr109622-6.f90: New test.

libgomp/
* testsuite/libgomp.fortran/pr109622.f90: Move test...
* testsuite/libgomp.oacc-fortran/pr109622.f90: ...to here. Ignore
vector length warning.
* testsuite/libgomp.fortran/pr109622-2.f90: Move test...
* testsuite/libgomp.oacc-fortran/pr109622-2.f90: ...to here.  Add
missing copyin/copyout variable. Ignore vector length warnings.
* testsuite/libgomp.fortran/pr109622-3.f90: Move test...
* testsuite/libgomp.oacc-fortran/pr109622-3.f90: ...to here. 
Ignore
vector length warnings.
* testsuite/libgomp.oacc-fortran/pr109622-4.f90: New test.

[Bug fortran/109622] [13/14 regression][OpenACC] internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set.

2023-04-29 Thread patrick.begou--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109622

--- Comment #11 from Patrick Bégou  ---
Confirmed that this commit fixes the problem. 

I will check with the full application soon (need to rebuild OpenMPI for GCC
14).

Many thanks you for your responsiveness.

Patrick

[Bug fortran/109622] [13/14 regression][OpenACC] internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set.

2023-04-28 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109622

--- Comment #10 from CVS Commits  ---
The master branch has been updated by Julian Brown :

https://gcc.gnu.org/g:cacf65d74463600815773255e8b82b4043432bd7

commit r14-325-gcacf65d74463600815773255e8b82b4043432bd7
Author: Julian Brown 
Date:   Wed Apr 26 14:31:53 2023 +

OpenACC: Stand-alone attach/detach clause fixes for Fortran [PR109622]

This patch fixes several cases where multiple attach or detach mapping
nodes were being created for stand-alone attach or detach clauses
in Fortran.  After the introduction of stricter checking later during
compilation, these extra nodes could cause ICEs, as seen in the PR.

The patch also fixes cases that "happened to work" previously where
the user attaches/detaches a pointer to array using a descriptor, and
(I think!) the "_data" field has offset zero, hence the same address as
the descriptor as a whole.

2023-04-27  Julian Brown  

PR fortran/109622

gcc/fortran/
* trans-openmp.cc (gfc_trans_omp_clauses): Attach/detach clause
fixes.

gcc/testsuite/
* gfortran.dg/goacc/attach-descriptor.f90: Adjust expected output.

libgomp/
* testsuite/libgomp.fortran/pr109622.f90: New test.
* testsuite/libgomp.fortran/pr109622-2.f90: New test.
* testsuite/libgomp.fortran/pr109622-3.f90: New test.

[Bug fortran/109622] [13/14 regression][OpenACC] internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set.

2023-04-28 Thread burnus at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109622

--- Comment #9 from Tobias Burnus  ---
Julian submitted a patch for this (approved but not yet committed):
  https://gcc.gnu.org/pipermail/gcc-patches/2023-April/616939.html

Patrick: Can you check whether it also fixes your program?

[Bug fortran/109622] [13/14 regression][OpenACC] internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set.

2023-04-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109622

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|13.0|13.2

--- Comment #8 from Richard Biener  ---
GCC 13.1 is being released, retargeting bugs to GCC 13.2.

[Bug fortran/109622] [13/14 regression][OpenACC] internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set.

2023-04-25 Thread patrick.begou--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109622

--- Comment #7 from Patrick Bégou  ---
Le 25/04/2023 à 14:49, pault at gcc dot gnu.org a écrit :
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109622
>
> --- Comment #4 from Paul Thomas  ---
> Hi Patrick,
>
> Confirmed on pre-release GNU Fortran (GCC) 13.0.1 20230414.
>
> .
>
> Thanks for the report.

No, Paul. Thanks for providing such a powerful development environment!

Users should thanks, not developers. ;-)


Patrick

[Bug fortran/109622] [13/14 regression][OpenACC] internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set.

2023-04-25 Thread burnus at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109622

Tobias Burnus  changed:

   What|Removed |Added

 CC||jules at gcc dot gnu.org
Summary|[13/14 regression] internal |[13/14 regression][OpenACC]
   |compiler error: in  |internal compiler error: in
   |omp_group_base, at  |omp_group_base, at
   |gimplify.cc:9412 if |gimplify.cc:9412 if
   |-fopenacc is set.   |-fopenacc is set.

--- Comment #6 from Tobias Burnus  ---
The ICE is in omp_group_base, which was added by Julian
in r13-2661-gb57abd072dd319a72839a49e769bffc244a52bc0 and updated in later
commits.


The debugger shows:

Breakpoint 1, omp_index_mapping_groups_1 (grpmap=0x2d2f960, groups=0x2cc4700,
reindex_sentinel=0x0) at ../../repos/gcc/gcc/gimplify.cc:9426
9426{
(gdb) n
9431  FOR_EACH_VEC_ELT (*groups, i, grp)
...
9441  tree node = omp_group_base (grp, , );

for the last grp (i = 1, there are only 2).

9292omp_group_base (omp_mapping_group *grp, unsigned int *chained,
9293tree *firstprivate)
9294{
9295  tree node = *grp->grp_start;

(gdb) p debug(*grp->grp_start)
map(attach_detach:atransform2->next [bias: 0])

Which fails at 'gcc_unreachable' for 'switch (OMP_CLAUSE_MAP_KIND (node))'.

* * *

I note that
case GOMP_MAP_ATTACH:
case GOMP_MAP_DETACH:
are handled but GOMP_MAP_ATTACH_DETACH isn't.


Actually, it is handled but not as separate input but as:

case :
  ...
  node = OMP_CLAUSE_CHAIN (node);
switch (OMP_CLAUSE_MAP_KIND (node))
...
  case GOMP_MAP_ATTACH_DETACH:

 * * *

The original input is ("debug(...)" for i = 0, which shows i=0 and i=1):

map(attach:*atransform2->next [bias: 184]) map(attach_detach:atransform2->next
[bias: 0])

which is fine, but as   FOR_EACH_VEC_ELT (*groups, i, grp) then also processes
i=1 separately, it fails.