From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BFB2C3858401; Thu, 1 Jun 2023 10:35:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BFB2C3858401 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685615755; bh=pHOBd2hdOAr84iwEYZDaJ9QuLHAPYH3TATLYPtwqqv8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NH7XvPWJ36Sp1RZdYZOLT2elnM1+PJUoziWvdMVyzgkmpu4hP4oArfY9s8IGEBEZ/ VpPdcY4att9gr5sKoFhB8x1FRgOUM5UlfIeq590juKDMmnLxUFycTGddfKnClcu4Cc fu4s5uYkcji0Q4vZyaRcZrhv/TVF5QrA/BBzugRM= From: "maxim.blinov at imgtec dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/109989] RISC-V: Missing sign extension with int to float conversion with 64bit soft floats Date: Thu, 01 Jun 2023 10:35:51 +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: 13.1.0 X-Bugzilla-Keywords: ABI, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: maxim.blinov at imgtec 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: cc 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=3D109989 Maxim Blinov changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |maxim.blinov at imgtec dot= com --- Comment #1 from Maxim Blinov --- Hi all, I bisected the failure to commit 3496ca4e656, "RISC-V: Add runtime invariant support". GCC seems to treat the x array (`x[2]`) as a 2 integer vector, and loads it into a DI mode register. However after the patch it neglects to honour the = fact that we only really want the lower 32 bits (which corresponds to `x[0]`) wh= en passing it as an argument to `__floatsisf`. Before the commit, we generate (insn 12 11 13 2 (set (reg:DI 10 a0) (sign_extend:DI (subreg:SI (reg:DI 77) 0))) "../a.c":16:10 116 {extendsidi2} (expr_list:REG_DEAD (reg:DI 77) (nil))) After the commit, we generate (insn 12 11 13 2 (set (reg:SI 10 a0) (subreg:SI (reg:DI 77) 0)) "../a.c":16:10 178 {*movsi_internal} (expr_list:REG_DEAD (reg:DI 77) (nil))) which consequently gets removed as a useless instruction during the lra pas= s.=