From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 66DCB3858CDA; Wed, 10 Apr 2024 08:17:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 66DCB3858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712737042; bh=nQuVcLWXcsq38YZN32ChsV8r94wbpGVzKbWykLLUIcg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=P29dnGY8GW6/GfO7z+BG5e1cqTYRbSOMM2ydntp75feNIclH5qYDKFlE1QqDTnQsA CxK6IGb1ZxDO5vHO6mdSFY97SAkXRzkPkI9F6KA73whL8iyipZS04DfnewEJ19fc8O WImfxMqHS6HUWpasANvlop2jvy0HCPNwLrog6KwA= 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:17:21 +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: 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=3D114591 Hongtao Liu changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |liuhongt at gcc dot gnu.org --- Comment #4 from Hongtao Liu --- (In reply to Uro=C5=A1 Bizjak from comment #3) > (In reply to Jakub Jelinek from comment #2) > > This changed with r12-5584-gca5667e867252db3c8642ee90f55427149cd92b6 >=20 > Strange, if I revert the constraints to the previous setting with:=20 >=20 > --cut here-- > diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md > index 10ae3113ae8..262dd25a8e0 100644 > --- a/gcc/config/i386/i386.md > +++ b/gcc/config/i386/i386.md > @@ -2870,9 +2870,9 @@ (define_peephole2 >=20=20 > (define_insn "*movhi_internal" > [(set (match_operand:HI 0 "nonimmediate_operand" > - "=3Dr,r,r,m ,*k,*k ,r ,m ,*k ,?r,?*v,*Yv,*v,*v,jm,m") > + "=3Dr,r,r,m ,*k,*k ,*r ,*m ,*k ,?r,?v,*Yv,*v,*v,*jm,*m") > (match_operand:HI 1 "general_operand" > - "r ,n,m,rn,r ,*km,*k,*k,CBC,*v,r ,C ,*v,m ,*x,*v"))] > + "r ,n,m,rn,*r ,*km,*k,*k,CBC,v,r ,C ,v,m ,x,v"))] > "!(MEM_P (operands[0]) && MEM_P (operands[1])) > && ix86_hardreg_mov_ok (operands[0], operands[1])" > { > --cut here-- >=20 > I still get: >=20 > movl v1(%rip), %eax # 6 [c=3D6 l=3D6] *zero_extendsidi2/3 > movq %rax, v2(%rip) # 16 [c=3D4 l=3D7] *movdi_internal/5 > movzwl v1(%rip), %eax # 7 [c=3D5 l=3D7] *movhi_internal/2 My experience is memory cost for the operand with rm or separate r, m is different which impacts RA decision. https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595573.html=