From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from server.nextmovesoftware.com (server.nextmovesoftware.com [162.254.253.69]) by sourceware.org (Postfix) with ESMTPS id 9CDE73858430 for ; Sat, 9 Jul 2022 09:26:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9CDE73858430 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=nextmovesoftware.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nextmovesoftware.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nextmovesoftware.com; s=default; h=Content-Type:MIME-Version:Message-ID: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=mbT3RnsOf2t32VKdB32BlAdJxBJ1nuGil6HZcQGRYUs=; b=loi7gcjcTEJElAqv2H3sy4YUgu yNVTLqUAB6NRaBG9t5mRe44WDTkj7KGYuZLRZtG2z1/SMb2LwA48fNMxNKr4qBlwRls2y6MWWGV5q Eswe2SF/S95Zk9rJ8r0jecHnGI3KB71TIZr9CJl8/q4+JgP8vPhOce2S1EkeM/yQKF9/sm8ppg5Nw gG16RQi60nfrdk3pM/jttsNQCSWsaUfqQZd1klMI0bYlVtvPWlGd9Z2Cd2eb7cgQO1Ikm+FuQWXj+ douSirLiPskcivm0toqkjzQNCC+48W0oHnUfmYdIE/O1XC7fnz1NV0oEDgPU1hH6wxDnjbAA2XPnW T5woXBaQ==; Received: from host86-130-134-60.range86-130.btcentralplus.com ([86.130.134.60]:63406 helo=Dell) by server.nextmovesoftware.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oA6jH-0003jK-Oq; Sat, 09 Jul 2022 05:26:23 -0400 From: "Roger Sayle" To: Cc: "'Richard Biener'" , "'Uros Bizjak'" Subject: [gcc12 backport] PR target/105930: Split *xordi3_doubleword after reload on x86. Date: Sat, 9 Jul 2022 10:26:20 +0100 Message-ID: <019501d89375$f44b4560$dce1d020$@nextmovesoftware.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0196_01D8937E.5611F750" X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdiTdYCRadSDGS7RS1GglJqWFT7KDQ== Content-Language: en-gb X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server.nextmovesoftware.com X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - nextmovesoftware.com X-Get-Message-Sender-Via: server.nextmovesoftware.com: authenticated_id: roger@nextmovesoftware.com X-Authenticated-Sender: server.nextmovesoftware.com: roger@nextmovesoftware.com X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jul 2022 09:26:26 -0000 This is a multipart message in MIME format. ------=_NextPart_000_0196_01D8937E.5611F750 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable This is a backport of the fix for PR target/105930 from mainline to the gcc12 release branch. This patch has been retested against the gcc12 branch on x86_64-pc-linux-gnu with make bootstrap and make -k check, both with and without --target_board=3Dunix{-m32} with no new failures. Ok for the gcc12 branch? 2022-07-09 Roger Sayle Uro=B9 Bizjak gcc/ChangeLog PR target/105930 * config/i386/i386.md (*di3_doubleword): Split after reload. Use rtx_equal_p to avoid creating memory-to-memory = moves, and emit NOTE_INSN_DELETED if operand[2] is zero (i.e. with = -O0). Thanks in advance, Roger -- ------=_NextPart_000_0196_01D8937E.5611F750 Content-Type: text/plain; name="patchlt.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="patchlt.txt" diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md=0A= index 7c9560fc4..1c4781d 100644=0A= --- a/gcc/config/i386/i386.md=0A= +++ b/gcc/config/i386/i386.md=0A= @@ -10400,22 +10400,25 @@=0A= "ix86_expand_binary_operator (, mode, operands); DONE;")=0A= =0A= (define_insn_and_split "*di3_doubleword"=0A= - [(set (match_operand:DI 0 "nonimmediate_operand")=0A= + [(set (match_operand:DI 0 "nonimmediate_operand" "=3Dro,r")=0A= (any_or:DI=0A= - (match_operand:DI 1 "nonimmediate_operand")=0A= - (match_operand:DI 2 "x86_64_szext_general_operand")))=0A= + (match_operand:DI 1 "nonimmediate_operand" "0,0")=0A= + (match_operand:DI 2 "x86_64_szext_general_operand" "re,o")))=0A= (clobber (reg:CC FLAGS_REG))]=0A= "!TARGET_64BIT=0A= - && ix86_binary_operator_ok (, DImode, operands)=0A= - && ix86_pre_reload_split ()"=0A= + && ix86_binary_operator_ok (, DImode, operands)"=0A= "#"=0A= - "&& 1"=0A= + "&& reload_completed"=0A= [(const_int 0)]=0A= {=0A= + /* This insn may disappear completely when operands[2] =3D=3D = const0_rtx=0A= + and operands[0] =3D=3D operands[1], which requires a = NOTE_INSN_DELETED. */=0A= + bool emit_insn_deleted_note_p =3D false;=0A= +=0A= split_double_mode (DImode, &operands[0], 3, &operands[0], = &operands[3]);=0A= =0A= if (operands[2] =3D=3D const0_rtx)=0A= - emit_move_insn (operands[0], operands[1]);=0A= + emit_insn_deleted_note_p =3D true;=0A= else if (operands[2] =3D=3D constm1_rtx)=0A= {=0A= if ( =3D=3D IOR)=0A= @@ -10427,7 +10430,10 @@=0A= ix86_expand_binary_operator (, SImode, &operands[0]);=0A= =0A= if (operands[5] =3D=3D const0_rtx)=0A= - emit_move_insn (operands[3], operands[4]);=0A= + {=0A= + if (emit_insn_deleted_note_p)=0A= + emit_note (NOTE_INSN_DELETED);=0A= + }=0A= else if (operands[5] =3D=3D constm1_rtx)=0A= {=0A= if ( =3D=3D IOR)=0A= ------=_NextPart_000_0196_01D8937E.5611F750--