From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D4C8238582B0; Fri, 11 Aug 2023 15:08:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D4C8238582B0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691766485; bh=6Ze7ms/vr4eninAJZjYktI32gInaB0Hq0kMoy7CoLYE=; h=From:To:Subject:Date:From; b=kW4qeQG8dt3LUAlpScEMURy/Fpc7EZ2UOOAgUbLmHjBHJCdKCU5wLMKAAC/rSddYx kLZEVySBtLwNt7mS1QWspP9ysWIoPLwseRWkb5eUAuudxB7Chfp8zNpVtinYV5PA8J Xm0yDml4FkiYIY8kSThbwBRR/DfAevlVjhXWcros= From: "jeremy.bennett at embecosm dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/110994] New: RISC-V Fortran: Illegal instruction ICE with scalable autovec Date: Fri, 11 Aug 2023 15:08:04 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jeremy.bennett at embecosm 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 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=3D110994 Bug ID: 110994 Summary: RISC-V Fortran: Illegal instruction ICE with scalable autovec Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: jeremy.bennett at embecosm dot com Target Milestone: --- Created attachment 55723 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D55723&action=3Dedit Fortran 90 source code of the test case Discovered by accident when hunting down a RVV bug, but this appears to be connected with the autovectorizer generically rather than specifically the RISC-V vector ISA extension. The following code (testcase.f90) causes an ICE when using RISC-V as target with --param=3Driscv-autovec-preference=3Dscalable. SUBROUTINE d(e) f (this is invalid Fortran 90, but it should still not trigger an ICE) Compiled with: riscv64-unknown-linux-gnu-gfortran -march=3Drv64gc -mabi=3Dlp64d -c \ -Ofast --param=3Driscv-autovec-preference=3Dscalable testcase.f90 Output is: f951: internal compiler error: Illegal instruction 0x112a263 crash_signal /home/jeremy/gittrees/mustang/gcc/gcc/toplev.cc:314 0x7f0d57e3c4af ??? ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 0x9342a9 poly_int_pod<2u, unsigned short>::to_constant() const /home/jeremy/gittrees/mustang/gcc/gcc/config/riscv/riscv.cc:6565 0x9342a9 riscv_hard_regno_nregs /home/jeremy/gittrees/mustang/gcc/gcc/config/riscv/riscv.cc:6578 0x1092519 init_reg_modes_target() /home/jeremy/gittrees/mustang/gcc/gcc/reginfo.cc:466 0xd00827 init_emit_regs() /home/jeremy/gittrees/mustang/gcc/gcc/emit-rtl.cc:6072 0x9e6058 backend_init /home/jeremy/gittrees/mustang/gcc/gcc/toplev.cc:1749 0x9e6058 do_compile /home/jeremy/gittrees/mustang/gcc/gcc/toplev.cc:2108 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. System information ------------------ Using built-in specs. COLLECT_GCC=3Driscv64-unknown-linux-gnu-gfortran COLLECT_LTO_WRAPPER=3D/home/jeremy/gittrees/mustang/install/libexec/gcc/ris= cv64-unknown-linux-gnu/14.0.0/lto-wrapper Target: riscv64-unknown-linux-gnu Configured with: /home/jeremy/gittrees/mustang/gcc/configure --target=3Driscv64-unknown-linux-gnu --prefix=3D/home/jeremy/gittrees/mustang/install --with-sysroot=3D/home/jeremy/gittrees/mustang/install/sysroot --with-pkgversion=3Dg68783211f66 --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/jeremy/gittrees/mustang/gcc --enable-multilib --with-abi=3Dlp= 64d --with-arch=3Drv64gc --with-tune=3D --with-isa-spec=3D20191213 'CFLAGS_FOR_= TARGET=3D-O2 -mcmodel=3Dmedany' 'CXXFLAGS_FOR_TARGET=3D-O2 -mcmodel=3Dmedany' Thread model: posix Supported LTO compression algorithms: zlib gcc version 14.0.0 20230811 (experimental) (g68783211f66)=