From patchwork Tue Nov 8 08:42:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 1701172 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=OC0twRmz; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N61ry4QHpz23lT for ; Tue, 8 Nov 2022 19:45:38 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 893E8385DC39 for ; Tue, 8 Nov 2022 08:45:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 893E8385DC39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667897136; bh=QvyC6GH08HG1v+NhjzK1k6NeEdfgzFtF/mA1ulRJ8Ec=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=OC0twRmzQ4DO1Mra/aPfiyHDb+Pq3diJ8fwS3M9K0bFPlCsXxBhZFxIv5KiWH07OS K4C6Qf0ofA5WulYfVSisrdb2geiBDV5Yj4R9bofLqJE5CqHFeIgdjeieflLzt75LDf MvuWbuLpoKH4GXNC9jMt7UzZXkEp5QQETFR4RRCI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 2A1703858C53 for ; Tue, 8 Nov 2022 08:42:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2A1703858C53 Received: by mail-wr1-x430.google.com with SMTP id a14so19793246wru.5 for ; Tue, 08 Nov 2022 00:42:12 -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:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QvyC6GH08HG1v+NhjzK1k6NeEdfgzFtF/mA1ulRJ8Ec=; b=rCcxM3zlmFUMhmtl51ALD6Ggza1wtKYwKvo4nKtachOwIlwx1AdvBjfu9FuuCjGCcB x/LfIAZqWapITP3Y6t0gzIJoZtLUmrtt9EqUg9feakw7yvTUjEx3LPnTNHn0OBoIyr8Z 7lqpvdRlDE3gAW9spF+j/SmPUBmB36voRFhTneX14Wq9IRC0Qz/2SWEq+6Mkra2yUWwP NaGQ9LbYGN0A+DYU+9XrTR52bJwv8bkJ+3912qRHgSnCMRvI5FBmBBuGouUVINtiBR+h nAZH3oUW4LSEhOTaxpvX2eXV7XF2KcNaRqepf9vYz0pBVOnSm+35hwfIAXRrjJjVwKD5 1/Mg== X-Gm-Message-State: ACrzQf3et/iaXX3VBUDRnO0h1iezUP7+HzigUUR+whd1LhEWK/pZgCGg aO6cVBqq49gxT5Zh9j8g8oydGj3IRW8lyQ== X-Google-Smtp-Source: AMsMyM63YfoMM25X/3icy1p7MPQFhowA3/NAlUC9a9Uy5Ah4ySoKqHGsYi+qxjV8g/qXS35D6vzTHQ== X-Received: by 2002:a5d:548f:0:b0:236:ccb9:6749 with SMTP id h15-20020a5d548f000000b00236ccb96749mr29128599wrv.25.1667896931052; Tue, 08 Nov 2022 00:42:11 -0800 (PST) Received: from localhost.localdomain (static-176-191-105-132.ftth.abo.bbox.fr. [176.191.105.132]) by smtp.gmail.com with ESMTPSA id m8-20020a05600c4f4800b003c64c186206sm10867002wmq.16.2022.11.08.00.42.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Nov 2022 00:42:10 -0800 (PST) To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED] ada: Cleanup local variable that is only set as an out parameter Date: Tue, 8 Nov 2022 09:42:07 +0100 Message-Id: <20221108084207.301124-1-poulhies@adacore.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= From: =?utf-8?q?Marc_Poulhi=C3=A8s?= Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" From: Piotr Trojanek Minor improvements; found experimenting with improved detection of unreferenced objects. gcc/ada/ * exp_spark.adb (SPARK_Freeze_Type): Refine type of a local object. * sem_ch3.adb (Derive_Subprograms): Remove initial value for New_Subp, which is in only written as an out parameter and never read. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_spark.adb | 2 +- gcc/ada/sem_ch3.adb | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gcc/ada/exp_spark.adb b/gcc/ada/exp_spark.adb index c89d604aa80..ba7bd7fe5d2 100644 --- a/gcc/ada/exp_spark.adb +++ b/gcc/ada/exp_spark.adb @@ -895,7 +895,7 @@ package body Exp_SPARK is procedure SPARK_Freeze_Type (N : Entity_Id) is Typ : constant Entity_Id := Entity (N); - Renamed_Eq : Node_Id; + Renamed_Eq : Entity_Id; -- Defining unit name for the predefined equality function in the case -- where the type has a primitive operation that is a renaming of -- predefined equality (but only if there is also an overriding diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index f6b852051dc..8f4e9f80eb8 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -16497,15 +16497,15 @@ package body Sem_Ch3 is -- Local variables - Alias_Subp : Entity_Id; - Act_List : Elist_Id; - Act_Elmt : Elmt_Id; - Act_Subp : Entity_Id := Empty; - Elmt : Elmt_Id; - Need_Search : Boolean := False; - New_Subp : Entity_Id := Empty; - Parent_Base : Entity_Id; - Subp : Entity_Id; + Alias_Subp : Entity_Id; + Act_List : Elist_Id; + Act_Elmt : Elmt_Id; + Act_Subp : Entity_Id := Empty; + Elmt : Elmt_Id; + Need_Search : Boolean := False; + New_Subp : Entity_Id; + Parent_Base : Entity_Id; + Subp : Entity_Id; -- Start of processing for Derive_Subprograms