From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8D237385697F; Tue, 15 Aug 2023 17:13:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8D237385697F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692119613; bh=D93+C49GqN5EQ00LR2qlaXm0SbQveJZaBx9h3kM9QVA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZesGff5w8kO7mavRMLxxAVgIwDfZs5iwGhNK8IqemBxDdt3iQXdCxhhTlOb30SK6T sft2Zc9kkING9YalcxDg1afaxndv9p8jW+xgKzhMvDL5vqM1fImqZKltIB1FL5sfF7 ABelDimP1Bte6uRob3L2/bBL05Dwjm4quKyA5P1c= From: "vineetg at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/110748] RISC-V: optimize store of DF 0.0 Date: Tue, 15 Aug 2023 17:13:32 +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.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: vineetg at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: vineetg 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=3D110748 --- Comment #16 from Vineet Gupta --- (In reply to Vineet Gupta from comment #15) > On the branch devel/vineetg/optim-double-const-m0 I have double -0.0 work= ing. >=20 > znd: > li a5,-1 > slli a5,a5,63 > sd a5,0(a0) > ret >=20 > There's currently an ICE for zbs >=20 > IRA is undoing the split so the insn with const_int 0x80000000_00000000 > doesn't exist for final pass. >=20 > expand > ------ > (insn 6 3 0 2 (set (mem:DF (reg:DI 135) > (const_double:DF -0.0 [-0x0.0p+0])) {*movdf_hardfloat_rv64} >=20 > split1 > ----- > (insn 10 3 11 2 (set (reg:DI 136) > (const_int [0x8000000000000000])) >=20 > (insn 11 10 0 2 (set (mem:DF (reg:DI 135) > (subreg:DF (reg:DI 136) 0)) >=20 > ira > ---- > (insn 11 9 12 2 (set (mem:DF (reg:DI 135) > (const_double:DF -0.0 [-0x0.0p+0])) {*movdf_hardfloat_rv64} So IRA is doing the equivalent replacement for a register which is referenc= ed exactly twice: set once and used once, w/o any reg pressure considerations = [1]. [1] https://gcc.gnu.org/pipermail/gcc-patches/2023-August/627212.html There seems to be no easy way around it.=