Message ID | 20240620085321.2412421-20-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=JShVEDXZ; dkim-atps=neutral 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=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 [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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4ZYm50Lbz20X8 for <incoming@patchwork.ozlabs.org>; Thu, 20 Jun 2024 19:14:20 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 044E7389244A for <incoming@patchwork.ozlabs.org>; Thu, 20 Jun 2024 09:14:19 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by sourceware.org (Postfix) with ESMTPS id A9B5F388A40D for <gcc-patches@gcc.gnu.org>; Thu, 20 Jun 2024 08:53:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A9B5F388A40D 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 A9B5F388A40D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::135 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718873639; cv=none; b=LR4Dtx2WzkqOhpNpYSvlktRDCDFS5tdHwS7iZwLMHGFD5XcNSIjD4/E7H048AdkmxAQuVbAJB4QkPeGR0FR8wFbdehm2gFhgPbvQfHPZOFZRyyM+rtb2Si5Vjve5afqT54knCDxzHV5BZtf8KD0qrkThj7byRpdW7JC1v+PCv+o= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718873639; c=relaxed/simple; bh=wq0XDazx0inZwEwGdRQnUjm0GTMkOTdqBuMVpaCaMfs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=qGLPhYSwLB0LUhUrn2ClA0G0wHFbPDQrWNhm6tjY8gXSvHtuwu1LLJ7LrBjfyW1EEvI7n+fBTc9EP561lf7BSWL17O8fk/+g2N99ipAPM03eqwb/e8HAKTVZ6CVJ1q+EFfPKWoO8rW05cPOsKtSYvukmmL/wbq22ep3ZQOc9LWQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-52cc9b887f1so775251e87.3 for <gcc-patches@gcc.gnu.org>; Thu, 20 Jun 2024 01:53:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1718873628; x=1719478428; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/3JpYcsiHaE8rBFMlAjqJ993iHUqwK4JxkXpAPViq8M=; b=JShVEDXZK/6WAoeLGbTV+LMr2M8oGkm0O9uWsS3HLEEJUWP5V8caq77zP8qjQUBtDt 9qRdm2nQT5yfK3twxhxOhRz6+JiUJMLdGsuWeAlutFC7C6DSiY8fnTg9NIVL1o+ENZmV gGtS3JHn84SEZH/LHxJjGd4ou5yY4/A8F2Ar0T+YIqCjY4nSmCR91+0IS+9wagZTkV9b a3Uxz9ZE/9fv8FCJEwYlHehCF8Obwy0wmKSuamc7YJrIq+rGXxMUWznxlRKzE2OudRsD Mo44aueAj6LmG6eqCcJaHcZTDNZdQP+DntfNuOuetjwBw84nc/In+Xv2vyshdYrHmK/k qT4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718873628; x=1719478428; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/3JpYcsiHaE8rBFMlAjqJ993iHUqwK4JxkXpAPViq8M=; b=POsFvhbEyMm/T+U9a0Qz7B7ryvyaqlC47GLxdo3l+SuDXL0D3RUlMMRrV3hEhfOBWW VMWARveXcKtAFwJWeSF0qAU6y4BSKTe2b9FD/nJ7HwT5JgxwPJEGCGu3JtLbWhgvaR2h iM01Ly7v3HqlohLNEHfiPf6SEGK9nxAMzcZCkrciFT/yK6SGTQkN1CEc0BFOlrN3B93C z9rgEyKcmvdEuoKRxz+SLaZUjAkvsd2qP+FABmZ3QB03/D1YCtoaOwL2M2xvmUBYwKm4 Dfj6i141JTqH7p16ZbebcXOuyvbdVE9j26iBOM2ExU+sPlWYCZlTx0H71NTyB3eSaU1y S80Q== X-Gm-Message-State: AOJu0YwKVFq5E1SDF3ap3F3kmrK0/8XcdgzO9CKrUuspWDVjk+BMRezz bXxZBe93TA68sUnPZgHqXzulRB0Hz+7ArcjHJj+bpOz7C/B0w9h/HwNviq0isnOXPLH/UCONGpU = X-Google-Smtp-Source: AGHT+IEAMXJNcg2SMN1ngGOE6Ooe7XnLeZL2Wk0zYrNefBznPje5aR4WrB9CGFw5/TjTGscCS7mzYQ== X-Received: by 2002:ac2:52b2:0:b0:52b:796e:66a5 with SMTP id 2adb3069b0e04-52ccaaa2607mr2514503e87.66.1718873627935; Thu, 20 Jun 2024 01:53:47 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-363c795febfsm3305522f8f.104.2024.06.20.01.53.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 01:53:47 -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 20/30] ada: Fix crash on real literal in declare expression of expression function Date: Thu, 20 Jun 2024 10:53:10 +0200 Message-ID: <20240620085321.2412421-20-poulhies@adacore.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240620085321.2412421-1-poulhies@adacore.com> References: <20240620085321.2412421-1-poulhies@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.7 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.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,01/30] ada: Fix list of attributes defined by Ada 2022
|
expand
|
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index 3c3d038c392..1867880b314 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -8872,7 +8872,8 @@ package body Freeze is end if; -- The current scope may be that of a constrained component of - -- an enclosing record declaration, or of a loop of an enclosing + -- an enclosing record declaration, or a block of an enclosing + -- declare expression in Ada 2022, or of a loop of an enclosing -- quantified expression or aggregate with an iterated component -- in Ada 2022, which is above the current scope in the scope -- stack. Indeed in the context of a quantified expression or @@ -8884,7 +8885,7 @@ package body Freeze is if not Is_Compilation_Unit (Current_Scope) and then (Is_Record_Type (Scope (Current_Scope)) - or else (Ekind (Current_Scope) = E_Loop + or else (Ekind (Current_Scope) in E_Block | E_Loop and then Is_Internal (Current_Scope))) then Pos := Pos - 1;
From: Eric Botcazou <ebotcazou@adacore.com> The problem is that the freeze node of the type to which the real literal is resolved is placed inside the expression function instead of outside. gcc/ada/ * freeze.adb (Freeze_Expression): Also attach pending freeze nodes to the parent in the case of an internal block in a spec expression. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/freeze.adb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)