public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/109622] New: internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set.
@ 2023-04-25 10:27 patrick.begou@univ-grenoble-alpes.fr
  2023-04-25 10:29 ` [Bug fortran/109622] " patrick.begou@univ-grenoble-alpes.fr
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: patrick.begou@univ-grenoble-alpes.fr @ 2023-04-25 10:27 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109622
           Summary: internal compiler error: in omp_group_base, at
                    gimplify.cc:9412 if -fopenacc is set.
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: patrick.begou@univ-grenoble-alpes.fr
  Target Milestone: ---

Created attachment 54916
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54916&action=edit
Simple file to reproduce the bug

Gfortran is git master branch, commit n°
f743863e09ad788b044dd01696b073581116843b from Apr 24 00:22:57

How to reproduce:
Small fortran file is attached (begou.f90).

gfortran -c -fopenacc begou.f90 

0xa830c6 omp_group_base
        ../../gcc/gcc/gimplify.cc:9412
0xa830c6 omp_index_mapping_groups_1
        ../../gcc/gcc/gimplify.cc:9441
0xa833c7 omp_index_mapping_groups
        ../../gcc/gcc/gimplify.cc:9502
0xa96a9a gimplify_scan_omp_clauses
        ../../gcc/gcc/gimplify.cc:10802
0xa8660d gimplify_omp_target_update
        ../../gcc/gcc/gimplify.cc:15563
0xa8660d gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gcc/gimplify.cc:16928
0xa89826 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gcc/gimplify.cc:7219
0xa875a3 gimplify_statement_list
        ../../gcc/gcc/gimplify.cc:2019
0xa875a3 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gcc/gimplify.cc:16821
0xa89826 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gcc/gimplify.cc:7219
0xa86e8a gimplify_and_add(tree_node*, gimple**)
        ../../gcc/gcc/gimplify.cc:492
0xa86e8a gimplify_loop_expr
        ../../gcc/gcc/gimplify.cc:1993
0xa86e8a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gcc/gimplify.cc:16581
0xa89826 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gcc/gimplify.cc:7219
0xa875a3 gimplify_statement_list
        ../../gcc/gcc/gimplify.cc:2019
0xa875a3 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gcc/gimplify.cc:16821
0xa89826 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gcc/gimplify.cc:7219
0xa89d2b gimplify_bind_expr
        ../../gcc/gcc/gimplify.cc:1430
0xa86d8e gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gcc/gimplify.cc:16577
0xa89826 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gcc/gimplify.cc:7219


Script used for building the compiler:

#!/bin/sh

#
# Build GCC with support for offloading to NVIDIA GPUs.
#

work_dir=/robin/data/begou/GCC_GIT_BUILD
install_dir=/robin/data/begou/GCC_GIT_binaries
rm -rf $install_dir $work_dir/build-host-gcc $work_dir/build-nvptx-gcc
$work_dir/gcc $work_dir/nvptx-*
CC=$(which gcc)
CXX=$(which g++)
FC=$(which gfortran)
F90=$(which gfortran)

# Location of the installed CUDA toolkit
cuda=/opt/nvidia/hpc_sdk/Linux_x86_64/22.5/cuda/

# Build assembler and linking tools
mkdir -p $work_dir
cd $work_dir
git clone https://github.com/MentorEmbedded/nvptx-tools
cd nvptx-tools
./configure \
    --with-cuda-driver-include=$cuda/include \
    --with-cuda-driver-lib=$cuda/lib64 \
    --prefix=$install_dir
make || exit 1
make install || exit 1
cd ..

# Set up the GCC source tree
git clone git://sourceware.org/git/newlib-cygwin.git nvptx-newlib
git clone git://gcc.gnu.org/git/gcc.git gcc
#git clone --branch releases/gcc-11 git://gcc.gnu.org/git/gcc.git gcc
cd gcc
contrib/download_prerequisites
ln -s ../nvptx-newlib/newlib newlib
cd ..
target=$(gcc/config.guess)

# Build nvptx GCC
mkdir build-nvptx-gcc
cd build-nvptx-gcc
../gcc/configure \
    --disable-gcov \
    --target=nvptx-none --with-build-time-tools=$install_dir/nvptx-none/bin \
    --enable-as-accelerator-for=$target \
    --disable-sjlj-exceptions \
    --enable-newlib-io-long-long \
    --enable-languages="c,c++,fortran,lto" \
    --prefix=$install_dir
make -j`nproc` || exit 1
make install || exit 1
cd ..

# Build host GCC
mkdir build-host-gcc
cd  build-host-gcc
../gcc/configure \
    --enable-offload-targets=nvptx-none \
    --with-cuda-driver-include=$cuda/include \
    --with-cuda-driver-lib=$cuda/lib64 \
    --disable-bootstrap \
    --disable-multilib \
    --enable-languages="c,c++,fortran,lto" \
    --prefix=$install_dir
make -j`nproc` || exit 1
make install || exit 1
cd ..

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug fortran/109622] internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set.
  2023-04-25 10:27 [Bug fortran/109622] New: internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set patrick.begou@univ-grenoble-alpes.fr
@ 2023-04-25 10:29 ` patrick.begou@univ-grenoble-alpes.fr
  2023-04-25 10:32 ` patrick.begou@univ-grenoble-alpes.fr
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: patrick.begou@univ-grenoble-alpes.fr @ 2023-04-25 10:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Patrick Bégou <patrick.begou@univ-grenoble-alpes.fr> ---
OS: CentOS8
Compiler 13 built with native CentOS8 compiler: GNU Fortran (GCC) 8.3.1
20191121 (Red Hat 8.3.1-5)

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug fortran/109622] internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set.
  2023-04-25 10:27 [Bug fortran/109622] New: internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set patrick.begou@univ-grenoble-alpes.fr
  2023-04-25 10:29 ` [Bug fortran/109622] " patrick.begou@univ-grenoble-alpes.fr
