From patchwork Fri Jan 13 10:49:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 43156 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp199705wrt; Fri, 13 Jan 2023 02:50:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXunzjVSKGfYfr8a5hYZajoCtxYVpS6J3e5Ezd+SBrEVn0x2pi+W3Fh3fgergA9vv9sukrKU X-Received: by 2002:a05:6402:4141:b0:461:8be6:1ac4 with SMTP id x1-20020a056402414100b004618be61ac4mr71594675eda.20.1673607038520; Fri, 13 Jan 2023 02:50:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673607038; cv=none; d=google.com; s=arc-20160816; b=0RFiFJI6ca1LOL5coHxXsgpqlb2+M/LTTlVxbr0T1mvELx1vxKglG1V2UyCqc+HmfF GVUYI0bvkBEwz8WhokO97xabQXcMKoyUHsfF4onkGbTiZCWOyvF7rS4/ez7lIMUT01by 8SfsBqy2WWCbipUBOzs5DBWs9NdiE1Ke1gmZbc8pNVWlGgwtTl8/GfYLd/8FXYLDcric TVZSW6z/Kci0KR4X0CPiQgdi8vOXhiQDaJvmhLkFSsuplgqKPH26WugkhEHCpDUjC8QP mnQtmv5nnOKKChScEPjzStirUbhIUU7oFxz9v2I9opvYSJgYdD59yqkBOKnlFaqjzWBL +Ygg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=RRT9eEdpaQO7sr6LtUD17Alg5yKLCIzNTeGGPdgogvs=; b=iPH7nFwxxBPSPrZtej/E2KONDorJUD0xQ+LAKm4TOOwTeVEV0SrYJdBfQ1OC/W4Qt9 BLfl/OFmezKafry8o1RX9k4IxfSnihdwQMPMKz1cDeX/YYD2eyQ5g/xfUsqGMuee6eks P81jjiM3snmWMBdrlEo0Ev02THg2Xq0a1f98MQD0dJ7QcrDoQ/U57SMZMQcLdjQOSK0t lehJ/P2fwBhq0bQRVjZucku+4Y8LcY8flURV6vWNeHJ8gb7n1EuI6L4M7U4gVl6vwiuh d+/hx6cf/FJ50rnsSLXATVd0vERtUo+MB3NLzUiUMLKPoDB2PoSougGLvXBxnvJGtxpm YUmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="S/otGLem"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id z7-20020a50eb47000000b00483347f1b8esi19759194edp.402.2023.01.13.02.50.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 02:50:38 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="S/otGLem"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1C1FD38493DD for ; Fri, 13 Jan 2023 10:50:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1C1FD38493DD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673607028; bh=RRT9eEdpaQO7sr6LtUD17Alg5yKLCIzNTeGGPdgogvs=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=S/otGLemUhccxAwvV0lg3Pe3TwHM+tZmA8njYLbaqyMQQxg4xQAuoLWB0l5R9rBDl prTDiiYcJbtGyeKMd1nRHFGhFyE6NFSikIs5mksOSPL4++xC3J+yIXi9Z270ZJRz4D ERV7aQMC0lLKeYHdDif1qhRXoiRbVa6iyOf8YW9Y= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id 52F8F385783F for ; Fri, 13 Jan 2023 10:49:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 52F8F385783F Received: by mail-wm1-x333.google.com with SMTP id j34-20020a05600c1c2200b003da1b054057so2765213wms.5 for ; Fri, 13 Jan 2023 02:49:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RRT9eEdpaQO7sr6LtUD17Alg5yKLCIzNTeGGPdgogvs=; b=gbwR3QcDdenimBk/BrmhR6n+y0Eoer51bzDeh2lLKMpZaMEoXYY6iUkacPoIT85u9l /bsXRI7UG5b6pqo5eAeObSu/I2MGvDVSd9c+ysf41ohgiwdASH1kOrOL0kluM7OWEcTF 7AWyA57Ri/uZTwZ/PjrNgoRKHYz1aPE0mZB8vKWVRseza4Ts8Ob/ntUDeAuExkRQpqQP IWE8PTCWrn1Z4LnNHD0qB2F9XijpoLguae9bOdg0d4eE6rxX/nGTyTVhi9iSQIcSd/cd F73Z294aHQmobMYx2VbpKVFcf0ZqDdktCxJuHqjtabWhtMoyftOegG2c4mcAE1V2p7bK /0mQ== X-Gm-Message-State: AFqh2koNWOCOycu0blIp5r5i1VH1jfdATOTvfYifagRzCY0ovskD9SIS M08+Zam1K1yCs5PABCrVrssLPya1/9fTDSN/ X-Received: by 2002:a05:600c:3545:b0:3d9:a145:9ab with SMTP id i5-20020a05600c354500b003d9a14509abmr38633494wmq.39.1673606980863; Fri, 13 Jan 2023 02:49:40 -0800 (PST) Received: from fomalhaut.localnet ([2a01:e0a:8d5:d990:e654:e8ff:fe8f:2ce6]) by smtp.gmail.com with ESMTPSA id n1-20020a5d67c1000000b002bc7f64efa3sm11312393wrw.29.2023.01.13.02.49.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 02:49:40 -0800 (PST) X-Google-Original-From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix PR rtl-optimization/108274 Date: Fri, 13 Jan 2023 11:49:04 +0100 Message-ID: <4771224.GXAFRqVoOG@fomalhaut> MIME-Version: 1.0 X-Spam-Status: No, score=-10.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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-Patchwork-Original-From: Eric Botcazou via Gcc-patches From: Eric Botcazou Reply-To: Eric Botcazou Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754904174425700576?= X-GMAIL-MSGID: =?utf-8?q?1754904174425700576?= Hi, unlike other IPA passes, the ICF pass can be run at -O0 and some testcases rely on this in the testsuite. Now it effectively creates a tail call so the DF information needs be updated in this case after epilogue creation. Tested on x86-64/Linux, OK for mainline? 2023-01-13 Eric Botcazou PR rtl-optimization/108274 * function.cc (thread_prologue_and_epilogue_insns): Also update the DF information for calls in a few more cases. diff --git a/gcc/function.cc b/gcc/function.cc index d975b001ec9..95f47d287c5 100644 --- a/gcc/function.cc +++ b/gcc/function.cc @@ -6261,7 +6261,10 @@ thread_prologue_and_epilogue_insns (void) /* Threading the prologue and epilogue changes the artificial refs in the entry and exit blocks, and may invalidate DF info for tail calls. */ - if (optimize) + if (optimize + || flag_optimize_sibling_calls + || flag_ipa_icf_functions + || in_lto_p) df_update_entry_exit_and_calls (); else {