From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A951F3857427; Wed, 15 Jun 2022 08:49:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A951F3857427 From: "tschwinge at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/105975] OpenMP/nvptx offloading: 'internal compiler error: in maybe_legitimize_operand, at optabs.cc:7785' Date: Wed, 15 Jun 2022 08:49:22 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: openmp X-Bugzilla-Severity: normal X-Bugzilla-Who: tschwinge at gcc dot gnu.org 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: attachments.created Message-ID: In-Reply-To: References: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2022 08:49:22 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105975 --- Comment #2 from Thomas Schwinge --- Created attachment 53140 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D53140&action=3Dedit 'a-for-11.o.xz' With commit 1d205dbac1e1754c01c22a31bd1688126545401e "Factor out common internal-fn idiom" sources, I've run such an OpenMP/nvptx offloading compilation ('libgomp.c-c++-common/for-11.c', '-O1') with '-v -save-temps',= and we see: [...] =20=20=20=20 /home/thomas/tmp/source/gcc/build/trace-slim-omp/build-gcc-offload-nvptx-no= ne/gcc/lto1 -quiet -dumpbase ./a.xnvptx-none.mkoffload -m64 -mgomp -O1 -version -fno-openacc -fno-pie -fcf-protection=3Dnone -foffload-abi=3Dlp64 -fopenmp @./a.xnvptx-none.mkoffload.args.0 -o ./a.xnvptx-none.mkoffload.s [...] during RTL pass: expand source-gcc/libgomp/testsuite/libgomp.c-c++-common/for-2.h: In function =E2=80=98f20_tpf_simd_static._omp_fn.1=E2=80=99: source-gcc/libgomp/testsuite/libgomp.c-c++-common/for-2.h:343:9: intern= al compiler error: in maybe_legitimize_operand, at optabs.cc:7785 [...] $ cat < a.xnvptx-none.mkoffload.args.0 a-for-11.o If you now build a nvptx offloading compiler (same commit 1d205dbac1e1754c01c22a31bd1688126545401e sources): $ ../source-gcc/configure --target=3Dnvptx-none --enable-as-accelerator-for=3Dx86_64-pc-linux-gnu --enable-languages=3Dlto --enable-checking=3Dyes,extra,rtl $ make -j16 all-gcc ..., you ought to be able to reproduce the ICE (using the 'a-for-11.o' I've attached to this PR, 'xz'-compressed): $ gcc/lto1 -quiet -dumpbase ./a.xnvptx-none.mkoffload -m64 -mgomp -O1 -version -fno-openacc -fno-pie -fcf-protection=3Dnone -foffload-abi=3Dlp64 = -fopenmp a-for-11.o -o ./a.xnvptx-none.mkoffload.s [...] during RTL pass: expand ../source-gcc/libgomp/testsuite/libgomp.c-c++-common/for-2.h: In functi= on =E2=80=98f20_tpf_simd_static._omp_fn.1=E2=80=99: ../source-gcc/libgomp/testsuite/libgomp.c-c++-common/for-2.h:343:9: internal compiler error: in maybe_legitimize_operand, at optabs.cc:7785 [...]=