From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1BAD93858284; Wed, 21 Dec 2022 13:15:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1BAD93858284 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671628516; bh=C4SZwN2uYSRa14SS7vGlc4OCMWSdPKF/1u7KCOnVqUw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uWSezvfDecc+GRqEcHjATMUQUxvyetmGPc8PWxlG6gNz0A7h4wkINVDTVowblqSoZ pGTY2esvC73WSV6Eenujm+8XadBXmcACTzdEWN8v5YlY1gfcVc6KDPoJRBYWum34qp SwJz5xR25Oy2Dur5UyR4MnM27/SukWI8AMCtKsOc= From: "rsandifo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/107991] [10/11/12/13 Regression] Extra mov instructions with ternary on x86 Date: Wed, 21 Dec 2022 13:15:15 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: missed-optimization, ra X-Bugzilla-Severity: normal X-Bugzilla-Who: rsandifo 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: 10.5 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=3D107991 --- Comment #5 from rsandifo at gcc dot gnu.org --- >From a slightly old build, but it looks like we have a redundant move: (insn 4 27 28 2 (set (reg/v:SI 85 [ i ]) (reg:SI 91)) "foo.c":9:31 83 {*movsi_internal} (expr_list:REG_DEAD (reg:SI 91) (nil))) This causes problems because we can then assign different preferences and costs to 85 and 91. 91 comes from input register SI and so prefers SIREG while 85 feeds the result and so prefers AREG. We should be able to cope better with this, will have a look in the new year. The output seems better with -fweb.=