From patchwork Tue Dec 27 04:19:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 36765 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1218976wrt; Mon, 26 Dec 2022 20:20:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXsJawyuq0kTy3It9LTeRzAhxwp8xf8JCkhB+BjmhJTDgvVus5lRFecVOt709yHyaPjzw+i+ X-Received: by 2002:a17:906:f250:b0:7c1:528:bc02 with SMTP id gy16-20020a170906f25000b007c10528bc02mr17517073ejb.41.1672114838112; Mon, 26 Dec 2022 20:20:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672114838; cv=none; d=google.com; s=arc-20160816; b=ZvuaVAejTa0mMeelqq4hsiITlUgF5HnkM5HEsExjPjr14v4rihYjRKr2EBt4aPRx89 BbXdP5CJbwTBEnd9dAysfFW9G+P3t+WIrxrADVpAP6rw1xlR10g0Zlwzxcvr2Z6szrUl HDRqZIiyts2MSH3jj5/9YMppJEBq6iWgAFcsiJY1QYnbDuc3UcW1pfG063disPEzheOd WRKfewaHSeIuvoBhAFRg5OeIDGeTDHPsqcqbi4jsQyyJwso8o58Bq3+du8iyJJ5VlwkG xZksCf3KY7rB2cE2abAp/7+pH7tndK5t4o3xmQ+9nSlla0DacnCZ3vmP43IhNZhZfl6c PQZA== 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=/PgCft1l4EDdjOvRkxQTxgtYwaE0wX7X55ujfEfrbLU=; b=zsnPDI2XJCHQ0hGyvJK1l/sV8UYKhboerEc3PM/Xlj9J97SvZ1y9FdF4oNiAP/1DHj 0Q7na5rHRM2E/oV7TYrM3XLHLyD+BrwFBhwBHMWXC7nberKnwKMAzwcLQ/AvcJ7JA5Ku Wr0zDlnRhfmrYDDbB59KOCPV5vmcDW2+JNbXgYwTLpdgIF7EYvLwU6dIvu3z0IpdNleo 0x+4+dUpaP7eraBCwAeEr6N3aX8pQVRm1ZY9PceZUNH0nq3iZ8xw4py05wz1qeSMa9V6 AGgwYBhxfMKUDvbNJPmdApJbL+rydzGdXDbyii/fLXbfObD3IjPOkMqqhpaa5bwVlkgQ SbXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=U1e2CSTB; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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. [8.43.85.97]) by mx.google.com with ESMTPS id jg14-20020a170907970e00b007c1651709e3si10705985ejc.177.2022.12.26.20.20.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Dec 2022 20:20:38 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=U1e2CSTB; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 1EAAD385843A for ; Tue, 27 Dec 2022 04:20:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1EAAD385843A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672114837; bh=/PgCft1l4EDdjOvRkxQTxgtYwaE0wX7X55ujfEfrbLU=; 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=U1e2CSTBrm8k8S2iTMQYSjBCxqfw8W+eKIX1zOy/MmrAH9SPlFvUDf3Ye3eE/yZB7 C3f2W08Cqp4tUXgvgjWvsps+d5WL1gWv+kbYfyt15lGMj2MA0oNXvN0JzUq+ycwsvc h0cZWR/g0MY6SLVmrtcz0gMllgAmICGuGk8s03Hc= 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 B47C13858422 for ; Tue, 27 Dec 2022 04:19:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B47C13858422 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 8A2121162A6; Mon, 26 Dec 2022 23:19:54 -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 EZjwON2FBhZ2; Mon, 26 Dec 2022 23:19:54 -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 2AE7711628F; Mon, 26 Dec 2022 23:19:54 -0500 (EST) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 2BR4Jl83712025 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 27 Dec 2022 01:19:47 -0300 To: gcc-patches@gcc.gnu.org Subject: [03/13] tree-inline decl_map: skip mapping NULL to itself Organization: Free thinker, does not speak for AdaCore References: Date: Tue, 27 Dec 2022 01:19:47 -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.2 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?1753339488790141702?= X-GMAIL-MSGID: =?utf-8?q?1753339488790141702?= Mapping a NULL key is no use, skip it. Regstrapped on x86_64-linux-gnu. Ok to install? for gcc/ChangeLog * tree-inline.cc (insert_decl_map): Skip mapping a NULL decl as value to itself. --- gcc/tree-inline.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/tree-inline.cc b/gcc/tree-inline.cc index c6c86af6c4ea9..bfea1cc11822e 100644 --- a/gcc/tree-inline.cc +++ b/gcc/tree-inline.cc @@ -148,7 +148,7 @@ insert_decl_map (copy_body_data *id, tree key, tree value) /* Always insert an identity map as well. If we see this same new node again, we won't want to duplicate it a second time. */ - if (key != value) + if (key != value && value) id->decl_map->put (value, value); }