Message ID | 20240513083547.164657-1-poulhies@adacore.com |
---|---|
State | New |
Headers | show
Return-Path: <gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=NSW7B4VR; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VdCbh1Ncjz1ymw for <incoming@patchwork.ozlabs.org>; Mon, 13 May 2024 18:40:00 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 73C353870881 for <incoming@patchwork.ozlabs.org>; Mon, 13 May 2024 08:39:58 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id B4BBB386EC0B for <gcc-patches@gcc.gnu.org>; Mon, 13 May 2024 08:35:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B4BBB386EC0B Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B4BBB386EC0B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::433 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715589391; cv=none; b=r/i9ei4h6be48d1KYXLTOrGh5gxaSbN2I85DXZ3n3p4m89wAYC34p1TUfdJECtxoQh0F5oHwIiiYFcNIEgwfHq/HCYBvd9LwNzPTSYySfQoN5EcQIjx7T6hnYdXCpGOMPBoORsb9Y+Jl3DZYQONEno63+M3adO0KfORFd/MCA6c= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715589391; c=relaxed/simple; bh=0iHvogqeRYWkRWCHGnHM6uTEKlQ3jLEtGNRMN1BjaHc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=rJP/gmk2nUQJhlY2GnZeKJd15sFAqvZY43wfyoOnx4SRY9QDwUaGH8prGfOoBUmIyO5y/4IwCg0m3KToWSn2KKyR+Iz1ITaEX7dvUSZXZNpePH8isDMlzBGYrQYjnRP6ToFtGo3Z9mKtd3x2SkvbUtODP+ihcj8FdRP7b/ZPEO4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-34de61b7ca4so2885755f8f.2 for <gcc-patches@gcc.gnu.org>; Mon, 13 May 2024 01:35:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1715589348; x=1716194148; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=rSsjdl2na31T3x/28/dHK08RcgvZ62bE6krkV0Kf+5Y=; b=NSW7B4VRLrmjvQ8DykvDgrW/C+vMjjRivPvK/riApWuGK+q7UReDefk2R0Awb56vM6 XGCJceql+fB1+KxXFlOTA2vnabwUTr8U4dodA4UFai+tdYX/PTRj5ZEcvqKp6nOU6HsT jePB7Bnyg549/z5l8ilovTy9imaVGGiDFDgK43rIvWHpF69yqr9N5USpKvVoR86XGALl gbL+c9ag1kaXtkwmg5dvfwYMFEJ6ZHArROykKhcMo/vxBo1DmFxMOd0CNZjkyXmmQEFX CJlkHJTXS95W1QHuEnDddRoBQNbi3/jBRmstFFF7KAKp6VSO/hRet5bN9UiPAnAozsa2 D64A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715589348; x=1716194148; 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=rSsjdl2na31T3x/28/dHK08RcgvZ62bE6krkV0Kf+5Y=; b=Pby8ijgS3BzHA4vWzTY+fjLB0rKnm0SUIU7VKOFKW+cCbutBwQ+aoOWh+3PfJbt8OL Uk0bpZa+iCiVwOMUFYRexBJ2wEq1GMtxoghiG7YO5cjR112MG7LkYQ2susSLfdDWDhij BnOlznTF+TeSJbHFznfWT5DeCX4wnKxymyTxGvoFAgtcaWRzbVn+1GlP5e4+aKG/mJ/C c2/KfWqAF81AHQt2pQpOSMZAZV0e/Gt7nVIOu9x5oammTRcbRK1sfiWGpAT25TzifUvq 6VFJ9rt0hOL9Utzbx6yWLkX7aQFvdf0pMXuIqmi0bUUTl3POz2OOqtM2FnhKQAn2C2bA UpQw== X-Gm-Message-State: AOJu0Yxmf8gNaTlpb67epSuX58CutN8ziLmH9u7paX2Frdk/c1KiOIWL Ey4jOZFvz/6jfH2c5hl2FbEbDJkholtdTK4t0lqYwmFS+BfAo4B70XCamu6RM/rutg3TCI8U+XY = X-Google-Smtp-Source: AGHT+IH3yaB5P7Q7csEHqxLJI7Xraheq0dR64G+vD78/7QSfxGHqZfE2VNozAI0GkN76JSwvGMsyXQ== X-Received: by 2002:a5d:53c5:0:b0:34d:ae55:9dbc with SMTP id ffacd0b85a97d-3504a63105fmr9149682f8f.16.1715589348532; Mon, 13 May 2024 01:35:48 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:cf0f:cd6c:7a6a:cbed]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3502baacf52sm10662559f8f.87.2024.05.13.01.35.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 01:35:48 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= <poulhies@adacore.com> To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou <ebotcazou@adacore.com> Subject: [COMMITTED] ada: Fix internal error with Put_Image aspect on access-to-class-wide type Date: Mon, 13 May 2024 10:35:47 +0200 Message-ID: <20240513083547.164657-1-poulhies@adacore.com> X-Mailer: git-send-email 2.43.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.6 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.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org |
Series |
[COMMITTED] ada: Fix internal error with Put_Image aspect on access-to-class-wide type
|
expand
|
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 1f3f8277294..f3212f25dcc 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -15112,6 +15112,11 @@ package body Sem_Ch13 is then Append_Freeze_Action (Ent, Subp_Decl); + -- We may freeze Subp_Id immediately since Ent has just been frozen. + -- This will help to shield us from potential late freezing issues. + + Set_Is_Frozen (Subp_Id); + else Insert_Action (N, Subp_Decl); Set_Entity (N, Subp_Id);
From: Eric Botcazou <ebotcazou@adacore.com> This occurs with an instantiation of Ada.Containers.Vectors in a nested package on an access-to-class-wide type declared with the Put_Image aspect because of too late a freezing for the internal renaming generated for the Put_Image procedure. The change freezes this renaming immediately in this particular case; this is similar to a trick used in Build_Array_Put_Image_Procedure. gcc/ada/ * sem_ch13.adb (New_Put_Image_Subprogram): In the nondeferred case coming from an aspect and for a type with delaying freezing, also freeze the subprogram immediately. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch13.adb | 5 +++++ 1 file changed, 5 insertions(+)