From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by sourceware.org (Postfix) with ESMTPS id 6CDB03855002 for ; Wed, 23 Jun 2021 22:19:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6CDB03855002 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15NMGZS7006605 for ; Wed, 23 Jun 2021 15:19:20 -0700 Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com with ESMTP id 39bx5jbxje-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 23 Jun 2021 15:19:20 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 23 Jun 2021 15:19:18 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Wed, 23 Jun 2021 15:19:19 -0700 Received: from linux.wrightpinski.org.com (unknown [10.69.242.197]) by maili.marvell.com (Postfix) with ESMTP id E6C9E5B694E; Wed, 23 Jun 2021 15:19:18 -0700 (PDT) From: To: CC: Andrew Pinski Subject: [PATCH 2/7] Reset the range info on the moved instruction in PHIOPT Date: Wed, 23 Jun 2021 15:19:10 -0700 Message-ID: <1624486755-12879-3-git-send-email-apinski@marvell.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1624486755-12879-1-git-send-email-apinski@marvell.com> References: <1624486755-12879-1-git-send-email-apinski@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-ORIG-GUID: nRPUwj2WIx_bRfAlelgBW32dxMNs3srz X-Proofpoint-GUID: nRPUwj2WIx_bRfAlelgBW32dxMNs3srz X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-06-23_14:2021-06-23, 2021-06-23 signatures=0 X-Spam-Status: No, score=-14.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Wed, 23 Jun 2021 22:19:22 -0000 From: Andrew Pinski I had missed this when wrote the patch which allowed the gimple to be moved from inside the conditional as it. It was also missed in the review. Anyways the range information needs to be reset for the moved gimple as it was under a conditional and the flow has changed to be unconditional. I have not seen any testcase in the wild that produces wrong code yet which is why there is no testcase but this is similar to what the other code in phiopt does so after moving those to match, there might be some. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: * tree-ssa-phiopt.c (match_simplify_replacement): Reset flow senatitive info on the moved ssa set. --- gcc/tree-ssa-phiopt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c index 02e26f974a5..24cbce9955a 100644 --- a/gcc/tree-ssa-phiopt.c +++ b/gcc/tree-ssa-phiopt.c @@ -836,7 +836,7 @@ match_simplify_replacement (basic_block cond_bb, basic_block middle_bb, if (!is_gimple_assign (stmt_to_move)) return false; - tree lhs = gimple_assign_lhs (stmt_to_move); + tree lhs = gimple_assign_lhs (stmt_to_move); gimple *use_stmt; use_operand_p use_p; @@ -892,6 +892,7 @@ match_simplify_replacement (basic_block cond_bb, basic_block middle_bb, } gimple_stmt_iterator gsi1 = gsi_for_stmt (stmt_to_move); gsi_move_before (&gsi1, &gsi); + reset_flow_sensitive_info (gimple_assign_lhs (stmt_to_move)); } if (seq) gsi_insert_seq_before (&gsi, seq, GSI_SAME_STMT); -- 2.27.0