From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1490738582B6; Wed, 6 Mar 2024 12:55:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1490738582B6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709729710; bh=goqzuamdZsu8B/XKP0f3WEH0htOdZ6O7N7nyeYgL4qM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jeThP11t6hSIDuaG45zKjXlmQ4Dd+5sIwQnr81dhp1DuJ9RZ+ujK7N/6TWWvBhaq5 D+udSeQGgJaPd5/kHH2XamDIkNusmtL085bpmNGSx+PMXWSP8XcIcgzs9hYv035v+b 0e9Td4yyZDV4k+4AkZWVXUMbB/NQJUukXhu1+mw4= From: "rdapp at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/114200] [14] RISC-V fixed-length vector miscompile at -O3 Date: Wed, 06 Mar 2024 12:55:09 +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: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rdapp 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=3D114200 --- Comment #1 from Robin Dapp --- Took me a while to analyze this... needed more time than I'd like to admit = to make sense of the somewhat weird code created by fully unrolling and peelin= g. I believe the problem is that we reload the output register of a vfmacc/fma= via vmv.v.v (subject to length masking) but we should be using vmv1r.v. The re= sult is used by a reduction which always operates on the full length. As annoyi= ng as it was to find - it's definitely a good catch. I'm testing a patch. PR114202 is indeed a duplicate. Going to add its test case to the patch.=