From patchwork Tue Dec 27 04:23:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 36769 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1220457wrt; Mon, 26 Dec 2022 20:28:22 -0800 (PST) X-Google-Smtp-Source: AMrXdXvkWshKKjx+9oeXHme2A8CpMgqEj0CU3RCwlG1JZsPWGyt2Msnphg53AY9l1TOud4sptxN5 X-Received: by 2002:a50:fe0e:0:b0:46f:9507:36bc with SMTP id f14-20020a50fe0e000000b0046f950736bcmr23021254edt.16.1672115301934; Mon, 26 Dec 2022 20:28:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672115301; cv=none; d=google.com; s=arc-20160816; b=X7xzIgMHNwG8NRSrdNChCWnMsjscPNKq83+5cTq5oV9jGsz+Ig7BKRJj62X0j5NCWQ y2rmv94kfF77w7rtDYPyQEZPCESal8AcLFhF19l1fs06WO0edyASLjA+2qyc947jyOCI YbmJpoXk2DX6IJpNWRZXV1c46D9ScUIrB2kA6uH8CIBCX/F0K3KebMbMV/Ki88QIfzOs YuIOaNOEH8LDawSVs23WHxIx+Rc2GY7JznYqhniQbohl6hIag0W7Omkj11Mb+bTeVAPg 5yWC2VVwUbhMDslzLvIKswyloFaeu+uq6UCUOzGCtY2iB9lpqiAEO29mGJife16vAvRv iGSg== 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:mime-version :user-agent:message-id:in-reply-to:date:references:organization :subject:to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=ICanSbrAIBRMKeEwo2aMRWmhuZdx7zWOKpQJ6LQJkjg=; b=kuTXQ+9XDfWtMcsTqd2Eg9wFibhv9X3a42KCInDwjl8bbxG1JL5VBHEUcIzVi8cUxv d8fQEs5ZISUo7cGRx2wbwB0wThDh8KsKVO+3QkREGecQLd0yMTpUcwENH+VSajnfzxRv 5XLd8jKOczhehKTLp+f83PF9HZXvW1C7ShIyCZ5KNWl2M4y/6YHDjBLuxGDVa+G4MOF1 ObBZII2UpzksvJE9vZ/OWPoOjEHFx37Tz9QnrMBFsh5m0bjjq71Q4E3RFZTYRMjoaM+B yHgncDOVgZsK0IQz4uFxLiXHJm0rJ7nMhYbxnog9o6zV310gJRdp18l2lVpOXZi+6ypJ tubQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=npj5Tepm; 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 d21-20020a056402079500b004700a51c22asi9421805edy.420.2022.12.26.20.28.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Dec 2022 20:28:21 -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=npj5Tepm; 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 BB9CE3858416 for ; Tue, 27 Dec 2022 04:28:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB9CE3858416 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672115300; bh=ICanSbrAIBRMKeEwo2aMRWmhuZdx7zWOKpQJ6LQJkjg=; h=To:Subject:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=npj5TepmE25AMZBsbc9Iq/5JQM+HkAOCtKGxCVm9jX6O3uJSbnALsiwGjzaizqZxF mhxT5cByNpq+zqPBL7E8531kR4FMaoJzuNGU3UxRRa7UXOvOQ1mYZDtfJGk/5bST6y dg6aw9oXSbtXm7mCGCi2vAos5Td3ibtY3r6ZkOew= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from rock.gnat.com (rock.gnat.com [205.232.38.15]) by sourceware.org (Postfix) with ESMTPS id BF0C33858D32 for ; Tue, 27 Dec 2022 04:27:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BF0C33858D32 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 854D31162AC; Mon, 26 Dec 2022 23:27:38 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at gnat.com Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 9DaWA6Dd0eZ5; Mon, 26 Dec 2022 23:27:38 -0500 (EST) Received: from free.home (tron.gnat.com [IPv6:2620:20:4000:0:46a8:42ff:fe0e:e294]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPS id 4D0571162AB; Mon, 26 Dec 2022 23:27:38 -0500 (EST) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 2BR4NMXR712163 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 27 Dec 2022 01:23:22 -0300 To: gcc-patches@gcc.gnu.org Subject: [06/13] tree-inline decl_map: skip mapping result's NULL default def Organization: Free thinker, does not speak for AdaCore References: Date: Tue, 27 Dec 2022 01:23:22 -0300 In-Reply-To: (Alexandre Oliva's message of "Tue, 27 Dec 2022 01:07:35 -0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, 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: Alexandre Oliva via Gcc-patches From: Alexandre Oliva Reply-To: Alexandre Oliva 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?1753339975119526802?= X-GMAIL-MSGID: =?utf-8?q?1753339975119526802?= If a result doesn't have a default def, don't attempt to remap it. Regstrapped on x86_64-linux-gnu. Ok to install? for gcc/ChangeLog * tree-inline.cc (declare_return_variable): Don't remap NULL default def of result. --- gcc/tree-inline.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gcc/tree-inline.cc b/gcc/tree-inline.cc index bfea1cc11822e..4556256dc32b1 100644 --- a/gcc/tree-inline.cc +++ b/gcc/tree-inline.cc @@ -3851,10 +3851,11 @@ declare_return_variable (copy_body_data *id, tree return_slot, tree modify_dest, it's default_def SSA_NAME. */ if (gimple_in_ssa_p (id->src_cfun) && is_gimple_reg (result)) - { - temp = make_ssa_name (temp); - insert_decl_map (id, ssa_default_def (id->src_cfun, result), temp); - } + if (tree default_def = ssa_default_def (id->src_cfun, result)) + { + temp = make_ssa_name (temp); + insert_decl_map (id, default_def, temp); + } insert_init_stmt (id, entry_bb, gimple_build_assign (temp, var)); } else