@ 2023-04-25 10:32 ` patrick.begou@univ-grenoble-alpes.fr
  2023-04-25 12:25 ` patrick.begou@univ-grenoble-alpes.fr
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: patrick.begou@univ-grenoble-alpes.fr @ 2023-04-25 10:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Patrick Bégou <patrick.begou@univ-grenoble-alpes.fr> ---
Sorry, exact branch is: releases/gcc-13

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug fortran/109622] internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set.
  2023-04-25 10:27 [Bug fortran/109622] New: internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set patrick.begou@univ-grenoble-alpes.fr
  2023-04-25 10:29 ` [Bug fortran/109622] " patrick.begou@univ-grenoble-alpes.fr
  2023-04-25 10:32 ` patrick.begou@univ-grenoble-alpes.fr
@ 2023-04-25 12:25 ` patrick.begou@univ-grenoble-alpes.fr
  2023-04-25 12:49 ` pault at gcc dot gnu.org
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: patrick.begou@univ-grenoble-alpes.fr @ 2023-04-25 12:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Patrick Bégou <patrick.begou@univ-grenoble-alpes.fr> ---
Following Harald Anlauf idea, I have built the compilers from the
devel/omp/gcc-12 branch for testing:
GNU Fortran (GCC) 12.2.1 20230302 [OG12]

The "internal error" shown with this small test case (begou.f90) do not occur
with this branch. I have to test with the full application but I need first to
rebuild all the prerequisites (Gcc13 modules files are not backward compatibles
with Gcc12).

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug fortran/109622] internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set.
  2023-04-25 10:27 [Bug fortran/109622] New: internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set patrick.begou@univ-grenoble-alpes.fr
                   ` (2 preceding siblings ...)
  2023-04-25 12:25 ` patrick.begou@univ-grenoble-alpes.fr
@ 2023-04-25 12:49 ` pault at gcc dot gnu.org
  2023-04-25 12:51 ` [Bug fortran/109622] [13/14 regression] " pault at gcc dot gnu.org
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pault at gcc dot gnu.org @ 2023-04-25 12:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Paul Thomas <pault at gcc dot gnu.org> ---
Hi Patrick,

