From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 78BA53858D35; Sat, 6 May 2023 22:54:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 78BA53858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683413696; bh=Vi0qnL01kPJFnDOQWjYjWHhxMusLRbmHsigtVdUg/Dk=; h=From:To:Subject:Date:From; b=v18c6cOoJLYST6RsOchLiYSRcICk0L4ZC+PBy+XZdGL9nqZctSAux741zV7SLkXfe GKFWNnRY2u4uMFgFawva87d+yxbPWRuGKMM+/nHFvPH1MaZCkiqGeoEXVwdWk4wClk BB3Y5OHQYx99x6SvBbbQeyaUPZzKl4vLzZpkUUOk= From: "sepotvin at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/109760] New: riscv Internal compiler error in extract_insn after addition of XTheadCondMov Date: Sat, 06 May 2023 22:54:55 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 13.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sepotvin at gmail dot com 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 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=3D109760 Bug ID: 109760 Summary: riscv Internal compiler error in extract_insn after addition of XTheadCondMov Product: gcc Version: 13.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: sepotvin at gmail dot com Target Milestone: --- I get the following internal compiler error after the addition of support of XTheadCondMov in commit "basepoints/gcc-13-6686-g8e7ffe126de" when using the following compile options: "-O2 -mcpu=3Dsifive-u74" or "-O1 -mcpu-sifive-u7= 4" with a riscv64-unknown-linux-gnu compiler. The bug is still present on a re= cent master (basepoints/gcc-14-540-gb7fe38c14e5) ./cross/riscv64/bin/riscv64-unknown-linux-gnu-gcc -O1 -mcpu=3Dsifive-u74 -c ./qgridlayoutengine.ii ./qgridlayoutengine.ii: In function 'void e()': ./qgridlayoutengine.ii:14:1: error: unrecognizable insn: 14 | } | ^ (insn 12 11 13 2 (set (reg:DI 137) (if_then_else:DI (ne:DF (reg:DF 139) (reg:DF 140)) (reg:DI 141) (reg:DI 143))) -1 (nil)) during RTL pass: vregs ./qgridlayoutengine.ii:14:1: internal compiler error: in extract_insn, at recog.cc:2791 0x82e78d _fatal_insn(char const*, rtx_def const*, char const*, int, char const*) /home/spotvin/work/gcc-13.1.0-failure/cross/gcc/gcc/rtl-error.cc:108 0x82e7a9 _fatal_insn_not_found(rtx_def const*, char const*, int, char const= *) /home/spotvin/work/gcc-13.1.0-failure/cross/gcc/gcc/rtl-error.cc:116 0x82d133 extract_insn(rtx_insn*) /home/spotvin/work/gcc-13.1.0-failure/cross/gcc/gcc/recog.cc:2791 0xe80f9d instantiate_virtual_regs_in_insn /home/spotvin/work/gcc-13.1.0-failure/cross/gcc/gcc/function.cc:1611 0xe80f9d instantiate_virtual_regs /home/spotvin/work/gcc-13.1.0-failure/cross/gcc/gcc/function.cc:1985 0xe80f9d execute /home/spotvin/work/gcc-13.1.0-failure/cross/gcc/gcc/function.cc:2034 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See for instructions. Here's the code snippet that can reproduce the issue struct a { void b(); } boxes; struct { a boxes; } c; double d; void e() { bool f(d); for (;;) { a &g =3D f ? c.boxes : boxes; g.b(); } } The output of gcc -v is COLLECT_GCC=3D./cross/riscv64/bin/riscv64-unknown-linux-gnu-gcc COLLECT_LTO_WRAPPER=3D/home/spotvin/work/gcc-13.1.0-failure/cross/riscv64/b= in/../libexec/gcc/riscv64-unknown-linux-gnu/13.0.1/lto-wrapper Target: riscv64-unknown-linux-gnu Configured with: /home/spotvin/work/gcc-13.1.0-failure/cross/riscv-gnu-toolchain/build/../..= /gcc/configure --target=3Driscv64-unknown-linux-gnu --prefix=3D/home/spotvin/work/gcc-13.1.0-failure/cross/riscv-gnu-toolchain/= build/../../riscv64 --with-sysroot=3D/home/spotvin/work/gcc-13.1.0-failure/cross/riscv-gnu-tool= chain/build/../../riscv64/sysroot --with-pkgversion=3Dg8e7ffe126de --with-system-zlib --enable-shared --enabl= e-tls --enable-languages=3Dc,c++,fortran --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libsanitizer --disable-nls --disable-bootst= rap --src=3D/home/spotvin/work/gcc-13.1.0-failure/cross/gcc --disable-multilib --with-abi=3Dlp64d --with-arch=3Drv64imafdc --with-tune=3Drocket --with-isa-spec=3D20191213 'CFLAGS_FOR_TARGET=3D-O2 -mcmodel=3Dmedlow' 'CXXFLAGS_FOR_TARGET=3D-O2 -mcmodel=3Dmedlow' Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 13.0.1 20230315 (experimental) (g8e7ffe126de) I used a cross-compiler to speedup the bisection of the commit where the is= sue appeared but I got the same behavior with a native gcc: Using built-in specs. COLLECT_GCC=3Dgcc COLLECT_LTO_WRAPPER=3D/usr/libexec/gcc/riscv64-unknown-linux-gnu/13/lto-wra= pper Target: riscv64-unknown-linux-gnu Configured with: /var/tmp/portage/sys-devel/gcc-13.1.0-r1/work/gcc-13.1.0/configure --host=3Driscv64-unknown-linux-gnu --build=3Driscv64-unknown-linux-gnu --prefix=3D/usr --bindir=3D/usr/riscv64-unknown-linux-gnu/gcc-bin/13 --includedir=3D/usr/lib/gcc/riscv64-unknown-linux-gnu/13/include --datadir=3D/usr/share/gcc-data/riscv64-unknown-linux-gnu/13 --mandir=3D/usr/share/gcc-data/riscv64-unknown-linux-gnu/13/man --infodir=3D/usr/share/gcc-data/riscv64-unknown-linux-gnu/13/info --with-gxx-include-dir=3D/usr/lib/gcc/riscv64-unknown-linux-gnu/13/include/= g++-v13 --with-python-dir=3D/share/gcc-data/riscv64-unknown-linux-gnu/13/python --enable-languages=3Dc,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --disable-libunwind-exceptions --enable-checking=3Drelease --with-bugurl=3Dhttps://bugs.gentoo.org/ --with-pkgversion=3D'Gentoo 13.1.0= -r1 p1' --with-gcc-major-version-only --disable-esp --enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --enable-shared --enable-threads=3Dpos= ix --enable-__cxa_atexit --enable-clocale=3Dgnu --disable-multilib --disable-fixed-point --with-abi=3Dlp64d --enable-libgomp --disable-libssp --disable-libada --disable-cet --disable-systemtap --disable-valgrind-annotations --disable-vtable-verify --disable-libvtv --without-zstd --without-isl --enable-default-pie --enable-default-ssp Thread model: posix Supported LTO compression algorithms: zlib gcc version 13.1.0 (Gentoo 13.1.0-r1 p1)=