From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by sourceware.org (Postfix) with ESMTPS id CC0853851174 for ; Tue, 12 Jul 2022 12:25:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CC0853851174 Received: by mail-ed1-x536.google.com with SMTP id v12so9850692edc.10 for ; Tue, 12 Jul 2022 05:25:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=PPmkR70uT9eVJj5ws90zfzj0HheX9zp4lAG/6+Ezxi0=; b=wQ+RXn0Kh9pNXUqY0hQJ3cqbUdQhPpD5TsXhoSzyUh4Yq4qh1YCo4ulEu897tKNoPA CzEoTK/WLNYL0H6u0Pe6Hk8hbi5tjvK2I41oBUYYPsUJ2yRGJcBbxWrO44bgYcZQi+8u O0OgVeQl9yLV2ARShKmu4Uv2gtuK9kep9H8c4sXfZUTSv3blPecKKbVNSjY228apLHfm n6TrFEOPVFFul++Fbp+fwpyXN92MagY2ACHgfCLpW36qenNpbVr2UomdM11x2kfNtONw BJVhv/4yl44lI6uy9+iS+2jGU8xe+piRqERdNOWas1wPlESU9bSml2UgQT/hDXRHZrkF UiTw== X-Gm-Message-State: AJIora8AZgjXo0f2+9P5CN63UDCZ6WKlXYE7J0k2TGcTSVjsYcPhIf9G nx1nzzb4+dmYUfC/13Pu9GrnhJQqrGIlGQ== X-Google-Smtp-Source: AGRyM1sSwXnbNXmpKu2ebo52+YUfR/+dUpNJ3ylE5IOTFdKEFjC08yYL+Pc4bcWYu275U7LK0qDgqA== X-Received: by 2002:a05:6402:1455:b0:43a:77bb:af0f with SMTP id d21-20020a056402145500b0043a77bbaf0fmr31654252edx.301.1657628724446; Tue, 12 Jul 2022 05:25:24 -0700 (PDT) Received: from adacore.com ([45.147.211.82]) by smtp.gmail.com with ESMTPSA id b4-20020aa7d484000000b0043a46f5fb82sm5932002edr.73.2022.07.12.05.25.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jul 2022 05:25:23 -0700 (PDT) Date: Tue, 12 Jul 2022 12:25:23 +0000 From: Pierre-Marie de Rodat To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [Ada] Fix spurious warning on unreferenced internal generic instance Message-ID: <20220712122523.GA3404783@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="J2SCkAp4GZ/dPZZf" Content-Disposition: inline X-Spam-Status: No, score=-13.2 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, T_SCC_BODY_TEXT_LINE 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-List-Received-Date: Tue, 12 Jul 2022 12:25:26 -0000 --J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline This patch removes a spurious warning, saying that an internal entity of a generic formal package is unreferenced. The immediate cause of this warning is that the internal entity is explicitly flagged as coming from source. The explicit flagging was added decades ago to fix a missing cross-reference in the ALI file. Apparently these days the cross-references work fine without this flag. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch12.adb (Analyze_Package_Instantiation): Remove dubious call to Set_Comes_From_Source. --J2SCkAp4GZ/dPZZf Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="patch.diff" diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -4297,7 +4297,6 @@ package body Sem_Ch12 is if Nkind (N) = N_Package_Instantiation then Act_Decl_Id := New_Copy (Defining_Entity (N)); - Set_Comes_From_Source (Act_Decl_Id, True); if Nkind (Defining_Unit_Name (N)) = N_Defining_Program_Unit_Name then Act_Decl_Name := --J2SCkAp4GZ/dPZZf--