From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8047D384773E; Wed, 10 Apr 2024 08:52:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8047D384773E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712739126; bh=KivKzCEriNm9Ohgl6Ff9pPSFHhgo9RCobvVMLEopWkc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Sh55qANn9fvwlc/4t8v3HZrolBeMk7KcSL+h2M/mSXeQ9o0zT/UpDssbLZlVT+VpI pE6bLd28G3W6X64kkFDqrxhYJPf74JLOJ3rB3gYHyumtrjv+zk97Btwca6+s1Y2tTA nkZre7ETFMchNMFt4tzL6MDh+ZYQdl2JQ85Nx74o= From: "liuhongt at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/114591] [12/13/14 Regression] register allocators introduce an extra load operation since gcc-12 Date: Wed, 10 Apr 2024 08:52:06 +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.2.0 X-Bugzilla-Keywords: missed-optimization, ra X-Bugzilla-Severity: normal X-Bugzilla-Who: liuhongt at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.4 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=3D114591 --- Comment #9 from Hongtao Liu --- >=20 > It looks that different modes of memory read confuse LRA to not CSE the r= ead. >=20 > IMO, if the preloaded value is later accessed in different modes, LRA sho= uld > leave it. Alternatively, LRA should CSE memory accesses in different mode= s. (insn 7 6 12 2 (set (reg:HI 101 [ _5 ]) (subreg:HI (reg:SI 98 [ v1.0_1 ]) 0)) "test.c":6:12 86 {*movhi_internal} (expr_list:REG_DEAD (reg:SI 98 [ v1.0_1 ]) (nil))) May be we should reduce cost from simple move instruction(with subreg?) when calculating total_cost, since it's probably be eliminated by later rtl optimization.=