From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D287F3858035; Mon, 11 Jul 2022 23:23:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D287F3858035 From: "vineet.gupta at linux dot dev" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/106265] RISC-V SPEC2017 507.cactu code bloat due to address generation Date: Mon, 11 Jul 2022 23:23:07 +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: 12.1.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: vineet.gupta at linux dot dev 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: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2022 23:23:07 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106265 --- Comment #1 from Vineet Gupta --- Analyzed a section of -dP dump where reg a2 is setup with exact same value while being live. rhs-cred.cc:42: (*(double *)((char *)&ao)[k] + *(double *)((char *)0)[12] + #(insn 2662 1711 76 (set (reg:DI 12 a2 [2816]) # (const_int 4096 [0x1000])) "rhs-cred.cc":42:47 139 {*movdi_64bit} # (nil)) li a2,4096 # tmp2816, # 2662 [c=3D4 l=3D4]=20 *movdi_64bit/1 rhs-cred.cc:39: bg =3D (&ao[az])[0] * *(&ao)[av] + *(&ao)[2]; #(insn 76 2662 2663 (set (reg/f:DI 20 s4 [orig:193 _239 ] [193]) # (plus:DI (reg:DI 13 a3 [1865]) # (reg:DI 20 s4 [orig:181 _224 ] [181]))) "rhs-cred.cc":39:40 4 {adddi3} # (expr_list:REG_DEAD (reg:DI 13 a3 [1865]) # (nil))) add s4,a3,s4 # _224, _239, tmp1865 # 76 [c=3D4 l=3D= 4]=20 adddi3/0 rhs-cred.cc:42: (*(double *)((char *)&ao)[k] + *(double *)((char *)0)[12] + #(insn 2663 76 2660 (set (reg:DI 13 a3 [2815]) # (plus:DI (reg:DI 12 a2 [2816]) # (const_int -2024 [0xfffffffffffff818]))) "rhs-cred.cc":42:47 4 {adddi3} # (expr_list:REG_DEAD (reg:DI 12 a2 [2816]) # (expr_list:REG_EQUAL (const_int 2072 [0x818]) # (nil)))) addi a3,a2,-2024 #, tmp2815, tmp2816 # 2663 [c=3D4 l=3D= 4]=20 adddi3/1 rhs-cred.cc:44: *(&ao)[av * 2] - *(&ao)[k] - (&ao[az])[2] + #(insn 2660 2663 1710 (set (reg:DI 12 a2 [2814]) # (const_int 4096 [0x1000])) "rhs-cred.cc":44:29 139 {*movdi_64bit} # (nil)) li a2,4096 # tmp2814, # 2660 [c=3D4 l=3D4]=20 *movdi_64bit/1=