From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 152F63858D1E; Tue, 25 Apr 2023 10:27:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 152F63858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682418439; bh=zcDLQWVFcGwzIGFU5TM3ePBeVihVKi1w4UCVuBXRvz8=; h=From:To:Subject:Date:From; b=ohTh8YW0/7tKqVklZePaPCUWQ6nBng5uYwJuKezrOnBBxphjeJ+griKoSA5k/A+rW rVbULoXreuKCyLA/rZdfDIwF0/Nkx2hruX3yvCRO0yWPmIhJ/Ngw76T17L0MFbyb63 k/fSEQFg3ga7QFznDss0hYm7pi1OB5tWEY7lfiDo= From: "patrick.begou@univ-grenoble-alpes.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/109622] New: internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is set. Date: Tue, 25 Apr 2023 10:27:18 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: patrick.begou@univ-grenoble-alpes.fr X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109622 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=3D54916&action=3Dedit Simple file to reproduce the bug Gfortran is git master branch, commit n=C2=B0 f743863e09ad788b044dd01696b073581116843b from Apr 24 00:22:57 How to reproduce: Small fortran file is attached (begou.f90). gfortran -c -fopenacc begou.f90=20 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=3D/robin/data/begou/GCC_GIT_BUILD install_dir=3D/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=3D$(which gcc) CXX=3D$(which g++) FC=3D$(which gfortran) F90=3D$(which gfortran) # Location of the installed CUDA toolkit cuda=3D/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=3D$cuda/include \ --with-cuda-driver-lib=3D$cuda/lib64 \ --prefix=3D$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=3D$(gcc/config.guess) # Build nvptx GCC mkdir build-nvptx-gcc cd build-nvptx-gcc ../gcc/configure \ --disable-gcov \ --target=3Dnvptx-none --with-build-time-tools=3D$install_dir/nvptx-none= /bin \ --enable-as-accelerator-for=3D$target \ --disable-sjlj-exceptions \ --enable-newlib-io-long-long \ --enable-languages=3D"c,c++,fortran,lto" \ --prefix=3D$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=3Dnvptx-none \ --with-cuda-driver-include=3D$cuda/include \ --with-cuda-driver-lib=3D$cuda/lib64 \ --disable-bootstrap \ --disable-multilib \ --enable-languages=3D"c,c++,fortran,lto" \ --prefix=3D$install_dir make -j`nproc` || exit 1 make install || exit 1 cd ..=