From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 058543858C66; Thu, 29 Feb 2024 15:55:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 058543858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709222127; bh=sdKoQpDMGMjnLz4A94koMWmaHFgyx44AXVCg1LLroDs=; h=From:To:Subject:Date:From; b=l4KDIWZ6yMBGmoe97R+BcTvS4rA5W0AVQFpsE+fpjKGGW1MLF/Q4p2K9ga+KVeiY+ dbe8gTXM+tM5FgU6TSNLz3bINzCjUYoNWAMOHVDvivSl2GaJaE/z40SwVfJrr3VPbi q34QFHr0ntIgBd6/IB/kG7ldJruFpt11tu4z524k= From: "vogelm at buerokommunikation dot fernuni-hagen.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/114172] New: ICE with riscv rvv VSETVL intrinsic Date: Thu, 29 Feb 2024 15:55:25 +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.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vogelm at buerokommunikation dot fernuni-hagen.de 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=3D114172 Bug ID: 114172 Summary: ICE with riscv rvv VSETVL intrinsic Product: gcc Version: 13.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: vogelm at buerokommunikation dot fernuni-hagen.de Target Milestone: --- Created attachment 57576 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D57576&action=3Dedit .i file generated from code in description #pragma riscv intrinsic "vector" void saxpy_rvv_m8(float *y, long vl) { for (;;) { vl =3D __riscv_vsetvl_e32m8(vl); //ICE vfloat32m8_t y_vec; __riscv_vse32_v_f32m8(y, y_vec, vl); } } Description:=20 The attached code snipped causes an ICE on about 4 out of 10 attempts on my local machine. It seems to be related to the RVV intrinsic call __riscv_vsetvl_e32m8(vl) on line 7. Passing vl as a parameter here is a programming error, but I don't think the compiler should crash.=20 The behavior can also be observed on godbolt (https://godbolt.org/z/Gr915sh= zq). I can reproduce the error on gcc 13.2.0 and 13.1.0. gcc 14.0.1 doesn't crash so there already seems to be a fix for it but I couldn't find any bug reports about it. the exact version of GCC: gcc version 13.2.0 (gc891d8dc23e)=20 the system type: riscv64-unknown-linux-gnu the options given when GCC was configured/built; Configured with: $home/riscv-gnu-toolchain/gcc/configure=20 --target=3Driscv64-unknown-linux-gnu=20 --prefix=3D$home/riscv-gnu-toolchain/../_install=20 --with-sysroot=3D$home/riscv-gnu-toolchain/../_install/sysroot=20 --with-pkgversion=3Dgc891d8dc23e=20 --with-system-zlib=20 --enable-shared=20 --enable-tls=20 --enable-languages=3Dc,c++,fortran=20 --disable-libmudflap=20 --disable-libssp=20 --disable-libquadmath=20 --disable-libsanitizer=20 --disable-nls=20 --disable-bootstrap=20 --src=3D.././gcc=20 --enable-multilib=20 --with-abi=3Dlp64d=20 --with-arch=3Drv64imafdcv=20 --with-tune=3Drocket=20 --with-isa-spec=3D20191213 'CFLAGS_FOR_TARGET=3D-O2 -mcmodel=3Dm= edlow' 'CXXFLAGS_FOR_TARGET=3D-O2 -mcmodel=3Dmedlow' the complete command line that triggers the bug; riscv64-unknown-linux-gnu-gcc -march=3Drv64imafdcv -mabi=3Dlp64d -O3 -s= tatic -c saxpy.c -o saxpy the compiler output (error messages, warnings, etc.) riscv64-unknown-linux-gnu-gcc: internal compiler error: Segmentation fa= ult signal terminated program cc1=