Message ID | 20240516092606.41242-9-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=SPyP0KNE; 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 4Vg4YV0Vz5z1yfq for <incoming@patchwork.ozlabs.org>; Thu, 16 May 2024 19:29:34 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3052038449C9 for <incoming@patchwork.ozlabs.org>; Thu, 16 May 2024 09:29:32 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by sourceware.org (Postfix) with ESMTPS id 434E2384AB7F for <gcc-patches@gcc.gnu.org>; Thu, 16 May 2024 09:26:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 434E2384AB7F 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 434E2384AB7F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::230 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715851579; cv=none; b=tuhNgknphDgFjj3EUxzIf/6bsqs65wm0AggmmP4rKWKWj8qBYGuite/bebesuE89QztMSwx+ToRr4W3GfYsGuzniRGu+5SmvvxbnBpbbJqn4RVj72cxiyYp+8nX+nbEBj82hOLyXqWOXQLwIjI1ssJo0dBXSlHHSj8xvuQVqxtM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715851579; c=relaxed/simple; bh=W/R2dPlRWmK97GO6qGe95pvC4d4S5XlPMOvla9MYfb4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=wVhA4BjVwtX7XXNG6arb7/RKp0IlcxiN4S6lWBR+sB3Xg/cGtwauf7w0AZ2kF5Cw/fkXTQA4vuex7TEK7FQLmOw+vFKcFmJ3c0xM5W7u+zWfRITL0sC+9l+zFsuCHx5gCmJA2qxFBSBb/glogwY/tx0MCD7eUNzvbbUskPzWMIA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2dfb4ea2bbfso5831331fa.2 for <gcc-patches@gcc.gnu.org>; Thu, 16 May 2024 02:26:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1715851576; x=1716456376; 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=D17veeiEpXQESaV51ryHcYbNOwe8pAJla/WQTbX79Cw=; b=SPyP0KNEEBEU9SshIU0p6rsmkFXH9N3qRdDodLVfKI9TvYkU8jMMD9ha1EKm+ZEi3P mkmB/TTwE2byQ16KOGrhn6OLYSdUYOPNJzxYsI3J9Q+G+QJmAiLXheTv2ijPK9Ir12aL +LQ9hQY6pZfkhq7VaJ8fD1GcSyZA25gQ5RsL//kDza3Q9vbFe2ynR+MgYRda7RhmhbxR IHhiX566AfuCkqqFQpFXasckrbzPmRpdGrmoX1yKJ2UEwJW8OO1Kj3YupmvB3PSvxU4a maZ7WulRawrTYG6FLIMQiGTK91A66+vVDlVb0gj2UN2+jOuqzS7+bmcG5GwULBvBlyYh ahmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715851576; x=1716456376; 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=D17veeiEpXQESaV51ryHcYbNOwe8pAJla/WQTbX79Cw=; b=ZM5F61dTo+FaGRkG1oP2Zc76KQ+zq1PQy/+7SNo7+ExBOsmS5fqr1QyrcnyqQMnUsQ fKJpYsirA2t3rPwGSmL9j7wvwpH9bSRDpVNHFitZYYriCT1pnO+cnp8OkFjXunbvY6+l XXNjHl1cpaL70sGzF40x5sDy3tqGeTILQzfFUjD3ACuz8frOoUqWoTBChtBg89Dka/ap 091c5YIAn0dpu47vJlQVhBDwuzmHJr1dOWRMsDH/P4+xHvNxqsUPh3glUpwrsKubXwi3 3q55npJLss7RoaQw6wfP6AsgtXQ4ihW9AFzVup7VOMlAg8yWo5B05zeMo536v0jKtjTg PYXA== X-Gm-Message-State: AOJu0Yw0qIpc6o5zXVbnRE+Zf0lE3OJMWeXCxJZQg+V5owX6Nvegd2pd Ep5tEKewQHSzHzY05lCzqpZhqRfE+wCRiq3qOhmU07300rhBY+b1B/lYO8hyxUZ+7e5zII8q+1s = X-Google-Smtp-Source: AGHT+IF75VULZVy90NqydwsHZvcs6HZBrF2adYk3DVBDGMsg+gyJkjJ6tNT2N+Kx9VWKGYMwp3RbSw== X-Received: by 2002:a05:651c:221b:b0:2df:c1e7:ab65 with SMTP id 38308e7fff4ca-2e520062280mr132259741fa.26.1715851573841; Thu, 16 May 2024 02:26:13 -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 5b1f17b1804b1-41fd10cf8besm135802635e9.1.2024.05.16.02.26.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 02:26:13 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= <poulhies@adacore.com> To: gcc-patches@gcc.gnu.org Cc: Steve Baird <baird@adacore.com> Subject: [COMMITTED 09/35] ada: Formal_Derived_Type'Size is not static Date: Thu, 16 May 2024 11:25:38 +0200 Message-ID: <20240516092606.41242-9-poulhies@adacore.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240516092606.41242-1-poulhies@adacore.com> References: <20240516092606.41242-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 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/35] ada: Fix docs and comments about pragmas for Boolean-valued aspects
|
expand
|
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 65442d45a85..2fa7d7d25d2 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -8685,10 +8685,20 @@ package body Sem_Attr is -- If the root type or base type is generic, then we cannot fold. This -- test is needed because subtypes of generic types are not always -- marked as being generic themselves (which seems odd???) + -- + -- Should this situation be addressed instead by either + -- a) setting Is_Generic_Type in more cases + -- or b) replacing preceding calls to Is_Generic_Type with calls to + -- Sem_Util.Some_New_Function + -- so that we wouldn't have to deal with these cases here ??? if Is_Generic_Type (P_Root_Type) or else Is_Generic_Type (P_Base_Type) + or else (Present (Associated_Node_For_Itype (P_Base_Type)) + and then Is_Generic_Type (Defining_Identifier + (Associated_Node_For_Itype (P_Base_Type)))) then + Set_Is_Static_Expression (N, False); return; end if;
From: Steve Baird <baird@adacore.com> In deciding whether a Size attribute reference is static, the compiler could get confused about whether an implicitly-declared subtype of a generic formal type is itself a generic formal type, possibly resulting in an assertion failure and then a bugbox. gcc/ada/ * sem_attr.adb (Eval_Attribute): Expand existing checks for generic formal types for which Is_Generic_Type returns False. In that case, mark the attribute reference as nonstatic. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_attr.adb | 10 ++++++++++ 1 file changed, 10 insertions(+)