From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A3F753858D32; Tue, 25 Apr 2023 09:31:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A3F753858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682415089; bh=63HPxqfMvUu17Qtz1Wjwl7+uOGHeNtpN7cwhnRUMDpo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Owkf7G+VBc5e+W8noCl//5ewqz6ojHcX+/gBZ/E6SkJwRebJ/R1hBBPcsP6XOBh3I 7z3y52/rIivc+1Mr6iuUFlnnhH1KNY8K0L8afbgwDmbMyqRepp/M6IP5zMeLoj7Xqg /+nFkG+IB2hWQ48PG/UQv3cPHK72zcpxaJz4xh74= From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/109610] [14 regression] gcc.target/powerpc/dform-3.c fails after r14-172-g0368d169492017 Date: Tue, 25 Apr 2023 09:31:29 +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: 14.0 X-Bugzilla-Keywords: testsuite-fail X-Bugzilla-Severity: normal X-Bugzilla-Who: crazylht at gmail 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: 14.0 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=3D109610 --- Comment #3 from Hongtao.liu --- >=20 > And after my commit, RA take best scenario when preferred reg_class is > unkown, which make cost of MEM:0,0 of r117 same as VSX_REGS:0,0, and > allocate r117 as VSX_REGS, which create an extra move and failed the > testcase. The extra move normally can be eliminated by reload if both src and dest ha= ve same reg_class, but here src is VSX_REGS and dest is GENERAL_REGS. Maybe we should add a little bit extra cost to best scenario to make RA han= dle such redundancy but not relies on pass_reload for that. @@ -1580,7 +1580,7 @@ scan_one_insn (rtx_insn *insn) int num =3D COST_INDEX (REGNO (reg)); COSTS (costs, num)->mem_cost - -=3D ira_memory_move_cost[GET_MODE (reg)][cl][1] * frequency; + -=3D (ira_memory_move_cost[GET_MODE (reg)][cl][1] + 1) * frequency; 1 unit cost is aligned with what's did in recog_reg_class /* If the alternative actually allows memory, make things a bit cheaper since we won't need an extra insn to load it. */ pp->mem_cost =3D ((out_p ? ira_memory_move_cost[mode][op_class][0] := 0) + (in_p ? ira_memory_move_cost[mode][op_class][1] : = 0) - allows_mem[i]) * frequency;=