From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 687FC3860759; Mon, 22 Apr 2024 15:45:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 687FC3860759 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713800756; bh=VEssIfQfAg0YTsrO9XnqmGkmT6vSDlmMoPFqIkCrWd0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HlNC/edulvDE2ybdqPvkbtpwW6oaPN/M85a7wQUs5csDqjOhnQeJzkIeaWx0lgChx cJ3ucwJwqK21NLmtZabQOefjyVQG06GCyu9LaY1BcHe0Rk/ejwI2J3FKJFtqQaWCbf S4NKePa0CZ0So/3Ff/xv0z4rvDRnM0xtOvB7gWWU= From: "rdapp at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/114734] [14] RISC-V rv64gcv_zvl256b miscompile with -flto -O3 -mrvv-vector-bits=zvl Date: Mon, 22 Apr 2024 15:45:54 +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: needs-bisection, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rdapp at gcc dot gnu.org X-Bugzilla-Status: NEW 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=3D114734 --- Comment #5 from Robin Dapp --- What happens is that code sinking does: Sinking # VUSE <.MEM_1235> vect__173.251_1238 =3D .MASK_LEN_LOAD (_911, 32B, { -1, -1, -1, -1 }, loop_len_1064, 0); from bb 3 to bb 4 so we have vect__173.251_1238 =3D .MASK_LEN_LOAD (_911, 32B, { -1, -1, -1, -1 }, loop_len_1064, 0); after the loop. When expanding this stmt expand_call_mem_ref creates a mem reference to vectp_g.178 for _911 (=3D=3D vectp_g.178_1078). This is expanded to the sa= me rtl as vectp_g.178_1079 (which is incremented before the latch as opposed to ...1078 which is not). Disabling sinking or expand_call_mem_ref both help but neither is correct of course :) I don't have a solution yet but I'd hope we're a bit closer to t= he problem now.=