Confirmed on pre-release GNU Fortran (GCC) 13.0.1 20230414.

The compiler is objecting to the dereferencing in the pragma call:
  while (1)
    {
      if (done) goto L.4;
      copy_transform (&atransform1, &atransform2);
      #pragma acc enter data map(attach:*atransform2->next [bias: 184])
map(attach_detach:atransform2->next [bias: 0]);
      if (atransform1->next != 0B && atransform2->next != 0B)
        {
          atransform1 = atransform1->next;
          atransform2 = atransform2->next;
        }
      else
        {
          done = 1;
        }
      L.5:;
      L.3:;
    }

Compiles OK with GNU Fortran (GCC) 12.2.1 20230321 so I am marking as a
regression. ifort compiles it OK with -qopenmp.

It compiles fine is a non-pointer transform_t is passed.

I am cc'ing Tobias, who at least knows a lot about the workings of OpenMP in
gcc.

Thanks for the report.

Paul

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug fortran/109622] [13/14 regression] internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set.
  2023-04-25 10:27 [Bug fortran/109622] New: internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set patrick.begou@univ-grenoble-alpes.fr
                   ` (3 preceding siblings ...)
  2023-04-25 12:49 ` pault at gcc dot gnu.org
@ 2023-04-25 12:51 ` pault at gcc dot gnu.org
  2023-04-25 13:20 ` rguenth at gcc dot gnu.org
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pault at gcc dot gnu.org @ 2023-04-25 12:51 UTC (permalink / raw)
  To: gcc-bugs

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

Paul Thomas <pault at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
            Summary|internal compiler error: in |[13/14 regression] internal
                   |omp_group_base, at          |compiler error: in
                   |gimplify.cc:9412 if         |omp_group_base, at
                   |-fopenacc is set.           |gimplify.cc:9412 if
                   |                            |-fopenacc is set.
                 CC|                            |burnus at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2023-04-25

--- Comment #5 from Paul Thomas <pault at gcc dot gnu.org> ---
Hi Patrick,

We had a mid-air collision :-)

Paul

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug fortran/109622] [13/14 regression] internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set.
  2023-04-25 10:27 [Bug fortran/109622] New: internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set patrick.begou@univ-grenoble-alpes.fr
                   ` (4 preceding siblings ...)
  2023-04-25 12:51 ` [Bug fortran/109622] [13/14 regression] " pault at gcc dot gnu.org
@ 2023-04-25 13:20 ` rguenth at gcc dot gnu.org
  2023-04-25 13:59 ` [Bug fortran/109622] [13/14 regression][OpenACC] " burnus at gcc dot gnu.org
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-04-25 13:20 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.0
           Keywords|                            |openacc

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [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 10:27 [Bug fortran/109622] New: internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set patrick.begou@univ-grenoble-alpes.fr
                   ` (5 preceding siblings ...)
  2023-04-25 13:20 ` rguenth at gcc dot gnu.org
@ 2023-04-25 13:59 ` burnus at gcc dot gnu.org
  2023-04-25 16:38 ` patrick.begou@univ-grenoble-alpes.fr
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: burnus at gcc dot gnu.org @ 2023-04-25 13:59 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> 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 <burnus at gcc dot gnu.org> ---
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, &chained, &fpp);

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

