From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3D6233858284; Thu, 23 Nov 2023 12:09:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3D6233858284 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1700741350; bh=bRa3Ux9vwPsfBB/bQdEVO9Mzp13AeMiU/OrsJaV7n8Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UIfSILr2SVJIHnKONi9uQH0GaXHDPYM+MSQ8nKCVCu/jwokpxSD9/BhY5FWdoryCs EqOKtpgslwr+QXWB+srBL5GIr+5b1QE/eQlnnA0a3M/OZabLqopGoMUcwLfLHu5jsy ce7pa8QJ7A2CDJGlEjPpjS1aO4p3YzoW5B7/wLfo= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/112599] RISC-V regression testsuite errors with rv64gcv_zvl1024b Date: Thu, 23 Nov 2023 12:09:08 +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: 14.0 X-Bugzilla-Keywords: testsuite-fail X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit 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: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112599 --- Comment #3 from CVS Commits --- The master branch has been updated by Robin Dapp : https://gcc.gnu.org/g:35a688f434159a923420310860c5bc721e29a741 commit r14-5777-g35a688f434159a923420310860c5bc721e29a741 Author: Juzhe-Zhong Date: Thu Nov 23 19:59:52 2023 +0800 RISC-V: Disable AVL propagation of vrgather instruction This patch fixes following FAILs in zvl1024b of both RV32/RV64: FAIL: gcc.c-torture/execute/990128-1.c -O2 execution test FAIL: gcc.c-torture/execute/990128-1.c -O2 -flto -fno-use-linker-plug= in -flto-partition=3Dnone execution test FAIL: gcc.c-torture/execute/990128-1.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects execution test FAIL: gcc.c-torture/execute/990128-1.c -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions execution test FAIL: gcc.c-torture/execute/990128-1.c -O3 -g execution test FAIL: gcc.dg/torture/pr58955-2.c -O3 -fomit-frame-pointer -funroll-lo= ops -fpeel-loops -ftracer -finline-functions execution test The root case can be simpliy described in this following small case: https://godbolt.org/z/7GaxbEGzG typedef int64_t v1024b __attribute__ ((vector_size (128))); void foo (void *out, void *in, int64_t a, int64_t b) { v1024b v =3D {a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a}; v1024b v2 =3D {b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b}; v1024b index =3D *(v1024b*)in; v1024b v3 =3D __builtin_shuffle (v, v2, index); __riscv_vse64_v_i64m1 (out, (vint64m1_t)v3, 10); } Incorrect ASM: foo: li a5,31 vsetivli zero,10,e64,m1,ta,mu vmv.v.x v2,a5 vl1re64.v v1,0(a1) vmv.v.x v4,a2 vand.vv v1,v1,v2 vmv.v.x v3,a3 vmsgeu.vi v0,v1,16 vrgather.vv v2,v4,v1 --> AVL =3D VLMAX according to c= odes. vadd.vi v1,v1,-16 vrgather.vv v2,v3,v1,v0.t --> AVL =3D VLMAX according to c= odes. vse64.v v2,0(a0) --> AVL =3D 10 according to code= s. ret For vrgather dest, source, index instruction, when index may has the va= lue > the following store AVL that is index value > 10. In this situation, the codes above will end = up with: The source vector of vrgather has undefined value on index >=3D AVL (wh= ich is 10 in this case). So disable AVL propagation for vrgather instruction. PR target/112599 PR target/112670 gcc/ChangeLog: * config/riscv/riscv-avlprop.cc (alv_can_be_propagated_p): New function. (vlmax_ta_p): Disable vrgather AVL propagation. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/pr112599-1.c: New test.=