From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3A3473858D35; Thu, 12 Jan 2023 12:41:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3A3473858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673527268; bh=oZ77dZruzob6bs3j7eY54OS8PjTUtOYMs6fvLj4R36M=; h=From:To:Subject:Date:From; b=xDPuoN+XasvDzPetYVwK/2QzscsvF3MQcKcoXWX6zrEvAtMJT0hbDpZJGbSfSvUlG e87U09fKlez2hMbLDucomUAH5+5zMXLR1tDJ36/o5JN1trQ+gBs+QmcCmW5kDstjUl mtFq3oPaETMt0uSPQkXgEBDTzBpjf3b+23eNLqfA= From: "zbigniew.piotrowski at ecmwf dot int" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/108382] New: Incorrect parsing when acc and omp coexist and -fopenmp -fopenacc is used. Date: Thu, 12 Jan 2023 12:41:06 +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: 12.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zbigniew.piotrowski at ecmwf dot int 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=3D108382 Bug ID: 108382 Summary: Incorrect parsing when acc and omp coexist and -fopenmp -fopenacc is used. Product: gcc Version: 12.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: zbigniew.piotrowski at ecmwf dot int Target Milestone: --- Created attachment 54254 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D54254&action=3Dedit Source file with a minimal example raising an error. Problem: parsing acc and omp directives seems to incorrectly interfere, when line continuation is used. As a result, frontend is trying to interpret omp directives as belonging to acc.=20 1) GCC versions affected: 12.1.0 (also: Mac 12.2.0) (11.3.0 unaffected) 2) System type: both: x86_64-linux-gnu (also: aarch64-apple-darwin) 3) configure options: see below, official Ubuntu 22.04 package=20 4) command line: gfortran-12 -c -fopenmp -fopenacc yoethf.F90 (same with gfortran-11 works fine) 5) compiler output: yoethf.F90:76:7: 76 | !$omp r5alvcp, r5alscp, ralvdcp, ralsdcp, ralfdcp, rtwat, rtice, rticecu , & | 1 Error: Wrong OpenACC continuation at (1): expected !$ACC, got !$OMP yoethf.F90:75:21: 75 | !$omp declare target(r2es, r3les, r3ies, r4les, r4ies, r5les, r5ies= , & | 1 Error: Syntax error in !$OMP DECLARE TARGET list at (1) yoethf.F90:76:22: 76 | !$omp r5alvcp, r5alscp, ralvdcp, ralsdcp, ralfdcp, rtwat, rtice, rticecu , & | 1 Error: Unclassifiable OpenMP directive at (1) yoethf.F90:77:7: 77 | !$omp rtwat_rtice_r, rtwat_rticecu_r, rkoop1, rkoop2) | 1 Error: Wrong OpenACC continuation at (1): expected !$ACC, got !$OMP yoethf.F90:77:22: 77 | !$omp rtwat_rtice_r, rtwat_rticecu_r, rkoop1, rkoop2) | 1 Error: Unclassifiable OpenMP directive at (1) 6) Workaround: replace lines: !$acc declare copyin(r2es, r3les, r3ies, r4les, r4ies, r5les, r5ies, & !$acc r5alvcp, r5alscp, ralvdcp, ralsdcp, ralfdcp, rtwat, rtice, rticecu,= & !$acc rtwat_rtice_r, rtwat_rticecu_r, rkoop1, rkoop2) !$omp declare target(r2es, r3les, r3ies, r4les, r4ies, r5les, r5ies , & !$omp r5alvcp, r5alscp, ralvdcp, ralsdcp, ralfdcp, rtwat, rt= ice, rticecu , & !$omp rtwat_rtice_r, rtwat_rticecu_r, rkoop1, rkoop2) with: !$acc declare copyin(r2es, r3les, r3ies, r4les, r4ies, r5les, r5ies, & !$acc r5alvcp, r5alscp, ralvdcp, ralsdcp, ralfdcp, rtwat, rtice, rticecu,= & !$acc rtwat_rtice_r, rtwat_rticecu_r, rkoop1, rkoop2) !$omp declare target(r2es, r3les, r3ies, r4les, r4ies, r5les, r5ies) !$omp declare target(r5alvcp, r5alscp, ralvdcp, ralsdcp, ralfdcp, rtwat, rt= ice, rticecu) !$omp declare target(rtwat_rtice_r, rtwat_rticecu_r, rkoop1, rkoop2) gfortran-12 -v Using built-in specs. COLLECT_GCC=3Dgfortran-12 COLLECT_LTO_WRAPPER=3D/usr/lib/gcc/x86_64-linux-gnu/12/lto-wrapper OFFLOAD_TARGET_NAMES=3Dnvptx-none:amdgcn-amdhsa OFFLOAD_TARGET_DEFAULT=3D1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion=3D'Ubuntu 12.1.0-2ubuntu1~22.04' --with-bugurl=3Dfile:///usr/share/doc/gcc-12/README.= Bugs --enable-languages=3Dc,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=3D/usr --with-gcc-major-version-only --program-suffix=3D-12 --program-prefix=3Dx86_64-linux-gnu- --enable-shared --enable-linker-build-= id --libexecdir=3D/usr/lib --without-included-gettext --enable-threads=3Dposix --libdir=3D/usr/lib --enable-nls --enable-clocale=3Dgnu --enable-libstdcxx-= debug --enable-libstdcxx-time=3Dyes --with-default-libstdcxx-abi=3Dnew --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=3Drelea= se --with-target-system-zlib=3Dauto --enable-objc-gc=3Dauto --enable-multiarch --disable-werror --enable-cet --with-arch-32=3Di686 --with-abi=3Dm64 --with-multilib-list=3Dm32,m64,mx32 --enable-multilib --with-tune=3Dgeneric --enable-offload-targets=3Dnvptx-none=3D/build/gcc-12-sZcx2y/gcc-12-12.1.0/= debian/tmp-nvptx/usr,amdgcn-amdhsa=3D/build/gcc-12-sZcx2y/gcc-12-12.1.0/deb= ian/tmp-gcn/usr --enable-offload-defaulted --without-cuda-driver --enable-checking=3Drelease --build=3Dx86_64-linux-gnu --host=3Dx86_64-linux-gnu --target=3Dx86_64-linu= x-gnu Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.1.0 (Ubuntu 12.1.0-2ubuntu1~22.04)=