9292    omp_group_base (omp_mapping_group *grp, unsigned int *chained,
9293                    tree *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.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [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 10:27 [Bug fortran/109622] New: internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set patrick.begou@univ-grenoble-alpes.fr
                   ` (6 preceding siblings ...)
  2023-04-25 13:59 ` [Bug fortran/109622] [13/14 regression][OpenACC] " burnus at gcc dot gnu.org
@ 2023-04-25 16:38 ` patrick.begou@univ-grenoble-alpes.fr
  2023-04-26  6:58 ` rguenth at gcc dot gnu.org
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: patrick.begou@univ-grenoble-alpes.fr @ 2023-04-25 16:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Patrick Bégou <patrick.begou@univ-grenoble-alpes.fr> ---
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 <pault at gcc dot gnu.org> ---
> 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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [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 10:27 [Bug fortran/109622] New: internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set patrick.begou@univ-grenoble-alpes.fr
                   ` (7 preceding siblings ...)
  2023-04-25 16:38 ` patrick.begou@univ-grenoble-alpes.fr
@ 2023-04-26  6:58 ` rguenth at gcc dot gnu.org
  2023-04-28 11:03 ` burnus at gcc dot gnu.org
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-04-26  6:58 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|13.0                        |13.2

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 13.1 is being released, retargeting bugs to GCC 13.2.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [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 10:27 [Bug fortran/109622] New: internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set patrick.begou@univ-grenoble-alpes.fr
                   ` (8 preceding siblings ...)
  2023-04-26  6:58 ` rguenth at gcc dot gnu.org
@ 2023-04-28 11:03 ` burnus at gcc dot gnu.org
  2023-04-28 11:34 ` cvs-commit at gcc dot gnu.org
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: burnus at gcc dot gnu.org @ 2023-04-28 11:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Tobias Burnus <burnus at gcc dot gnu.org> ---
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?

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [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 10:27 [Bug fortran/109622] New: internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set patrick.begou@univ-grenoble-alpes.fr
                   ` (9 preceding siblings ...)
  2023-04-28 11:03 ` burnus at gcc dot gnu.org
@ 2023-04-28 11:34 ` cvs-commit at gcc dot gnu.org
  2023-04-29  9:41 ` patrick.begou@univ-grenoble-alpes.fr
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-04-28 11:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Julian Brown <jules@gcc.gnu.org>:

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

commit r14-325-gcacf65d74463600815773255e8b82b4043432bd7
Author: Julian Brown <julian@codesourcery.com>
Date:   Wed Apr 26 14:31:53 2023 +0000

    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  <julian@codesourcery.com>

            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.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [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 10:27 [Bug fortran/109622] New: internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set patrick.begou@univ-grenoble-alpes.fr
                   ` (10 preceding siblings ...)
  2023-04-28 11:34 ` cvs-commit at gcc dot gnu.org
@ 2023-04-29  9:41 ` patrick.begou@univ-grenoble-alpes.fr
  2023-05-04 11:52 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: patrick.begou@univ-grenoble-alpes.fr @ 2023-04-29  9:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Patrick Bégou <patrick.begou@univ-grenoble-alpes.fr> ---
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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [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 10:27 [Bug fortran/109622] New: internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set patrick.begou@univ-grenoble-alpes.fr
                   ` (11 preceding siblings ...)
  2023-04-29  9:41 ` patrick.begou@univ-grenoble-alpes.fr
@ 2023-05-04 11:52 ` cvs-commit at gcc dot gnu.org
  2023-05-05 13:15 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-05-04 11:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Julian Brown <jules@gcc.gnu.org>:

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

commit r14-481-g0a26a42b237bada32165e61867a2bf4461c5fab2
Author: Julian Brown <julian@codesourcery.com>
Date:   Fri Apr 28 22:27:54 2023 +0000

    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  <julian@codesourcery.com>

            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.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [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 10:27 [Bug fortran/109622] New: internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set patrick.begou@univ-grenoble-alpes.fr
                   ` (12 preceding siblings ...)
  2023-05-04 11:52 ` cvs-commit at gcc dot gnu.org
@ 2023-05-05 13:15 ` cvs-commit at gcc dot gnu.org
  2023-05-05 13:15 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-05-05 13:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Julian Brown
<jules@gcc.gnu.org>:

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

commit r13-7298-gfa7c4ab36585ba128733265fb626ff3f4066400f
Author: Julian Brown <julian@codesourcery.com>
Date:   Wed Apr 26 14:31:53 2023 +0000

    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  <julian@codesourcery.com>

            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)

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [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 10:27 [Bug fortran/109622] New: internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set patrick.begou@univ-grenoble-alpes.fr
                   ` (13 preceding siblings ...)
  2023-05-05 13:15 ` cvs-commit at gcc dot gnu.org
@ 2023-05-05 13:15 ` cvs-commit at gcc dot gnu.org
  2023-05-08 12:35 ` tschwinge at gcc dot gnu.org
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-05-05 13:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Julian Brown
<jules@gcc.gnu.org>:

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

commit r13-7299-ga4cc474b15ecd148f5bb13a1db3bc3e40a4ff86e
Author: Julian Brown <julian@codesourcery.com>
Date:   Fri Apr 28 22:27:54 2023 +0000

    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  <julian@codesourcery.com>

            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)

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [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 10:27 [Bug fortran/109622] New: internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set patrick.begou@univ-grenoble-alpes.fr
                   ` (14 preceding siblings ...)
  2023-05-05 13:15 ` cvs-commit at gcc dot gnu.org
@ 2023-05-08 12:35 ` tschwinge at gcc dot gnu.org
  2023-05-08 13:52 ` patrick.begou@univ-grenoble-alpes.fr
  2023-05-08 13:56 ` burnus at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2023-05-08 12:35 UTC (permalink / raw)
  To: gcc-bugs

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

Thomas Schwinge <tschwinge at gcc dot gnu.org> 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 <tschwinge at gcc dot gnu.org> ---
Julian, Patrick, is this now all resolved?

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [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 10:27 [Bug fortran/109622] New: internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set patrick.begou@univ-grenoble-alpes.fr
                   ` (15 preceding siblings ...)
  2023-05-08 12:35 ` tschwinge at gcc dot gnu.org
@ 2023-05-08 13:52 ` patrick.begou@univ-grenoble-alpes.fr
  2023-05-08 13:56 ` burnus at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: patrick.begou@univ-grenoble-alpes.fr @ 2023-05-08 13:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from Patrick Bégou <patrick.begou@univ-grenoble-alpes.fr> ---
Hi Thomas,

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

Thanks

Patrick

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [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 10:27 [Bug fortran/109622] New: internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set patrick.begou@univ-grenoble-alpes.fr
                   ` (16 preceding siblings ...)
  2023-05-08 13:52 ` patrick.begou@univ-grenoble-alpes.fr
@ 2023-05-08 13:56 ` burnus at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: burnus at gcc dot gnu.org @ 2023-05-08 13:56 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |FIXED

--- Comment #17 from Tobias Burnus <burnus at gcc dot gnu.org> ---
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!

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2023-05-08 13:56 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-25 10:27 [Bug fortran/109622] New: internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set patrick.begou@univ-grenoble-alpes.fr
2023-04-25 10:29 ` [Bug fortran/109622] " patrick.begou@univ-grenoble-alpes.fr
2023-04-25 10:32 ` patrick.begou@univ-grenoble-alpes.fr
2023-04-25 12:25 ` patrick.begou@univ-grenoble-alpes.fr
2023-04-25 12:49 ` pault at gcc dot gnu.org
2023-04-25 12:51 ` [Bug fortran/109622] [13/14 regression] " pault at gcc dot gnu.org
2023-04-25 13:20 ` rguenth at gcc dot gnu.org
2023-04-25 13:59 ` [Bug fortran/109622] [13/14 regression][OpenACC] " burnus at gcc dot gnu.org
2023-04-25 16:38 ` patrick.begou@univ-grenoble-alpes.fr
2023-04-26  6:58 ` rguenth at gcc dot gnu.org
2023-04-28 11:03 ` burnus at gcc dot gnu.org
2023-04-28 11:34 ` cvs-commit at gcc dot gnu.org
2023-04-29  9:41 ` patrick.begou@univ-grenoble-alpes.fr
2023-05-04 11:52 ` cvs-commit at gcc dot gnu.org
2023-05-05 13:15 ` cvs-commit at gcc dot gnu.org
2023-05-05 13:15 ` cvs-commit at gcc dot gnu.org
2023-05-08 12:35 ` tschwinge at gcc dot gnu.org
2023-05-08 13:52 ` patrick.begou@univ-grenoble-alpes.fr
2023-05-08 13:56 ` burnus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).