From patchwork Tue Jun 2 08:44:49 2026 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: 136239 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E2AA24BA23D3 for ; Tue, 2 Jun 2026 08:51:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E2AA24BA23D3 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=Phi4VAQ0 X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id 7BFC14BA2E26 for ; Tue, 2 Jun 2026 08:45:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7BFC14BA2E26 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 7BFC14BA2E26 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::331 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389958; cv=none; b=GknLYQYsaDQ5TCPYPJNA4XBXJ6NPp4oXSGyrah9adAmBx17uYqL8z9WBZoj9YclxNxjqlWik7xPtAQ8ycJDsScpYonqN5qgYWZ8NXYlwcM5fkj1cSlhxSCwzcsoLUWlkM4borR6mpvOnGHjcBVcDKGi4MXgx5Feux4JEOosKI+4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389958; c=relaxed/simple; bh=rSB8BvDlHXeUXnZGge3bow2RWFT5T47tm+ERwvDgjZg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=gsv0IyjyKSl3resV7BSV7IA5Gs+1XkGFEjMMKORQ4tmAU19NQYf2UV5f6O9xCmsAV05FeQ38YnAVDpl4Tc/o4twPOWZ68Sug0OeR6KC7PvFpvPeAo5OBOEPq3P8961Ak+3mBT8Id0HHRvImOcf2UpO9vlRneYadQuM2G881Ss/Y= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=Phi4VAQ0 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7BFC14BA2E26 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-490ace40f4bso18710425e9.3 for ; Tue, 02 Jun 2026 01:45:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389957; x=1780994757; 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=GDFi7Qny/IQbJFIRhQWEodArcLXKTEK+VqllqaKMTGQ=; b=Phi4VAQ0udeFgFKMIjULeexqYauoiENKBD/TyNmSz7WzswIOQRnGlCa+GRWukS7Duk QIcatIpaymKgnACWEAiWnnXNZvO9vm5gkDgjkLolUepPbuG1rOr9M0e+/06WmIJ0diIS HKx9/0wPObUSSOl+7z1gCB4ebDETEb8mvCwzvx8VL9rqAXOPItReBOs07QOnHiDD85nq lB5hseBN9Wu9bLt99Ku3Q2qRJKY5ueNbx6TJ4JwHYFEcHp39HjlgUWk80PJggBiq/Lhl BlgZdzmyuhkV8NhhpsbuMuXBwR3rD4xanBK0mg+leAzjBsPRHizmW07biwgtfSlIMdHV UjuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389957; x=1780994757; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=GDFi7Qny/IQbJFIRhQWEodArcLXKTEK+VqllqaKMTGQ=; b=ofm9TNZNvnUbGUKDhU2R3PMwziGNmow++NS7lIofWoBwmAS8AZJFK2fYNao1xg7KeG x0iGRBKqt5zZeDdKO6NELBXAHiRK25gCL3tN/u4/so7iOyiZFsRL6TiNe6g8MSyg98oY 4doeYJCtAxVJTg0i5d1j/QWx8zTKo6tB9cFa7K1J4Kbupbwkad+4tO+klgf8u6CV7RYu gCih+kWR+daw7puquVYf1zhqN0V7sHcK8q31x9YJNE+HizFEnznbGfBWSDSIHyA1lmHf 0lzoDQAsjSIjXUdrlVZxejXAggR/kIKp9W0oK5Sz0nbs+ClMBJdeBlyId15ZxNsHxLf3 K9Fw== X-Gm-Message-State: AOJu0YyU2j5ydXpXs47bIBu4IlwqsOe2Ayf8TOZ9wVb56XMzyU9GKVoP 6vK5q5q8cy2e/OUC7YzmLw8X+/yie506gI+G5P+q/fqWcMFwVPjQX1WnNEM0t5iygKDyI7pEjZc vy4U= X-Gm-Gg: Acq92OGHgUfbNboAtjeBPwUBI0oIc7mmHiQYXZGb3ka462D2w3D+BJepuYpCpDMn7XY oG9m4Mj01QzzxpOBxC3CqGzYUhSRhRRu4+0c4vRfZoUNY0cCe7RuVAxMrT7Jl01B3n3Dvn2BYcT 1lF7rouS0YuZ7zxbCsVhCmBn56D9EmfsRgV7NHPbplpAJpDwlv6NcHeqqdCA8ZiWjJFoKoCLyTP 9fHHdLR7HqA+9idM+Q7sckgF6pmg1HwN1FFWaQADTsMEg3mJvQUAE7rxrjGvcsEfv9XMvJ4f/PQ K0mEgQnaMgGyNMB9sYYv/zH/xBs118iBgD9qn8jbIuMJCV5q+z9E0+Y0cwO4dVQfgAjjSN4oOt7 Mn3WyRmObSBhht4sKFyqX0WUzT4tc91gsufhwBYlpfpx5NuEefTemtbSOd9r6Q5cNmX3lvo/TbJ Q+CEC62kkKCnrWl5IklqbVCnG0WIAMhsYKb1URvVIE8m8LnGVIIsOQMI19mLT03ERuy/pOHYUIG QvfOlTm5NUievLU23GAUBF1hJvZvuM= X-Received: by 2002:a05:600c:4703:b0:48f:d1b8:9ab1 with SMTP id 5b1f17b1804b1-490a2915af8mr285771625e9.9.1780389957351; Tue, 02 Jun 2026 01:45:57 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.45.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:45:56 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Ronan Desplanques Subject: [COMMITTED 01/51] ada: Rename Private_Component function Date: Tue, 2 Jun 2026 10:44:49 +0200 Message-ID: <20260602084541.3829876-1-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 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, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Ronan Desplanques The expression "private component" is best reserved for components of protected objects' private sections. This renames a function from "Private_Component" to a more explicit name because that function is not about the protected object component case. gcc/ada/ChangeLog: * sem_util.ads, sem_util.adb (Private_Component): Rename into... (Partially_Visible_Subcomponent): ...this. * sem_ch3.adb (Analyze_Component_Declaration, Array_Type_Declaration): Adapt to above renaming. * sem_ch7.adb (Install_Composite_Operations): Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch3.adb | 4 ++-- gcc/ada/sem_ch7.adb | 2 +- gcc/ada/sem_util.adb | 12 +++++++----- gcc/ada/sem_util.ads | 15 +++++++++------ 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 612cf712fd5..7e28881aeb0 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -2222,7 +2222,7 @@ package body Sem_Ch3 is -- If this component is private (or depends on a private type), flag the -- record type to indicate that some operations are not available. - P := Private_Component (T); + P := Partially_Visible_Subcomponent (T); if Present (P) then @@ -6814,7 +6814,7 @@ package body Sem_Ch3 is end if; end if; - Priv := Private_Component (Element_Type); + Priv := Partially_Visible_Subcomponent (Element_Type); if Present (Priv) then diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb index 1f2fe1622ef..90de70d2568 100644 --- a/gcc/ada/sem_ch7.adb +++ b/gcc/ada/sem_ch7.adb @@ -697,7 +697,7 @@ package body Sem_Ch7 is if Is_Type (Id) and then (Is_Limited_Composite (Id) or else Is_Private_Composite (Id)) - and then No (Private_Component (Id)) + and then No (Partially_Visible_Subcomponent (Id)) then Set_Is_Limited_Composite (Id, False); Set_Is_Private_Composite (Id, False); diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 863fd4d87b2..9348bf87d7f 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -27240,11 +27240,13 @@ package body Sem_Util is end if; end Predicate_Tests_On_Arguments; - ----------------------- - -- Private_Component -- - ----------------------- + ------------------------------------ + -- Partially_Visible_Subcomponent -- + ------------------------------------ - function Private_Component (Type_Id : Entity_Id) return Entity_Id is + function Partially_Visible_Subcomponent + (Type_Id : Entity_Id) return Entity_Id + is Ancestor : constant Entity_Id := Base_Type (Type_Id); function Trace_Components @@ -27329,7 +27331,7 @@ package body Sem_Util is begin return Trace_Components (Type_Id, False); - end Private_Component; + end Partially_Visible_Subcomponent; --------------------------- -- Primitive_Names_Match -- diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index fc1845e0b49..9913e941036 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -3092,12 +3092,15 @@ package Sem_Util is -- with a special name to avoid being overridden (i.e. return true in case -- of entities with names "nameP" and "name" or vice versa). - function Private_Component (Type_Id : Entity_Id) return Entity_Id; - -- Returns some private component (if any) of the given Type_Id. - -- Used to enforce the rules on visibility of operations on composite - -- types, that depend on the full view of the component type. For a - -- record type there may be several such components, we just return - -- the first one. + function Partially_Visible_Subcomponent + (Type_Id : Entity_Id) return Entity_Id; + -- If there exist any subcomponents of Type_Id whose types are currently + -- only partially visible, returns one such subcomponent. Otherwise returns + -- Empty. Used to enforce the rules on visibility of operations on + -- composite types, that depend on the full view of the subcomponent types. + -- + -- We say that a type is "partially visible" when it has a partial view + -- that is currently visible but no full view that is currently visible. procedure Process_End_Label (N : Node_Id; From patchwork Tue Jun 2 08:44:50 2026 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: 136236 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 660514BA2E26 for ; Tue, 2 Jun 2026 08:48:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 660514BA2E26 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=AtUoUWoD X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by sourceware.org (Postfix) with ESMTPS id 18F984BA2E11 for ; Tue, 2 Jun 2026 08:45:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 18F984BA2E11 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 18F984BA2E11 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::330 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389959; cv=none; b=Bxz/oCAqZDPVsjirIvJZpFCf1pecAInhRc7KpF+qFv/OYMV+sKVPRDq0rYiCM8uBX9FaMVA8fBiACAPGzdjAIBt3zzXwKPCnJpOswceSaUrRNUkejp1YARbpfVR+aLHONo/8rbCN3b9g0abM2JSNHs942/a5znxBuh7NumLB75c= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389959; c=relaxed/simple; bh=EKqiy/mMjo2mavEK/VC76khV2U4S5GOviXBmKvVH9pw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=X67AdwpDGyzmjaVW/XmLsvfuKPsYSGZ2UecI5xSTMvwVut1AyUefumeOnwfDEskgAP9u6wCpUBFTzupVmHGnRRRXYKX/L7ncAAaWi3f9+Dai8A0Ai+6C/AP76wVwKWjUXu4WtxOfMFkedtAKTAL+XGWFYrabNQXZcrO1yUTdwPM= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=AtUoUWoD DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 18F984BA2E11 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-490b2b037d2so2315565e9.3 for ; Tue, 02 Jun 2026 01:45:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389958; x=1780994758; 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=NpJYbWvnJH0Frq9fmnJ28CEX1LzrtHrrHsDLxRunW0Q=; b=AtUoUWoDGAhI31AbgiGHDmy/Vj/Cw6SieOBUjVODxlTyrWYKVyOaCQfBDIbDQc+GbR ut1uWgyTCfdzWlkh7ewBNBchch2XCzC24PMbinuCcvhnJUHNhcIJNw7boNZEHDTwFA54 aIaoE9pWBdC+6riuZrkRjTHnb1UOqZvu82f3vpihpGPZcg1V0j5c/MWDykhJt/k/4n4u CIDCBfPDEhC8zWhXU6i9mp2abDI2YUnKzkPAFEbhCDCMzfE89VuvDAKJFgzGp7NtDwzJ tiJTG0ci3z3LAuY5m6yuEYgjx82e2JD4HpkulpFyiPQFjiSJ2++jX26+IpR5JXtwhstF PPdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389958; x=1780994758; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=NpJYbWvnJH0Frq9fmnJ28CEX1LzrtHrrHsDLxRunW0Q=; b=h0ZMDxuoWsSyA6aJwODccC681nhBNcF3oyUjihTSpMAA9xqQ8Y1p//eaDQsLrD4RJD aCSIvM8HXD7gzB9i1Pauya8sdO953NxY3cYYrg2enh66MWla1A/N2aTSRgMkCeOQqARR Hms2guKV0vsDHLAP7ACkG0zKCJ8ozKmw8uHER860x+pFVZqxdvcv1M68a41Nvr0u+wBc O9laOYzDRqoN1S6v7EXNzeTtHiK5KDWE4i7jyBMjqfH9Rh/dHf1nSXkUSUDRAy0dg5B4 /Yfepq4qLbSzSBDCUCBBtPslzL/lBuZLDhNavzkjdty6Mkby5Gp89mPq0WgRAUpJ0Gxj wZPg== X-Gm-Message-State: AOJu0YzRZz78sED9hcYDI6FPDfz93jk7+0ofMaVRqAVeSb/5XVVT93uR JL5PT/txuOon4DyVn+2csdb1+zOyJSDPI1597DOFE9vzX4HMjVj2egz6ST6v1Ajv1CBFHOfHwob AlV0= X-Gm-Gg: Acq92OFzPrCY6HxL53wCAbXTV8Z/9yttNyPSmx6dcFCJBrMS6szPgbzR8B+spQW++/S dPV3Rvc7L0zXzamXhcNXLnUtz0K1KC9vrTzDJcg5tuMb+9St8orp912x0FvmB0CwCVjdxMu3FvZ RDuEjdAoP2wxX7Ki+VydQPDVEmOY9nc7jTRI/RqG1h8tB1YTYpmIn+VBb/Vr5nZlMZO6Ca+Rlx4 X5NTaHSFYv7YYltbGZWzDlI4JiyQI+pZNdxu272pulRITdxsrp/bHGxtqYmMfeFIlYgtZ6ijns2 +gOMwrx3gv6Gdzh9hsP7hpWdMRqBvfnGrmyYzdy/Dbn8i5uPH5tW2g7k7HAA6TzE5zbxFBQfPlT iG5+APPejI41gseUihHZqSiv1NZPG91upNrOs7SuJvTtOjMrcujt04IoC3u557oI5c8JH/GfEec BQloh/ydvLIG35OYk5OnZe4mI0ZRwVwn9yUZz8ujt59oF6RQXzYfLPmH7SQleGN/sK+0F4Iv8Py WZE8MxTGAqZKcnJ8BUwocmPu6pXVRHOOQH1kx3DaA== X-Received: by 2002:a05:600c:458f:b0:490:b202:4772 with SMTP id 5b1f17b1804b1-490b20248cbmr32638175e9.2.1780389958058; Tue, 02 Jun 2026 01:45:58 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.45.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:45:57 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Viljar Indus Subject: [COMMITTED 02/51] ada: Avoid giving multiple errors on ghost argument Date: Tue, 2 Jun 2026 10:44:50 +0200 Message-ID: <20260602084541.3829876-2-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Viljar Indus Avoid marking multiple errors on the same line if the ghost expression is both non-static and also would evaluate to False. gcc/ada/ChangeLog: * sem_prag.adb (Analyze_Abstract_State): make error checks exclusive. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_prag.adb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index e3f1ed0e085..a22ae61cd55 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -13595,9 +13595,7 @@ package body Sem_Prag is & "in pragma % " & "must be static"), Expr); - end if; - - if Is_False (Expr_Value (Expr)) then + elsif Is_False (Expr_Value (Expr)) then Is_Ghost := False; -- "Ghostness" cannot be turned off once From patchwork Tue Jun 2 08:44:51 2026 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: 136234 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DD0914BA2E2A for ; Tue, 2 Jun 2026 08:47:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DD0914BA2E2A Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=OSMCrKVZ X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id AF77D4BA2E2D for ; Tue, 2 Jun 2026 08:45:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AF77D4BA2E2D 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 AF77D4BA2E2D Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389959; cv=none; b=EVE+okRjTO5dlgiOIFGo2Jtk4m/M4UXRx4hjGpXq31DzUL6Bd3WgfoKniGRPc4EliBj6V21oEPytaYQ1I/I0uc8H+se5bPYF3R4CtG6+h3qhXI/j0j+uPPaFAPWKfLKeH1KHFaLO0WIL1z9at51hjZpWKjY2UfJUvcqSUnZEWpQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389959; c=relaxed/simple; bh=mrv2q7SRvG9AgLwFRg5MGI0z+cIttPClvi6Do96Dxu8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=DIbDCLzT8HNeKgCshlCyBZg3tcWpu63ZoitJbLWBZwc2bWpsq2tnEJWoGcQV54jiaahIMDaWbpW/cEfYQRnQyhh+wQHb4zFDjhGQz+IcNnQikYJitahO7W3uJQLBjFNZJNCbxA1Zp0ObKcdWfth84mVrrSJRZK7YSi4aqogitvQ= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=OSMCrKVZ DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AF77D4BA2E2D Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-490ac357c55so16732265e9.1 for ; Tue, 02 Jun 2026 01:45:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389959; x=1780994759; 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=7g0vVvhjqXm3YI6PXgzv51qisxCMpKglm1ZAQWusyGM=; b=OSMCrKVZn4kFab1DxQSn/ObRmr7h2xgXUoPN3Ot9ToVw0pUbQ4CMOOK+mFzCZhty4k By+1dBTbHdkbGAyZOR4uAZZq2a4pS/XBE2ve99wTiOGo/mTwnxw5NJ2+PzTn9HUlW6Xg M/+dquLg/hdiG8fApcvVH0PJosiPrIUbYQvyuY/EVeGYHWGtF1xqAD0fbijRBByLRVJZ MIAd1RHir23Vo5WsyX2dVjURehVmPCAuwnymDhZzpY76iSfzS4eZjzxERsG6sSSB1cE+ Qp995oW0BJx+3ecPhEQQ/SzoWoygedVITyImiQ+oGsFFsT0qXvwhMH0cNsDDCTr0eg/x vmAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389959; x=1780994759; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=7g0vVvhjqXm3YI6PXgzv51qisxCMpKglm1ZAQWusyGM=; b=gqrdAif25VUseNlQ5FkAUbaNmmSvWkU3x9qd+0SA5p6Y4ahFhefh2grP7TRpLK9pCh aRLG2QuQoFY0HMPTQxKudYgG/1mHJpxu/3YJMp/2MjRdjPFf+t2RXMLiBBLg2GPVQtOc xAIs4K6l6UdgL73eMi1xeLmGyT+A2hVUoD5ilayYjC1bnYP4EoBJrVpmHl41lqRhoTPv 5iEk42XzGbx6Q3PW/CIBmg/JAth1ARzwmAlxnyVnaMGfzdSJtral3rOktyH+gbopNShQ /ZOPEjgAt8+KtrsNRK5r7j5sSP20LmxxRYp0S9NIrQKnmO+rlnOOtNanu9Mn9KodSXUo WgIw== X-Gm-Message-State: AOJu0Yw6h3Ec+pFDRt1SWuw8Cj5wVFBQXdXVnaXIj09IAvyBr0UZFuxb jzN+tZ9Kf0M2HuljbEb70e3VHnHI5XFl6XKpSnYunhYNl1gh+kXC/LdwiVzHt1XKROY+dJriQKo vzbg= X-Gm-Gg: Acq92OEjKoeqRzBKsc3V+zYq3CTp8aZhzG0Sh0saWek0H3bYm8mO277n9in5UAbgmPA aOq5c3srT3rnFDo73UKcKtGsQjZymdK0ovNACjYGkrXD/baaPhRSdm5OsSv6iAyFz8SKn2++b41 2jADUSbQE8tw00IS5rmTxbv0/4ycv9n4SC0TtqW5qxy/bLsTpVn43NkGQMKLcaxZylQfBZtTbqm 9FjYJ/I/HKQxPSRyToI9UQBROA+aHs14XIojM9S2ch9+4NuT/hj43vd9wqbV7WoAyhOzX2Btn8U uM3+sQEq4GDSEKkl9qm/WGf/HbbO7n2i2z1v27SJ51/CRcNBZ1uWyjWmO3bV91Q/5/13ZgPJGS8 MRQcGzS24qzO0L1Ft3437PvL3icUiwQQgT0rKHZ90kJRU5o1Y81HvtJzu2k6oLyfeHvW0tBmd3R VZZ/r9wKVvSY05zZRvofQClu3w3JtprC/W3Dbhrk+D3ecWmsdmq+KD7VfiMb0K7zjkMePiav/Ba Gb/OeKNCjbrjXiaJbvqyV+tKNaE8xM= X-Received: by 2002:a05:600c:1992:b0:490:adb6:793d with SMTP id 5b1f17b1804b1-490adb67fc0mr106646715e9.26.1780389958703; Tue, 02 Jun 2026 01:45:58 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.45.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:45:58 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Ronan Desplanques Subject: [COMMITTED 03/51] ada: Restrict Is_Limited_Composite field to (sub)types Date: Tue, 2 Jun 2026 10:44:51 +0200 Message-ID: <20260602084541.3829876-3-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Ronan Desplanques Is_Limited_Composite was set on all entities during the migration to Gen_IL, but it's only used on types and subtypes. This moves the field to the appropriate entity kind. gcc/ada/ChangeLog: * gen_il-gen-gen_entities.adb (Gen_Entities): Move Is_Limited_Composite. * einfo.ads (Is_Limited_Composite): Update documentation. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/einfo.ads | 8 ++++---- gcc/ada/gen_il-gen-gen_entities.adb | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index dc75d6f1bc7..b0283e2a0b1 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -3041,10 +3041,10 @@ package Einfo is -- about them. -- Is_Limited_Composite --- Defined in all entities. Set for composite types that have a limited --- component. Used to enforce the rule that operations on the composite --- type that depend on the full view of the component do not become --- visible until the immediate scope of the composite type itself +-- Defined in types and subtypes. Set for composite types that have a +-- limited component. Used to enforce the rule that operations on the +-- composite type that depend on the full view of the component do not +-- become visible until the immediate scope of the composite type itself -- (RM 7.3.1 (5)). -- Is_Limited_Interface diff --git a/gcc/ada/gen_il-gen-gen_entities.adb b/gcc/ada/gen_il-gen-gen_entities.adb index 2d358929b5f..84bcc429642 100644 --- a/gcc/ada/gen_il-gen-gen_entities.adb +++ b/gcc/ada/gen_il-gen-gen_entities.adb @@ -173,7 +173,6 @@ begin -- Gen_IL.Gen.Gen_Entities Sm (Is_Known_Non_Null, Flag), Sm (Is_Known_Null, Flag), Sm (Is_Known_Valid, Flag), - Sm (Is_Limited_Composite, Flag), Sm (Is_Limited_Interface, Flag), Sm (Is_Limited_Record, Flag), Sm (Is_Link_Once, Flag), @@ -508,6 +507,7 @@ begin -- Gen_IL.Gen.Gen_Entities Sm (Is_Fixed_Lower_Bound_Index_Subtype, Flag), Sm (Is_Generic_Actual_Type, Flag), Sm (Is_Implicit_Full_View, Flag), + Sm (Is_Limited_Composite, Flag), Sm (Is_Mutably_Tagged_Type, Flag), Sm (Is_Non_Static_Subtype, Flag), Sm (Is_Private_Composite, Flag), From patchwork Tue Jun 2 08:44:52 2026 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: 136241 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 812C64BA23E1 for ; Tue, 2 Jun 2026 08:51:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 812C64BA23E1 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=AvHa0pT9 X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id C08864BA23DA for ; Tue, 2 Jun 2026 08:46:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C08864BA23DA 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 C08864BA23DA Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389961; cv=none; b=WPELMX2hHg1VHtft7+5HDO3VrBYO9/6SvtOF+cQxb11uAM9p1UW8fXEq2lAuKOZF+DnuUPckS/8EXn/78ZvzHjdgBaRNe97yNwL0raz4p4oFYMqGDgYc4Qt0XZsJ9p7xFFKMgk84Eq0PIaCLN0XLDnJvtkH7Mc8SgMyeieRSZUE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389961; c=relaxed/simple; bh=A6G1IpGYdhnuvBZvNlzS7JbkDWBKvrcHWm+sEEikfHU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=pCqtZdUTtUj/ELB06SGSbgxf2xD0mb25Okfy40tnUoiB8Md6XhT1yXARj12WhzUtnA09yYk5+hfJoFThzKWdP0MzXOKDQMl/5SvPMqMaP7afNLhcm5ujvv6QLORK10U3QcXI+ofBZ2hSSODEyTzxHSARN2DM3FRx0vNaQsLzGk8= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=AvHa0pT9 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C08864BA23DA Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4908b92904fso57813825e9.0 for ; Tue, 02 Jun 2026 01:46:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389960; x=1780994760; 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=iB0KaXt+hvUkmypmLKCrkhUdWBe64mCQYxtJUEXU2UE=; b=AvHa0pT9kGuHpP6+7yyZ1TonnizOAUi6rNI6rftSDcFqHeDYL7YNrnW30ywQwUqX0u l9Xw6oPaQG/X63BcRcV7z/kx0OFdSGs2OfWpdKHPOyKkLZj0RBSG9064sbFu4kCtdidv 29b1CrWe4/tKd/NAcP6HFCavA20nWroU+2iB7UiHOeAnFp2J9EnG7s64XN0sHRzxpyN2 N4LtnJfonge7wVTQ3lP+4AHDFPOZ8XkK0zM7N/j9K4MOyHxwHTxbp+WAXc92iyeQq1QY R2//PHq1ZDg/nWlMJL1EDGHyqUlCfZUm4TVA3AaQcbJPvg8MmVqLc6PYdKBz6Kclwqw2 mEww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389960; x=1780994760; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=iB0KaXt+hvUkmypmLKCrkhUdWBe64mCQYxtJUEXU2UE=; b=qB8Wr+kp0EyY0PtBtFvmPhyW2Ht9Zu8EpAym9ufsJsC2NM2HA9XVOiL69T6Uda4pEO 6H1Z6B5/7CVg9NGj3WMoBY5sYpU6C1U2i2/fkBlyuE84fVBzsgeo7xtLavtrBmq18fsN FJ70pH1Swb6WTn5Cpe9JXIROQtOy7G8DiiEqHrFg4iXhRo84bnFhiusqzFxCCHIMlvFi 9qK+cVZsKC87Oc6ygYId5fOkS1Wj9ksvQpJJb2/NtiJo8oKVOebaMdPTmh24jG5rLBsW qCyCyhuxVMW0kgk0lrcV17GbGaK1Qp4pIEhX3fdZqXYq5biHiQziuLZKl48l4LCF0KCU kB4w== X-Gm-Message-State: AOJu0Yx6Pm4L3hf08Xy9VoM6qRFFKEvn2jbKkvZ0QQeVsoqSAPpOwElY hWz847/+FymOpKumBQDN2MJoj7pIgp/UVZs/lVcvbTdtS/vxqOswdTRA3qLnHhIMjNl4X3WCMkr hwhU= X-Gm-Gg: Acq92OGS0KjDWRZhCqypvYO0myeHNfqednRXkGfbd4rRdYnuqeQVnaW/D9diNrFfPWU GNuMhQ5d8t4aLqEzuSWFYwYpkzFQWnxrwhCvLEopOk094rRjK34Dbsn625wKMequ3K2L6ydq31o tTLj74ysOJBmgx+0KxyK45o6Ap+U8SsrTK2lfXCbcq62V7JGUrjwVHSsEzW0H4SOU0zAXcUt3cI oFjLfOBHX/0JutYtUO/eA9xKb5xIwQx7rMWLO2qC09ZfFHScom+ONOog8mMtGRFYvzuIQtYElfs 0rDL785fpbHhR0xc4eOYVXz3h1Zyf/EpryQR3uyI7WR89DIBjnG67kknorVUhNjo5Oq4h0bLMKJ A5wSRqiWnj4E1hGbaEHCt1M9PERiYHOUACNjO/5s4Y9OcwiRns9WsMTJfRl0Np/2ejBrBIa3klW j8jw+Luzrn0CiCBFA29Cu0HSlhedy8cPfDB5IH3F71c/6RGy91MXhHQhTi1aJvF8oHMs0UzE9Ss tkjFX6UKblZZbCI5CVC7GDBcMTkO/I= X-Received: by 2002:a05:600c:4714:b0:489:1c1f:35f1 with SMTP id 5b1f17b1804b1-490a290ebf2mr277612685e9.4.1780389959608; Tue, 02 Jun 2026 01:45:59 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.45.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:45:59 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Ronan Desplanques Subject: [COMMITTED 04/51] ada: Rename Has_Private_Component function Date: Tue, 2 Jun 2026 10:44:52 +0200 Message-ID: <20260602084541.3829876-4-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> 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, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Ronan Desplanques The expression "private component" is best reserved for components of protected objects' private sections. This renames a function from "Has_Private_Component" to a more explicit name because that function is not about the protected object component case. gcc/ada/ChangeLog: * sem_util.ads (Has_Private_Component): Rename into... (Is_Incompletely_Defined): ...this. * sem_util.adb (Has_Private_Component): Rename into... (Is_Incompletely_Defined): ...this. (Check_Fully_Declared): Adapt to above renaming. * exp_ch3.adb (Freeze_Type): Likewise. * freeze.adb (Check_And_Freeze_Type): Likewise. * sem_aggr.adb (Array_Aggr_Subtype): Likewise. * sem_ch12.adb (Instantiate_Type): Likewise. * sem_ch13.adb (Rep_Item_Too_Early): Likewise. * sem_ch3.adb (Access_Definition, Analyze_Full_Type_Declaration, Analyze_Subtype_Declaration, Build_Derived_Access_Type, Copy_And_Build, Complete_Private_Subtype, Constrain_Access, Constrain_Array, Build_Constrained_Access_Type, Constrain_Concurrent, Constrain_Corresponding_Record, Copy_Array_Subtype_Attributes, Derived_Type_Declaration): Likewise. * sem_ch6.adb (Create_Extra_Formals): Likewise. * sem_res.adb (Make_Call_Into_Operator): Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch3.adb | 4 +- gcc/ada/freeze.adb | 2 +- gcc/ada/sem_aggr.adb | 16 +++--- gcc/ada/sem_ch12.adb | 4 +- gcc/ada/sem_ch13.adb | 4 +- gcc/ada/sem_ch3.adb | 29 +++++----- gcc/ada/sem_ch6.adb | 2 +- gcc/ada/sem_res.adb | 2 +- gcc/ada/sem_util.adb | 129 ++++++++++++++++++++++--------------------- gcc/ada/sem_util.ads | 9 +-- 10 files changed, 102 insertions(+), 99 deletions(-) diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index e8bccb22872..38aafbf7578 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -10109,10 +10109,10 @@ package body Exp_Ch3 is Build_Finalization_Collection (Def_Id); -- Also create a finalization collection when the designated type - -- contains a private component. It is assumed that the full view + -- is not completely defined. It is assumed that the full view -- will be controlled. - elsif Has_Private_Component (Desig_Type) then + elsif Is_Incompletely_Defined (Desig_Type) then Build_Finalization_Collection (Typ => Def_Id, For_Private => True, diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index 13d3a7f2e34..2b9ef460c36 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -9419,7 +9419,7 @@ package body Freeze is Check_Fully_Declared (Typ, N); if Error_Posted (N) then - if Has_Private_Component (Typ) + if Is_Incompletely_Defined (Typ) and then not Is_Private_Type (Typ) then Error_Msg_NE ("\\type& has private component", N, Typ); diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 5f6570f36f0..1d39bd7d845 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -735,14 +735,14 @@ package body Sem_Aggr is Itype := Create_Itype (E_Array_Subtype, N); - Set_First_Rep_Item (Itype, First_Rep_Item (Typ)); - Set_Convention (Itype, Convention (Typ)); - Set_Depends_On_Private (Itype, Has_Private_Component (Typ)); - Set_Etype (Itype, Base_Type (Typ)); - Set_Has_Alignment_Clause (Itype, Has_Alignment_Clause (Typ)); - Set_Is_Aliased (Itype, Is_Aliased (Typ)); - Set_Is_Independent (Itype, Is_Independent (Typ)); - Set_Depends_On_Private (Itype, Depends_On_Private (Typ)); + Set_First_Rep_Item (Itype, First_Rep_Item (Typ)); + Set_Convention (Itype, Convention (Typ)); + Set_Depends_On_Private (Itype, Is_Incompletely_Defined (Typ)); + Set_Etype (Itype, Base_Type (Typ)); + Set_Has_Alignment_Clause (Itype, Has_Alignment_Clause (Typ)); + Set_Is_Aliased (Itype, Is_Aliased (Typ)); + Set_Is_Independent (Itype, Is_Independent (Typ)); + Set_Depends_On_Private (Itype, Depends_On_Private (Typ)); Copy_Suppress_Status (Index_Check, Typ, Itype); Copy_Suppress_Status (Length_Check, Typ, Itype); diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index ae9f76d3791..fb0d06e348c 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -15785,7 +15785,7 @@ package body Sem_Ch12 is Act_T := Full_View (Act_T); Set_Entity (Actual, Act_T); - if Has_Private_Component (Act_T) then + if Is_Incompletely_Defined (Act_T) then Error_Msg_N ("premature use of type with private component", Actual); end if; @@ -15803,7 +15803,7 @@ package body Sem_Ch12 is then Error_Msg_N ("premature use of private type", Actual); - elsif Has_Private_Component (Act_T) then + elsif Is_Incompletely_Defined (Act_T) then Error_Msg_N ("premature use of type with private component", Actual); end if; diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index a6a25aefc86..773fa64a3e8 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -16783,10 +16783,10 @@ package body Sem_Ch13 is ("representation item must be after full type declaration", N); return True; - -- If the type has incomplete components, a representation clause is + -- If the type is not completely defined, a representation clause is -- illegal but stream attributes and Convention pragmas are correct. - elsif Has_Private_Component (T) then + elsif Is_Incompletely_Defined (T) then if Nkind (N) = N_Pragma then return False; diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 7e28881aeb0..1cfe48db4d7 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -904,7 +904,7 @@ package body Sem_Ch3 is -- set, as required by gigi. This is necessary in the case of the -- Task_Body_Procedure. - if not Has_Private_Component (Desig_Type) then + if not Is_Incompletely_Defined (Desig_Type) then Layout_Type (Anon_Type); end if; @@ -3421,7 +3421,7 @@ package body Sem_Ch3 is -- Some common processing for all types - Set_Depends_On_Private (T, Has_Private_Component (T)); + Set_Depends_On_Private (T, Is_Incompletely_Defined (T)); Check_Ops_From_Incomplete_Type; -- Both the declared entity, and its anonymous base type if one was @@ -6291,7 +6291,7 @@ package body Sem_Ch3 is T := Etype (Id); Set_Is_Immediately_Visible (Id, True); - Set_Depends_On_Private (Id, Has_Private_Component (T)); + Set_Depends_On_Private (Id, Is_Incompletely_Defined (T)); Set_Is_Descendant_Of_Address (Id, Is_Descendant_Of_Address (T)); if Is_Interface (T) then @@ -7362,7 +7362,7 @@ package body Sem_Ch3 is Set_Size_Info (Derived_Type, Parent_Type); Copy_RM_Size (To => Derived_Type, From => Parent_Type); Set_Depends_On_Private (Derived_Type, - Has_Private_Component (Derived_Type)); + Is_Incompletely_Defined (Derived_Type)); Conditional_Delay (Derived_Type, Subt); if Is_Access_Subprogram_Type (Derived_Type) @@ -8504,7 +8504,7 @@ package body Sem_Ch3 is Set_Is_Frozen (Full_Der, False); Set_Freeze_Node (Full_Der, Empty); Set_Depends_On_Private - (Full_Der, Has_Private_Component (Full_Der)); + (Full_Der, Is_Incompletely_Defined (Full_Der)); Set_Is_Public (Full_Der, Is_Public (Derived_Type)); Set_Is_Implicit_Full_View (Full_Der); @@ -13655,7 +13655,7 @@ package body Sem_Ch3 is end if; Set_First_Rep_Item (Full, First_Rep_Item (Full_Base)); - Set_Depends_On_Private (Full, Has_Private_Component (Full)); + Set_Depends_On_Private (Full, Is_Incompletely_Defined (Full)); -- When prefixed calls are enabled for untagged types, the subtype -- shares the primitive operations of its base type. Do this even @@ -14324,7 +14324,8 @@ package body Sem_Ch3 is Set_Size_Info (Def_Id, T); Set_Is_Constrained (Def_Id, Constraint_OK); Set_Directly_Designated_Type (Def_Id, Desig_Subtype); - Set_Depends_On_Private (Def_Id, Has_Private_Component (Def_Id)); + Set_Depends_On_Private + (Def_Id, Is_Incompletely_Defined (Def_Id)); Set_Is_Access_Constant (Def_Id, Is_Access_Constant (T)); Set_Can_Never_Be_Null (Def_Id, Can_Never_Be_Null (T)); @@ -14493,7 +14494,7 @@ package body Sem_Ch3 is (Def_Id, Is_FLB_Array_Subtype); Set_Is_Aliased (Def_Id, Is_Aliased (T)); Set_Is_Independent (Def_Id, Is_Independent (T)); - Set_Depends_On_Private (Def_Id, Has_Private_Component (Def_Id)); + Set_Depends_On_Private (Def_Id, Is_Incompletely_Defined (Def_Id)); Set_Is_Private_Composite (Def_Id, Is_Private_Composite (T)); Set_Is_Limited_Composite (Def_Id, Is_Limited_Composite (T)); @@ -14618,7 +14619,7 @@ package body Sem_Ch3 is Set_Etype (Itype, Base_Type (Old_Type)); Set_Size_Info (Itype, (Old_Type)); Set_Directly_Designated_Type (Itype, Desig_Subtype); - Set_Depends_On_Private (Itype, Has_Private_Component + Set_Depends_On_Private (Itype, Is_Incompletely_Defined (Old_Type)); Set_Is_Access_Constant (Itype, Is_Access_Constant (Old_Type)); @@ -14958,7 +14959,7 @@ package body Sem_Ch3 is Constrain_Discriminated_Type (Def_Id, SI, Related_Nod); Set_First_Private_Entity (Def_Id, First_Private_Entity (T_Ent)); - Set_Depends_On_Private (Def_Id, Has_Private_Component (Def_Id)); + Set_Depends_On_Private (Def_Id, Is_Incompletely_Defined (Def_Id)); Set_Corresponding_Record_Type (Def_Id, Constrain_Corresponding_Record (Def_Id, T_Val, Related_Nod)); @@ -15011,7 +15012,7 @@ package body Sem_Ch3 is (T_Sub, Related_Nod, Corr_Rec, Discriminant_Constraint (T_Sub)); end if; - Set_Depends_On_Private (T_Sub, Has_Private_Component (T_Sub)); + Set_Depends_On_Private (T_Sub, Is_Incompletely_Defined (T_Sub)); if Ekind (Scope (Prot_Subt)) /= E_Record_Type then Conditional_Delay (T_Sub, Corr_Rec); @@ -15838,7 +15839,7 @@ package body Sem_Ch3 is Set_Is_Volatile_Full_Access (T1, Is_Volatile_Full_Access (T2)); Set_Treat_As_Volatile (T1, Treat_As_Volatile (T2)); Set_Is_Constrained (T1, Is_Constrained (T2)); - Set_Depends_On_Private (T1, Has_Private_Component (T2)); + Set_Depends_On_Private (T1, Is_Incompletely_Defined (T2)); Inherit_Rep_Item_Chain (T1, T2); Set_Convention (T1, Convention (T2)); Set_Is_Limited_Composite (T1, Is_Limited_Composite (T2)); @@ -18235,7 +18236,7 @@ package body Sem_Ch3 is elsif (Is_Incomplete_Or_Private_Type (Parent_Type) and then not Comes_From_Generic (Parent_Type)) - or else Has_Private_Component (Parent_Type) + or else Is_Incompletely_Defined (Parent_Type) then -- The ancestor type of a formal type can be incomplete, in which -- case only the operations of the partial view are available in the @@ -18247,7 +18248,7 @@ package body Sem_Ch3 is null; elsif No (Underlying_Type (Parent_Type)) - or else Has_Private_Component (Parent_Type) + or else Is_Incompletely_Defined (Parent_Type) then Error_Msg_N ("premature derivation of derived or private type", Indic); diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 3016daf2c2f..568b7d46db6 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -9471,7 +9471,7 @@ package body Sem_Ch6 is (Formal_Typ, Incomplete_View_From_Limited_With (Result_Subt)); Set_Etype (Formal_Typ, Formal_Typ); Set_Depends_On_Private - (Formal_Typ, Has_Private_Component (Formal_Typ)); + (Formal_Typ, Is_Incompletely_Defined (Formal_Typ)); Set_Is_Public (Formal_Typ, Is_Public (Scope (Formal_Typ))); Set_Is_Access_Constant (Formal_Typ, False); diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 9a9ae4bc4ca..08d45ebca33 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -1821,7 +1821,7 @@ package body Sem_Res is Orig_Type := Type_In_P (Is_Composite_Type'Access); if Present (Orig_Type) then - if Has_Private_Component (Orig_Type) then + if Is_Incompletely_Defined (Orig_Type) then Orig_Type := Empty; else Set_Etype (Act1, Orig_Type); diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 9348bf87d7f..0f576a3941c 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -2612,12 +2612,11 @@ package body Sem_Util is ("premature usage of incomplete}", N, First_Subtype (T)); end if; - -- The other case is a type with a private component (including itself) - -- that has not yet received a full declaration. But we exclude formal + -- The other case is an incompletely defined type. But we exclude formal -- types, as well as references in generic units to entities declared -- outside of them, and all references in spec expressions. - elsif Has_Private_Component (T) + elsif Is_Incompletely_Defined (T) and then not Is_Generic_Type (Root_Type (T)) and then (not Is_Generic_Unit (Current_Scope) or else Scope_Within_Or_Same (Scope (T), Current_Scope)) @@ -13750,67 +13749,6 @@ package body Sem_Util is N_Slice; end Has_Prefix; - --------------------------- - -- Has_Private_Component -- - --------------------------- - - function Has_Private_Component (Type_Id : Entity_Id) return Boolean is - Btype : Entity_Id := Base_Type (Type_Id); - Component : Entity_Id; - - begin - if Error_Posted (Type_Id) - or else Error_Posted (Btype) - then - return False; - end if; - - if Is_Class_Wide_Type (Btype) then - Btype := Root_Type (Btype); - end if; - - if Is_Private_Type (Btype) then - declare - UT : constant Entity_Id := Underlying_Type (Btype); - begin - if No (UT) then - if No (Full_View (Btype)) then - return not Is_Generic_Type (Btype) - and then - not Is_Generic_Type (Root_Type (Btype)); - else - return not Is_Generic_Type (Root_Type (Full_View (Btype))); - end if; - else - return not Is_Frozen (UT) and then Has_Private_Component (UT); - end if; - end; - - elsif Is_Array_Type (Btype) then - return Has_Private_Component (Component_Type (Btype)); - - elsif Is_Record_Type (Btype) then - Component := First_Component (Btype); - while Present (Component) loop - if Has_Private_Component (Etype (Component)) then - return True; - end if; - - Next_Component (Component); - end loop; - - return False; - - elsif Is_Protected_Type (Btype) - and then Present (Corresponding_Record_Type (Btype)) - then - return Has_Private_Component (Corresponding_Record_Type (Btype)); - - else - return False; - end if; - end Has_Private_Component; - -------------------------------- -- Has_Relaxed_Initialization -- -------------------------------- @@ -18676,6 +18614,69 @@ package body Sem_Util is return False; end Is_In_Context_Clause; + ----------------------------- + -- Is_Incompletely_Defined -- + ----------------------------- + + function Is_Incompletely_Defined (Type_Id : Entity_Id) return Boolean is + Btype : Entity_Id := Base_Type (Type_Id); + Component : Entity_Id; + + begin + if Error_Posted (Type_Id) + or else Error_Posted (Btype) + then + return False; + end if; + + if Is_Class_Wide_Type (Btype) then + Btype := Root_Type (Btype); + end if; + + if Is_Private_Type (Btype) then + declare + UT : constant Entity_Id := Underlying_Type (Btype); + begin + if No (UT) then + if No (Full_View (Btype)) then + return not Is_Generic_Type (Btype) + and then + not Is_Generic_Type (Root_Type (Btype)); + else + return not Is_Generic_Type (Root_Type (Full_View (Btype))); + end if; + else + return + not Is_Frozen (UT) and then Is_Incompletely_Defined (UT); + end if; + end; + + elsif Is_Array_Type (Btype) then + return Is_Incompletely_Defined (Component_Type (Btype)); + + elsif Is_Record_Type (Btype) then + Component := First_Component (Btype); + while Present (Component) loop + if Is_Incompletely_Defined (Etype (Component)) then + return True; + end if; + + Next_Component (Component); + end loop; + + return False; + + elsif Is_Protected_Type (Btype) + and then Present (Corresponding_Record_Type (Btype)) + then + return + Is_Incompletely_Defined (Corresponding_Record_Type (Btype)); + + else + return False; + end if; + end Is_Incompletely_Defined; + --------------------------- -- Is_Independent_Object -- --------------------------- diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index 9913e941036..98a7ae8be51 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -1621,10 +1621,6 @@ package Sem_Util is function Has_Prefix (N : Node_Id) return Boolean; -- Return True if N has attribute Prefix - function Has_Private_Component (Type_Id : Entity_Id) return Boolean; - -- Check if a type has a (sub)component of a private type that has not - -- yet received a full declaration. - function Has_Relaxed_Initialization (E : Entity_Id) return Boolean; -- Returns True iff entity E is subject to the Relaxed_Initialization -- aspect. Entity E can be either type, variable, constant, subprogram or @@ -2259,6 +2255,11 @@ package Sem_Util is -- Returns True if N appears within the context clause of a unit, and False -- for any other placement. + function Is_Incompletely_Defined (Type_Id : Entity_Id) return Boolean; + -- Returns True iff Type_Id is incompletely defined. See RM 3.11.1 (8) for + -- the definition of "completely defined". Note that "incompletely defined" + -- is also used in the Ada RM, for example in RM 12.5.1 (1/5). + function Is_Independent_Object (N : Node_Id) return Boolean; -- Determine whether arbitrary node N denotes a reference to an independent -- object as per RM C.6(8). From patchwork Tue Jun 2 08:44:53 2026 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: 136235 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2AA334BA23D1 for ; Tue, 2 Jun 2026 08:47:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2AA334BA23D1 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=aVVDBAin X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by sourceware.org (Postfix) with ESMTPS id 7552A4BA2E11 for ; Tue, 2 Jun 2026 08:46:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7552A4BA2E11 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 7552A4BA2E11 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::330 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389961; cv=none; b=rkkoR+J9lsVCG7S+0m9C1bnSdl58jFVPqrQD+6Dms/pVzrE8ymWezN1zO1DcvA950MSH8L8l7pedfSpvhln2lICqGWdw5Vup+lcr4/7UJUBdVrc6RWoLObZbiozyA34A19QEuR0VAx3aWxrtcMmShmMcJbob54U+f/E+2CZ/EgI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389961; c=relaxed/simple; bh=uMsjsytNAGTvAa0NWKJKfv7nSwx1nEboM6J2Ot2sXj0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=DFA9O9RlrJIONoToILec6d/T2HrMBGYiMgnXE6ACTSBoCt3YXvgIJjOU5oMETsFd0KFH8/IhK3ajOUi2UIk6+ncIF7dmb2rlCL24Nh1Z9ft7EB6wSyJXM0NCzezF9+/sL6LJOnG7tPtTwdAURqP2R52Y+/SYfkpOZbxOUHh4d6E= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=aVVDBAin DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7552A4BA2E11 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-490ace40f4bso18711235e9.3 for ; Tue, 02 Jun 2026 01:46:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389960; x=1780994760; 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=nhOIqvSukhIt52e0g4iMFqMNk6gmLUPuuCDzgVzABQw=; b=aVVDBAinI4l+DIUT6m8HPYb7/PgfuLmYM0WGtj1iQDYF4TUbNyUE/m2r+RGg/3z4Sq MNxehweEmKoTJ1O+rCr7Jd/H9UVh1/lU1wPpJczSNrxIwc0TrZCAOlIA+FF8uOdKMdCf 1WxNTcfgIbLGXcIYUV4RzwNKBBXSotxr7SYBF/EsHy9Z9Ir9O/cyfh7fed55D2kQnDOY S9dwVw5Lz/O+dTKnpGENpU2l/l02UQZBExSURvcCmPVVU2uvTH5mY+8rhbu4UKeSqwMH LvGb7KqrlPf3McG4+Sbhfc8JkgbA59FzQgzqUHFgUfkiX0AyZaOkEx4Ec0h1z3HWYOSL h6AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389960; x=1780994760; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=nhOIqvSukhIt52e0g4iMFqMNk6gmLUPuuCDzgVzABQw=; b=GL2yr1kOo2Tj8dSEx3Zthd9QpWNatUGNrj8V32JdDXhHkW+m6sm1PlqxPLnaflhL0V cnWTTSPfQUf4Wwvv2q2llNDowxlAQSWhshE2b22v2X+JAfGzRI97Q/matl/XblWKzejO RiJjRTE+iFpoTeBR6bWrOXHz2O8Lm6bRL8tHgZqzeaLpM55B6/yXuLDPtBUgZxQN2cRZ vSDfAZWcexSXkgYXIEBF9kePg5lqzkK72g44t6lBaaHNuVxggO7K5vrmguZa3zwbdRNQ fo7lBkK4/32VtOY15r1bJD2DV9jFoAVylJaRMDwhLC6ALCldF7YW4nqlmV1g9yVIR2f4 QO/g== X-Gm-Message-State: AOJu0YwVtC431k2V2jWMQw3HUW3CKiX6VEuICNb65Y5nAlR6/xxeSbhc Vhsmxo5Aqphtt7ADlVBydmS2jd1zJFePxNhrz3JyE8aQPBUBjI1coh8FM77+7LiXE6omEKfgU6Q sAJ0= X-Gm-Gg: Acq92OEGxvPzqaTrQdn5xYCkW3WkcKkFFd2fWIMTYFQrluld5ur0lFUE2Jld23VirfK A2i0tXJbprYFaMrAKrvuco8U45v6b3bXWVDAz02Mn1Y6DPBHHoEXQhWY/wkN3qo+5tLd19W2TRt gz+rsBJVFLoSmtCYDXWhGyhBwLnTFXvfMZxmkQioS3MAHiMKW0xUHkGyELwn42R+lbFZa9ltKDR oDQhTYTNKIRKC75c0Zj803aMuwhJGaxQ9n7D2BqwgqQpgHJrj2F5KfyXH7d/5MkqRwBhLr1Pzlz 3WVriTJJNRM+cPbLa8epn739wTmZl9vIXRSDR7llFF0L0rbFn6PnsZKl0EHyFXfYJj+cypA4Gcb dFIu1j2mOTy1p8G9k16nc9T2f7K2Ei7L3UTDorE5U/JviJEbghEuFCq4BafUpbtrzj+QbDpvl/I 9szrsJzuvusb9o6TLBfoAkWcVno+ZqhxGTLDn+qe8WceWF5nmZhHxAC64J8cIUm9aPLKxGNls6I UN75dqRW4iZEXO3qxJJKlSZwKAQOv4= X-Received: by 2002:a05:600c:e489:20b0:490:4ee0:82ff with SMTP id 5b1f17b1804b1-490a2957d95mr182317805e9.27.1780389960331; Tue, 02 Jun 2026 01:46:00 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.45.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:45:59 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 05/51] ada: Implement AI12-0331 Binding Interpretation Date: Tue, 2 Jun 2026 10:44:53 +0200 Message-ID: <20260602084541.3829876-5-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> 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, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Eric Botcazou The Binding Interpretation defines the order of the four steps that occur during the finalization of subpools. The order was previously unspecified but the AI mentions that there was no real leeway, i.e. that there was a unique possible order; however it turns out that GNAT implements another order, which therefore needs to be changed. Moreover GNAT's implementation is unnecessarily convoluted: 1) it uses a circular doubly-linked list with a fake head to implement the subpools, but the subpools have a pointer to the owner of the list, so a simple doubly-linked list is sufficient and 2) it allocates special nodes on the heap to chain the subpools onto the list, which is a bit awkward. gcc/ada/ChangeLog: PR ada/124143 * libgnat/s-spsufi.ads (Finalize_And_Deallocate): Adjust comment. * libgnat/s-spsufi.adb: Remove clause for Ada.Unchecked_Deallocation (Finalize_And_Deallocate): Adjust and implement AI12-0331. * libgnat/s-stposu.ads (Allocate_From_Subpool): Remove ??? comment. (Deallocate_Subpool): Likewise. (SP_Node): Delete. (SP_Node_Ptr): Likewise. (Root_Storage_Pool_With_Subpools): Adjust type of Subpools component (Root_Subpool): Remove Node, add Prev and Next components. (Detach): Adjust signature. (Initialize): Delete. (Initialize_Pool): Likewise. * libgnat/s-stposu.adb (Allocate_Any_Controlled): Adjust. (Attach): Reimplement. (Detach): Likewise. (Finalize_Pool): Loop over a simple doubly linked list. (Initialize): Delete. (Initialize_Pool): Likewise. (Print_Pool): Adjust. (Print_Subpool): Likewise. (Set_Pool_Of_Subpool): Remove obsolete code. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/s-spsufi.adb | 41 ++----- gcc/ada/libgnat/s-spsufi.ads | 6 +- gcc/ada/libgnat/s-stposu.adb | 220 ++++++++--------------------------- gcc/ada/libgnat/s-stposu.ads | 117 +++++++------------ 4 files changed, 109 insertions(+), 275 deletions(-) diff --git a/gcc/ada/libgnat/s-spsufi.adb b/gcc/ada/libgnat/s-spsufi.adb index 36bb9f4a0ee..185d746a4a0 100644 --- a/gcc/ada/libgnat/s-spsufi.adb +++ b/gcc/ada/libgnat/s-spsufi.adb @@ -29,8 +29,6 @@ -- -- ------------------------------------------------------------------------------ -with Ada.Unchecked_Deallocation; - with System.Finalization_Primitives; use System.Finalization_Primitives; package body System.Storage_Pools.Subpools.Finalization is @@ -40,50 +38,35 @@ package body System.Storage_Pools.Subpools.Finalization is ----------------------------- procedure Finalize_And_Deallocate (Subpool : in out Subpool_Handle) is - procedure Free is new Ada.Unchecked_Deallocation (SP_Node, SP_Node_Ptr); - begin -- Do nothing if the subpool was never created or never used. The latter -- case may arise with an array of subpool implementations. - if Subpool = null - or else Subpool.Owner = null - or else Subpool.Node = null - then + if Subpool = null or else Subpool.Owner = null then return; end if; - -- Clean up all controlled objects chained on the subpool's collection + -- Finalize all the objects chained on the subpool's collection Finalize (Subpool.Collection); -- Remove the subpool from its owner's list of subpools - Detach (Subpool.Node); + Detach (Subpool, Subpool.Owner.all); - -- Destroy the associated doubly linked list node which was created in - -- Set_Pool_Of_Subpools. + -- Dispatch to the user-defined implementation of Deallocate_Subpool - Free (Subpool.Node); + Deallocate_Subpool (Subpool.Owner.all, Subpool); - -- Dispatch to the user-defined implementation of Deallocate_Subpool. It - -- is important to first set Subpool.Owner to null, because RM-13.11.5 - -- requires that "The subpool no longer belongs to any pool" BEFORE - -- calling Deallocate_Subpool. The actual dispatching call required is: - -- - -- Deallocate_Subpool(Pool_Of_Subpool(Subpool).all, Subpool); - -- - -- but that can't be taken literally, because Pool_Of_Subpool will - -- return null. + -- The subpool ceases to belong to any pool. Note that ACATS cdb4001 + -- sets Subpool to null on exit from Deallocate_Subpool, but it is also + -- possible for the designated subpool object to be reused and, then, + -- the next call to Set_Pool_Of_Subpool must succeed. - declare - Owner : constant Any_Storage_Pool_With_Subpools_Ptr := Subpool.Owner; - begin + if Subpool /= null then Subpool.Owner := null; - Deallocate_Subpool (Owner.all, Subpool); - end; - - Subpool := null; + Subpool := null; + end if; end Finalize_And_Deallocate; end System.Storage_Pools.Subpools.Finalization; diff --git a/gcc/ada/libgnat/s-spsufi.ads b/gcc/ada/libgnat/s-spsufi.ads index 9e7623c2fab..7ceada60a8e 100644 --- a/gcc/ada/libgnat/s-spsufi.ads +++ b/gcc/ada/libgnat/s-spsufi.ads @@ -38,9 +38,9 @@ package System.Storage_Pools.Subpools.Finalization is procedure Finalize_And_Deallocate (Subpool : in out Subpool_Handle); -- This routine performs the following actions: - -- 1) Finalize all objects chained on the subpool's collection + -- 1) Finalize all the objects chained on the subpool's collection -- 2) Remove the subpool from the owner's list of subpools - -- 3) Deallocate the doubly linked list node associated with the subpool - -- 4) Call Deallocate_Subpool + -- 3) Dispatch to the user-defined implementation of Deallocate_Subpool + -- 4) Set Pool_Of_Subpool (Subpool) and then Subpool to null end System.Storage_Pools.Subpools.Finalization; diff --git a/gcc/ada/libgnat/s-stposu.adb b/gcc/ada/libgnat/s-stposu.adb index c6d941af0a0..76032fe8dd8 100644 --- a/gcc/ada/libgnat/s-stposu.adb +++ b/gcc/ada/libgnat/s-stposu.adb @@ -41,8 +41,10 @@ use System.Storage_Pools.Subpools.Finalization; package body System.Storage_Pools.Subpools is - procedure Attach (N : not null SP_Node_Ptr; L : not null SP_Node_Ptr); - -- Attach a subpool node to a pool + procedure Attach + (Subpool : not null Subpool_Handle; + Pool : in out Root_Storage_Pool_With_Subpools'Class); + -- Attach a subpool to a pool ----------------------------------- -- Adjust_Controlled_Dereference -- @@ -140,13 +142,10 @@ package body System.Storage_Pools.Subpools is Subpool := Named_Subpool; end if; - -- Ensure proper ownership and chaining of the subpool + -- Ensure proper ownership if Subpool.Owner /= Root_Storage_Pool_With_Subpools'Class (Pool)'Unchecked_Access - or else Subpool.Node = null - or else Subpool.Node.Prev = null - or else Subpool.Node.Next = null then raise Program_Error with "incorrect owner of subpool"; end if; @@ -258,18 +257,23 @@ package body System.Storage_Pools.Subpools is -- Attach -- ------------ - procedure Attach (N : not null SP_Node_Ptr; L : not null SP_Node_Ptr) is + procedure Attach + (Subpool : not null Subpool_Handle; + Pool : in out Root_Storage_Pool_With_Subpools'Class) + is begin - -- Ensure that the node has not been attached already + -- Ensure that the subpool has not been attached already - pragma Assert (N.Prev = null and then N.Next = null); + pragma Assert (Subpool.Prev = null and then Subpool.Next = null); Lock_Task.all; - L.Next.Prev := N; - N.Next := L.Next; - L.Next := N; - N.Prev := L; + if Pool.Subpools /= null then + Pool.Subpools.Prev := Subpool; + Subpool.Next := Pool.Subpools; + end if; + + Pool.Subpools := Subpool; Unlock_Task.all; @@ -363,18 +367,25 @@ package body System.Storage_Pools.Subpools is -- Detach -- ------------ - procedure Detach (N : not null SP_Node_Ptr) is + procedure Detach + (Subpool : not null Subpool_Handle; + Pool : in out Root_Storage_Pool_With_Subpools'Class) + is begin - -- Ensure that the node is attached to some list - - pragma Assert (N.Next /= null and then N.Prev /= null); - Lock_Task.all; - N.Prev.Next := N.Next; - N.Next.Prev := N.Prev; - N.Prev := null; - N.Next := null; + if Subpool.Prev /= null then + Subpool.Prev.Next := Subpool.Next; + else + Pool.Subpools := Subpool.Next; + end if; + + if Subpool.Next /= null then + Subpool.Next.Prev := Subpool.Prev; + end if; + + Subpool.Prev := null; + Subpool.Next := null; Unlock_Task.all; @@ -396,22 +407,9 @@ package body System.Storage_Pools.Subpools is ------------------- procedure Finalize_Pool (Pool : in out Root_Storage_Pool_With_Subpools) is - Curr_Ptr : SP_Node_Ptr; Ex_Occur : Exception_Occurrence; - Handle : Subpool_Handle; Raised : Boolean := False; - - function Is_Empty_List (L : not null SP_Node_Ptr) return Boolean; - -- Determine whether a list contains only one element, the dummy head - - ------------------- - -- Is_Empty_List -- - ------------------- - - function Is_Empty_List (L : not null SP_Node_Ptr) return Boolean is - begin - return L.Next = L and then L.Prev = L; - end Is_Empty_List; + Subpool : Subpool_Handle; -- Start of processing for Finalize_Pool @@ -430,16 +428,12 @@ package body System.Storage_Pools.Subpools is Pool.Finalization_Started := True; - while not Is_Empty_List (Pool.Subpools'Unchecked_Access) loop - Curr_Ptr := Pool.Subpools.Next; - - -- Finalize and deallocate the subpool. Beware that the node pointed - -- to by Curr_Ptr will be deallocated so may not be passed as actual - -- in the call, since the formal parameter is In Out. + while Pool.Subpools /= null loop + -- Finalize and deallocate the subpool begin - Handle := Curr_Ptr.Subpool; - Finalize_And_Deallocate (Handle); + Subpool := Pool.Subpools; + Finalize_And_Deallocate (Subpool); exception when Fin_Occur : others => @@ -481,27 +475,6 @@ package body System.Storage_Pools.Subpools is end if; end Header_Size_With_Padding; - ---------------- - -- Initialize -- - ---------------- - - overriding procedure Initialize (Controller : in out Pool_Controller) is - begin - Initialize_Pool (Controller.Enclosing_Pool.all); - end Initialize; - - --------------------- - -- Initialize_Pool -- - --------------------- - - procedure Initialize_Pool (Pool : in out Root_Storage_Pool_With_Subpools) is - begin - -- The dummy head must point to itself in both directions - - Pool.Subpools.Next := Pool.Subpools'Unchecked_Access; - Pool.Subpools.Prev := Pool.Subpools'Unchecked_Access; - end Initialize_Pool; - --------------------- -- Pool_Of_Subpool -- --------------------- @@ -519,100 +492,29 @@ package body System.Storage_Pools.Subpools is ---------------- procedure Print_Pool (Pool : Root_Storage_Pool_With_Subpools) is - Head : constant SP_Node_Ptr := Pool.Subpools'Unrestricted_Access; - Head_Seen : Boolean := False; - SP_Ptr : SP_Node_Ptr; - begin -- Output the contents of the pool -- Pool : 0x123456789 -- Subpools : 0x123456789 -- Fin_Start : TRUE FALSE - -- Controller: OK NOK + -- Controller: OK ERROR Put ("Pool : "); Put_Line (Address_Image (Pool'Address)); Put ("Subpools : "); - Put_Line (Address_Image (Pool.Subpools'Address)); + Put_Line (Pool.Subpools'Img); Put ("Fin_Start : "); Put_Line (Pool.Finalization_Started'Img); - Put ("Controlled: "); + Put ("Controller: "); if Pool.Controller.Enclosing_Pool = Pool'Unrestricted_Access then Put_Line ("OK"); else - Put_Line ("NOK (ERROR)"); + Put_Line ("ERROR"); end if; - - SP_Ptr := Head; - while SP_Ptr /= null loop -- Should never be null - Put_Line ("V"); - - -- We see the head initially; we want to exit when we see the head a - -- second time. - - if SP_Ptr = Head then - exit when Head_Seen; - - Head_Seen := True; - end if; - - -- The current element is null. This should never happend since the - -- list is circular. - - if SP_Ptr.Prev = null then - Put_Line ("null (ERROR)"); - - -- The current element points back to the correct element - - elsif SP_Ptr.Prev.Next = SP_Ptr then - Put_Line ("^"); - - -- The current element points to an erroneous element - - else - Put_Line ("? (ERROR)"); - end if; - - -- Output the contents of the node - - Put ("|Header: "); - Put (Address_Image (SP_Ptr.all'Address)); - if SP_Ptr = Head then - Put_Line (" (dummy head)"); - else - Put_Line (""); - end if; - - Put ("| Prev: "); - - if SP_Ptr.Prev = null then - Put_Line ("null"); - else - Put_Line (Address_Image (SP_Ptr.Prev.all'Address)); - end if; - - Put ("| Next: "); - - if SP_Ptr.Next = null then - Put_Line ("null"); - else - Put_Line (Address_Image (SP_Ptr.Next.all'Address)); - end if; - - Put ("| Subp: "); - - if SP_Ptr.Subpool = null then - Put_Line ("null"); - else - Put_Line (Address_Image (SP_Ptr.Subpool.all'Address)); - end if; - - SP_Ptr := SP_Ptr.Next; - end loop; end Print_Pool; ------------------- @@ -630,30 +532,20 @@ package body System.Storage_Pools.Subpools is -- Owner : 0x123456789 -- Collection: 0x123456789 - -- Node : 0x123456789 + -- Prev : 0x123456789 + -- Next : 0x123456789 - Put ("Owner : "); - if Subpool.Owner = null then - Put_Line ("null"); - else - Put_Line (Address_Image (Subpool.Owner'Address)); - end if; + Put ("Owner : "); + Put_Line (Subpool.Owner'Img); Put ("Collection: "); Put_Line (Address_Image (Subpool.Collection'Address)); - Put ("Node : "); - if Subpool.Node = null then - Put ("null"); + Put ("Prev : "); + Put_Line (Subpool.Prev'Img); - if Subpool.Owner = null then - Put_Line (" OK"); - else - Put_Line (" (ERROR)"); - end if; - else - Put_Line (Address_Image (Subpool.Node'Address)); - end if; + Put ("Next : "); + Put_Line (Subpool.Next'Img); end Print_Subpool; ------------------------- @@ -664,8 +556,6 @@ package body System.Storage_Pools.Subpools is (Subpool : not null Subpool_Handle; To : in out Root_Storage_Pool_With_Subpools'Class) is - N_Ptr : SP_Node_Ptr; - begin -- If the subpool is already owned, raise Program_Error. This is a -- direct violation of the RM rules. @@ -684,15 +574,7 @@ package body System.Storage_Pools.Subpools is Subpool.Owner := To'Unchecked_Access; - -- Create a subpool node and decorate it. Since this node is not - -- allocated on the owner's pool, it must be explicitly destroyed by - -- Finalize_And_Detach. - - N_Ptr := new SP_Node; - N_Ptr.Subpool := Subpool; - Subpool.Node := N_Ptr; - - Attach (N_Ptr, To.Subpools'Unchecked_Access); + Attach (Subpool, To); end Set_Pool_Of_Subpool; ------------------- diff --git a/gcc/ada/libgnat/s-stposu.ads b/gcc/ada/libgnat/s-stposu.ads index 13d7889471a..0a1d7e1b419 100644 --- a/gcc/ada/libgnat/s-stposu.ads +++ b/gcc/ada/libgnat/s-stposu.ads @@ -75,10 +75,9 @@ package System.Storage_Pools.Subpools is Size_In_Storage_Elements : System.Storage_Elements.Storage_Count; Alignment : System.Storage_Elements.Storage_Count; Subpool : not null Subpool_Handle) is abstract; + -- The precondition specified in the RM is illegal: + -- with Pre'Class => Pool_Of_Subpool (Subpool) = Pool'Access; - -- ??? This precondition causes errors in simple tests, disabled for now - - -- with Pre'Class => Pool_Of_Subpool (Subpool) = Pool'Access; -- This routine requires implementation. Allocate an object described by -- Size_In_Storage_Elements and Alignment on a subpool. @@ -99,7 +98,7 @@ package System.Storage_Pools.Subpools is (Pool : in out Root_Storage_Pool_With_Subpools; Subpool : in out Subpool_Handle) is abstract; - -- This precondition causes errors in simple tests, disabled for now??? + -- The precondition specified in the RM is illegal: -- with Pre'Class => Pool_Of_Subpool (Subpool) = Pool'Access; -- This routine requires implementation. Reclaim the storage a particular @@ -144,9 +143,6 @@ package System.Storage_Pools.Subpools is -- of Ada.Containers.Bounded_Indefinite_Holders. private - -- SP_Nodes are created on the heap, while collection nodes and associated - -- objects are created on the pool_with_subpools. - type Any_Storage_Pool_With_Subpools_Ptr is access all Root_Storage_Pool_With_Subpools'Class; for Any_Storage_Pool_With_Subpools_Ptr'Storage_Size use 0; @@ -157,40 +153,12 @@ private type Pool_Controller (Enclosing_Pool : Any_Storage_Pool_With_Subpools_Ptr) is new Ada.Finalization.Limited_Controlled with null record; - -- Subpool list types. Each pool_with_subpools contains a list of subpools. - -- This is an indirect doubly linked list since subpools are not supposed - -- to be allocatable by language design. - - type SP_Node; - type SP_Node_Ptr is access all SP_Node; - - type SP_Node is record - Prev : SP_Node_Ptr := null; - Next : SP_Node_Ptr := null; - Subpool : Subpool_Handle := null; - end record; - - -- Root_Storage_Pool_With_Subpools internal structure. The type uses a - -- special controller to perform initialization and finalization actions - -- on itself. This is necessary because the end user of this package may - -- decide to override Initialize and Finalize, thus disabling the desired - -- behavior. - - -- Pool_With_Subpools SP_Node SP_Node SP_Node - -- +-->+--------------------+ +-----+ +-----+ +-----+ - -- | | Subpools -------->| ------->| ------->| -------> - -- | +--------------------+ +-----+ +-----+ +-----+ - -- | |Finalization_Started| : : : : : : - -- | +--------------------+ - -- +--- Controller.Encl_Pool| - -- +--------------------+ - -- : End-user : - -- : components : + -- Root_Storage_Pool_With_Subpools internal structure type Root_Storage_Pool_With_Subpools is abstract new Root_Storage_Pool with record - Subpools : aliased SP_Node; + Subpools : Subpool_Handle := null; -- A doubly linked list of subpools Finalization_Started : Boolean := False; @@ -205,32 +173,7 @@ private -- finalized at the appropriate places. end record; - -- A subpool is an abstraction layer which sits on top of a pool. It - -- contains links to all controlled objects allocated on a particular - -- subpool. - - -- Pool_With_Subpools SP_Node SP_Node SP_Node - -- +-->+--------------------+ +-----+ +-----+ +-----+ - -- | | Subpools -------->| ------->| ------->| -------> - -- | +--------------------+ +-----+ +-----+ +-----+ - -- | |Finalization_Started|<------ |<------- |<------- |<--- - -- | +--------------------+ +-----+ +-----+ +-----+ - -- +--- Controller.Encl_Pool| | nul | | + | | + | - -- | +--------------------+ +-----+ +--|--+ +--:--+ - -- | : : Dummy | ^ : - -- | : : | | : - -- | Root_Subpool V | - -- | +-------------+ | - -- +-------------------------------- Owner | | - -- Collection nodes +-------------+ | - -- +-----+ +-----+<-- | Collection | - -- <------ |<------ | +-------------+ | - -- +-----+ +-----+ | Node -------+ - -- | ------>| -----> +-------------+ - -- +-----+ +-----+ : : - -- |ctrl | Dummy : : - -- | obj | - -- +-----+ + -- Root_Subpool internal structure type Root_Subpool is abstract tagged limited record Owner : Any_Storage_Pool_With_Subpools_Ptr := null; @@ -239,11 +182,41 @@ private Collection : aliased Finalization_Primitives.Finalization_Collection; -- A collection of controlled objects - Node : SP_Node_Ptr := null; - -- A link to the doubly linked list node which contains the subpool. - -- This back pointer is used in subpool deallocation. + Prev : Subpool_Handle := null; + Next : Subpool_Handle := null; + -- Links for the doubly linked list which contains the subpool end record; + -- The subpool is an abstraction layer that sits on top of a pool and + -- contains links to all controlled objects allocated on this subpool. + -- + -- Pool_With_Subpools + -- +-->+--------------------+ + -- | | Subpools ---------------+ + -- | +--------------------+ | + -- | |Finalization_Started| | + -- | +--------------------+ | + -- +--- Controller.Encl_Pool| | + -- | +--------------------+ V + -- | : : Subpool Subpool + -- | +-------------+ +-------------+ + -- +--------------------------<----- Owner | <----- Owner | + -- +-------------+ +-------------+ + -- +---------------- | Collection | | Collection | + -- | +-------------+ +-------------+ + -- | | Prev | <---- Prev | + -- | | Next ------> | Next ------> + -- V +-------------+ +-------------+ + -- Node Node : : : : + -- +-----+ +-----+ + -- <------ |<------ | + -- +-----+ +-----+ + -- | ------>| -----> + -- +-----+ +-----+ + -- Dummy |ctrl | + -- | obj | + -- +-----+ + procedure Adjust_Controlled_Dereference (Addr : in out System.Address; Storage_Size : in out System.Storage_Elements.Storage_Count; @@ -316,8 +289,10 @@ private -- * Is_Controlled - A flag which determines whether the allocated object -- is controlled. When set to True, the address must be displaced. - procedure Detach (N : not null SP_Node_Ptr); - -- Unhook a subpool node from an arbitrary subpool list + procedure Detach + (Subpool : not null Subpool_Handle; + Pool : in out Root_Storage_Pool_With_Subpools'Class); + -- Detach a subpool from a pool overriding procedure Finalize (Controller : in out Pool_Controller); -- Buffer routine, calls Finalize_Pool @@ -334,12 +309,6 @@ private -- precedes a controlled object as the nearest multiple rounded up of the -- alignment. - overriding procedure Initialize (Controller : in out Pool_Controller); - -- Buffer routine, calls Initialize_Pool - - procedure Initialize_Pool (Pool : in out Root_Storage_Pool_With_Subpools); - -- Setup the doubly linked list of subpools - procedure Print_Pool (Pool : Root_Storage_Pool_With_Subpools); -- Debug routine, output the contents of a pool_with_subpools From patchwork Tue Jun 2 08:44:54 2026 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: 136243 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C99A34BA23DF for ; Tue, 2 Jun 2026 08:54:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C99A34BA23DF Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=gL5feLHf X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id 1D5F14BA23DC for ; Tue, 2 Jun 2026 08:46:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1D5F14BA23DC 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 1D5F14BA23DC Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389962; cv=none; b=AS6D6vVS/eMqE5qohaQ4trBrXLVejt5hjxg2F+VeNMnFBCG/ct0lo+bbZOTl433alrKHBAo7bHI867GqC92PFWV9mcw6wsdg1R30RFqR2Oy8zX+nHRi4xj1RYlKvKhTa7B262kSUC/Nw5OWzuuSJb6zU+0kGLcx20baEm2cJH/8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389962; c=relaxed/simple; bh=beKg4mAeVZFIGnQvOmByp4aFZfTIVf8UToVpRC0p5gc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=uE8c3/jE592OmiagJzzOIlnclLgF7JofYgnt+7kimf0CJiNAlghwfd6zfj0bzD3l+AJo+ckbJxjXC5ybRd2zoOjUoHt6OCEa8k4jWYXixPkLFCT3/dTcdzm18EBl+HQCcQ0zA8d90pk6nonzkrp0uGE1sFAOzYcPCZwhTz/pfbc= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=gL5feLHf DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1D5F14BA23DC Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-45eec22fab7so2627447f8f.3 for ; Tue, 02 Jun 2026 01:46:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389961; x=1780994761; 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=oBHB8D5LHwsaCNWlig6Njra6mbPuzKlMTXvKPG6vdSw=; b=gL5feLHf0g5enK9LpL1JkID3uawJ8K0n8hExcxpRjJo4gAbUIHPUlx7GoEzs1dBoeQ LAyikpfMxH+73+2sygwUqXcCxhhD54hvbs7rj21PTv7cxZU3ECZlK+0I1ewjnZkkK/kx Omt8eZKax+njJkfFuy75yu1BGRAsYndsEU4iNpSkqCcgEkzZGI2y/UUxOpANLu0Se5AR g4DYt+9UrcQk35HGJbCEfoRYEoYULE1HHUZI3Gr8gDxrwWISFcmbxvlZoYFCghQJnuV0 hadzvhgvHTkkl7soOE4O0l3bIGZlzKceSgDvzn4lobdKqXYQv36E0r5wTs9K+g+cyGnk mz+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389961; x=1780994761; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=oBHB8D5LHwsaCNWlig6Njra6mbPuzKlMTXvKPG6vdSw=; b=AofjVTCyzIdFLOlB5zgIRm/gNMgqqpGs08guDFSwfqs9/5KxWmbPrFoWgL8BnPx7y0 2EPNfcBkOYXxulqrJ1yjIfvJBBx2Fs2NsNKL8hQMf+0c6yEC/K2EQtROOSO/pNiqk0WZ NrSb8jIPjjGI+1aWh2i5ff3s0YHPi3UAq0B6hvY+1h+ZGFuolcRadqMJbelSHT34YVZg jzV8dX+O7z6kp17aDe6IAvngRn3JHptsulKbST0vcVx1Kxk3F6JlZMivXMhDfld48UaH wDO+FB2koRYPYJ6Rv6500xgwY4W9epLqSEwSp4Quq1e6ITHKGMnnI1bPdfVd6Ldtcwl4 aIwA== X-Gm-Message-State: AOJu0Yz24IGbkLtwTh7bUNUXnr8Paac5vCBhmSZA1x+d+bu4vcrwPq2R 4cnwrzVOfUFj0lJUttsn8b1K0U8aY33fgYu+Not213W2C8tSUuJ39lex3HW8h5pbQSkVAKR0LCT yRNQ= X-Gm-Gg: Acq92OFdhceosVcJJjOFtYtquKc/G6YtcgpJ32JSG8+BusbQSYfjduOb0D9JYg3twxp YzhCnCSTxZzeFgBb4xKM034G1VZJ4IRjkLTaYQEGh7Nz9k/tVW04/DtMQ2tC+JI5EA+fw0YDGMH bappELJhYAtUdKF7JZ5SvX7Fk7+iUYQpdMVXDajQHt7Gu4PPTsrmhDRjLBWwBd3+IIdiVr6uimn IrwEkW9IU9NvQyuE6nC6qz616q2wnfGaKDebO7VLH0y1481ykFI0UtbS7PJWTYMCpLtCyVqZhs2 XFd8t1b3nZdY4u3BrN30yfT0KCSk8PxSld9DRmkvCRYBU6qqJi5U4F2yuDH4GZAlxNmZ5iyIayU gh1QZ1iLJkboE1nhm07XlOYhbk2OLJTWntqg+iJD0f6Py2LN0KoaF38vJg0HP2lb/5II2t5LazK PKAluUtl2JSDIgMmbS0SKLbguoURkJYPSkS3Ea+4kZD70KAETfe2dg41pamnpx0Qd+D+D7DMBDg Y2qytCkcpZ0yn6BwjHqyOzNNzGrHIk= X-Received: by 2002:a05:600c:c16b:b0:490:b26f:a512 with SMTP id 5b1f17b1804b1-490b26fa58bmr27919205e9.0.1780389961007; Tue, 02 Jun 2026 01:46:01 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:00 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 06/51] ada: Small consistency fixes Date: Tue, 2 Jun 2026 10:44:54 +0200 Message-ID: <20260602084541.3829876-6-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Eric Botcazou Build_Activation_Chain_Entity and Build_Master_Entity from Exp_Ch9 are very similar but the former takes a Node while the latter takes an Entity. This aligns the latter with the former. No functional changes. gcc/ada/ChangeLog: * exp_aggr.adb (Build_Array_Aggr_Code): Adjust actual parameter in the call to Build_Master_Entity. * exp_ch3.adb (Expand_N_Full_Type_Declaration): Likewise. (Expand_N_Object_Declaration): Likewise. (Expand_Previous_Access_Type): Likewise. * exp_ch6.adb (Make_Build_In_Place_Call_In_Anonymous_Context): Likewise. (Make_Build_In_Place_Iface_Call_In_Allocator): Likewise. (Make_Build_In_Place_Iface_Call_In_Anonymous_Context): Likewise. * sem_ch3.adb (Access_Definition): Likewise. (Access_Type_Declaration): Likewise. * exp_ch9.ads (Build_Activation_Chain_Entity): Tweak description. (Build_Master_Entity): Change parameter and tweak description. * exp_ch9.adb (Build_Master_Entity): Change parameter and adjust. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_aggr.adb | 2 +- gcc/ada/exp_ch3.adb | 10 +++++----- gcc/ada/exp_ch6.adb | 6 +++--- gcc/ada/exp_ch9.adb | 16 ++++------------ gcc/ada/exp_ch9.ads | 18 ++++++++---------- gcc/ada/sem_ch3.adb | 6 +++--- 6 files changed, 24 insertions(+), 34 deletions(-) diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index 4077a8e17d2..2f653dd123e 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -2060,7 +2060,7 @@ package body Exp_Aggr is -- in-place functions are called in the expanded code. if Nkind (Parent (N)) = N_Object_Declaration and then Has_Task (Typ) then - Build_Master_Entity (Defining_Identifier (Parent (N))); + Build_Master_Entity (Parent (N)); end if; -- STEP 1: Process component associations diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 38aafbf7578..843dc173c25 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -6866,7 +6866,7 @@ package body Exp_Ch3 is -- for such a type. if Has_Task (Desig_Typ) then - Build_Master_Entity (Ptr_Typ); + Build_Master_Entity (N); Build_Master_Renaming (Ptr_Typ); -- Create a class-wide master because a Master_Id must be generated @@ -6885,7 +6885,7 @@ package body Exp_Ch3 is elsif not Is_Param_Block_Component_Type (Ptr_Typ) and then Is_Limited_Class_Wide_Type (Desig_Typ) then - Build_Master_Entity (Ptr_Typ); + Build_Master_Entity (N); Build_Master_Renaming (Ptr_Typ); end if; end Build_Master; @@ -6956,7 +6956,7 @@ package body Exp_Ch3 is -- Ensure that the record or array type have a _master if First then - Build_Master_Entity (Def_Id); + Build_Master_Entity (N); Build_Master_Renaming (Typ); M_Id := Master_Id (Typ); @@ -7874,7 +7874,7 @@ package body Exp_Ch3 is Build_Activation_Chain_Entity (N); if Has_Task (Typ) or else Has_BIP_Init_Expr then - Build_Master_Entity (Def_Id); + Build_Master_Entity (N); end if; end if; @@ -9567,7 +9567,7 @@ package body Exp_Ch3 is then -- Ensure that the designated type has a master - Build_Master_Entity (Def_Id); + Build_Master_Entity (Parent (Def_Id)); -- Private and incomplete types complicate the insertion of master -- renamings because the access type may precede the full view of diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 5ae609c47e4..6d434507d45 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -8982,7 +8982,7 @@ package body Exp_Ch6 is if Has_Tasks then Build_Activation_Chain_Entity (Temp_Decl); - Build_Master_Entity (Temp_Id); + Build_Master_Entity (Temp_Decl); end if; Make_Build_In_Place_Call_In_Object_Declaration @@ -9580,7 +9580,7 @@ package body Exp_Ch6 is Insert_Action (Allocator, Tmp_Decl); Expander_Mode_Restore; - Build_Master_Entity (Anon_Type); + Build_Master_Entity (Tmp_Decl); Build_Master_Renaming (Anon_Type); Make_Build_In_Place_Call_In_Allocator @@ -9638,7 +9638,7 @@ package body Exp_Ch6 is Expander_Mode_Restore; Build_Activation_Chain_Entity (Tmp_Decl); - Build_Master_Entity (Tmp_Id); + Build_Master_Entity (Tmp_Decl); Make_Build_In_Place_Iface_Call_In_Object_Declaration (Obj_Decl => Tmp_Decl, diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index 040ffb22204..77e19f905bd 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -3033,13 +3033,11 @@ package body Exp_Ch9 is -- Build_Master_Entity -- ------------------------- - procedure Build_Master_Entity (Obj_Or_Typ : Entity_Id) is - Loc : constant Source_Ptr := Sloc (Obj_Or_Typ); + procedure Build_Master_Entity (N : Node_Id) is Context : Node_Id; Context_Id : Entity_Id; Decl : Node_Id; Decls : List_Id; - Par : Node_Id; begin -- No action needed if the run-time has no tasking support @@ -3048,18 +3046,12 @@ package body Exp_Ch9 is return; end if; - if Is_Itype (Obj_Or_Typ) then - Par := Associated_Node_For_Itype (Obj_Or_Typ); - else - Par := Parent (Obj_Or_Typ); - end if; - -- When creating a master for a record component which is either a task -- or access-to-task, the enclosing record is the master scope and the -- proper insertion point is the component list. if Is_Record_Type (Current_Scope) then - Context := Par; + Context := N; Context_Id := Current_Scope; Decls := List_Containing (Context); @@ -3068,7 +3060,7 @@ package body Exp_Ch9 is -- return statement. else - Find_Enclosing_Context (Par, Context, Context_Id, Decls); + Find_Enclosing_Context (N, Context, Context_Id, Decls); end if; pragma Assert (not Is_Finalizer (Context_Id)); @@ -3079,7 +3071,7 @@ package body Exp_Ch9 is return; end if; - Decl := Build_Master_Declaration (Loc); + Decl := Build_Master_Declaration (Sloc (N)); -- The master is inserted at the start of the declarative list of the -- context. diff --git a/gcc/ada/exp_ch9.ads b/gcc/ada/exp_ch9.ads index a4354eeec85..3d882f2262d 100644 --- a/gcc/ada/exp_ch9.ads +++ b/gcc/ada/exp_ch9.ads @@ -37,11 +37,9 @@ package Exp_Ch9 is -- protected subprogram. procedure Build_Activation_Chain_Entity (N : Node_Id); - -- Given a declaration N of an object that is a task, or contains tasks - -- (other than allocators to tasks) this routine ensures that an activation - -- chain has been declared in the appropriate scope, building the required - -- declaration for the chain variable if not. The name of this variable - -- is always _Chain and it is accessed by name. + -- Given a construct N that involves tasks (other than allocators to tasks) + -- create a _Chain entity in the appropriate scope to be used as activation + -- chain if there is not already one. function Build_Call_With_Task (N : Node_Id; E : Entity_Id) return Node_Id; -- N is a node representing the name of a task or an access to a task. @@ -56,11 +54,11 @@ package Exp_Ch9 is -- For targets where tasks or tasking hierarchies are prohibited, generate: -- _Master : constant Integer := Library_Task_Level; - procedure Build_Master_Entity (Obj_Or_Typ : Entity_Id); - -- Given the name of an object or a type which is either a task, contains - -- tasks or designates tasks, create a _Master in the appropriate scope - -- which captures the value of Current_Master. Mark the nearest enclosing - -- body or block as being a task master. + procedure Build_Master_Entity (N : Node_Id); + -- Given a construct N that involves or designates tasks, create a _Master + -- entity in the appropriate scope if there is not already one, which will + -- capture the value of Current_Master. Mark the nearest enclosing body or + -- block as being a task master. function Build_Master_Renaming_Declaration (Ptr_Typ : Entity_Id; diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 1cfe48db4d7..99799431d87 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -956,7 +956,7 @@ package body Sem_Ch3 is if Is_Limited_Record (Desig_Type) and then Is_Class_Wide_Type (Desig_Type) then - Build_Master_Entity (Defining_Identifier (Related_Nod)); + Build_Master_Entity (Related_Nod); Build_Master_Renaming (Anon_Type); -- Similarly, if the type is an anonymous access that designates @@ -965,7 +965,7 @@ package body Sem_Ch3 is elsif Has_Task (Desig_Type) and then Comes_From_Source (Related_Nod) then - Build_Master_Entity (Defining_Identifier (Related_Nod)); + Build_Master_Entity (Related_Nod); Build_Master_Renaming (Anon_Type); end if; end if; @@ -1385,7 +1385,7 @@ package body Sem_Ch3 is if From_Limited_With (Entity (S)) and then not Is_Class_Wide_Type (Entity (S)) then - Build_Master_Entity (T); + Build_Master_Entity (Def); Build_Master_Renaming (T); end if; From patchwork Tue Jun 2 08:44:55 2026 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: 136238 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E3C2A4BA2E2B for ; Tue, 2 Jun 2026 08:50:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E3C2A4BA2E2B Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=ib1zQOrQ X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id E8BBE4BA23E0 for ; Tue, 2 Jun 2026 08:46:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E8BBE4BA23E0 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 E8BBE4BA23E0 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389963; cv=none; b=ZD9dpqf/UY38ikyLaF3yYfV2T7Zv2ny9Sfy9zwPodc69sr5URpejsSqoKza6eB1uYlnkhcawUVrMwmg1r23GhKkn/FCSPBRBrQTK8o6LVT6vhw2pebIpZj1vTv0JZBQX8oTRaXhw820gU5l+HHyDRp6FaFv38WhJQLWPjDWnYCI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389963; c=relaxed/simple; bh=/NSWK4ioTO4fNWdMUmiH+zgmysERU4Mti6Ut9Yfqk48=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=jO4lhrwZknYx83b3U1jvHONGhANDG+79OVgCKRYKrATHRqFax0vXmqhK04y3YXBi7dKwx46Cbeezl5Y8RAfHyVj2W5PrqH10F78UyVNp9YsjSwRascS9xIGPTLL3Ue0A4gHgFAqX5TuIksO0Uzh/usEIoUBNqtphKMfXTDoSn4s= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=ib1zQOrQ DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E8BBE4BA23E0 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-490a7629380so22446865e9.0 for ; Tue, 02 Jun 2026 01:46:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389962; x=1780994762; 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=skWA9kcDMHgZBFXqkzsGxAbdkryqeav2zcX4SzIj2HQ=; b=ib1zQOrQW1Wff+IeNQ8vEkbmcIm9FjZkJ4DGWmdvYvuySMQkO8yHHVxWQsHT/4ruqM 1+uU5idOBB2+55T5JNgEBUTpBHrj7TvpiOwR3Dft+CYCYdHrFIu3A1cDT3/kqGCMIbsI YNeyzH7Kv5uRJ4eQWfQMnUpUOjJ/zj2Z1zj8O1Ewu6ZeB2letzBOjfNQg2L++/zOk/pV biMDI0B5rpB+ayQqqghiW4yUCdrmtiJ1exR21TldQMZMfZvRdRZQT677ziSgqsqMRQSk lQKfvLbmf4seDsaZxc35adrQ3J/i0y15Wu8/23/KrNWs71JKtDtWHSbRKYCHe4OQAepA CNQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389962; x=1780994762; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=skWA9kcDMHgZBFXqkzsGxAbdkryqeav2zcX4SzIj2HQ=; b=OLpljbzbQKOB716kR9GjWF7big7pysvYgJR6wlJabNkJCilh3DUiLFJOFiJ9exworV ba5DoSx7CamjV8N9Yd2qcc7tmIfQfK85aEB5BcXgWh1sGDB+w3/3NjNN4y4KL+vjf1hS fLDLDIlz5N84T2tynv5E+Lg3hlxdUONqq+oj1d2EFxRoamFSAErvS2cz6pZo5CeowteT MOcO8ab8BMI9R5JFnjAQ7pV5XH6Crw8us/B0pQgB7sEAcFFHdKqHSGHZnqBhaS34zIWF czZltD8hwaW/sol6huhH16nXw8KONSN+0RPB9268o8IkePSn7iWamok6w1vX0+2Yvqp/ Fwig== X-Gm-Message-State: AOJu0YyIaGjCAV9BhHKIbS69eLjGJ0Wbh8deJw7sYh5/m91XGhV3RG1p UbN7vEEyf+Jq0ZEIkGeyk/nv7Bd02IX/kaZv5/3anr7DcUehJVbAc3xtupefvy+yz+kB68v4tT6 5Sj4= X-Gm-Gg: Acq92OGpEQ2cpaM8NtSmDLNUzfVkb9HjMyTUfxdol3G5HY1W7tg9jFxMj014DTPE/dZ aUZycF3SG/eKxGjHhWXV0hwjRsuD2pvlIPIe/BcT0ZdN+iAgDpls1C6tgaqab6XaYOTgSoOU2Se RvQOSQjDMjQKCBTXSY2GUjw7YzUqarN3Nxyw5ae+6Tge7AhH8j0ZaWiE8oimk/s6QT9eU0Zifxk ZmVsutiC5nRrKqHNS/jDyYt1U+zeUdXREh7DYPC3g6+gVePscjMmd5Q/X/M8rTojWdBppiNXXea bWzzjxendmuje3hYhN93d03tF7UbfH4RNtqojZ8v94AwEoEm1772lxR44TyKl1kc9thwJhhPHnU Qw55QnFKl9XkRdETyBJcwtqyTOp6DeZdAlC2ugDU4+2GGYJqhBBucWhDhFRZm0TvFsG0+QQczg+ 1OunLP8URMtnAK+vIPSFsAfGIdKPhXMyOcB6AIdlJ9sWvKaj5rD5dUyVMuI7FGuEK+uiNg6Cu97 uIoQ3svF4nQtdEKu67DBX8xiNw9+Q8= X-Received: by 2002:a05:600c:450b:b0:490:3fa2:1b93 with SMTP id 5b1f17b1804b1-490a291fa5bmr280362775e9.13.1780389961754; Tue, 02 Jun 2026 01:46:01 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:01 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Ronan Desplanques Subject: [COMMITTED 07/51] ada: Restore alphabetical ordering in Sem_Util Date: Tue, 2 Jun 2026 10:44:55 +0200 Message-ID: <20260602084541.3829876-7-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> 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, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Ronan Desplanques gcc/ada/ChangeLog: * sem_util.adb, sem_util.ads (Partially_Visible_Subcomponent): Move to right spot. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_util.adb | 186 +++++++++++++++++++++---------------------- gcc/ada/sem_util.ads | 20 ++--- 2 files changed, 103 insertions(+), 103 deletions(-) diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 0f576a3941c..89060c31acd 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -26981,6 +26981,99 @@ package body Sem_Util is return Empty; end Param_Entity; + ------------------------------------ + -- Partially_Visible_Subcomponent -- + ------------------------------------ + + function Partially_Visible_Subcomponent + (Type_Id : Entity_Id) return Entity_Id + is + Ancestor : constant Entity_Id := Base_Type (Type_Id); + + function Trace_Components + (T : Entity_Id; + Check : Boolean) return Entity_Id; + -- Recursive function that does the work, and checks against circular + -- definition for each subcomponent type. + + ---------------------- + -- Trace_Components -- + ---------------------- + + function Trace_Components + (T : Entity_Id; + Check : Boolean) return Entity_Id + is + Btype : constant Entity_Id := Base_Type (T); + Component : Entity_Id; + P : Entity_Id; + Candidate : Entity_Id := Empty; + + begin + if Check and then Btype = Ancestor then + Error_Msg_N ("circular type definition", Type_Id); + return Any_Type; + end if; + + if Is_Private_Type (Btype) and then not Is_Generic_Type (Btype) then + if Present (Full_View (Btype)) + and then Is_Record_Type (Full_View (Btype)) + and then not Is_Frozen (Btype) + then + -- To indicate that the ancestor depends on a private type, the + -- current Btype is sufficient. However, to check for circular + -- definition we must recurse on the full view. + + Candidate := Trace_Components (Full_View (Btype), True); + + if Candidate = Any_Type then + return Any_Type; + else + return Btype; + end if; + + else + return Btype; + end if; + + elsif Is_Array_Type (Btype) then + return Trace_Components (Component_Type (Btype), True); + + elsif Is_Record_Type (Btype) then + Component := First_Entity (Btype); + while Present (Component) + and then Comes_From_Source (Component) + loop + -- Skip anonymous types generated by constrained components + + if not Is_Type (Component) then + P := Trace_Components (Etype (Component), True); + + if Present (P) then + if P = Any_Type then + return P; + else + Candidate := P; + end if; + end if; + end if; + + Next_Entity (Component); + end loop; + + return Candidate; + + else + return Empty; + end if; + end Trace_Components; + + -- Start of processing for Private_Component + + begin + return Trace_Components (Type_Id, False); + end Partially_Visible_Subcomponent; + ---------------------- -- Policy_In_Effect -- ---------------------- @@ -27241,99 +27334,6 @@ package body Sem_Util is end if; end Predicate_Tests_On_Arguments; - ------------------------------------ - -- Partially_Visible_Subcomponent -- - ------------------------------------ - - function Partially_Visible_Subcomponent - (Type_Id : Entity_Id) return Entity_Id - is - Ancestor : constant Entity_Id := Base_Type (Type_Id); - - function Trace_Components - (T : Entity_Id; - Check : Boolean) return Entity_Id; - -- Recursive function that does the work, and checks against circular - -- definition for each subcomponent type. - - ---------------------- - -- Trace_Components -- - ---------------------- - - function Trace_Components - (T : Entity_Id; - Check : Boolean) return Entity_Id - is - Btype : constant Entity_Id := Base_Type (T); - Component : Entity_Id; - P : Entity_Id; - Candidate : Entity_Id := Empty; - - begin - if Check and then Btype = Ancestor then - Error_Msg_N ("circular type definition", Type_Id); - return Any_Type; - end if; - - if Is_Private_Type (Btype) and then not Is_Generic_Type (Btype) then - if Present (Full_View (Btype)) - and then Is_Record_Type (Full_View (Btype)) - and then not Is_Frozen (Btype) - then - -- To indicate that the ancestor depends on a private type, the - -- current Btype is sufficient. However, to check for circular - -- definition we must recurse on the full view. - - Candidate := Trace_Components (Full_View (Btype), True); - - if Candidate = Any_Type then - return Any_Type; - else - return Btype; - end if; - - else - return Btype; - end if; - - elsif Is_Array_Type (Btype) then - return Trace_Components (Component_Type (Btype), True); - - elsif Is_Record_Type (Btype) then - Component := First_Entity (Btype); - while Present (Component) - and then Comes_From_Source (Component) - loop - -- Skip anonymous types generated by constrained components - - if not Is_Type (Component) then - P := Trace_Components (Etype (Component), True); - - if Present (P) then - if P = Any_Type then - return P; - else - Candidate := P; - end if; - end if; - end if; - - Next_Entity (Component); - end loop; - - return Candidate; - - else - return Empty; - end if; - end Trace_Components; - - -- Start of processing for Private_Component - - begin - return Trace_Components (Type_Id, False); - end Partially_Visible_Subcomponent; - --------------------------- -- Primitive_Names_Match -- --------------------------- diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index 98a7ae8be51..df7296d527f 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -3041,6 +3041,16 @@ package Sem_Util is -- of the corresponding formal entity, otherwise returns Empty. Also -- handles the case of references to renamings of formals. + function Partially_Visible_Subcomponent + (Type_Id : Entity_Id) return Entity_Id; + -- If there exist any subcomponents of Type_Id whose types are currently + -- only partially visible, returns one such subcomponent. Otherwise returns + -- Empty. Used to enforce the rules on visibility of operations on + -- composite types, that depend on the full view of the subcomponent types. + -- + -- We say that a type is "partially visible" when it has a partial view + -- that is currently visible but no full view that is currently visible. + function Policy_In_Effect (Policy : Name_Id; Level : Name_Id := No_Name) @@ -3093,16 +3103,6 @@ package Sem_Util is -- with a special name to avoid being overridden (i.e. return true in case -- of entities with names "nameP" and "name" or vice versa). - function Partially_Visible_Subcomponent - (Type_Id : Entity_Id) return Entity_Id; - -- If there exist any subcomponents of Type_Id whose types are currently - -- only partially visible, returns one such subcomponent. Otherwise returns - -- Empty. Used to enforce the rules on visibility of operations on - -- composite types, that depend on the full view of the subcomponent types. - -- - -- We say that a type is "partially visible" when it has a partial view - -- that is currently visible but no full view that is currently visible. - procedure Process_End_Label (N : Node_Id; Typ : Character; From patchwork Tue Jun 2 08:44:56 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 136252 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3232D4BA2E2B for ; Tue, 2 Jun 2026 09:01:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3232D4BA2E2B Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=WmZ0Mrnz X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by sourceware.org (Postfix) with ESMTPS id CA7D24BA2E32 for ; Tue, 2 Jun 2026 08:46:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CA7D24BA2E32 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 CA7D24BA2E32 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::334 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389967; cv=none; b=Xxww2QNqQaKYrxbs7Qtnh60/oSdxHQHkuN37YfsIPM7e9pqWsiA6xw70mXepI/b1yUPPBI5h+HZpWcj4Ngm151G5D2gjnL7CgWrAwCO5UF/3lIdWsj9VFzaFWP1xLlXIoqnbE/n+SJ3bv9t7B9CibzZsmysIcL2QgybIvDtxzy4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389967; c=relaxed/simple; bh=8mHR18BulVukeTiUAgE+HAhqOOspptgIMKPfP8a/Bv0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=BS38iW66BWF5cs9OuMctVYE6dZcCyk3nbY0dWJYjrjzUYQvN2eGiRZSLmqYZYpTt/DdZnHIl8V6X7B/vhLbrWPrXlX+WXQ66G+vT0sqViHWE6lr9xdqi41axj7JD1dgQKYCLSTY7XAPNPCRscb0kp4wX4dOGnsc8xy/aQDq0TMs= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=WmZ0Mrnz DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA7D24BA2E32 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-490abf12f0fso8674425e9.0 for ; Tue, 02 Jun 2026 01:46:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389966; x=1780994766; 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=VBpjLmT84d/CUzmG7YuKeJ3j+s1JkUQhluUMJUResB0=; b=WmZ0MrnzIRr6gT4E38zD+THdivRtYfOGMzW2HLyRjKnIlONMCQCHl7mN+wUursgltv zhXLxPhe+S0Ua1UWFMpMzgJ7o95+f3v966YUI0ft+srnhBMfE/9UWqU24dnacJjuHyyJ uaIpm01FKSkBAcPnMnmOwpVdZdg7rm7Rjm5ieAXPF105OWXucvxXZCZML4G+3XBs7GC9 d7LnT1bChGsX4uy6mM3CJqIZssYBxb12SEmP1AxT/rR92mVDhaP1YeKiLJ6upmP85l9e wNo7YHEEX7qdhPWDeHxnnFwCzGdWvKetYKl8ajBUyb/j0fEdckdDRHufArCheIeXuSIg RLMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389966; x=1780994766; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=VBpjLmT84d/CUzmG7YuKeJ3j+s1JkUQhluUMJUResB0=; b=dVPSK0QLoPNmr5oSkFkqyyZt3102xFQQdKk7UN0rjTE6+T8GT2O2VytyImrCqSeSl6 Ia8gQ72e008ytoFvL4dNuJSjYENLMXOUitr07Qrsp+QMjP23aEmUlGgs+t7vAbzDP89G iXqjimoI2UNe/r7ra2rmoJoG5PLZYtSC9Jgv7LAr4YxArZvNU/Sb1+42WHp5GLuPQ5RV jyEnJyLBa4/b9NH2eFB+X5dJcBnKKqHsr73Kv7zao0B8VjFrHMRo4AXlgdt7/yAlmrlc DlF5d9j9h28YgTYf09CP41LPtMvCEMhfRUQTV2ykIP7EUFu1VKTy/yI+tmTIaEkfxXav qe5g== X-Gm-Message-State: AOJu0YyO3oJNYpQFLdlZwlPLaeRRKuyfwLgqgETwDdAfYu/KHbi05+vd 5AmQxt/iNXQZASJLR88O4Ue+bp7QzoJdzlU2ZPyRcwbsw+bF/c7jtedTPI9AONuwjHYz8h5XiG9 nqao= X-Gm-Gg: Acq92OGkWxaGoY9Cclj4Wf+KAl7KlUwgXh0dIXJSD0DDdAmU3zmoTc+j5rkj80tr3KD aCmn2cPk5Yx2pp452U0Nh/H0kR/uo+CMcUD+XesmwhyMRexQdHowl0VPV3IkXJe+PNkivJrKQrH R1zFjLWnKk4yz+KnsKJg6ulirjBfiNXpHnXMUiZ++69pHhlMTR0FsYy78zSxc1LYveF6e/8AYh/ QZiV3XcwTgivkf/q9CBFE4NMWlXOFsQEXEFjXS89FZ0vdIEa5F9BGJWpcySDxlmWJlJP6KpBz7f eqJdPPjShjeLLsPi8L6hCM1GBkw74GQv8peLv1FgnOh7gPRafyuPKOkyuVrBAASAouheK7JX2aA hMtybdiKHUEiyFS1uJTIGqtWzw5I0e0p8Wb9qw2R+2z13HPUgZPd5ExMTdLMjxXwUHpijeNvHjK eNRy3jV/R0adybquK0323B+YIZAN9BcbMGr3RD5qfIexEQY8SVK8vnaQFy0SgNOxyD7nd44cjeI 7EcDcEsv5mbh7/N6s7eDGQ8ELlc5/I= X-Received: by 2002:a05:600d:84ca:10b0:490:8b0b:d3b1 with SMTP id 5b1f17b1804b1-490b0e8f03bmr27239845e9.12.1780389963109; Tue, 02 Jun 2026 01:46:03 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:02 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED 08/51] ada: Add missing documentation for attribute Ref Date: Tue, 2 Jun 2026 10:44:56 +0200 Message-ID: <20260602084541.3829876-8-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Piotr Trojanek Attribute Ref was implemented for compatibility with other compilers, but never documented. gcc/ada/ChangeLog: * doc/gnat_rm/implementation_defined_attributes.rst (Attribute_Ref): New section based on comment in sem_attr.ads. * gnat_rm.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- .../implementation_defined_attributes.rst | 7 + gcc/ada/gnat_rm.texi | 1077 +++++++++-------- 2 files changed, 551 insertions(+), 533 deletions(-) diff --git a/gcc/ada/doc/gnat_rm/implementation_defined_attributes.rst b/gcc/ada/doc/gnat_rm/implementation_defined_attributes.rst index 90da0a961ec..ce568c48f6e 100644 --- a/gcc/ada/doc/gnat_rm/implementation_defined_attributes.rst +++ b/gcc/ada/doc/gnat_rm/implementation_defined_attributes.rst @@ -873,6 +873,13 @@ range). The result is static for static subtypes. ``Range_Length`` applied to the index subtype of a one dimensional array always gives the same result as ``Length`` applied to the array itself. +Attribute Ref +============= + +``System.Address'Ref`` (``Address`` is the only permissible prefix) is +equivalent to ``System'To_Address``, provided for compatibility with other +compilers. + Attribute Restriction_Set ========================= .. index:: Restriction_Set diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index e58020889ee..bb985bd7429 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -434,6 +434,7 @@ Implementation Defined Attributes * Attribute Passed_By_Reference:: * Attribute Pool_Address:: * Attribute Range_Length:: +* Attribute Ref:: * Attribute Restriction_Set:: * Attribute Result:: * Attribute Round:: @@ -10822,6 +10823,7 @@ consideration, you should minimize the use of these attributes. * Attribute Passed_By_Reference:: * Attribute Pool_Address:: * Attribute Range_Length:: +* Attribute Ref:: * Attribute Restriction_Set:: * Attribute Result:: * Attribute Round:: @@ -11843,7 +11845,7 @@ the global heap, on the stack, or in a static memory area. For an object created by @code{new}, @code{Ptr.all'Pool_Address} is what is passed to @code{Allocate} and returned from @code{Deallocate}. -@node Attribute Range_Length,Attribute Restriction_Set,Attribute Pool_Address,Implementation Defined Attributes +@node Attribute Range_Length,Attribute Ref,Attribute Pool_Address,Implementation Defined Attributes @anchor{gnat_rm/implementation_defined_attributes attribute-range-length}@anchor{1b3} @section Attribute Range_Length @@ -11856,8 +11858,17 @@ range). The result is static for static subtypes. @code{Range_Length} applied to the index subtype of a one dimensional array always gives the same result as @code{Length} applied to the array itself. -@node Attribute Restriction_Set,Attribute Result,Attribute Range_Length,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-restriction-set}@anchor{1b4} +@node Attribute Ref,Attribute Restriction_Set,Attribute Range_Length,Implementation Defined Attributes +@anchor{gnat_rm/implementation_defined_attributes attribute-ref}@anchor{1b4} +@section Attribute Ref + + +@code{System.Address'Ref} (@code{Address} is the only permissible prefix) is +equivalent to @code{System'To_Address}, provided for compatibility with other +compilers. + +@node Attribute Restriction_Set,Attribute Result,Attribute Ref,Implementation Defined Attributes +@anchor{gnat_rm/implementation_defined_attributes attribute-restriction-set}@anchor{1b5} @section Attribute Restriction_Set @@ -11927,7 +11938,7 @@ Restrictions pragma, they are not analyzed semantically, so they do not have a type. @node Attribute Result,Attribute Round,Attribute Restriction_Set,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-result}@anchor{1b5} +@anchor{gnat_rm/implementation_defined_attributes attribute-result}@anchor{1b6} @section Attribute Result @@ -11940,7 +11951,7 @@ For a further discussion of the use of this attribute and examples of its use, see the description of pragma Postcondition. @node Attribute Round,Attribute Safe_Emax,Attribute Result,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-round}@anchor{1b6} +@anchor{gnat_rm/implementation_defined_attributes attribute-round}@anchor{1b7} @section Attribute Round @@ -11951,7 +11962,7 @@ also permits the use of the @code{'Round} attribute for ordinary fixed point types. @node Attribute Safe_Emax,Attribute Safe_Large,Attribute Round,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-safe-emax}@anchor{1b7} +@anchor{gnat_rm/implementation_defined_attributes attribute-safe-emax}@anchor{1b8} @section Attribute Safe_Emax @@ -11964,7 +11975,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Safe_Large,Attribute Safe_Small,Attribute Safe_Emax,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-safe-large}@anchor{1b8} +@anchor{gnat_rm/implementation_defined_attributes attribute-safe-large}@anchor{1b9} @section Attribute Safe_Large @@ -11977,7 +11988,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Safe_Small,Attribute Scalar_Storage_Order,Attribute Safe_Large,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-safe-small}@anchor{1b9} +@anchor{gnat_rm/implementation_defined_attributes attribute-safe-small}@anchor{1ba} @section Attribute Safe_Small @@ -11990,7 +12001,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Scalar_Storage_Order,Attribute Simple_Storage_Pool,Attribute Safe_Small,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-scalar-storage-order}@anchor{169}@anchor{gnat_rm/implementation_defined_attributes id4}@anchor{1ba} +@anchor{gnat_rm/implementation_defined_attributes attribute-scalar-storage-order}@anchor{169}@anchor{gnat_rm/implementation_defined_attributes id4}@anchor{1bb} @section Attribute Scalar_Storage_Order @@ -12153,7 +12164,7 @@ Note that debuggers may be unable to display the correct value of scalar components of a type for which the opposite storage order is specified. @node Attribute Simple_Storage_Pool,Attribute Small,Attribute Scalar_Storage_Order,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-simple-storage-pool}@anchor{f4}@anchor{gnat_rm/implementation_defined_attributes id5}@anchor{1bb} +@anchor{gnat_rm/implementation_defined_attributes attribute-simple-storage-pool}@anchor{f4}@anchor{gnat_rm/implementation_defined_attributes id5}@anchor{1bc} @section Attribute Simple_Storage_Pool @@ -12216,7 +12227,7 @@ as defined in section 13.11.2 of the Ada Reference Manual, except that the term `simple storage pool' is substituted for `storage pool'. @node Attribute Small,Attribute Small_Denominator,Attribute Simple_Storage_Pool,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-small}@anchor{1bc} +@anchor{gnat_rm/implementation_defined_attributes attribute-small}@anchor{1bd} @section Attribute Small @@ -12232,7 +12243,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute when applied to floating-point types. @node Attribute Small_Denominator,Attribute Small_Numerator,Attribute Small,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-small-denominator}@anchor{1bd} +@anchor{gnat_rm/implementation_defined_attributes attribute-small-denominator}@anchor{1be} @section Attribute Small_Denominator @@ -12245,7 +12256,7 @@ denominator in the representation of @code{typ'Small} as a rational number with coprime factors (i.e. as an irreducible fraction). @node Attribute Small_Numerator,Attribute Storage_Unit,Attribute Small_Denominator,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-small-numerator}@anchor{1be} +@anchor{gnat_rm/implementation_defined_attributes attribute-small-numerator}@anchor{1bf} @section Attribute Small_Numerator @@ -12258,7 +12269,7 @@ numerator in the representation of @code{typ'Small} as a rational number with coprime factors (i.e. as an irreducible fraction). @node Attribute Storage_Unit,Attribute Stub_Type,Attribute Small_Numerator,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-storage-unit}@anchor{1bf} +@anchor{gnat_rm/implementation_defined_attributes attribute-storage-unit}@anchor{1c0} @section Attribute Storage_Unit @@ -12268,7 +12279,7 @@ with coprime factors (i.e. as an irreducible fraction). prefix) provides the same value as @code{System.Storage_Unit}. @node Attribute Stub_Type,Attribute System_Allocator_Alignment,Attribute Storage_Unit,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-stub-type}@anchor{1c0} +@anchor{gnat_rm/implementation_defined_attributes attribute-stub-type}@anchor{1c1} @section Attribute Stub_Type @@ -12292,7 +12303,7 @@ unit @code{System.Partition_Interface}. Use of this attribute will create an implicit dependency on this unit. @node Attribute System_Allocator_Alignment,Attribute Target_Name,Attribute Stub_Type,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-system-allocator-alignment}@anchor{1c1} +@anchor{gnat_rm/implementation_defined_attributes attribute-system-allocator-alignment}@anchor{1c2} @section Attribute System_Allocator_Alignment @@ -12309,7 +12320,7 @@ with alignment too large or to enable a realignment circuitry if the alignment request is larger than this value. @node Attribute Target_Name,Attribute To_Address,Attribute System_Allocator_Alignment,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-target-name}@anchor{1c2} +@anchor{gnat_rm/implementation_defined_attributes attribute-target-name}@anchor{1c3} @section Attribute Target_Name @@ -12322,7 +12333,7 @@ standard gcc target name without the terminating slash (for example, GNAT 5.0 on windows yields “i586-pc-mingw32msv”). @node Attribute To_Address,Attribute To_Any,Attribute Target_Name,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-to-address}@anchor{1c3} +@anchor{gnat_rm/implementation_defined_attributes attribute-to-address}@anchor{1c4} @section Attribute To_Address @@ -12345,7 +12356,7 @@ modular manner (e.g., -1 means the same as 16#FFFF_FFFF# on a 32 bits machine). @node Attribute To_Any,Attribute Type_Class,Attribute To_Address,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-to-any}@anchor{1c4} +@anchor{gnat_rm/implementation_defined_attributes attribute-to-any}@anchor{1c5} @section Attribute To_Any @@ -12355,7 +12366,7 @@ This internal attribute is used for the generation of remote subprogram stubs in the context of the Distributed Systems Annex. @node Attribute Type_Class,Attribute Type_Key,Attribute To_Any,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-type-class}@anchor{1c5} +@anchor{gnat_rm/implementation_defined_attributes attribute-type-class}@anchor{1c6} @section Attribute Type_Class @@ -12385,7 +12396,7 @@ applies to all concurrent types. This attribute is designed to be compatible with the DEC Ada 83 attribute of the same name. @node Attribute Type_Key,Attribute TypeCode,Attribute Type_Class,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-type-key}@anchor{1c6} +@anchor{gnat_rm/implementation_defined_attributes attribute-type-key}@anchor{1c7} @section Attribute Type_Key @@ -12397,7 +12408,7 @@ about the type or subtype. This provides improved compatibility with other implementations that support this attribute. @node Attribute TypeCode,Attribute Unconstrained_Array,Attribute Type_Key,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-typecode}@anchor{1c7} +@anchor{gnat_rm/implementation_defined_attributes attribute-typecode}@anchor{1c8} @section Attribute TypeCode @@ -12407,7 +12418,7 @@ This internal attribute is used for the generation of remote subprogram stubs in the context of the Distributed Systems Annex. @node Attribute Unconstrained_Array,Attribute Universal_Literal_String,Attribute TypeCode,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-unconstrained-array}@anchor{1c8} +@anchor{gnat_rm/implementation_defined_attributes attribute-unconstrained-array}@anchor{1c9} @section Attribute Unconstrained_Array @@ -12421,7 +12432,7 @@ still static, and yields the result of applying this test to the generic actual. @node Attribute Universal_Literal_String,Attribute Unrestricted_Access,Attribute Unconstrained_Array,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-universal-literal-string}@anchor{1c9} +@anchor{gnat_rm/implementation_defined_attributes attribute-universal-literal-string}@anchor{1ca} @section Attribute Universal_Literal_String @@ -12449,7 +12460,7 @@ end; @end example @node Attribute Unrestricted_Access,Attribute Update,Attribute Universal_Literal_String,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-unrestricted-access}@anchor{1ca} +@anchor{gnat_rm/implementation_defined_attributes attribute-unrestricted-access}@anchor{1cb} @section Attribute Unrestricted_Access @@ -12636,7 +12647,7 @@ In general this is a risky approach. It may appear to “work” but such uses o of GNAT to another, so are best avoided if possible. @node Attribute Update,Attribute Valid_Value,Attribute Unrestricted_Access,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-update}@anchor{1cb} +@anchor{gnat_rm/implementation_defined_attributes attribute-update}@anchor{1cc} @section Attribute Update @@ -12717,7 +12728,7 @@ A := A'Update ((1, 2) => 20, (3, 4) => 30); which changes element (1,2) to 20 and (3,4) to 30. @node Attribute Valid_Value,Attribute Valid_Scalars,Attribute Update,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-valid-value}@anchor{1cc} +@anchor{gnat_rm/implementation_defined_attributes attribute-valid-value}@anchor{1cd} @section Attribute Valid_Value @@ -12729,7 +12740,7 @@ a function that takes a String, and returns Boolean. @code{T'Valid_Value (S)} returns True if and only if @code{T'Value (S)} would not raise Constraint_Error. @node Attribute Valid_Scalars,Attribute VADS_Size,Attribute Valid_Value,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-valid-scalars}@anchor{1cd} +@anchor{gnat_rm/implementation_defined_attributes attribute-valid-scalars}@anchor{1ce} @section Attribute Valid_Scalars @@ -12763,7 +12774,7 @@ write a function with a single use of the attribute, and then call that function from multiple places. @node Attribute VADS_Size,Attribute Value_Size,Attribute Valid_Scalars,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-vads-size}@anchor{1ce} +@anchor{gnat_rm/implementation_defined_attributes attribute-vads-size}@anchor{1cf} @section Attribute VADS_Size @@ -12783,7 +12794,7 @@ gives the result that would be obtained by applying the attribute to the corresponding type. @node Attribute Value_Size,Attribute Wchar_T_Size,Attribute VADS_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-value-size}@anchor{17b}@anchor{gnat_rm/implementation_defined_attributes id6}@anchor{1cf} +@anchor{gnat_rm/implementation_defined_attributes attribute-value-size}@anchor{17b}@anchor{gnat_rm/implementation_defined_attributes id6}@anchor{1d0} @section Attribute Value_Size @@ -12797,7 +12808,7 @@ a value of the given subtype. It is the same as @code{type'Size}, but, unlike @code{Size}, may be set for non-first subtypes. @node Attribute Wchar_T_Size,Attribute Word_Size,Attribute Value_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-wchar-t-size}@anchor{1d0} +@anchor{gnat_rm/implementation_defined_attributes attribute-wchar-t-size}@anchor{1d1} @section Attribute Wchar_T_Size @@ -12809,7 +12820,7 @@ primarily for constructing the definition of this type in package @code{Interfaces.C}. The result is a static constant. @node Attribute Word_Size,,Attribute Wchar_T_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-word-size}@anchor{1d1} +@anchor{gnat_rm/implementation_defined_attributes attribute-word-size}@anchor{1d2} @section Attribute Word_Size @@ -12820,7 +12831,7 @@ prefix) provides the value @code{System.Word_Size}. The result is a static constant. @node Standard and Implementation Defined Restrictions,Implementation Advice,Implementation Defined Attributes,Top -@anchor{gnat_rm/standard_and_implementation_defined_restrictions doc}@anchor{1d2}@anchor{gnat_rm/standard_and_implementation_defined_restrictions id1}@anchor{1d3}@anchor{gnat_rm/standard_and_implementation_defined_restrictions standard-and-implementation-defined-restrictions}@anchor{9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions doc}@anchor{1d3}@anchor{gnat_rm/standard_and_implementation_defined_restrictions id1}@anchor{1d4}@anchor{gnat_rm/standard_and_implementation_defined_restrictions standard-and-implementation-defined-restrictions}@anchor{9} @chapter Standard and Implementation Defined Restrictions @@ -12849,7 +12860,7 @@ language defined or GNAT-specific, are listed in the following. @end menu @node Partition-Wide Restrictions,Program Unit Level Restrictions,,Standard and Implementation Defined Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions id2}@anchor{1d4}@anchor{gnat_rm/standard_and_implementation_defined_restrictions partition-wide-restrictions}@anchor{1d5} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions id2}@anchor{1d5}@anchor{gnat_rm/standard_and_implementation_defined_restrictions partition-wide-restrictions}@anchor{1d6} @section Partition-Wide Restrictions @@ -12942,7 +12953,7 @@ then all compilation units in the partition must obey the restriction). @end menu @node Immediate_Reclamation,Max_Asynchronous_Select_Nesting,,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions immediate-reclamation}@anchor{1d6} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions immediate-reclamation}@anchor{1d7} @subsection Immediate_Reclamation @@ -12954,7 +12965,7 @@ deallocation, any storage reserved at run time for an object is immediately reclaimed when the object no longer exists. @node Max_Asynchronous_Select_Nesting,Max_Entry_Queue_Length,Immediate_Reclamation,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-asynchronous-select-nesting}@anchor{1d7} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-asynchronous-select-nesting}@anchor{1d8} @subsection Max_Asynchronous_Select_Nesting @@ -12966,7 +12977,7 @@ detected at compile time. Violations of this restriction with values other than zero cause Storage_Error to be raised. @node Max_Entry_Queue_Length,Max_Protected_Entries,Max_Asynchronous_Select_Nesting,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-entry-queue-length}@anchor{1d8} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-entry-queue-length}@anchor{1d9} @subsection Max_Entry_Queue_Length @@ -12987,7 +12998,7 @@ compatibility purposes (and a warning will be generated for its use if warnings on obsolescent features are activated). @node Max_Protected_Entries,Max_Select_Alternatives,Max_Entry_Queue_Length,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-protected-entries}@anchor{1d9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-protected-entries}@anchor{1da} @subsection Max_Protected_Entries @@ -12998,7 +13009,7 @@ bounds of every entry family of a protected unit shall be static, or shall be defined by a discriminant of a subtype whose corresponding bound is static. @node Max_Select_Alternatives,Max_Storage_At_Blocking,Max_Protected_Entries,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-select-alternatives}@anchor{1da} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-select-alternatives}@anchor{1db} @subsection Max_Select_Alternatives @@ -13007,7 +13018,7 @@ defined by a discriminant of a subtype whose corresponding bound is static. [RM D.7] Specifies the maximum number of alternatives in a selective accept. @node Max_Storage_At_Blocking,Max_Task_Entries,Max_Select_Alternatives,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-storage-at-blocking}@anchor{1db} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-storage-at-blocking}@anchor{1dc} @subsection Max_Storage_At_Blocking @@ -13018,7 +13029,7 @@ Storage_Size that can be retained by a blocked task. A violation of this restriction causes Storage_Error to be raised. @node Max_Task_Entries,Max_Tasks,Max_Storage_At_Blocking,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-task-entries}@anchor{1dc} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-task-entries}@anchor{1dd} @subsection Max_Task_Entries @@ -13031,7 +13042,7 @@ defined by a discriminant of a subtype whose corresponding bound is static. @node Max_Tasks,No_Abort_Statements,Max_Task_Entries,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-tasks}@anchor{1dd} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-tasks}@anchor{1de} @subsection Max_Tasks @@ -13045,7 +13056,7 @@ zero are detected for library-level tasks at compile time, but are not detected for local tasks at all. @node No_Abort_Statements,No_Access_Parameter_Allocators,Max_Tasks,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-abort-statements}@anchor{1de} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-abort-statements}@anchor{1df} @subsection No_Abort_Statements @@ -13055,7 +13066,7 @@ not detected for local tasks at all. no calls to Task_Identification.Abort_Task. @node No_Access_Parameter_Allocators,No_Access_Subprograms,No_Abort_Statements,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-access-parameter-allocators}@anchor{1df} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-access-parameter-allocators}@anchor{1e0} @subsection No_Access_Parameter_Allocators @@ -13066,7 +13077,7 @@ occurrences of an allocator as the actual parameter to an access parameter. @node No_Access_Subprograms,No_Allocators,No_Access_Parameter_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-access-subprograms}@anchor{1e0} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-access-subprograms}@anchor{1e1} @subsection No_Access_Subprograms @@ -13076,7 +13087,7 @@ parameter. declarations of access-to-subprogram types. @node No_Allocators,No_Anonymous_Allocators,No_Access_Subprograms,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-allocators}@anchor{1e1} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-allocators}@anchor{1e2} @subsection No_Allocators @@ -13086,7 +13097,7 @@ declarations of access-to-subprogram types. occurrences of an allocator. @node No_Anonymous_Allocators,No_Asynchronous_Control,No_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-anonymous-allocators}@anchor{1e2} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-anonymous-allocators}@anchor{1e3} @subsection No_Anonymous_Allocators @@ -13096,7 +13107,7 @@ occurrences of an allocator. occurrences of an allocator of anonymous access type. @node No_Asynchronous_Control,No_Calendar,No_Anonymous_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-asynchronous-control}@anchor{1e3} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-asynchronous-control}@anchor{1e4} @subsection No_Asynchronous_Control @@ -13106,7 +13117,7 @@ occurrences of an allocator of anonymous access type. dependences on the predefined package Asynchronous_Task_Control. @node No_Calendar,No_Coextensions,No_Asynchronous_Control,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-calendar}@anchor{1e4} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-calendar}@anchor{1e5} @subsection No_Calendar @@ -13116,7 +13127,7 @@ dependences on the predefined package Asynchronous_Task_Control. dependences on package Calendar. @node No_Coextensions,No_Default_Initialization,No_Calendar,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-coextensions}@anchor{1e5} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-coextensions}@anchor{1e6} @subsection No_Coextensions @@ -13126,7 +13137,7 @@ dependences on package Calendar. coextensions. See 3.10.2. @node No_Default_Initialization,No_Delay,No_Coextensions,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-default-initialization}@anchor{1e6} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-default-initialization}@anchor{1e7} @subsection No_Default_Initialization @@ -13143,7 +13154,7 @@ is to prohibit all cases of variables declared without a specific initializer (including the case of OUT scalar parameters). @node No_Delay,No_Dependence,No_Default_Initialization,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-delay}@anchor{1e7} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-delay}@anchor{1e8} @subsection No_Delay @@ -13153,7 +13164,7 @@ initializer (including the case of OUT scalar parameters). delay statements and no semantic dependences on package Calendar. @node No_Dependence,No_Direct_Boolean_Operators,No_Delay,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dependence}@anchor{1e8} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dependence}@anchor{1e9} @subsection No_Dependence @@ -13196,7 +13207,7 @@ to support specific constructs of the language. Here are some examples: @end itemize @node No_Direct_Boolean_Operators,No_Dispatch,No_Dependence,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-direct-boolean-operators}@anchor{1e9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-direct-boolean-operators}@anchor{1ea} @subsection No_Direct_Boolean_Operators @@ -13209,7 +13220,7 @@ protocol requires the use of short-circuit (and then, or else) forms for all composite boolean operations. @node No_Dispatch,No_Dispatching_Calls,No_Direct_Boolean_Operators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dispatch}@anchor{1ea} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dispatch}@anchor{1eb} @subsection No_Dispatch @@ -13219,7 +13230,7 @@ composite boolean operations. occurrences of @code{T'Class}, for any (tagged) subtype @code{T}. @node No_Dispatching_Calls,No_Dynamic_Attachment,No_Dispatch,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dispatching-calls}@anchor{1eb} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dispatching-calls}@anchor{1ec} @subsection No_Dispatching_Calls @@ -13280,7 +13291,7 @@ end Example; @end example @node No_Dynamic_Attachment,No_Dynamic_Priorities,No_Dispatching_Calls,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-attachment}@anchor{1ec} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-attachment}@anchor{1ed} @subsection No_Dynamic_Attachment @@ -13299,7 +13310,7 @@ compatibility purposes (and a warning will be generated for its use if warnings on obsolescent features are activated). @node No_Dynamic_Priorities,No_Entry_Calls_In_Elaboration_Code,No_Dynamic_Attachment,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-priorities}@anchor{1ed} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-priorities}@anchor{1ee} @subsection No_Dynamic_Priorities @@ -13308,7 +13319,7 @@ warnings on obsolescent features are activated). [RM D.7] There are no semantic dependencies on the package Dynamic_Priorities. @node No_Entry_Calls_In_Elaboration_Code,No_Enumeration_Maps,No_Dynamic_Priorities,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-entry-calls-in-elaboration-code}@anchor{1ee} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-entry-calls-in-elaboration-code}@anchor{1ef} @subsection No_Entry_Calls_In_Elaboration_Code @@ -13320,7 +13331,7 @@ restriction, the compiler can assume that no code past an accept statement in a task can be executed at elaboration time. @node No_Enumeration_Maps,No_Exception_Handlers,No_Entry_Calls_In_Elaboration_Code,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-enumeration-maps}@anchor{1ef} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-enumeration-maps}@anchor{1f0} @subsection No_Enumeration_Maps @@ -13331,7 +13342,7 @@ enumeration maps are used (that is Image and Value attributes applied to enumeration types). @node No_Exception_Handlers,No_Exception_Propagation,No_Enumeration_Maps,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-handlers}@anchor{1f0} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-handlers}@anchor{1f1} @subsection No_Exception_Handlers @@ -13356,7 +13367,7 @@ the raise statement generated by the compiler). The Line parameter when nonzero represents the line number in the source program where the raise occurs. @node No_Exception_Propagation,No_Exception_Registration,No_Exception_Handlers,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-propagation}@anchor{1f1} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-propagation}@anchor{1f2} @subsection No_Exception_Propagation @@ -13373,7 +13384,7 @@ the package GNAT.Current_Exception is not permitted, and reraise statements (raise with no operand) are not permitted. @node No_Exception_Registration,No_Exceptions,No_Exception_Propagation,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-registration}@anchor{1f2} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-registration}@anchor{1f3} @subsection No_Exception_Registration @@ -13387,7 +13398,7 @@ code is simplified by omitting the otherwise-required global registration of exceptions when they are declared. @node No_Exceptions,No_Finalization,No_Exception_Registration,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exceptions}@anchor{1f3} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exceptions}@anchor{1f4} @subsection No_Exceptions @@ -13398,7 +13409,7 @@ raise statements and no exception handlers and also suppresses the generation of language-defined run-time checks. @node No_Finalization,No_Fixed_Point,No_Exceptions,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-finalization}@anchor{1f4} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-finalization}@anchor{1f5} @subsection No_Finalization @@ -13439,7 +13450,7 @@ object or a nested component, either declared on the stack or on the heap. The deallocation of a controlled object no longer finalizes its contents. @node No_Fixed_Point,No_Floating_Point,No_Finalization,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-fixed-point}@anchor{1f5} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-fixed-point}@anchor{1f6} @subsection No_Fixed_Point @@ -13449,7 +13460,7 @@ deallocation of a controlled object no longer finalizes its contents. occurrences of fixed point types and operations. @node No_Floating_Point,No_Implicit_Conditionals,No_Fixed_Point,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-floating-point}@anchor{1f6} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-floating-point}@anchor{1f7} @subsection No_Floating_Point @@ -13459,7 +13470,7 @@ occurrences of fixed point types and operations. occurrences of floating point types and operations. @node No_Implicit_Conditionals,No_Implicit_Dynamic_Code,No_Floating_Point,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-conditionals}@anchor{1f7} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-conditionals}@anchor{1f8} @subsection No_Implicit_Conditionals @@ -13475,7 +13486,7 @@ normal manner. Constructs generating implicit conditionals include comparisons of composite objects and the Max/Min attributes. @node No_Implicit_Dynamic_Code,No_Implicit_Heap_Allocations,No_Implicit_Conditionals,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-dynamic-code}@anchor{1f8} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-dynamic-code}@anchor{1f9} @subsection No_Implicit_Dynamic_Code @@ -13505,7 +13516,7 @@ foreign-language convention; primitive operations of nested tagged types. @node No_Implicit_Heap_Allocations,No_Implicit_Protected_Object_Allocations,No_Implicit_Dynamic_Code,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-heap-allocations}@anchor{1f9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-heap-allocations}@anchor{1fa} @subsection No_Implicit_Heap_Allocations @@ -13514,7 +13525,7 @@ types. [RM D.7] No constructs are allowed to cause implicit heap allocation. @node No_Implicit_Protected_Object_Allocations,No_Implicit_Task_Allocations,No_Implicit_Heap_Allocations,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-protected-object-allocations}@anchor{1fa} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-protected-object-allocations}@anchor{1fb} @subsection No_Implicit_Protected_Object_Allocations @@ -13524,7 +13535,7 @@ types. protected object. @node No_Implicit_Task_Allocations,No_Initialize_Scalars,No_Implicit_Protected_Object_Allocations,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-task-allocations}@anchor{1fb} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-task-allocations}@anchor{1fc} @subsection No_Implicit_Task_Allocations @@ -13533,7 +13544,7 @@ protected object. [GNAT] No constructs are allowed to cause implicit heap allocation of a task. @node No_Initialize_Scalars,No_IO,No_Implicit_Task_Allocations,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-initialize-scalars}@anchor{1fc} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-initialize-scalars}@anchor{1fd} @subsection No_Initialize_Scalars @@ -13545,7 +13556,7 @@ code, and in particular eliminates dummy null initialization routines that are otherwise generated for some record and array types. @node No_IO,No_Local_Allocators,No_Initialize_Scalars,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-io}@anchor{1fd} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-io}@anchor{1fe} @subsection No_IO @@ -13556,7 +13567,7 @@ dependences on any of the library units Sequential_IO, Direct_IO, Text_IO, Wide_Text_IO, Wide_Wide_Text_IO, or Stream_IO. @node No_Local_Allocators,No_Local_Protected_Objects,No_IO,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-allocators}@anchor{1fe} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-allocators}@anchor{1ff} @subsection No_Local_Allocators @@ -13567,7 +13578,7 @@ occurrences of an allocator in subprograms, generic subprograms, tasks, and entry bodies. @node No_Local_Protected_Objects,No_Local_Tagged_Types,No_Local_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-protected-objects}@anchor{1ff} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-protected-objects}@anchor{200} @subsection No_Local_Protected_Objects @@ -13577,7 +13588,7 @@ and entry bodies. only declared at the library level. @node No_Local_Tagged_Types,No_Local_Timing_Events,No_Local_Protected_Objects,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-tagged-types}@anchor{200} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-tagged-types}@anchor{201} @subsection No_Local_Tagged_Types @@ -13587,7 +13598,7 @@ only declared at the library level. declared at the library level. @node No_Local_Timing_Events,No_Long_Long_Integers,No_Local_Tagged_Types,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-timing-events}@anchor{201} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-timing-events}@anchor{202} @subsection No_Local_Timing_Events @@ -13597,7 +13608,7 @@ declared at the library level. declared at the library level. @node No_Long_Long_Integers,No_Multiple_Elaboration,No_Local_Timing_Events,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-long-long-integers}@anchor{202} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-long-long-integers}@anchor{203} @subsection No_Long_Long_Integers @@ -13609,7 +13620,7 @@ implicit base type is Long_Long_Integer, and modular types whose size exceeds Long_Integer’Size. @node No_Multiple_Elaboration,No_Nested_Finalization,No_Long_Long_Integers,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-multiple-elaboration}@anchor{203} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-multiple-elaboration}@anchor{204} @subsection No_Multiple_Elaboration @@ -13625,7 +13636,7 @@ possible, including non-Ada main programs and Stand Alone libraries, are not permitted and will be diagnosed by the binder. @node No_Nested_Finalization,No_Protected_Type_Allocators,No_Multiple_Elaboration,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-nested-finalization}@anchor{204} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-nested-finalization}@anchor{205} @subsection No_Nested_Finalization @@ -13634,7 +13645,7 @@ permitted and will be diagnosed by the binder. [RM D.7] All objects requiring finalization are declared at the library level. @node No_Protected_Type_Allocators,No_Protected_Types,No_Nested_Finalization,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-protected-type-allocators}@anchor{205} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-protected-type-allocators}@anchor{206} @subsection No_Protected_Type_Allocators @@ -13644,7 +13655,7 @@ permitted and will be diagnosed by the binder. expressions that attempt to allocate protected objects. @node No_Protected_Types,No_Recursion,No_Protected_Type_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-protected-types}@anchor{206} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-protected-types}@anchor{207} @subsection No_Protected_Types @@ -13654,7 +13665,7 @@ expressions that attempt to allocate protected objects. declarations of protected types or protected objects. @node No_Recursion,No_Reentrancy,No_Protected_Types,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-recursion}@anchor{207} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-recursion}@anchor{208} @subsection No_Recursion @@ -13664,7 +13675,7 @@ declarations of protected types or protected objects. part of its execution. @node No_Reentrancy,No_Relative_Delay,No_Recursion,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-reentrancy}@anchor{208} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-reentrancy}@anchor{209} @subsection No_Reentrancy @@ -13674,7 +13685,7 @@ part of its execution. two tasks at the same time. @node No_Relative_Delay,No_Requeue_Statements,No_Reentrancy,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-relative-delay}@anchor{209} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-relative-delay}@anchor{20a} @subsection No_Relative_Delay @@ -13685,7 +13696,7 @@ relative statements and prevents expressions such as @code{delay 1.23;} from appearing in source code. @node No_Requeue_Statements,No_Secondary_Stack,No_Relative_Delay,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-requeue-statements}@anchor{20a} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-requeue-statements}@anchor{20b} @subsection No_Requeue_Statements @@ -13703,7 +13714,7 @@ compatibility purposes (and a warning will be generated for its use if warnings on oNobsolescent features are activated). @node No_Secondary_Stack,No_Select_Statements,No_Requeue_Statements,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-secondary-stack}@anchor{20b} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-secondary-stack}@anchor{20c} @subsection No_Secondary_Stack @@ -13716,7 +13727,7 @@ stack is used to implement functions returning unconstrained objects secondary stacks for tasks (excluding the environment task) at run time. @node No_Select_Statements,No_Specific_Termination_Handlers,No_Secondary_Stack,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-select-statements}@anchor{20c} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-select-statements}@anchor{20d} @subsection No_Select_Statements @@ -13726,7 +13737,7 @@ secondary stacks for tasks (excluding the environment task) at run time. kind are permitted, that is the keyword @code{select} may not appear. @node No_Specific_Termination_Handlers,No_Specification_of_Aspect,No_Select_Statements,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-specific-termination-handlers}@anchor{20d} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-specific-termination-handlers}@anchor{20e} @subsection No_Specific_Termination_Handlers @@ -13736,7 +13747,7 @@ kind are permitted, that is the keyword @code{select} may not appear. or to Ada.Task_Termination.Specific_Handler. @node No_Specification_of_Aspect,No_Standard_Allocators_After_Elaboration,No_Specific_Termination_Handlers,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-specification-of-aspect}@anchor{20e} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-specification-of-aspect}@anchor{20f} @subsection No_Specification_of_Aspect @@ -13747,7 +13758,7 @@ specification, attribute definition clause, or pragma is given for a given aspect. @node No_Standard_Allocators_After_Elaboration,No_Standard_Storage_Pools,No_Specification_of_Aspect,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-standard-allocators-after-elaboration}@anchor{20f} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-standard-allocators-after-elaboration}@anchor{210} @subsection No_Standard_Allocators_After_Elaboration @@ -13759,7 +13770,7 @@ library items of the partition has completed. Otherwise, Storage_Error is raised. @node No_Standard_Storage_Pools,No_Stream_Optimizations,No_Standard_Allocators_After_Elaboration,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-standard-storage-pools}@anchor{210} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-standard-storage-pools}@anchor{211} @subsection No_Standard_Storage_Pools @@ -13771,7 +13782,7 @@ have an explicit Storage_Pool attribute defined specifying a user-defined storage pool. @node No_Stream_Optimizations,No_Streams,No_Standard_Storage_Pools,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-stream-optimizations}@anchor{211} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-stream-optimizations}@anchor{212} @subsection No_Stream_Optimizations @@ -13784,7 +13795,7 @@ due to their superior performance. When this restriction is in effect, the compiler performs all IO operations on a per-character basis. @node No_Streams,No_Tagged_Type_Registration,No_Stream_Optimizations,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-streams}@anchor{212} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-streams}@anchor{213} @subsection No_Streams @@ -13811,7 +13822,7 @@ configuration pragmas to avoid exposing entity names at binary level for the entire partition. @node No_Tagged_Type_Registration,No_Task_Allocators,No_Streams,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-tagged-type-registration}@anchor{213} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-tagged-type-registration}@anchor{214} @subsection No_Tagged_Type_Registration @@ -13826,7 +13837,7 @@ are declared. This restriction may be necessary in order to also apply the No_Elaboration_Code restriction. @node No_Task_Allocators,No_Task_At_Interrupt_Priority,No_Tagged_Type_Registration,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-allocators}@anchor{214} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-allocators}@anchor{215} @subsection No_Task_Allocators @@ -13836,7 +13847,7 @@ the No_Elaboration_Code restriction. or types containing task subcomponents. @node No_Task_At_Interrupt_Priority,No_Task_Attributes_Package,No_Task_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-at-interrupt-priority}@anchor{215} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-at-interrupt-priority}@anchor{216} @subsection No_Task_At_Interrupt_Priority @@ -13848,7 +13859,7 @@ a consequence, the tasks are always created with a priority below that an interrupt priority. @node No_Task_Attributes_Package,No_Task_Hierarchy,No_Task_At_Interrupt_Priority,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-attributes-package}@anchor{216} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-attributes-package}@anchor{217} @subsection No_Task_Attributes_Package @@ -13865,7 +13876,7 @@ compatibility purposes (and a warning will be generated for its use if warnings on obsolescent features are activated). @node No_Task_Hierarchy,No_Task_Termination,No_Task_Attributes_Package,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-hierarchy}@anchor{217} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-hierarchy}@anchor{218} @subsection No_Task_Hierarchy @@ -13875,7 +13886,7 @@ warnings on obsolescent features are activated). directly on the environment task of the partition. @node No_Task_Termination,No_Tasking,No_Task_Hierarchy,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-termination}@anchor{218} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-termination}@anchor{219} @subsection No_Task_Termination @@ -13884,7 +13895,7 @@ directly on the environment task of the partition. [RM D.7] Tasks that terminate are erroneous. @node No_Tasking,No_Terminate_Alternatives,No_Task_Termination,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-tasking}@anchor{219} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-tasking}@anchor{21a} @subsection No_Tasking @@ -13897,7 +13908,7 @@ and cause an error message to be output either by the compiler or binder. @node No_Terminate_Alternatives,No_Unchecked_Access,No_Tasking,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-terminate-alternatives}@anchor{21a} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-terminate-alternatives}@anchor{21b} @subsection No_Terminate_Alternatives @@ -13906,7 +13917,7 @@ binder. [RM D.7] There are no selective accepts with terminate alternatives. @node No_Unchecked_Access,No_Unchecked_Conversion,No_Terminate_Alternatives,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-access}@anchor{21b} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-access}@anchor{21c} @subsection No_Unchecked_Access @@ -13916,7 +13927,7 @@ binder. occurrences of the Unchecked_Access attribute. @node No_Unchecked_Conversion,No_Unchecked_Deallocation,No_Unchecked_Access,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-conversion}@anchor{21c} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-conversion}@anchor{21d} @subsection No_Unchecked_Conversion @@ -13926,7 +13937,7 @@ occurrences of the Unchecked_Access attribute. dependences on the predefined generic function Unchecked_Conversion. @node No_Unchecked_Deallocation,No_Use_Of_Attribute,No_Unchecked_Conversion,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-deallocation}@anchor{21d} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-deallocation}@anchor{21e} @subsection No_Unchecked_Deallocation @@ -13936,7 +13947,7 @@ dependences on the predefined generic function Unchecked_Conversion. dependences on the predefined generic procedure Unchecked_Deallocation. @node No_Use_Of_Attribute,No_Use_Of_Entity,No_Unchecked_Deallocation,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-use-of-attribute}@anchor{21e} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-use-of-attribute}@anchor{21f} @subsection No_Use_Of_Attribute @@ -13946,7 +13957,7 @@ dependences on the predefined generic procedure Unchecked_Deallocation. earlier versions of Ada. @node No_Use_Of_Entity,No_Use_Of_Pragma,No_Use_Of_Attribute,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-use-of-entity}@anchor{21f} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-use-of-entity}@anchor{220} @subsection No_Use_Of_Entity @@ -13966,7 +13977,7 @@ No_Use_Of_Entity => Ada.Text_IO.Put_Line @end example @node No_Use_Of_Pragma,Pure_Barriers,No_Use_Of_Entity,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-use-of-pragma}@anchor{220} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-use-of-pragma}@anchor{221} @subsection No_Use_Of_Pragma @@ -13976,7 +13987,7 @@ No_Use_Of_Entity => Ada.Text_IO.Put_Line earlier versions of Ada. @node Pure_Barriers,Simple_Barriers,No_Use_Of_Pragma,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions pure-barriers}@anchor{221} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions pure-barriers}@anchor{222} @subsection Pure_Barriers @@ -14027,7 +14038,7 @@ but still ensures absence of side effects, exceptions, and recursion during the evaluation of the barriers. @node Simple_Barriers,Static_Priorities,Pure_Barriers,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions simple-barriers}@anchor{222} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions simple-barriers}@anchor{223} @subsection Simple_Barriers @@ -14046,7 +14057,7 @@ compatibility purposes (and a warning will be generated for its use if warnings on obsolescent features are activated). @node Static_Priorities,Static_Storage_Size,Simple_Barriers,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-priorities}@anchor{223} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-priorities}@anchor{224} @subsection Static_Priorities @@ -14057,7 +14068,7 @@ are static, and that there are no dependences on the package @code{Ada.Dynamic_Priorities}. @node Static_Storage_Size,,Static_Priorities,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-storage-size}@anchor{224} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-storage-size}@anchor{225} @subsection Static_Storage_Size @@ -14067,7 +14078,7 @@ are static, and that there are no dependences on the package in a Storage_Size pragma or attribute definition clause is static. @node Program Unit Level Restrictions,,Partition-Wide Restrictions,Standard and Implementation Defined Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions id3}@anchor{225}@anchor{gnat_rm/standard_and_implementation_defined_restrictions program-unit-level-restrictions}@anchor{226} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions id3}@anchor{226}@anchor{gnat_rm/standard_and_implementation_defined_restrictions program-unit-level-restrictions}@anchor{227} @section Program Unit Level Restrictions @@ -14098,7 +14109,7 @@ other compilation units in the partition. @end menu @node No_Elaboration_Code,No_Dynamic_Accessibility_Checks,,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-elaboration-code}@anchor{227} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-elaboration-code}@anchor{228} @subsection No_Elaboration_Code @@ -14154,7 +14165,7 @@ associated with the unit. This counter is typically used to check for access before elaboration and to control multiple elaboration attempts. @node No_Dynamic_Accessibility_Checks,No_Dynamic_Sized_Objects,No_Elaboration_Code,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-accessibility-checks}@anchor{228} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-accessibility-checks}@anchor{229} @subsection No_Dynamic_Accessibility_Checks @@ -14203,7 +14214,7 @@ In all other cases, the level of T is as defined by the existing rules of Ada. @end itemize @node No_Dynamic_Sized_Objects,No_Entry_Queue,No_Dynamic_Accessibility_Checks,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-sized-objects}@anchor{229} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-sized-objects}@anchor{22a} @subsection No_Dynamic_Sized_Objects @@ -14221,7 +14232,7 @@ access discriminants. It is often a good idea to combine this restriction with No_Secondary_Stack. @node No_Entry_Queue,No_Implementation_Aspect_Specifications,No_Dynamic_Sized_Objects,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-entry-queue}@anchor{22a} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-entry-queue}@anchor{22b} @subsection No_Entry_Queue @@ -14234,7 +14245,7 @@ checked at compile time. A program execution is erroneous if an attempt is made to queue a second task on such an entry. @node No_Implementation_Aspect_Specifications,No_Implementation_Attributes,No_Entry_Queue,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-aspect-specifications}@anchor{22b} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-aspect-specifications}@anchor{22c} @subsection No_Implementation_Aspect_Specifications @@ -14245,7 +14256,7 @@ GNAT-defined aspects are present. With this restriction, the only aspects that can be used are those defined in the Ada Reference Manual. @node No_Implementation_Attributes,No_Implementation_Identifiers,No_Implementation_Aspect_Specifications,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-attributes}@anchor{22c} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-attributes}@anchor{22d} @subsection No_Implementation_Attributes @@ -14257,7 +14268,7 @@ attributes that can be used are those defined in the Ada Reference Manual. @node No_Implementation_Identifiers,No_Implementation_Pragmas,No_Implementation_Attributes,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-identifiers}@anchor{22d} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-identifiers}@anchor{22e} @subsection No_Implementation_Identifiers @@ -14268,7 +14279,7 @@ implementation-defined identifiers (marked with pragma Implementation_Defined) occur within language-defined packages. @node No_Implementation_Pragmas,No_Implementation_Restrictions,No_Implementation_Identifiers,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-pragmas}@anchor{22e} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-pragmas}@anchor{22f} @subsection No_Implementation_Pragmas @@ -14279,7 +14290,7 @@ GNAT-defined pragmas are present. With this restriction, the only pragmas that can be used are those defined in the Ada Reference Manual. @node No_Implementation_Restrictions,No_Implementation_Units,No_Implementation_Pragmas,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-restrictions}@anchor{22f} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-restrictions}@anchor{230} @subsection No_Implementation_Restrictions @@ -14291,7 +14302,7 @@ are present. With this restriction, the only other restriction identifiers that can be used are those defined in the Ada Reference Manual. @node No_Implementation_Units,No_Implicit_Aliasing,No_Implementation_Restrictions,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-units}@anchor{230} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-units}@anchor{231} @subsection No_Implementation_Units @@ -14302,7 +14313,7 @@ mention in the context clause of any implementation-defined descendants of packages Ada, Interfaces, or System. @node No_Implicit_Aliasing,No_Implicit_Loops,No_Implementation_Units,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-aliasing}@anchor{231} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-aliasing}@anchor{232} @subsection No_Implicit_Aliasing @@ -14317,7 +14328,7 @@ to be aliased, and in such cases, it can always be replaced by the standard attribute Unchecked_Access which is preferable. @node No_Implicit_Loops,No_Obsolescent_Features,No_Implicit_Aliasing,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-loops}@anchor{232} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-loops}@anchor{233} @subsection No_Implicit_Loops @@ -14334,7 +14345,7 @@ arrays larger than about 5000 scalar components. Note that if this restriction is set in the spec of a package, it will not apply to its body. @node No_Obsolescent_Features,No_Wide_Characters,No_Implicit_Loops,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-obsolescent-features}@anchor{233} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-obsolescent-features}@anchor{234} @subsection No_Obsolescent_Features @@ -14344,7 +14355,7 @@ is set in the spec of a package, it will not apply to its body. features are used, as defined in Annex J of the Ada Reference Manual. @node No_Wide_Characters,Static_Dispatch_Tables,No_Obsolescent_Features,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-wide-characters}@anchor{234} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-wide-characters}@anchor{235} @subsection No_Wide_Characters @@ -14358,7 +14369,7 @@ appear in the program (that is literals representing characters not in type @code{Character}). @node Static_Dispatch_Tables,SPARK_05,No_Wide_Characters,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-dispatch-tables}@anchor{235} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-dispatch-tables}@anchor{236} @subsection Static_Dispatch_Tables @@ -14368,7 +14379,7 @@ type @code{Character}). associated with dispatch tables can be placed in read-only memory. @node SPARK_05,,Static_Dispatch_Tables,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions spark-05}@anchor{236} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions spark-05}@anchor{237} @subsection SPARK_05 @@ -14391,7 +14402,7 @@ gnatprove -P project.gpr --mode=check_all @end example @node Implementation Advice,GNAT Implementation Mode the -gnatg switch,Standard and Implementation Defined Restrictions,Top -@anchor{gnat_rm/implementation_advice doc}@anchor{237}@anchor{gnat_rm/implementation_advice id1}@anchor{238}@anchor{gnat_rm/implementation_advice implementation-advice}@anchor{a} +@anchor{gnat_rm/implementation_advice doc}@anchor{238}@anchor{gnat_rm/implementation_advice id1}@anchor{239}@anchor{gnat_rm/implementation_advice implementation-advice}@anchor{a} @chapter Implementation Advice @@ -14489,7 +14500,7 @@ case the text describes what GNAT does and why. @end menu @node RM 1 1 3 20 Error Detection,RM 1 1 3 31 Child Units,,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-1-1-3-20-error-detection}@anchor{239} +@anchor{gnat_rm/implementation_advice rm-1-1-3-20-error-detection}@anchor{23a} @section RM 1.1.3(20): Error Detection @@ -14506,7 +14517,7 @@ or diagnosed at compile time. @geindex Child Units @node RM 1 1 3 31 Child Units,RM 1 1 5 12 Bounded Errors,RM 1 1 3 20 Error Detection,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-1-1-3-31-child-units}@anchor{23a} +@anchor{gnat_rm/implementation_advice rm-1-1-3-31-child-units}@anchor{23b} @section RM 1.1.3(31): Child Units @@ -14522,7 +14533,7 @@ Followed. @geindex Bounded errors @node RM 1 1 5 12 Bounded Errors,RM 2 8 16 Pragmas,RM 1 1 3 31 Child Units,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-1-1-5-12-bounded-errors}@anchor{23b} +@anchor{gnat_rm/implementation_advice rm-1-1-5-12-bounded-errors}@anchor{23c} @section RM 1.1.5(12): Bounded Errors @@ -14539,7 +14550,7 @@ runtime. @geindex Pragmas @node RM 2 8 16 Pragmas,RM 2 8 17-19 Pragmas,RM 1 1 5 12 Bounded Errors,Implementation Advice -@anchor{gnat_rm/implementation_advice id2}@anchor{23c}@anchor{gnat_rm/implementation_advice rm-2-8-16-pragmas}@anchor{23d} +@anchor{gnat_rm/implementation_advice id2}@anchor{23d}@anchor{gnat_rm/implementation_advice rm-2-8-16-pragmas}@anchor{23e} @section RM 2.8(16): Pragmas @@ -14652,7 +14663,7 @@ that this advice not be followed. For details see @ref{7,,Implementation Defined Pragmas}. @node RM 2 8 17-19 Pragmas,RM 3 5 2 5 Alternative Character Sets,RM 2 8 16 Pragmas,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-2-8-17-19-pragmas}@anchor{23e} +@anchor{gnat_rm/implementation_advice rm-2-8-17-19-pragmas}@anchor{23f} @section RM 2.8(17-19): Pragmas @@ -14673,14 +14684,14 @@ replacing @code{library_items}.” @end itemize @end quotation -See @ref{23d,,RM 2.8(16); Pragmas}. +See @ref{23e,,RM 2.8(16); Pragmas}. @geindex Character Sets @geindex Alternative Character Sets @node RM 3 5 2 5 Alternative Character Sets,RM 3 5 4 28 Integer Types,RM 2 8 17-19 Pragmas,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-5-2-5-alternative-character-sets}@anchor{23f} +@anchor{gnat_rm/implementation_advice rm-3-5-2-5-alternative-character-sets}@anchor{240} @section RM 3.5.2(5): Alternative Character Sets @@ -14708,7 +14719,7 @@ there is no such restriction. @geindex Integer types @node RM 3 5 4 28 Integer Types,RM 3 5 4 29 Integer Types,RM 3 5 2 5 Alternative Character Sets,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-5-4-28-integer-types}@anchor{240} +@anchor{gnat_rm/implementation_advice rm-3-5-4-28-integer-types}@anchor{241} @section RM 3.5.4(28): Integer Types @@ -14727,7 +14738,7 @@ are supported for convenient interface to C, and so that all hardware types of the machine are easily available. @node RM 3 5 4 29 Integer Types,RM 3 5 5 8 Enumeration Values,RM 3 5 4 28 Integer Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-5-4-29-integer-types}@anchor{241} +@anchor{gnat_rm/implementation_advice rm-3-5-4-29-integer-types}@anchor{242} @section RM 3.5.4(29): Integer Types @@ -14743,7 +14754,7 @@ Followed. @geindex Enumeration values @node RM 3 5 5 8 Enumeration Values,RM 3 5 7 17 Float Types,RM 3 5 4 29 Integer Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-5-5-8-enumeration-values}@anchor{242} +@anchor{gnat_rm/implementation_advice rm-3-5-5-8-enumeration-values}@anchor{243} @section RM 3.5.5(8): Enumeration Values @@ -14763,7 +14774,7 @@ Followed. @geindex Float types @node RM 3 5 7 17 Float Types,RM 3 6 2 11 Multidimensional Arrays,RM 3 5 5 8 Enumeration Values,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-5-7-17-float-types}@anchor{243} +@anchor{gnat_rm/implementation_advice rm-3-5-7-17-float-types}@anchor{244} @section RM 3.5.7(17): Float Types @@ -14793,7 +14804,7 @@ is a software rather than a hardware format. @geindex multidimensional @node RM 3 6 2 11 Multidimensional Arrays,RM 9 6 30-31 Duration’Small,RM 3 5 7 17 Float Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-6-2-11-multidimensional-arrays}@anchor{244} +@anchor{gnat_rm/implementation_advice rm-3-6-2-11-multidimensional-arrays}@anchor{245} @section RM 3.6.2(11): Multidimensional Arrays @@ -14811,7 +14822,7 @@ Followed. @geindex Duration'Small @node RM 9 6 30-31 Duration’Small,RM 10 2 1 12 Consistent Representation,RM 3 6 2 11 Multidimensional Arrays,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-9-6-30-31-duration-small}@anchor{245} +@anchor{gnat_rm/implementation_advice rm-9-6-30-31-duration-small}@anchor{246} @section RM 9.6(30-31): Duration’Small @@ -14832,7 +14843,7 @@ it need not be the same time base as used for @code{Calendar.Clock}.” Followed. @node RM 10 2 1 12 Consistent Representation,RM 11 4 1 19 Exception Information,RM 9 6 30-31 Duration’Small,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-10-2-1-12-consistent-representation}@anchor{246} +@anchor{gnat_rm/implementation_advice rm-10-2-1-12-consistent-representation}@anchor{247} @section RM 10.2.1(12): Consistent Representation @@ -14854,7 +14865,7 @@ advice without severely impacting efficiency of execution. @geindex Exception information @node RM 11 4 1 19 Exception Information,RM 11 5 28 Suppression of Checks,RM 10 2 1 12 Consistent Representation,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-11-4-1-19-exception-information}@anchor{247} +@anchor{gnat_rm/implementation_advice rm-11-4-1-19-exception-information}@anchor{248} @section RM 11.4.1(19): Exception Information @@ -14885,7 +14896,7 @@ Pragma @code{Discard_Names}. @geindex suppression of @node RM 11 5 28 Suppression of Checks,RM 13 1 21-24 Representation Clauses,RM 11 4 1 19 Exception Information,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-11-5-28-suppression-of-checks}@anchor{248} +@anchor{gnat_rm/implementation_advice rm-11-5-28-suppression-of-checks}@anchor{249} @section RM 11.5(28): Suppression of Checks @@ -14900,7 +14911,7 @@ Followed. @geindex Representation clauses @node RM 13 1 21-24 Representation Clauses,RM 13 2 6-8 Packed Types,RM 11 5 28 Suppression of Checks,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-1-21-24-representation-clauses}@anchor{249} +@anchor{gnat_rm/implementation_advice rm-13-1-21-24-representation-clauses}@anchor{24a} @section RM 13.1 (21-24): Representation Clauses @@ -14952,7 +14963,7 @@ Followed. @geindex Packed types @node RM 13 2 6-8 Packed Types,RM 13 3 14-19 Address Clauses,RM 13 1 21-24 Representation Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-2-6-8-packed-types}@anchor{24a} +@anchor{gnat_rm/implementation_advice rm-13-2-6-8-packed-types}@anchor{24b} @section RM 13.2(6-8): Packed Types @@ -14983,7 +14994,7 @@ subcomponent of the packed type. @geindex Address clauses @node RM 13 3 14-19 Address Clauses,RM 13 3 29-35 Alignment Clauses,RM 13 2 6-8 Packed Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-3-14-19-address-clauses}@anchor{24b} +@anchor{gnat_rm/implementation_advice rm-13-3-14-19-address-clauses}@anchor{24c} @section RM 13.3(14-19): Address Clauses @@ -15036,7 +15047,7 @@ Followed. @geindex Alignment clauses @node RM 13 3 29-35 Alignment Clauses,RM 13 3 42-43 Size Clauses,RM 13 3 14-19 Address Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-3-29-35-alignment-clauses}@anchor{24c} +@anchor{gnat_rm/implementation_advice rm-13-3-29-35-alignment-clauses}@anchor{24d} @section RM 13.3(29-35): Alignment Clauses @@ -15093,7 +15104,7 @@ Followed. @geindex Size clauses @node RM 13 3 42-43 Size Clauses,RM 13 3 50-56 Size Clauses,RM 13 3 29-35 Alignment Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-3-42-43-size-clauses}@anchor{24d} +@anchor{gnat_rm/implementation_advice rm-13-3-42-43-size-clauses}@anchor{24e} @section RM 13.3(42-43): Size Clauses @@ -15111,7 +15122,7 @@ object’s @code{Alignment} (if the @code{Alignment} is nonzero).” Followed. @node RM 13 3 50-56 Size Clauses,RM 13 3 71-73 Component Size Clauses,RM 13 3 42-43 Size Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-3-50-56-size-clauses}@anchor{24e} +@anchor{gnat_rm/implementation_advice rm-13-3-50-56-size-clauses}@anchor{24f} @section RM 13.3(50-56): Size Clauses @@ -15162,7 +15173,7 @@ Followed. @geindex Component_Size clauses @node RM 13 3 71-73 Component Size Clauses,RM 13 4 9-10 Enumeration Representation Clauses,RM 13 3 50-56 Size Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-3-71-73-component-size-clauses}@anchor{24f} +@anchor{gnat_rm/implementation_advice rm-13-3-71-73-component-size-clauses}@anchor{250} @section RM 13.3(71-73): Component Size Clauses @@ -15196,7 +15207,7 @@ Followed. @geindex enumeration @node RM 13 4 9-10 Enumeration Representation Clauses,RM 13 5 1 17-22 Record Representation Clauses,RM 13 3 71-73 Component Size Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-4-9-10-enumeration-representation-clauses}@anchor{250} +@anchor{gnat_rm/implementation_advice rm-13-4-9-10-enumeration-representation-clauses}@anchor{251} @section RM 13.4(9-10): Enumeration Representation Clauses @@ -15218,7 +15229,7 @@ Followed. @geindex records @node RM 13 5 1 17-22 Record Representation Clauses,RM 13 5 2 5 Storage Place Attributes,RM 13 4 9-10 Enumeration Representation Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-5-1-17-22-record-representation-clauses}@anchor{251} +@anchor{gnat_rm/implementation_advice rm-13-5-1-17-22-record-representation-clauses}@anchor{252} @section RM 13.5.1(17-22): Record Representation Clauses @@ -15278,7 +15289,7 @@ and all mentioned features are implemented. @geindex Storage place attributes @node RM 13 5 2 5 Storage Place Attributes,RM 13 5 3 7-8 Bit Ordering,RM 13 5 1 17-22 Record Representation Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-5-2-5-storage-place-attributes}@anchor{252} +@anchor{gnat_rm/implementation_advice rm-13-5-2-5-storage-place-attributes}@anchor{253} @section RM 13.5.2(5): Storage Place Attributes @@ -15298,7 +15309,7 @@ Followed. There are no such components in GNAT. @geindex Bit ordering @node RM 13 5 3 7-8 Bit Ordering,RM 13 7 37 Address as Private,RM 13 5 2 5 Storage Place Attributes,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-5-3-7-8-bit-ordering}@anchor{253} +@anchor{gnat_rm/implementation_advice rm-13-5-3-7-8-bit-ordering}@anchor{254} @section RM 13.5.3(7-8): Bit Ordering @@ -15316,7 +15327,7 @@ Followed. @geindex as private type @node RM 13 7 37 Address as Private,RM 13 7 1 16 Address Operations,RM 13 5 3 7-8 Bit Ordering,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-7-37-address-as-private}@anchor{254} +@anchor{gnat_rm/implementation_advice rm-13-7-37-address-as-private}@anchor{255} @section RM 13.7(37): Address as Private @@ -15334,7 +15345,7 @@ Followed. @geindex operations of @node RM 13 7 1 16 Address Operations,RM 13 9 14-17 Unchecked Conversion,RM 13 7 37 Address as Private,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-7-1-16-address-operations}@anchor{255} +@anchor{gnat_rm/implementation_advice rm-13-7-1-16-address-operations}@anchor{256} @section RM 13.7.1(16): Address Operations @@ -15352,7 +15363,7 @@ operation raises @code{Program_Error}, since all operations make sense. @geindex Unchecked conversion @node RM 13 9 14-17 Unchecked Conversion,RM 13 11 23-25 Implicit Heap Usage,RM 13 7 1 16 Address Operations,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-9-14-17-unchecked-conversion}@anchor{256} +@anchor{gnat_rm/implementation_advice rm-13-9-14-17-unchecked-conversion}@anchor{257} @section RM 13.9(14-17): Unchecked Conversion @@ -15396,7 +15407,7 @@ Followed. @geindex implicit @node RM 13 11 23-25 Implicit Heap Usage,RM 13 11 2 17 Unchecked Deallocation,RM 13 9 14-17 Unchecked Conversion,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-11-23-25-implicit-heap-usage}@anchor{257} +@anchor{gnat_rm/implementation_advice rm-13-11-23-25-implicit-heap-usage}@anchor{258} @section RM 13.11(23-25): Implicit Heap Usage @@ -15447,7 +15458,7 @@ Followed. @geindex Unchecked deallocation @node RM 13 11 2 17 Unchecked Deallocation,RM 13 13 2 1 6 Stream Oriented Attributes,RM 13 11 23-25 Implicit Heap Usage,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-11-2-17-unchecked-deallocation}@anchor{258} +@anchor{gnat_rm/implementation_advice rm-13-11-2-17-unchecked-deallocation}@anchor{259} @section RM 13.11.2(17): Unchecked Deallocation @@ -15462,7 +15473,7 @@ Followed. @geindex Stream oriented attributes @node RM 13 13 2 1 6 Stream Oriented Attributes,RM A 1 52 Names of Predefined Numeric Types,RM 13 11 2 17 Unchecked Deallocation,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-13-2-1-6-stream-oriented-attributes}@anchor{259} +@anchor{gnat_rm/implementation_advice rm-13-13-2-1-6-stream-oriented-attributes}@anchor{25a} @section RM 13.13.2(1.6): Stream Oriented Attributes @@ -15493,7 +15504,7 @@ scalar types. This XDR alternative can be enabled via the binder switch -xdr. @geindex Stream oriented attributes @node RM A 1 52 Names of Predefined Numeric Types,RM A 3 2 49 Ada Characters Handling,RM 13 13 2 1 6 Stream Oriented Attributes,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-1-52-names-of-predefined-numeric-types}@anchor{25a} +@anchor{gnat_rm/implementation_advice rm-a-1-52-names-of-predefined-numeric-types}@anchor{25b} @section RM A.1(52): Names of Predefined Numeric Types @@ -15511,7 +15522,7 @@ Followed. @geindex Ada.Characters.Handling @node RM A 3 2 49 Ada Characters Handling,RM A 4 4 106 Bounded-Length String Handling,RM A 1 52 Names of Predefined Numeric Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-3-2-49-ada-characters-handling}@anchor{25b} +@anchor{gnat_rm/implementation_advice rm-a-3-2-49-ada-characters-handling}@anchor{25c} @section RM A.3.2(49): @code{Ada.Characters.Handling} @@ -15528,7 +15539,7 @@ Followed. GNAT provides no such localized definitions. @geindex Bounded-length strings @node RM A 4 4 106 Bounded-Length String Handling,RM A 5 2 46-47 Random Number Generation,RM A 3 2 49 Ada Characters Handling,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-4-4-106-bounded-length-string-handling}@anchor{25c} +@anchor{gnat_rm/implementation_advice rm-a-4-4-106-bounded-length-string-handling}@anchor{25d} @section RM A.4.4(106): Bounded-Length String Handling @@ -15543,7 +15554,7 @@ Followed. No implicit pointers or dynamic allocation are used. @geindex Random number generation @node RM A 5 2 46-47 Random Number Generation,RM A 10 7 23 Get_Immediate,RM A 4 4 106 Bounded-Length String Handling,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-5-2-46-47-random-number-generation}@anchor{25d} +@anchor{gnat_rm/implementation_advice rm-a-5-2-46-47-random-number-generation}@anchor{25e} @section RM A.5.2(46-47): Random Number Generation @@ -15572,7 +15583,7 @@ condition here to hold true. @geindex Get_Immediate @node RM A 10 7 23 Get_Immediate,RM A 18 Containers,RM A 5 2 46-47 Random Number Generation,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-10-7-23-get-immediate}@anchor{25e} +@anchor{gnat_rm/implementation_advice rm-a-10-7-23-get-immediate}@anchor{25f} @section RM A.10.7(23): @code{Get_Immediate} @@ -15596,7 +15607,7 @@ this functionality. @geindex Containers @node RM A 18 Containers,RM B 1 39-41 Pragma Export,RM A 10 7 23 Get_Immediate,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-18-containers}@anchor{25f} +@anchor{gnat_rm/implementation_advice rm-a-18-containers}@anchor{260} @section RM A.18: @code{Containers} @@ -15617,7 +15628,7 @@ follow the implementation advice. @geindex Export @node RM B 1 39-41 Pragma Export,RM B 2 12-13 Package Interfaces,RM A 18 Containers,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-b-1-39-41-pragma-export}@anchor{260} +@anchor{gnat_rm/implementation_advice rm-b-1-39-41-pragma-export}@anchor{261} @section RM B.1(39-41): Pragma @code{Export} @@ -15665,7 +15676,7 @@ Followed. @geindex Interfaces @node RM B 2 12-13 Package Interfaces,RM B 3 63-71 Interfacing with C,RM B 1 39-41 Pragma Export,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-b-2-12-13-package-interfaces}@anchor{261} +@anchor{gnat_rm/implementation_advice rm-b-2-12-13-package-interfaces}@anchor{262} @section RM B.2(12-13): Package @code{Interfaces} @@ -15695,7 +15706,7 @@ Followed. GNAT provides all the packages described in this section. @geindex interfacing with @node RM B 3 63-71 Interfacing with C,RM B 4 95-98 Interfacing with COBOL,RM B 2 12-13 Package Interfaces,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-b-3-63-71-interfacing-with-c}@anchor{262} +@anchor{gnat_rm/implementation_advice rm-b-3-63-71-interfacing-with-c}@anchor{263} @section RM B.3(63-71): Interfacing with C @@ -15783,7 +15794,7 @@ Followed. @geindex interfacing with @node RM B 4 95-98 Interfacing with COBOL,RM B 5 22-26 Interfacing with Fortran,RM B 3 63-71 Interfacing with C,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-b-4-95-98-interfacing-with-cobol}@anchor{263} +@anchor{gnat_rm/implementation_advice rm-b-4-95-98-interfacing-with-cobol}@anchor{264} @section RM B.4(95-98): Interfacing with COBOL @@ -15824,7 +15835,7 @@ Followed. @geindex interfacing with @node RM B 5 22-26 Interfacing with Fortran,RM C 1 3-5 Access to Machine Operations,RM B 4 95-98 Interfacing with COBOL,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-b-5-22-26-interfacing-with-fortran}@anchor{264} +@anchor{gnat_rm/implementation_advice rm-b-5-22-26-interfacing-with-fortran}@anchor{265} @section RM B.5(22-26): Interfacing with Fortran @@ -15875,7 +15886,7 @@ Followed. @geindex Machine operations @node RM C 1 3-5 Access to Machine Operations,RM C 1 10-16 Access to Machine Operations,RM B 5 22-26 Interfacing with Fortran,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-1-3-5-access-to-machine-operations}@anchor{265} +@anchor{gnat_rm/implementation_advice rm-c-1-3-5-access-to-machine-operations}@anchor{266} @section RM C.1(3-5): Access to Machine Operations @@ -15910,7 +15921,7 @@ object that is specified as exported.” Followed. @node RM C 1 10-16 Access to Machine Operations,RM C 3 28 Interrupt Support,RM C 1 3-5 Access to Machine Operations,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-1-10-16-access-to-machine-operations}@anchor{266} +@anchor{gnat_rm/implementation_advice rm-c-1-10-16-access-to-machine-operations}@anchor{267} @section RM C.1(10-16): Access to Machine Operations @@ -15971,7 +15982,7 @@ Followed on any target supporting such operations. @geindex Interrupt support @node RM C 3 28 Interrupt Support,RM C 3 1 20-21 Protected Procedure Handlers,RM C 1 10-16 Access to Machine Operations,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-3-28-interrupt-support}@anchor{267} +@anchor{gnat_rm/implementation_advice rm-c-3-28-interrupt-support}@anchor{268} @section RM C.3(28): Interrupt Support @@ -15989,7 +16000,7 @@ of interrupt blocking. @geindex Protected procedure handlers @node RM C 3 1 20-21 Protected Procedure Handlers,RM C 3 2 25 Package Interrupts,RM C 3 28 Interrupt Support,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-3-1-20-21-protected-procedure-handlers}@anchor{268} +@anchor{gnat_rm/implementation_advice rm-c-3-1-20-21-protected-procedure-handlers}@anchor{269} @section RM C.3.1(20-21): Protected Procedure Handlers @@ -16015,7 +16026,7 @@ Followed. Compile time warnings are given when possible. @geindex Interrupts @node RM C 3 2 25 Package Interrupts,RM C 4 14 Pre-elaboration Requirements,RM C 3 1 20-21 Protected Procedure Handlers,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-3-2-25-package-interrupts}@anchor{269} +@anchor{gnat_rm/implementation_advice rm-c-3-2-25-package-interrupts}@anchor{26a} @section RM C.3.2(25): Package @code{Interrupts} @@ -16033,7 +16044,7 @@ Followed. @geindex Pre-elaboration requirements @node RM C 4 14 Pre-elaboration Requirements,RM C 5 8 Pragma Discard_Names,RM C 3 2 25 Package Interrupts,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-4-14-pre-elaboration-requirements}@anchor{26a} +@anchor{gnat_rm/implementation_advice rm-c-4-14-pre-elaboration-requirements}@anchor{26b} @section RM C.4(14): Pre-elaboration Requirements @@ -16049,7 +16060,7 @@ Followed. Executable code is generated in some cases, e.g., loops to initialize large arrays. @node RM C 5 8 Pragma Discard_Names,RM C 7 2 30 The Package Task_Attributes,RM C 4 14 Pre-elaboration Requirements,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-5-8-pragma-discard-names}@anchor{26b} +@anchor{gnat_rm/implementation_advice rm-c-5-8-pragma-discard-names}@anchor{26c} @section RM C.5(8): Pragma @code{Discard_Names} @@ -16067,7 +16078,7 @@ Followed. @geindex Task_Attributes @node RM C 7 2 30 The Package Task_Attributes,RM D 3 17 Locking Policies,RM C 5 8 Pragma Discard_Names,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-7-2-30-the-package-task-attributes}@anchor{26c} +@anchor{gnat_rm/implementation_advice rm-c-7-2-30-the-package-task-attributes}@anchor{26d} @section RM C.7.2(30): The Package Task_Attributes @@ -16088,7 +16099,7 @@ Not followed. This implementation is not targeted to such a domain. @geindex Locking Policies @node RM D 3 17 Locking Policies,RM D 4 16 Entry Queuing Policies,RM C 7 2 30 The Package Task_Attributes,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-d-3-17-locking-policies}@anchor{26d} +@anchor{gnat_rm/implementation_advice rm-d-3-17-locking-policies}@anchor{26e} @section RM D.3(17): Locking Policies @@ -16105,7 +16116,7 @@ whose names (@code{Inheritance_Locking} and @geindex Entry queuing policies @node RM D 4 16 Entry Queuing Policies,RM D 6 9-10 Preemptive Abort,RM D 3 17 Locking Policies,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-d-4-16-entry-queuing-policies}@anchor{26e} +@anchor{gnat_rm/implementation_advice rm-d-4-16-entry-queuing-policies}@anchor{26f} @section RM D.4(16): Entry Queuing Policies @@ -16120,7 +16131,7 @@ Followed. No such implementation-defined queuing policies exist. @geindex Preemptive abort @node RM D 6 9-10 Preemptive Abort,RM D 7 21 Tasking Restrictions,RM D 4 16 Entry Queuing Policies,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-d-6-9-10-preemptive-abort}@anchor{26f} +@anchor{gnat_rm/implementation_advice rm-d-6-9-10-preemptive-abort}@anchor{270} @section RM D.6(9-10): Preemptive Abort @@ -16146,7 +16157,7 @@ Followed. @geindex Tasking restrictions @node RM D 7 21 Tasking Restrictions,RM D 8 47-49 Monotonic Time,RM D 6 9-10 Preemptive Abort,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-d-7-21-tasking-restrictions}@anchor{270} +@anchor{gnat_rm/implementation_advice rm-d-7-21-tasking-restrictions}@anchor{271} @section RM D.7(21): Tasking Restrictions @@ -16165,7 +16176,7 @@ pragma @code{Profile (Restricted)} for more details. @geindex monotonic @node RM D 8 47-49 Monotonic Time,RM E 5 28-29 Partition Communication Subsystem,RM D 7 21 Tasking Restrictions,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-d-8-47-49-monotonic-time}@anchor{271} +@anchor{gnat_rm/implementation_advice rm-d-8-47-49-monotonic-time}@anchor{272} @section RM D.8(47-49): Monotonic Time @@ -16200,7 +16211,7 @@ Followed. @geindex PCS @node RM E 5 28-29 Partition Communication Subsystem,RM F 7 COBOL Support,RM D 8 47-49 Monotonic Time,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-e-5-28-29-partition-communication-subsystem}@anchor{272} +@anchor{gnat_rm/implementation_advice rm-e-5-28-29-partition-communication-subsystem}@anchor{273} @section RM E.5(28-29): Partition Communication Subsystem @@ -16212,7 +16223,7 @@ should allow them to block until the corresponding subprogram body returns.” @end quotation -A separately supplied PCS that can be used with GNAT when combined with the PolyORB product (NB! See the note in @ref{273,,PolyORB} regarding the lifetime +A separately supplied PCS that can be used with GNAT when combined with the PolyORB product (NB! See the note in @ref{274,,PolyORB} regarding the lifetime of this product). @quotation @@ -16225,7 +16236,7 @@ write the @code{Item} into the stream.” @geindex COBOL support @node RM F 7 COBOL Support,RM F 1 2 Decimal Radix Support,RM E 5 28-29 Partition Communication Subsystem,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-f-7-cobol-support}@anchor{274} +@anchor{gnat_rm/implementation_advice rm-f-7-cobol-support}@anchor{275} @section RM F(7): COBOL Support @@ -16245,7 +16256,7 @@ Followed. @geindex Decimal radix support @node RM F 1 2 Decimal Radix Support,RM G Numerics,RM F 7 COBOL Support,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-f-1-2-decimal-radix-support}@anchor{275} +@anchor{gnat_rm/implementation_advice rm-f-1-2-decimal-radix-support}@anchor{276} @section RM F.1(2): Decimal Radix Support @@ -16261,7 +16272,7 @@ representations. @geindex Numerics @node RM G Numerics,RM G 1 1 56-58 Complex Types,RM F 1 2 Decimal Radix Support,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-g-numerics}@anchor{276} +@anchor{gnat_rm/implementation_advice rm-g-numerics}@anchor{277} @section RM G: Numerics @@ -16281,7 +16292,7 @@ Followed. @geindex Complex types @node RM G 1 1 56-58 Complex Types,RM G 1 2 49 Complex Elementary Functions,RM G Numerics,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-g-1-1-56-58-complex-types}@anchor{277} +@anchor{gnat_rm/implementation_advice rm-g-1-1-56-58-complex-types}@anchor{278} @section RM G.1.1(56-58): Complex Types @@ -16343,7 +16354,7 @@ Followed. @geindex Complex elementary functions @node RM G 1 2 49 Complex Elementary Functions,RM G 2 4 19 Accuracy Requirements,RM G 1 1 56-58 Complex Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-g-1-2-49-complex-elementary-functions}@anchor{278} +@anchor{gnat_rm/implementation_advice rm-g-1-2-49-complex-elementary-functions}@anchor{279} @section RM G.1.2(49): Complex Elementary Functions @@ -16365,7 +16376,7 @@ Followed. @geindex Accuracy requirements @node RM G 2 4 19 Accuracy Requirements,RM G 2 6 15 Complex Arithmetic Accuracy,RM G 1 2 49 Complex Elementary Functions,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-g-2-4-19-accuracy-requirements}@anchor{279} +@anchor{gnat_rm/implementation_advice rm-g-2-4-19-accuracy-requirements}@anchor{27a} @section RM G.2.4(19): Accuracy Requirements @@ -16389,7 +16400,7 @@ Followed. @geindex complex arithmetic @node RM G 2 6 15 Complex Arithmetic Accuracy,RM H 6 15/2 Pragma Partition_Elaboration_Policy,RM G 2 4 19 Accuracy Requirements,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-g-2-6-15-complex-arithmetic-accuracy}@anchor{27a} +@anchor{gnat_rm/implementation_advice rm-g-2-6-15-complex-arithmetic-accuracy}@anchor{27b} @section RM G.2.6(15): Complex Arithmetic Accuracy @@ -16407,7 +16418,7 @@ Followed. @geindex Sequential elaboration policy @node RM H 6 15/2 Pragma Partition_Elaboration_Policy,,RM G 2 6 15 Complex Arithmetic Accuracy,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-h-6-15-2-pragma-partition-elaboration-policy}@anchor{27b} +@anchor{gnat_rm/implementation_advice rm-h-6-15-2-pragma-partition-elaboration-policy}@anchor{27c} @section RM H.6(15/2): Pragma Partition_Elaboration_Policy @@ -16422,7 +16433,7 @@ immediately terminated.” Not followed. @node GNAT Implementation Mode the -gnatg switch,Implementation Defined Characteristics,Implementation Advice,Top -@anchor{gnat_rm/gnat_implementation_mode doc}@anchor{27c}@anchor{gnat_rm/gnat_implementation_mode gnat-implementation-mode}@anchor{b}@anchor{gnat_rm/gnat_implementation_mode gnat-implementation-mode-the-gnatg-switch}@anchor{27d} +@anchor{gnat_rm/gnat_implementation_mode doc}@anchor{27d}@anchor{gnat_rm/gnat_implementation_mode gnat-implementation-mode}@anchor{b}@anchor{gnat_rm/gnat_implementation_mode gnat-implementation-mode-the-gnatg-switch}@anchor{27e} @chapter GNAT Implementation Mode (the @code{-gnatg} switch) @@ -16439,7 +16450,7 @@ It implies @code{-gnatw.ge} (extended warning set, treated as errors) and @end menu @node Language & Semantic Changes,,,GNAT Implementation Mode the -gnatg switch -@anchor{gnat_rm/gnat_implementation_mode language-semantic-changes}@anchor{27e} +@anchor{gnat_rm/gnat_implementation_mode language-semantic-changes}@anchor{27f} @section Language & Semantic Changes @@ -16454,7 +16465,7 @@ It implies @code{-gnatw.ge} (extended warning set, treated as errors) and @end menu @node Ada Version and Identifier Rules,Limited Types,,Language & Semantic Changes -@anchor{gnat_rm/gnat_implementation_mode ada-version-and-identifier-rules}@anchor{27f} +@anchor{gnat_rm/gnat_implementation_mode ada-version-and-identifier-rules}@anchor{280} @subsection Ada Version and Identifier Rules @@ -16474,7 +16485,7 @@ between global symbols in the runtime and those defined in the user code. @end itemize @node Limited Types,Preelaboration and Categorization,Ada Version and Identifier Rules,Language & Semantic Changes -@anchor{gnat_rm/gnat_implementation_mode limited-types}@anchor{280} +@anchor{gnat_rm/gnat_implementation_mode limited-types}@anchor{281} @subsection Limited Types @@ -16492,7 +16503,7 @@ Returning objects of limited types is `permitted'. @end itemize @node Preelaboration and Categorization,Overflow,Limited Types,Language & Semantic Changes -@anchor{gnat_rm/gnat_implementation_mode preelaboration-and-categorization}@anchor{281} +@anchor{gnat_rm/gnat_implementation_mode preelaboration-and-categorization}@anchor{282} @subsection Preelaboration and Categorization @@ -16522,7 +16533,7 @@ predefined runtime manages its own elaboration order correctly. @end itemize @node Overflow,Miscellaneous,Preelaboration and Categorization,Language & Semantic Changes -@anchor{gnat_rm/gnat_implementation_mode overflow}@anchor{282} +@anchor{gnat_rm/gnat_implementation_mode overflow}@anchor{283} @subsection Overflow @@ -16530,7 +16541,7 @@ Overflow checks are `suppressed' but the overflow checking mode is set to `Strict' (for assertion purposes). @node Miscellaneous,ALI Files and Recompilation,Overflow,Language & Semantic Changes -@anchor{gnat_rm/gnat_implementation_mode miscellaneous}@anchor{283} +@anchor{gnat_rm/gnat_implementation_mode miscellaneous}@anchor{284} @subsection Miscellaneous @@ -16568,7 +16579,7 @@ rule set rather than the default @code{-gnaty} set. @end itemize @node ALI Files and Recompilation,,Miscellaneous,Language & Semantic Changes -@anchor{gnat_rm/gnat_implementation_mode ali-files-and-recompilation}@anchor{284} +@anchor{gnat_rm/gnat_implementation_mode ali-files-and-recompilation}@anchor{285} @subsection ALI Files and Recompilation @@ -16587,7 +16598,7 @@ to let GNAT compile its own predefined library (@code{Ada.Text_IO}, @end itemize @node Implementation Defined Characteristics,Intrinsic Subprograms,GNAT Implementation Mode the -gnatg switch,Top -@anchor{gnat_rm/implementation_defined_characteristics doc}@anchor{285}@anchor{gnat_rm/implementation_defined_characteristics id1}@anchor{286}@anchor{gnat_rm/implementation_defined_characteristics implementation-defined-characteristics}@anchor{c} +@anchor{gnat_rm/implementation_defined_characteristics doc}@anchor{286}@anchor{gnat_rm/implementation_defined_characteristics id1}@anchor{287}@anchor{gnat_rm/implementation_defined_characteristics implementation-defined-characteristics}@anchor{c} @chapter Implementation Defined Characteristics @@ -17228,7 +17239,7 @@ may have been set by a call to @code{Ada.Command_Line.Set_Exit_Status}). “The mechanisms for building and running partitions. See 10.2(24).” @end itemize -GNAT itself supports programs with only a single partition. The PolyORB product (which also includes an implementation of the PCS) provides a completely flexible method for building and running programs consisting of multiple partitions. `NB!' See the note in @ref{273,,PolyORB} regarding the lifetime +GNAT itself supports programs with only a single partition. The PolyORB product (which also includes an implementation of the PCS) provides a completely flexible method for building and running programs consisting of multiple partitions. `NB!' See the note in @ref{274,,PolyORB} regarding the lifetime of this product. @@ -17250,7 +17261,7 @@ implementation. See 10.2(28).” @end itemize Passive partitions are supported on targets where shared memory is -provided by the operating system. `NB!' See the note in @ref{273,,PolyORB} regarding the lifetime of this product. +provided by the operating system. `NB!' See the note in @ref{274,,PolyORB} regarding the lifetime of this product. @itemize * @@ -17877,7 +17888,7 @@ When the @code{Pattern} parameter is not the null string, it is interpreted according to the syntax of regular expressions as defined in the @code{GNAT.Regexp} package. -See @ref{287,,GNAT.Regexp (g-regexp.ads)}. +See @ref{288,,GNAT.Regexp (g-regexp.ads)}. @itemize * @@ -18636,7 +18647,7 @@ programs. See E(5).” @end itemize The PolyORB product provides means creating and executing -distributed programs. `NB!' See the note in @ref{273,,PolyORB} regarding the lifetime of this product. +distributed programs. `NB!' See the note in @ref{274,,PolyORB} regarding the lifetime of this product. @itemize * @@ -18647,7 +18658,7 @@ inaccessible. See E.1(7).” @end itemize See the PolyORB user guide for full details on such events. -`NB!' Consider the note in @ref{273,,PolyORB} regarding the lifetime +`NB!' Consider the note in @ref{274,,PolyORB} regarding the lifetime of this product. @@ -18659,7 +18670,7 @@ shared resources between partitions in certain cases. See E.1(11).” @end itemize See the PolyORB user guide for full details on these aspects of -multi-partition execution. `NB!' Consider the note in @ref{273,,PolyORB} regarding the lifetime of this product. +multi-partition execution. `NB!' Consider the note in @ref{274,,PolyORB} regarding the lifetime of this product. @itemize * @@ -18670,7 +18681,7 @@ immediately aborted as a result of cancellation. See E.4(13).” @end itemize See the PolyORB user guide for details on the effect of abort in -a distributed application. `NB!' Consider the note in @ref{273,,PolyORB} regarding the lifetime of this product. +a distributed application. `NB!' Consider the note in @ref{274,,PolyORB} regarding the lifetime of this product. @itemize * @@ -18689,7 +18700,7 @@ System.RPC.Partition_ID’Last is Integer’Last. See source file @code{s-rpc.ad @end itemize See the PolyORB user guide for a full description of all -implementation defined interfaces. `NB!' See the note in @ref{273,,PolyORB} regarding the lifetime of this product. +implementation defined interfaces. `NB!' See the note in @ref{274,,PolyORB} regarding the lifetime of this product. @itemize * @@ -18977,7 +18988,7 @@ Information on those subjects is not yet available. Execution is erroneous in that case. @node Intrinsic Subprograms,Representation Clauses and Pragmas,Implementation Defined Characteristics,Top -@anchor{gnat_rm/intrinsic_subprograms doc}@anchor{288}@anchor{gnat_rm/intrinsic_subprograms id1}@anchor{289}@anchor{gnat_rm/intrinsic_subprograms intrinsic-subprograms}@anchor{d} +@anchor{gnat_rm/intrinsic_subprograms doc}@anchor{289}@anchor{gnat_rm/intrinsic_subprograms id1}@anchor{28a}@anchor{gnat_rm/intrinsic_subprograms intrinsic-subprograms}@anchor{d} @chapter Intrinsic Subprograms @@ -19015,7 +19026,7 @@ Ada standard does not require Ada compilers to implement this feature. @end menu @node Intrinsic Operators,Compilation_ISO_Date,,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms id2}@anchor{28a}@anchor{gnat_rm/intrinsic_subprograms intrinsic-operators}@anchor{28b} +@anchor{gnat_rm/intrinsic_subprograms id2}@anchor{28b}@anchor{gnat_rm/intrinsic_subprograms intrinsic-operators}@anchor{28c} @section Intrinsic Operators @@ -19046,7 +19057,7 @@ It is also possible to specify such operators for private types, if the full views are appropriate arithmetic types. @node Compilation_ISO_Date,Compilation_Date,Intrinsic Operators,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms compilation-iso-date}@anchor{28c}@anchor{gnat_rm/intrinsic_subprograms id3}@anchor{28d} +@anchor{gnat_rm/intrinsic_subprograms compilation-iso-date}@anchor{28d}@anchor{gnat_rm/intrinsic_subprograms id3}@anchor{28e} @section Compilation_ISO_Date @@ -19060,7 +19071,7 @@ application program should simply call the function the current compilation (in local time format YYYY-MM-DD). @node Compilation_Date,Compilation_Time,Compilation_ISO_Date,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms compilation-date}@anchor{28e}@anchor{gnat_rm/intrinsic_subprograms id4}@anchor{28f} +@anchor{gnat_rm/intrinsic_subprograms compilation-date}@anchor{28f}@anchor{gnat_rm/intrinsic_subprograms id4}@anchor{290} @section Compilation_Date @@ -19070,7 +19081,7 @@ Same as Compilation_ISO_Date, except the string is in the form MMM DD YYYY. @node Compilation_Time,Enclosing_Entity,Compilation_Date,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms compilation-time}@anchor{290}@anchor{gnat_rm/intrinsic_subprograms id5}@anchor{291} +@anchor{gnat_rm/intrinsic_subprograms compilation-time}@anchor{291}@anchor{gnat_rm/intrinsic_subprograms id5}@anchor{292} @section Compilation_Time @@ -19084,7 +19095,7 @@ application program should simply call the function the current compilation (in local time format HH:MM:SS). @node Enclosing_Entity,Exception_Information,Compilation_Time,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms enclosing-entity}@anchor{292}@anchor{gnat_rm/intrinsic_subprograms id6}@anchor{293} +@anchor{gnat_rm/intrinsic_subprograms enclosing-entity}@anchor{293}@anchor{gnat_rm/intrinsic_subprograms id6}@anchor{294} @section Enclosing_Entity @@ -19098,7 +19109,7 @@ application program should simply call the function the current subprogram, package, task, entry, or protected subprogram. @node Exception_Information,Exception_Message,Enclosing_Entity,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms exception-information}@anchor{294}@anchor{gnat_rm/intrinsic_subprograms id7}@anchor{295} +@anchor{gnat_rm/intrinsic_subprograms exception-information}@anchor{295}@anchor{gnat_rm/intrinsic_subprograms id7}@anchor{296} @section Exception_Information @@ -19112,7 +19123,7 @@ so an application program should simply call the function the exception information associated with the current exception. @node Exception_Message,Exception_Name,Exception_Information,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms exception-message}@anchor{296}@anchor{gnat_rm/intrinsic_subprograms id8}@anchor{297} +@anchor{gnat_rm/intrinsic_subprograms exception-message}@anchor{297}@anchor{gnat_rm/intrinsic_subprograms id8}@anchor{298} @section Exception_Message @@ -19126,7 +19137,7 @@ so an application program should simply call the function the message associated with the current exception. @node Exception_Name,File,Exception_Message,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms exception-name}@anchor{298}@anchor{gnat_rm/intrinsic_subprograms id9}@anchor{299} +@anchor{gnat_rm/intrinsic_subprograms exception-name}@anchor{299}@anchor{gnat_rm/intrinsic_subprograms id9}@anchor{29a} @section Exception_Name @@ -19140,7 +19151,7 @@ so an application program should simply call the function the name of the current exception. @node File,Line,Exception_Name,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms file}@anchor{29a}@anchor{gnat_rm/intrinsic_subprograms id10}@anchor{29b} +@anchor{gnat_rm/intrinsic_subprograms file}@anchor{29b}@anchor{gnat_rm/intrinsic_subprograms id10}@anchor{29c} @section File @@ -19154,7 +19165,7 @@ application program should simply call the function file. @node Line,Shifts and Rotates,File,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms id11}@anchor{29c}@anchor{gnat_rm/intrinsic_subprograms line}@anchor{29d} +@anchor{gnat_rm/intrinsic_subprograms id11}@anchor{29d}@anchor{gnat_rm/intrinsic_subprograms line}@anchor{29e} @section Line @@ -19168,7 +19179,7 @@ application program should simply call the function source line. @node Shifts and Rotates,Source_Location,Line,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms id12}@anchor{29e}@anchor{gnat_rm/intrinsic_subprograms shifts-and-rotates}@anchor{29f} +@anchor{gnat_rm/intrinsic_subprograms id12}@anchor{29f}@anchor{gnat_rm/intrinsic_subprograms shifts-and-rotates}@anchor{2a0} @section Shifts and Rotates @@ -19211,7 +19222,7 @@ corresponding operator for modular type. In particular, shifting a negative number may change its sign bit to positive. @node Source_Location,,Shifts and Rotates,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms id13}@anchor{2a0}@anchor{gnat_rm/intrinsic_subprograms source-location}@anchor{2a1} +@anchor{gnat_rm/intrinsic_subprograms id13}@anchor{2a1}@anchor{gnat_rm/intrinsic_subprograms source-location}@anchor{2a2} @section Source_Location @@ -19225,7 +19236,7 @@ application program should simply call the function source file location. @node Representation Clauses and Pragmas,Standard Library Routines,Intrinsic Subprograms,Top -@anchor{gnat_rm/representation_clauses_and_pragmas doc}@anchor{2a2}@anchor{gnat_rm/representation_clauses_and_pragmas id1}@anchor{2a3}@anchor{gnat_rm/representation_clauses_and_pragmas representation-clauses-and-pragmas}@anchor{e} +@anchor{gnat_rm/representation_clauses_and_pragmas doc}@anchor{2a3}@anchor{gnat_rm/representation_clauses_and_pragmas id1}@anchor{2a4}@anchor{gnat_rm/representation_clauses_and_pragmas representation-clauses-and-pragmas}@anchor{e} @chapter Representation Clauses and Pragmas @@ -19271,7 +19282,7 @@ and this section describes the additional capabilities provided. @end menu @node Alignment Clauses,Size Clauses,,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas alignment-clauses}@anchor{2a4}@anchor{gnat_rm/representation_clauses_and_pragmas id2}@anchor{2a5} +@anchor{gnat_rm/representation_clauses_and_pragmas alignment-clauses}@anchor{2a5}@anchor{gnat_rm/representation_clauses_and_pragmas id2}@anchor{2a6} @section Alignment Clauses @@ -19401,7 +19412,7 @@ assumption is non-portable, and other compilers may choose different alignments for the subtype @code{RS}. @node Size Clauses,Storage_Size Clauses,Alignment Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id3}@anchor{2a6}@anchor{gnat_rm/representation_clauses_and_pragmas size-clauses}@anchor{2a7} +@anchor{gnat_rm/representation_clauses_and_pragmas id3}@anchor{2a7}@anchor{gnat_rm/representation_clauses_and_pragmas size-clauses}@anchor{2a8} @section Size Clauses @@ -19478,7 +19489,7 @@ if it is known that a Size value can be accommodated in an object of type Integer. @node Storage_Size Clauses,Size of Variant Record Objects,Size Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id4}@anchor{2a8}@anchor{gnat_rm/representation_clauses_and_pragmas storage-size-clauses}@anchor{2a9} +@anchor{gnat_rm/representation_clauses_and_pragmas id4}@anchor{2a9}@anchor{gnat_rm/representation_clauses_and_pragmas storage-size-clauses}@anchor{2aa} @section Storage_Size Clauses @@ -19551,7 +19562,7 @@ Of course in practice, there will not be any explicit allocators in the case of such an access declaration. @node Size of Variant Record Objects,Biased Representation,Storage_Size Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id5}@anchor{2aa}@anchor{gnat_rm/representation_clauses_and_pragmas size-of-variant-record-objects}@anchor{2ab} +@anchor{gnat_rm/representation_clauses_and_pragmas id5}@anchor{2ab}@anchor{gnat_rm/representation_clauses_and_pragmas size-of-variant-record-objects}@anchor{2ac} @section Size of Variant Record Objects @@ -19661,7 +19672,7 @@ the maximum size, regardless of the current variant value, the variant value. @node Biased Representation,Value_Size and Object_Size Clauses,Size of Variant Record Objects,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas biased-representation}@anchor{2ac}@anchor{gnat_rm/representation_clauses_and_pragmas id6}@anchor{2ad} +@anchor{gnat_rm/representation_clauses_and_pragmas biased-representation}@anchor{2ad}@anchor{gnat_rm/representation_clauses_and_pragmas id6}@anchor{2ae} @section Biased Representation @@ -19699,7 +19710,7 @@ biased representation can be used for all discrete types except for enumeration types for which a representation clause is given. @node Value_Size and Object_Size Clauses,Component_Size Clauses,Biased Representation,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id7}@anchor{2ae}@anchor{gnat_rm/representation_clauses_and_pragmas value-size-and-object-size-clauses}@anchor{2af} +@anchor{gnat_rm/representation_clauses_and_pragmas id7}@anchor{2af}@anchor{gnat_rm/representation_clauses_and_pragmas value-size-and-object-size-clauses}@anchor{2b0} @section Value_Size and Object_Size Clauses @@ -20015,7 +20026,7 @@ definition clause forces biased representation. This warning can be turned off using @code{-gnatw.B}. @node Component_Size Clauses,Bit_Order Clauses,Value_Size and Object_Size Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas component-size-clauses}@anchor{2b0}@anchor{gnat_rm/representation_clauses_and_pragmas id8}@anchor{2b1} +@anchor{gnat_rm/representation_clauses_and_pragmas component-size-clauses}@anchor{2b1}@anchor{gnat_rm/representation_clauses_and_pragmas id8}@anchor{2b2} @section Component_Size Clauses @@ -20063,7 +20074,7 @@ and a pragma Pack for the same array type. if such duplicate clauses are given, the pragma Pack will be ignored. @node Bit_Order Clauses,Effect of Bit_Order on Byte Ordering,Component_Size Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas bit-order-clauses}@anchor{2b2}@anchor{gnat_rm/representation_clauses_and_pragmas id9}@anchor{2b3} +@anchor{gnat_rm/representation_clauses_and_pragmas bit-order-clauses}@anchor{2b3}@anchor{gnat_rm/representation_clauses_and_pragmas id9}@anchor{2b4} @section Bit_Order Clauses @@ -20169,7 +20180,7 @@ if desired. The following section contains additional details regarding the issue of byte ordering. @node Effect of Bit_Order on Byte Ordering,Pragma Pack for Arrays,Bit_Order Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas effect-of-bit-order-on-byte-ordering}@anchor{2b4}@anchor{gnat_rm/representation_clauses_and_pragmas id10}@anchor{2b5} +@anchor{gnat_rm/representation_clauses_and_pragmas effect-of-bit-order-on-byte-ordering}@anchor{2b5}@anchor{gnat_rm/representation_clauses_and_pragmas id10}@anchor{2b6} @section Effect of Bit_Order on Byte Ordering @@ -20426,7 +20437,7 @@ to set the boolean constant @code{Master_Byte_First} in an appropriate manner. @node Pragma Pack for Arrays,Pragma Pack for Records,Effect of Bit_Order on Byte Ordering,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id11}@anchor{2b6}@anchor{gnat_rm/representation_clauses_and_pragmas pragma-pack-for-arrays}@anchor{2b7} +@anchor{gnat_rm/representation_clauses_and_pragmas id11}@anchor{2b7}@anchor{gnat_rm/representation_clauses_and_pragmas pragma-pack-for-arrays}@anchor{2b8} @section Pragma Pack for Arrays @@ -20546,7 +20557,7 @@ Here 31-bit packing is achieved as required, and no warning is generated, since in this case the programmer intention is clear. @node Pragma Pack for Records,Record Representation Clauses,Pragma Pack for Arrays,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id12}@anchor{2b8}@anchor{gnat_rm/representation_clauses_and_pragmas pragma-pack-for-records}@anchor{2b9} +@anchor{gnat_rm/representation_clauses_and_pragmas id12}@anchor{2b9}@anchor{gnat_rm/representation_clauses_and_pragmas pragma-pack-for-records}@anchor{2ba} @section Pragma Pack for Records @@ -20630,7 +20641,7 @@ array that is longer than 64 bits, so it is itself non-packable on boundary, and takes an integral number of bytes, i.e., 72 bits. @node Record Representation Clauses,Handling of Records with Holes,Pragma Pack for Records,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id13}@anchor{2ba}@anchor{gnat_rm/representation_clauses_and_pragmas record-representation-clauses}@anchor{2bb} +@anchor{gnat_rm/representation_clauses_and_pragmas id13}@anchor{2bb}@anchor{gnat_rm/representation_clauses_and_pragmas record-representation-clauses}@anchor{2bc} @section Record Representation Clauses @@ -20709,7 +20720,7 @@ end record; @end example @node Handling of Records with Holes,Enumeration Clauses,Record Representation Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas handling-of-records-with-holes}@anchor{2bc}@anchor{gnat_rm/representation_clauses_and_pragmas id14}@anchor{2bd} +@anchor{gnat_rm/representation_clauses_and_pragmas handling-of-records-with-holes}@anchor{2bd}@anchor{gnat_rm/representation_clauses_and_pragmas id14}@anchor{2be} @section Handling of Records with Holes @@ -20785,7 +20796,7 @@ for Hrec'Size use 64; @end example @node Enumeration Clauses,Address Clauses,Handling of Records with Holes,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas enumeration-clauses}@anchor{2be}@anchor{gnat_rm/representation_clauses_and_pragmas id15}@anchor{2bf} +@anchor{gnat_rm/representation_clauses_and_pragmas enumeration-clauses}@anchor{2bf}@anchor{gnat_rm/representation_clauses_and_pragmas id15}@anchor{2c0} @section Enumeration Clauses @@ -20828,7 +20839,7 @@ the overhead of converting representation values to the corresponding positional values, (i.e., the value delivered by the @code{Pos} attribute). @node Address Clauses,Use of Address Clauses for Memory-Mapped I/O,Enumeration Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas address-clauses}@anchor{2c0}@anchor{gnat_rm/representation_clauses_and_pragmas id16}@anchor{2c1} +@anchor{gnat_rm/representation_clauses_and_pragmas address-clauses}@anchor{2c1}@anchor{gnat_rm/representation_clauses_and_pragmas id16}@anchor{2c2} @section Address Clauses @@ -21167,7 +21178,7 @@ then the program compiles without the warning and when run will generate the output @code{X was not clobbered}. @node Use of Address Clauses for Memory-Mapped I/O,Effect of Convention on Representation,Address Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id17}@anchor{2c2}@anchor{gnat_rm/representation_clauses_and_pragmas use-of-address-clauses-for-memory-mapped-i-o}@anchor{2c3} +@anchor{gnat_rm/representation_clauses_and_pragmas id17}@anchor{2c3}@anchor{gnat_rm/representation_clauses_and_pragmas use-of-address-clauses-for-memory-mapped-i-o}@anchor{2c4} @section Use of Address Clauses for Memory-Mapped I/O @@ -21225,7 +21236,7 @@ provides the pragma @code{Volatile_Full_Access} which can be used in lieu of pragma @code{Atomic} and will give the additional guarantee. @node Effect of Convention on Representation,Conventions and Anonymous Access Types,Use of Address Clauses for Memory-Mapped I/O,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas effect-of-convention-on-representation}@anchor{2c4}@anchor{gnat_rm/representation_clauses_and_pragmas id18}@anchor{2c5} +@anchor{gnat_rm/representation_clauses_and_pragmas effect-of-convention-on-representation}@anchor{2c5}@anchor{gnat_rm/representation_clauses_and_pragmas id18}@anchor{2c6} @section Effect of Convention on Representation @@ -21303,7 +21314,7 @@ when one of these values is read, any nonzero value is treated as True. @end itemize @node Conventions and Anonymous Access Types,Determining the Representations chosen by GNAT,Effect of Convention on Representation,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas conventions-and-anonymous-access-types}@anchor{2c6}@anchor{gnat_rm/representation_clauses_and_pragmas id19}@anchor{2c7} +@anchor{gnat_rm/representation_clauses_and_pragmas conventions-and-anonymous-access-types}@anchor{2c7}@anchor{gnat_rm/representation_clauses_and_pragmas id19}@anchor{2c8} @section Conventions and Anonymous Access Types @@ -21379,7 +21390,7 @@ package ConvComp is @end example @node Determining the Representations chosen by GNAT,,Conventions and Anonymous Access Types,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas determining-the-representations-chosen-by-gnat}@anchor{2c8}@anchor{gnat_rm/representation_clauses_and_pragmas id20}@anchor{2c9} +@anchor{gnat_rm/representation_clauses_and_pragmas determining-the-representations-chosen-by-gnat}@anchor{2c9}@anchor{gnat_rm/representation_clauses_and_pragmas id20}@anchor{2ca} @section Determining the Representations chosen by GNAT @@ -21531,7 +21542,7 @@ generated by the compiler into the original source to fix and guarantee the actual representation to be used. @node Standard Library Routines,The Implementation of Standard I/O,Representation Clauses and Pragmas,Top -@anchor{gnat_rm/standard_library_routines doc}@anchor{2ca}@anchor{gnat_rm/standard_library_routines id1}@anchor{2cb}@anchor{gnat_rm/standard_library_routines standard-library-routines}@anchor{f} +@anchor{gnat_rm/standard_library_routines doc}@anchor{2cb}@anchor{gnat_rm/standard_library_routines id1}@anchor{2cc}@anchor{gnat_rm/standard_library_routines standard-library-routines}@anchor{f} @chapter Standard Library Routines @@ -22358,7 +22369,7 @@ For packages in Interfaces and System, all the RM defined packages are available in GNAT, see the Ada 2012 RM for full details. @node The Implementation of Standard I/O,The GNAT Library,Standard Library Routines,Top -@anchor{gnat_rm/the_implementation_of_standard_i_o doc}@anchor{2cc}@anchor{gnat_rm/the_implementation_of_standard_i_o id1}@anchor{2cd}@anchor{gnat_rm/the_implementation_of_standard_i_o the-implementation-of-standard-i-o}@anchor{10} +@anchor{gnat_rm/the_implementation_of_standard_i_o doc}@anchor{2cd}@anchor{gnat_rm/the_implementation_of_standard_i_o id1}@anchor{2ce}@anchor{gnat_rm/the_implementation_of_standard_i_o the-implementation-of-standard-i-o}@anchor{10} @chapter The Implementation of Standard I/O @@ -22410,7 +22421,7 @@ these additional facilities are also described in this chapter. @end menu @node Standard I/O Packages,FORM Strings,,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id2}@anchor{2ce}@anchor{gnat_rm/the_implementation_of_standard_i_o standard-i-o-packages}@anchor{2cf} +@anchor{gnat_rm/the_implementation_of_standard_i_o id2}@anchor{2cf}@anchor{gnat_rm/the_implementation_of_standard_i_o standard-i-o-packages}@anchor{2d0} @section Standard I/O Packages @@ -22481,7 +22492,7 @@ flush the common I/O streams and in particular Standard_Output before elaborating the Ada code. @node FORM Strings,Direct_IO,Standard I/O Packages,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o form-strings}@anchor{2d0}@anchor{gnat_rm/the_implementation_of_standard_i_o id3}@anchor{2d1} +@anchor{gnat_rm/the_implementation_of_standard_i_o form-strings}@anchor{2d1}@anchor{gnat_rm/the_implementation_of_standard_i_o id3}@anchor{2d2} @section FORM Strings @@ -22507,7 +22518,7 @@ unrecognized keyword appears in a form string, it is silently ignored and not considered invalid. @node Direct_IO,Sequential_IO,FORM Strings,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o direct-io}@anchor{2d2}@anchor{gnat_rm/the_implementation_of_standard_i_o id4}@anchor{2d3} +@anchor{gnat_rm/the_implementation_of_standard_i_o direct-io}@anchor{2d3}@anchor{gnat_rm/the_implementation_of_standard_i_o id4}@anchor{2d4} @section Direct_IO @@ -22526,7 +22537,7 @@ There is no limit on the size of Direct_IO files, they are expanded as necessary to accommodate whatever records are written to the file. @node Sequential_IO,Text_IO,Direct_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id5}@anchor{2d4}@anchor{gnat_rm/the_implementation_of_standard_i_o sequential-io}@anchor{2d5} +@anchor{gnat_rm/the_implementation_of_standard_i_o id5}@anchor{2d5}@anchor{gnat_rm/the_implementation_of_standard_i_o sequential-io}@anchor{2d6} @section Sequential_IO @@ -22573,7 +22584,7 @@ using Stream_IO, and this is the preferred mechanism. In particular, the above program fragment rewritten to use Stream_IO will work correctly. @node Text_IO,Wide_Text_IO,Sequential_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id6}@anchor{2d6}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io}@anchor{2d7} +@anchor{gnat_rm/the_implementation_of_standard_i_o id6}@anchor{2d7}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io}@anchor{2d8} @section Text_IO @@ -22656,7 +22667,7 @@ the file. @end menu @node Stream Pointer Positioning,Reading and Writing Non-Regular Files,,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id7}@anchor{2d8}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning}@anchor{2d9} +@anchor{gnat_rm/the_implementation_of_standard_i_o id7}@anchor{2d9}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning}@anchor{2da} @subsection Stream Pointer Positioning @@ -22692,7 +22703,7 @@ between two Ada files, then the difference may be observable in some situations. @node Reading and Writing Non-Regular Files,Get_Immediate,Stream Pointer Positioning,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id8}@anchor{2da}@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files}@anchor{2db} +@anchor{gnat_rm/the_implementation_of_standard_i_o id8}@anchor{2db}@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files}@anchor{2dc} @subsection Reading and Writing Non-Regular Files @@ -22743,7 +22754,7 @@ to read data past that end of file indication, until another end of file indication is entered. @node Get_Immediate,Treating Text_IO Files as Streams,Reading and Writing Non-Regular Files,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o get-immediate}@anchor{2dc}@anchor{gnat_rm/the_implementation_of_standard_i_o id9}@anchor{2dd} +@anchor{gnat_rm/the_implementation_of_standard_i_o get-immediate}@anchor{2dd}@anchor{gnat_rm/the_implementation_of_standard_i_o id9}@anchor{2de} @subsection Get_Immediate @@ -22761,7 +22772,7 @@ possible), it is undefined whether the FF character will be treated as a page mark. @node Treating Text_IO Files as Streams,Text_IO Extensions,Get_Immediate,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id10}@anchor{2de}@anchor{gnat_rm/the_implementation_of_standard_i_o treating-text-io-files-as-streams}@anchor{2df} +@anchor{gnat_rm/the_implementation_of_standard_i_o id10}@anchor{2df}@anchor{gnat_rm/the_implementation_of_standard_i_o treating-text-io-files-as-streams}@anchor{2e0} @subsection Treating Text_IO Files as Streams @@ -22777,7 +22788,7 @@ skipped and the effect is similar to that described above for @code{Get_Immediate}. @node Text_IO Extensions,Text_IO Facilities for Unbounded Strings,Treating Text_IO Files as Streams,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id11}@anchor{2e0}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io-extensions}@anchor{2e1} +@anchor{gnat_rm/the_implementation_of_standard_i_o id11}@anchor{2e1}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io-extensions}@anchor{2e2} @subsection Text_IO Extensions @@ -22805,7 +22816,7 @@ the string is to be read. @end itemize @node Text_IO Facilities for Unbounded Strings,,Text_IO Extensions,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id12}@anchor{2e2}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io-facilities-for-unbounded-strings}@anchor{2e3} +@anchor{gnat_rm/the_implementation_of_standard_i_o id12}@anchor{2e3}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io-facilities-for-unbounded-strings}@anchor{2e4} @subsection Text_IO Facilities for Unbounded Strings @@ -22853,7 +22864,7 @@ files @code{a-szuzti.ads} and @code{a-szuzti.adb} provides similar extended @code{Wide_Wide_Text_IO} functionality for unbounded wide wide strings. @node Wide_Text_IO,Wide_Wide_Text_IO,Text_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id13}@anchor{2e4}@anchor{gnat_rm/the_implementation_of_standard_i_o wide-text-io}@anchor{2e5} +@anchor{gnat_rm/the_implementation_of_standard_i_o id13}@anchor{2e5}@anchor{gnat_rm/the_implementation_of_standard_i_o wide-text-io}@anchor{2e6} @section Wide_Text_IO @@ -23100,12 +23111,12 @@ input also causes Constraint_Error to be raised. @end menu @node Stream Pointer Positioning<2>,Reading and Writing Non-Regular Files<2>,,Wide_Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id14}@anchor{2e6}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning-1}@anchor{2e7} +@anchor{gnat_rm/the_implementation_of_standard_i_o id14}@anchor{2e7}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning-1}@anchor{2e8} @subsection Stream Pointer Positioning @code{Ada.Wide_Text_IO} is similar to @code{Ada.Text_IO} in its handling -of stream pointer positioning (@ref{2d7,,Text_IO}). There is one additional +of stream pointer positioning (@ref{2d8,,Text_IO}). There is one additional case: If @code{Ada.Wide_Text_IO.Look_Ahead} reads a character outside the @@ -23124,7 +23135,7 @@ to a normal program using @code{Wide_Text_IO}. However, this discrepancy can be observed if the wide text file shares a stream with another file. @node Reading and Writing Non-Regular Files<2>,,Stream Pointer Positioning<2>,Wide_Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id15}@anchor{2e8}@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files-1}@anchor{2e9} +@anchor{gnat_rm/the_implementation_of_standard_i_o id15}@anchor{2e9}@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files-1}@anchor{2ea} @subsection Reading and Writing Non-Regular Files @@ -23135,7 +23146,7 @@ treated as data characters), and @code{End_Of_Page} always returns it is possible to read beyond an end of file. @node Wide_Wide_Text_IO,Stream_IO,Wide_Text_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id16}@anchor{2ea}@anchor{gnat_rm/the_implementation_of_standard_i_o wide-wide-text-io}@anchor{2eb} +@anchor{gnat_rm/the_implementation_of_standard_i_o id16}@anchor{2eb}@anchor{gnat_rm/the_implementation_of_standard_i_o wide-wide-text-io}@anchor{2ec} @section Wide_Wide_Text_IO @@ -23304,12 +23315,12 @@ input also causes Constraint_Error to be raised. @end menu @node Stream Pointer Positioning<3>,Reading and Writing Non-Regular Files<3>,,Wide_Wide_Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id17}@anchor{2ec}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning-2}@anchor{2ed} +@anchor{gnat_rm/the_implementation_of_standard_i_o id17}@anchor{2ed}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning-2}@anchor{2ee} @subsection Stream Pointer Positioning @code{Ada.Wide_Wide_Text_IO} is similar to @code{Ada.Text_IO} in its handling -of stream pointer positioning (@ref{2d7,,Text_IO}). There is one additional +of stream pointer positioning (@ref{2d8,,Text_IO}). There is one additional case: If @code{Ada.Wide_Wide_Text_IO.Look_Ahead} reads a character outside the @@ -23328,7 +23339,7 @@ to a normal program using @code{Wide_Wide_Text_IO}. However, this discrepancy can be observed if the wide text file shares a stream with another file. @node Reading and Writing Non-Regular Files<3>,,Stream Pointer Positioning<3>,Wide_Wide_Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id18}@anchor{2ee}@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files-2}@anchor{2ef} +@anchor{gnat_rm/the_implementation_of_standard_i_o id18}@anchor{2ef}@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files-2}@anchor{2f0} @subsection Reading and Writing Non-Regular Files @@ -23339,7 +23350,7 @@ treated as data characters), and @code{End_Of_Page} always returns it is possible to read beyond an end of file. @node Stream_IO,Text Translation,Wide_Wide_Text_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id19}@anchor{2f0}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-io}@anchor{2f1} +@anchor{gnat_rm/the_implementation_of_standard_i_o id19}@anchor{2f1}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-io}@anchor{2f2} @section Stream_IO @@ -23361,7 +23372,7 @@ manner described for stream attributes. @end itemize @node Text Translation,Shared Files,Stream_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id20}@anchor{2f2}@anchor{gnat_rm/the_implementation_of_standard_i_o text-translation}@anchor{2f3} +@anchor{gnat_rm/the_implementation_of_standard_i_o id20}@anchor{2f3}@anchor{gnat_rm/the_implementation_of_standard_i_o text-translation}@anchor{2f4} @section Text Translation @@ -23395,7 +23406,7 @@ mode. (corresponds to_O_U16TEXT). @end itemize @node Shared Files,Filenames encoding,Text Translation,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id21}@anchor{2f4}@anchor{gnat_rm/the_implementation_of_standard_i_o shared-files}@anchor{2f5} +@anchor{gnat_rm/the_implementation_of_standard_i_o id21}@anchor{2f5}@anchor{gnat_rm/the_implementation_of_standard_i_o shared-files}@anchor{2f6} @section Shared Files @@ -23458,7 +23469,7 @@ heterogeneous input-output. Although this approach will work in GNAT if for this purpose (using the stream attributes). @node Filenames encoding,File content encoding,Shared Files,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o filenames-encoding}@anchor{2f6}@anchor{gnat_rm/the_implementation_of_standard_i_o id22}@anchor{2f7} +@anchor{gnat_rm/the_implementation_of_standard_i_o filenames-encoding}@anchor{2f7}@anchor{gnat_rm/the_implementation_of_standard_i_o id22}@anchor{2f8} @section Filenames encoding @@ -23498,7 +23509,7 @@ platform. On the other Operating Systems the run-time is supporting UTF-8 natively. @node File content encoding,Open Modes,Filenames encoding,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o file-content-encoding}@anchor{2f8}@anchor{gnat_rm/the_implementation_of_standard_i_o id23}@anchor{2f9} +@anchor{gnat_rm/the_implementation_of_standard_i_o file-content-encoding}@anchor{2f9}@anchor{gnat_rm/the_implementation_of_standard_i_o id23}@anchor{2fa} @section File content encoding @@ -23531,7 +23542,7 @@ Unicode 8-bit encoding This encoding is only supported on the Windows platform. @node Open Modes,Operations on C Streams,File content encoding,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id24}@anchor{2fa}@anchor{gnat_rm/the_implementation_of_standard_i_o open-modes}@anchor{2fb} +@anchor{gnat_rm/the_implementation_of_standard_i_o id24}@anchor{2fb}@anchor{gnat_rm/the_implementation_of_standard_i_o open-modes}@anchor{2fc} @section Open Modes @@ -23634,7 +23645,7 @@ subsequently requires switching from reading to writing or vice-versa, then the file is reopened in @code{r+} mode to permit the required operation. @node Operations on C Streams,Interfacing to C Streams,Open Modes,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id25}@anchor{2fc}@anchor{gnat_rm/the_implementation_of_standard_i_o operations-on-c-streams}@anchor{2fd} +@anchor{gnat_rm/the_implementation_of_standard_i_o id25}@anchor{2fd}@anchor{gnat_rm/the_implementation_of_standard_i_o operations-on-c-streams}@anchor{2fe} @section Operations on C Streams @@ -23794,7 +23805,7 @@ end Interfaces.C_Streams; @end example @node Interfacing to C Streams,,Operations on C Streams,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id26}@anchor{2fe}@anchor{gnat_rm/the_implementation_of_standard_i_o interfacing-to-c-streams}@anchor{2ff} +@anchor{gnat_rm/the_implementation_of_standard_i_o id26}@anchor{2ff}@anchor{gnat_rm/the_implementation_of_standard_i_o interfacing-to-c-streams}@anchor{300} @section Interfacing to C Streams @@ -23887,7 +23898,7 @@ imported from a C program, allowing an Ada file to operate on an existing C file. @node The GNAT Library,Interfacing to Other Languages,The Implementation of Standard I/O,Top -@anchor{gnat_rm/the_gnat_library doc}@anchor{300}@anchor{gnat_rm/the_gnat_library id1}@anchor{301}@anchor{gnat_rm/the_gnat_library the-gnat-library}@anchor{11} +@anchor{gnat_rm/the_gnat_library doc}@anchor{301}@anchor{gnat_rm/the_gnat_library id1}@anchor{302}@anchor{gnat_rm/the_gnat_library the-gnat-library}@anchor{11} @chapter The GNAT Library @@ -24073,7 +24084,7 @@ of GNAT, and will generate a warning message. @end menu @node Ada Characters Latin_9 a-chlat9 ads,Ada Characters Wide_Latin_1 a-cwila1 ads,,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-characters-latin-9-a-chlat9-ads}@anchor{302}@anchor{gnat_rm/the_gnat_library id2}@anchor{303} +@anchor{gnat_rm/the_gnat_library ada-characters-latin-9-a-chlat9-ads}@anchor{303}@anchor{gnat_rm/the_gnat_library id2}@anchor{304} @section @code{Ada.Characters.Latin_9} (@code{a-chlat9.ads}) @@ -24090,7 +24101,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Characters Wide_Latin_1 a-cwila1 ads,Ada Characters Wide_Latin_9 a-cwila9 ads,Ada Characters Latin_9 a-chlat9 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-characters-wide-latin-1-a-cwila1-ads}@anchor{304}@anchor{gnat_rm/the_gnat_library id3}@anchor{305} +@anchor{gnat_rm/the_gnat_library ada-characters-wide-latin-1-a-cwila1-ads}@anchor{305}@anchor{gnat_rm/the_gnat_library id3}@anchor{306} @section @code{Ada.Characters.Wide_Latin_1} (@code{a-cwila1.ads}) @@ -24107,7 +24118,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Characters Wide_Latin_9 a-cwila9 ads,Ada Characters Wide_Wide_Latin_1 a-chzla1 ads,Ada Characters Wide_Latin_1 a-cwila1 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-characters-wide-latin-9-a-cwila9-ads}@anchor{306}@anchor{gnat_rm/the_gnat_library id4}@anchor{307} +@anchor{gnat_rm/the_gnat_library ada-characters-wide-latin-9-a-cwila9-ads}@anchor{307}@anchor{gnat_rm/the_gnat_library id4}@anchor{308} @section @code{Ada.Characters.Wide_Latin_9} (@code{a-cwila9.ads}) @@ -24124,7 +24135,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Characters Wide_Wide_Latin_1 a-chzla1 ads,Ada Characters Wide_Wide_Latin_9 a-chzla9 ads,Ada Characters Wide_Latin_9 a-cwila9 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-characters-wide-wide-latin-1-a-chzla1-ads}@anchor{308}@anchor{gnat_rm/the_gnat_library id5}@anchor{309} +@anchor{gnat_rm/the_gnat_library ada-characters-wide-wide-latin-1-a-chzla1-ads}@anchor{309}@anchor{gnat_rm/the_gnat_library id5}@anchor{30a} @section @code{Ada.Characters.Wide_Wide_Latin_1} (@code{a-chzla1.ads}) @@ -24141,7 +24152,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Characters Wide_Wide_Latin_9 a-chzla9 ads,Ada Containers Bounded_Holders a-coboho ads,Ada Characters Wide_Wide_Latin_1 a-chzla1 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-characters-wide-wide-latin-9-a-chzla9-ads}@anchor{30a}@anchor{gnat_rm/the_gnat_library id6}@anchor{30b} +@anchor{gnat_rm/the_gnat_library ada-characters-wide-wide-latin-9-a-chzla9-ads}@anchor{30b}@anchor{gnat_rm/the_gnat_library id6}@anchor{30c} @section @code{Ada.Characters.Wide_Wide_Latin_9} (@code{a-chzla9.ads}) @@ -24158,7 +24169,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Containers Bounded_Holders a-coboho ads,Ada Command_Line Environment a-colien ads,Ada Characters Wide_Wide_Latin_9 a-chzla9 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-containers-bounded-holders-a-coboho-ads}@anchor{30c}@anchor{gnat_rm/the_gnat_library id7}@anchor{30d} +@anchor{gnat_rm/the_gnat_library ada-containers-bounded-holders-a-coboho-ads}@anchor{30d}@anchor{gnat_rm/the_gnat_library id7}@anchor{30e} @section @code{Ada.Containers.Bounded_Holders} (@code{a-coboho.ads}) @@ -24170,7 +24181,7 @@ This child of @code{Ada.Containers} defines a modified version of Indefinite_Holders that avoids heap allocation. @node Ada Command_Line Environment a-colien ads,Ada Command_Line Remove a-colire ads,Ada Containers Bounded_Holders a-coboho ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-command-line-environment-a-colien-ads}@anchor{30e}@anchor{gnat_rm/the_gnat_library id8}@anchor{30f} +@anchor{gnat_rm/the_gnat_library ada-command-line-environment-a-colien-ads}@anchor{30f}@anchor{gnat_rm/the_gnat_library id8}@anchor{310} @section @code{Ada.Command_Line.Environment} (@code{a-colien.ads}) @@ -24183,7 +24194,7 @@ provides a mechanism for obtaining environment values on systems where this concept makes sense. @node Ada Command_Line Remove a-colire ads,Ada Command_Line Response_File a-clrefi ads,Ada Command_Line Environment a-colien ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-command-line-remove-a-colire-ads}@anchor{310}@anchor{gnat_rm/the_gnat_library id9}@anchor{311} +@anchor{gnat_rm/the_gnat_library ada-command-line-remove-a-colire-ads}@anchor{311}@anchor{gnat_rm/the_gnat_library id9}@anchor{312} @section @code{Ada.Command_Line.Remove} (@code{a-colire.ads}) @@ -24201,7 +24212,7 @@ to further calls to the subprograms in @code{Ada.Command_Line}. These calls will not see the removed argument. @node Ada Command_Line Response_File a-clrefi ads,Ada Direct_IO C_Streams a-diocst ads,Ada Command_Line Remove a-colire ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-command-line-response-file-a-clrefi-ads}@anchor{312}@anchor{gnat_rm/the_gnat_library id10}@anchor{313} +@anchor{gnat_rm/the_gnat_library ada-command-line-response-file-a-clrefi-ads}@anchor{313}@anchor{gnat_rm/the_gnat_library id10}@anchor{314} @section @code{Ada.Command_Line.Response_File} (@code{a-clrefi.ads}) @@ -24221,7 +24232,7 @@ Using a response file allow passing a set of arguments to an executable longer than the maximum allowed by the system on the command line. @node Ada Direct_IO C_Streams a-diocst ads,Ada Exceptions Is_Null_Occurrence a-einuoc ads,Ada Command_Line Response_File a-clrefi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-direct-io-c-streams-a-diocst-ads}@anchor{314}@anchor{gnat_rm/the_gnat_library id11}@anchor{315} +@anchor{gnat_rm/the_gnat_library ada-direct-io-c-streams-a-diocst-ads}@anchor{315}@anchor{gnat_rm/the_gnat_library id11}@anchor{316} @section @code{Ada.Direct_IO.C_Streams} (@code{a-diocst.ads}) @@ -24236,7 +24247,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Exceptions Is_Null_Occurrence a-einuoc ads,Ada Exceptions Last_Chance_Handler a-elchha ads,Ada Direct_IO C_Streams a-diocst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-exceptions-is-null-occurrence-a-einuoc-ads}@anchor{316}@anchor{gnat_rm/the_gnat_library id12}@anchor{317} +@anchor{gnat_rm/the_gnat_library ada-exceptions-is-null-occurrence-a-einuoc-ads}@anchor{317}@anchor{gnat_rm/the_gnat_library id12}@anchor{318} @section @code{Ada.Exceptions.Is_Null_Occurrence} (@code{a-einuoc.ads}) @@ -24250,7 +24261,7 @@ exception occurrence (@code{Null_Occurrence}) without raising an exception. @node Ada Exceptions Last_Chance_Handler a-elchha ads,Ada Exceptions Traceback a-exctra ads,Ada Exceptions Is_Null_Occurrence a-einuoc ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-exceptions-last-chance-handler-a-elchha-ads}@anchor{318}@anchor{gnat_rm/the_gnat_library id13}@anchor{319} +@anchor{gnat_rm/the_gnat_library ada-exceptions-last-chance-handler-a-elchha-ads}@anchor{319}@anchor{gnat_rm/the_gnat_library id13}@anchor{31a} @section @code{Ada.Exceptions.Last_Chance_Handler} (@code{a-elchha.ads}) @@ -24264,7 +24275,7 @@ exceptions (hence the name last chance), and perform clean ups before terminating the program. Note that this subprogram never returns. @node Ada Exceptions Traceback a-exctra ads,Ada Sequential_IO C_Streams a-siocst ads,Ada Exceptions Last_Chance_Handler a-elchha ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-exceptions-traceback-a-exctra-ads}@anchor{31a}@anchor{gnat_rm/the_gnat_library id14}@anchor{31b} +@anchor{gnat_rm/the_gnat_library ada-exceptions-traceback-a-exctra-ads}@anchor{31b}@anchor{gnat_rm/the_gnat_library id14}@anchor{31c} @section @code{Ada.Exceptions.Traceback} (@code{a-exctra.ads}) @@ -24277,7 +24288,7 @@ give a traceback array of addresses based on an exception occurrence. @node Ada Sequential_IO C_Streams a-siocst ads,Ada Streams Stream_IO C_Streams a-ssicst ads,Ada Exceptions Traceback a-exctra ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-sequential-io-c-streams-a-siocst-ads}@anchor{31c}@anchor{gnat_rm/the_gnat_library id15}@anchor{31d} +@anchor{gnat_rm/the_gnat_library ada-sequential-io-c-streams-a-siocst-ads}@anchor{31d}@anchor{gnat_rm/the_gnat_library id15}@anchor{31e} @section @code{Ada.Sequential_IO.C_Streams} (@code{a-siocst.ads}) @@ -24292,7 +24303,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Streams Stream_IO C_Streams a-ssicst ads,Ada Strings Unbounded Text_IO a-suteio ads,Ada Sequential_IO C_Streams a-siocst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-streams-stream-io-c-streams-a-ssicst-ads}@anchor{31e}@anchor{gnat_rm/the_gnat_library id16}@anchor{31f} +@anchor{gnat_rm/the_gnat_library ada-streams-stream-io-c-streams-a-ssicst-ads}@anchor{31f}@anchor{gnat_rm/the_gnat_library id16}@anchor{320} @section @code{Ada.Streams.Stream_IO.C_Streams} (@code{a-ssicst.ads}) @@ -24307,7 +24318,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Strings Unbounded Text_IO a-suteio ads,Ada Strings Wide_Unbounded Wide_Text_IO a-swuwti ads,Ada Streams Stream_IO C_Streams a-ssicst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-strings-unbounded-text-io-a-suteio-ads}@anchor{320}@anchor{gnat_rm/the_gnat_library id17}@anchor{321} +@anchor{gnat_rm/the_gnat_library ada-strings-unbounded-text-io-a-suteio-ads}@anchor{321}@anchor{gnat_rm/the_gnat_library id17}@anchor{322} @section @code{Ada.Strings.Unbounded.Text_IO} (@code{a-suteio.ads}) @@ -24324,7 +24335,7 @@ strings, avoiding the necessity for an intermediate operation with ordinary strings. @node Ada Strings Wide_Unbounded Wide_Text_IO a-swuwti ads,Ada Strings Wide_Wide_Unbounded Wide_Wide_Text_IO a-szuzti ads,Ada Strings Unbounded Text_IO a-suteio ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-strings-wide-unbounded-wide-text-io-a-swuwti-ads}@anchor{322}@anchor{gnat_rm/the_gnat_library id18}@anchor{323} +@anchor{gnat_rm/the_gnat_library ada-strings-wide-unbounded-wide-text-io-a-swuwti-ads}@anchor{323}@anchor{gnat_rm/the_gnat_library id18}@anchor{324} @section @code{Ada.Strings.Wide_Unbounded.Wide_Text_IO} (@code{a-swuwti.ads}) @@ -24341,7 +24352,7 @@ wide strings, avoiding the necessity for an intermediate operation with ordinary wide strings. @node Ada Strings Wide_Wide_Unbounded Wide_Wide_Text_IO a-szuzti ads,Ada Task_Initialization a-tasini ads,Ada Strings Wide_Unbounded Wide_Text_IO a-swuwti ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-strings-wide-wide-unbounded-wide-wide-text-io-a-szuzti-ads}@anchor{324}@anchor{gnat_rm/the_gnat_library id19}@anchor{325} +@anchor{gnat_rm/the_gnat_library ada-strings-wide-wide-unbounded-wide-wide-text-io-a-szuzti-ads}@anchor{325}@anchor{gnat_rm/the_gnat_library id19}@anchor{326} @section @code{Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO} (@code{a-szuzti.ads}) @@ -24358,7 +24369,7 @@ wide wide strings, avoiding the necessity for an intermediate operation with ordinary wide wide strings. @node Ada Task_Initialization a-tasini ads,Ada Text_IO C_Streams a-tiocst ads,Ada Strings Wide_Wide_Unbounded Wide_Wide_Text_IO a-szuzti ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-task-initialization-a-tasini-ads}@anchor{326}@anchor{gnat_rm/the_gnat_library id20}@anchor{327} +@anchor{gnat_rm/the_gnat_library ada-task-initialization-a-tasini-ads}@anchor{327}@anchor{gnat_rm/the_gnat_library id20}@anchor{328} @section @code{Ada.Task_Initialization} (@code{a-tasini.ads}) @@ -24370,7 +24381,7 @@ parameterless procedures. Note that such a handler is only invoked for those tasks activated after the handler is set. @node Ada Text_IO C_Streams a-tiocst ads,Ada Text_IO Reset_Standard_Files a-tirsfi ads,Ada Task_Initialization a-tasini ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-text-io-c-streams-a-tiocst-ads}@anchor{328}@anchor{gnat_rm/the_gnat_library id21}@anchor{329} +@anchor{gnat_rm/the_gnat_library ada-text-io-c-streams-a-tiocst-ads}@anchor{329}@anchor{gnat_rm/the_gnat_library id21}@anchor{32a} @section @code{Ada.Text_IO.C_Streams} (@code{a-tiocst.ads}) @@ -24385,7 +24396,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Text_IO Reset_Standard_Files a-tirsfi ads,Ada Wide_Characters Unicode a-wichun ads,Ada Text_IO C_Streams a-tiocst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-text-io-reset-standard-files-a-tirsfi-ads}@anchor{32a}@anchor{gnat_rm/the_gnat_library id22}@anchor{32b} +@anchor{gnat_rm/the_gnat_library ada-text-io-reset-standard-files-a-tirsfi-ads}@anchor{32b}@anchor{gnat_rm/the_gnat_library id22}@anchor{32c} @section @code{Ada.Text_IO.Reset_Standard_Files} (@code{a-tirsfi.ads}) @@ -24400,7 +24411,7 @@ execution (for example a standard input file may be redefined to be interactive). @node Ada Wide_Characters Unicode a-wichun ads,Ada Wide_Text_IO C_Streams a-wtcstr ads,Ada Text_IO Reset_Standard_Files a-tirsfi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-wide-characters-unicode-a-wichun-ads}@anchor{32c}@anchor{gnat_rm/the_gnat_library id23}@anchor{32d} +@anchor{gnat_rm/the_gnat_library ada-wide-characters-unicode-a-wichun-ads}@anchor{32d}@anchor{gnat_rm/the_gnat_library id23}@anchor{32e} @section @code{Ada.Wide_Characters.Unicode} (@code{a-wichun.ads}) @@ -24413,7 +24424,7 @@ This package provides subprograms that allow categorization of Wide_Character values according to Unicode categories. @node Ada Wide_Text_IO C_Streams a-wtcstr ads,Ada Wide_Text_IO Reset_Standard_Files a-wrstfi ads,Ada Wide_Characters Unicode a-wichun ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-wide-text-io-c-streams-a-wtcstr-ads}@anchor{32e}@anchor{gnat_rm/the_gnat_library id24}@anchor{32f} +@anchor{gnat_rm/the_gnat_library ada-wide-text-io-c-streams-a-wtcstr-ads}@anchor{32f}@anchor{gnat_rm/the_gnat_library id24}@anchor{330} @section @code{Ada.Wide_Text_IO.C_Streams} (@code{a-wtcstr.ads}) @@ -24428,7 +24439,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Wide_Text_IO Reset_Standard_Files a-wrstfi ads,Ada Wide_Wide_Characters Unicode a-zchuni ads,Ada Wide_Text_IO C_Streams a-wtcstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-wide-text-io-reset-standard-files-a-wrstfi-ads}@anchor{330}@anchor{gnat_rm/the_gnat_library id25}@anchor{331} +@anchor{gnat_rm/the_gnat_library ada-wide-text-io-reset-standard-files-a-wrstfi-ads}@anchor{331}@anchor{gnat_rm/the_gnat_library id25}@anchor{332} @section @code{Ada.Wide_Text_IO.Reset_Standard_Files} (@code{a-wrstfi.ads}) @@ -24443,7 +24454,7 @@ execution (for example a standard input file may be redefined to be interactive). @node Ada Wide_Wide_Characters Unicode a-zchuni ads,Ada Wide_Wide_Text_IO C_Streams a-ztcstr ads,Ada Wide_Text_IO Reset_Standard_Files a-wrstfi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-wide-wide-characters-unicode-a-zchuni-ads}@anchor{332}@anchor{gnat_rm/the_gnat_library id26}@anchor{333} +@anchor{gnat_rm/the_gnat_library ada-wide-wide-characters-unicode-a-zchuni-ads}@anchor{333}@anchor{gnat_rm/the_gnat_library id26}@anchor{334} @section @code{Ada.Wide_Wide_Characters.Unicode} (@code{a-zchuni.ads}) @@ -24456,7 +24467,7 @@ This package provides subprograms that allow categorization of Wide_Wide_Character values according to Unicode categories. @node Ada Wide_Wide_Text_IO C_Streams a-ztcstr ads,Ada Wide_Wide_Text_IO Reset_Standard_Files a-zrstfi ads,Ada Wide_Wide_Characters Unicode a-zchuni ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-wide-wide-text-io-c-streams-a-ztcstr-ads}@anchor{334}@anchor{gnat_rm/the_gnat_library id27}@anchor{335} +@anchor{gnat_rm/the_gnat_library ada-wide-wide-text-io-c-streams-a-ztcstr-ads}@anchor{335}@anchor{gnat_rm/the_gnat_library id27}@anchor{336} @section @code{Ada.Wide_Wide_Text_IO.C_Streams} (@code{a-ztcstr.ads}) @@ -24471,7 +24482,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Wide_Wide_Text_IO Reset_Standard_Files a-zrstfi ads,GNAT Altivec g-altive ads,Ada Wide_Wide_Text_IO C_Streams a-ztcstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-wide-wide-text-io-reset-standard-files-a-zrstfi-ads}@anchor{336}@anchor{gnat_rm/the_gnat_library id28}@anchor{337} +@anchor{gnat_rm/the_gnat_library ada-wide-wide-text-io-reset-standard-files-a-zrstfi-ads}@anchor{337}@anchor{gnat_rm/the_gnat_library id28}@anchor{338} @section @code{Ada.Wide_Wide_Text_IO.Reset_Standard_Files} (@code{a-zrstfi.ads}) @@ -24486,7 +24497,7 @@ change during execution (for example a standard input file may be redefined to be interactive). @node GNAT Altivec g-altive ads,GNAT Altivec Conversions g-altcon ads,Ada Wide_Wide_Text_IO Reset_Standard_Files a-zrstfi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-altivec-g-altive-ads}@anchor{338}@anchor{gnat_rm/the_gnat_library id29}@anchor{339} +@anchor{gnat_rm/the_gnat_library gnat-altivec-g-altive-ads}@anchor{339}@anchor{gnat_rm/the_gnat_library id29}@anchor{33a} @section @code{GNAT.Altivec} (@code{g-altive.ads}) @@ -24499,7 +24510,7 @@ definitions of constants and types common to all the versions of the binding. @node GNAT Altivec Conversions g-altcon ads,GNAT Altivec Vector_Operations g-alveop ads,GNAT Altivec g-altive ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-altivec-conversions-g-altcon-ads}@anchor{33a}@anchor{gnat_rm/the_gnat_library id30}@anchor{33b} +@anchor{gnat_rm/the_gnat_library gnat-altivec-conversions-g-altcon-ads}@anchor{33b}@anchor{gnat_rm/the_gnat_library id30}@anchor{33c} @section @code{GNAT.Altivec.Conversions} (@code{g-altcon.ads}) @@ -24510,7 +24521,7 @@ binding. This package provides the Vector/View conversion routines. @node GNAT Altivec Vector_Operations g-alveop ads,GNAT Altivec Vector_Types g-alvety ads,GNAT Altivec Conversions g-altcon ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-operations-g-alveop-ads}@anchor{33c}@anchor{gnat_rm/the_gnat_library id31}@anchor{33d} +@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-operations-g-alveop-ads}@anchor{33d}@anchor{gnat_rm/the_gnat_library id31}@anchor{33e} @section @code{GNAT.Altivec.Vector_Operations} (@code{g-alveop.ads}) @@ -24524,7 +24535,7 @@ library. The hard binding is provided as a separate package. This unit is common to both bindings. @node GNAT Altivec Vector_Types g-alvety ads,GNAT Altivec Vector_Views g-alvevi ads,GNAT Altivec Vector_Operations g-alveop ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-types-g-alvety-ads}@anchor{33e}@anchor{gnat_rm/the_gnat_library id32}@anchor{33f} +@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-types-g-alvety-ads}@anchor{33f}@anchor{gnat_rm/the_gnat_library id32}@anchor{340} @section @code{GNAT.Altivec.Vector_Types} (@code{g-alvety.ads}) @@ -24536,7 +24547,7 @@ This package exposes the various vector types part of the Ada binding to AltiVec facilities. @node GNAT Altivec Vector_Views g-alvevi ads,GNAT Array_Split g-arrspl ads,GNAT Altivec Vector_Types g-alvety ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-views-g-alvevi-ads}@anchor{340}@anchor{gnat_rm/the_gnat_library id33}@anchor{341} +@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-views-g-alvevi-ads}@anchor{341}@anchor{gnat_rm/the_gnat_library id33}@anchor{342} @section @code{GNAT.Altivec.Vector_Views} (@code{g-alvevi.ads}) @@ -24551,7 +24562,7 @@ vector elements and provides a simple way to initialize vector objects. @node GNAT Array_Split g-arrspl ads,GNAT AWK g-awk ads,GNAT Altivec Vector_Views g-alvevi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-array-split-g-arrspl-ads}@anchor{342}@anchor{gnat_rm/the_gnat_library id34}@anchor{343} +@anchor{gnat_rm/the_gnat_library gnat-array-split-g-arrspl-ads}@anchor{343}@anchor{gnat_rm/the_gnat_library id34}@anchor{344} @section @code{GNAT.Array_Split} (@code{g-arrspl.ads}) @@ -24564,7 +24575,7 @@ an array wherever the separators appear, and provide direct access to the resulting slices. @node GNAT AWK g-awk ads,GNAT Binary_Search g-binsea ads,GNAT Array_Split g-arrspl ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-awk-g-awk-ads}@anchor{344}@anchor{gnat_rm/the_gnat_library id35}@anchor{345} +@anchor{gnat_rm/the_gnat_library gnat-awk-g-awk-ads}@anchor{345}@anchor{gnat_rm/the_gnat_library id35}@anchor{346} @section @code{GNAT.AWK} (@code{g-awk.ads}) @@ -24579,7 +24590,7 @@ or more files containing formatted data. The file is viewed as a database where each record is a line and a field is a data element in this line. @node GNAT Binary_Search g-binsea ads,GNAT Bind_Environment g-binenv ads,GNAT AWK g-awk ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-binary-search-g-binsea-ads}@anchor{346}@anchor{gnat_rm/the_gnat_library id36}@anchor{347} +@anchor{gnat_rm/the_gnat_library gnat-binary-search-g-binsea-ads}@anchor{347}@anchor{gnat_rm/the_gnat_library id36}@anchor{348} @section @code{GNAT.Binary_Search} (@code{g-binsea.ads}) @@ -24591,7 +24602,7 @@ Allow binary search of a sorted array (or of an array-like container; the generic does not reference the array directly). @node GNAT Bind_Environment g-binenv ads,GNAT Branch_Prediction g-brapre ads,GNAT Binary_Search g-binsea ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-bind-environment-g-binenv-ads}@anchor{348}@anchor{gnat_rm/the_gnat_library id37}@anchor{349} +@anchor{gnat_rm/the_gnat_library gnat-bind-environment-g-binenv-ads}@anchor{349}@anchor{gnat_rm/the_gnat_library id37}@anchor{34a} @section @code{GNAT.Bind_Environment} (@code{g-binenv.ads}) @@ -24604,7 +24615,7 @@ These associations can be specified using the @code{-V} binder command line switch. @node GNAT Branch_Prediction g-brapre ads,GNAT Bounded_Buffers g-boubuf ads,GNAT Bind_Environment g-binenv ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-branch-prediction-g-brapre-ads}@anchor{34a}@anchor{gnat_rm/the_gnat_library id38}@anchor{34b} +@anchor{gnat_rm/the_gnat_library gnat-branch-prediction-g-brapre-ads}@anchor{34b}@anchor{gnat_rm/the_gnat_library id38}@anchor{34c} @section @code{GNAT.Branch_Prediction} (@code{g-brapre.ads}) @@ -24615,7 +24626,7 @@ line switch. Provides routines giving hints to the branch predictor of the code generator. @node GNAT Bounded_Buffers g-boubuf ads,GNAT Bounded_Mailboxes g-boumai ads,GNAT Branch_Prediction g-brapre ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-bounded-buffers-g-boubuf-ads}@anchor{34c}@anchor{gnat_rm/the_gnat_library id39}@anchor{34d} +@anchor{gnat_rm/the_gnat_library gnat-bounded-buffers-g-boubuf-ads}@anchor{34d}@anchor{gnat_rm/the_gnat_library id39}@anchor{34e} @section @code{GNAT.Bounded_Buffers} (@code{g-boubuf.ads}) @@ -24630,7 +24641,7 @@ useful directly or as parts of the implementations of other abstractions, such as mailboxes. @node GNAT Bounded_Mailboxes g-boumai ads,GNAT Bubble_Sort g-bubsor ads,GNAT Bounded_Buffers g-boubuf ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-bounded-mailboxes-g-boumai-ads}@anchor{34e}@anchor{gnat_rm/the_gnat_library id40}@anchor{34f} +@anchor{gnat_rm/the_gnat_library gnat-bounded-mailboxes-g-boumai-ads}@anchor{34f}@anchor{gnat_rm/the_gnat_library id40}@anchor{350} @section @code{GNAT.Bounded_Mailboxes} (@code{g-boumai.ads}) @@ -24643,7 +24654,7 @@ such as mailboxes. Provides a thread-safe asynchronous intertask mailbox communication facility. @node GNAT Bubble_Sort g-bubsor ads,GNAT Bubble_Sort_A g-busora ads,GNAT Bounded_Mailboxes g-boumai ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-g-bubsor-ads}@anchor{350}@anchor{gnat_rm/the_gnat_library id41}@anchor{351} +@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-g-bubsor-ads}@anchor{351}@anchor{gnat_rm/the_gnat_library id41}@anchor{352} @section @code{GNAT.Bubble_Sort} (@code{g-bubsor.ads}) @@ -24658,7 +24669,7 @@ data items. Exchange and comparison procedures are provided by passing access-to-procedure values. @node GNAT Bubble_Sort_A g-busora ads,GNAT Bubble_Sort_G g-busorg ads,GNAT Bubble_Sort g-bubsor ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-a-g-busora-ads}@anchor{352}@anchor{gnat_rm/the_gnat_library id42}@anchor{353} +@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-a-g-busora-ads}@anchor{353}@anchor{gnat_rm/the_gnat_library id42}@anchor{354} @section @code{GNAT.Bubble_Sort_A} (@code{g-busora.ads}) @@ -24674,7 +24685,7 @@ access-to-procedure values. This is an older version, retained for compatibility. Usually @code{GNAT.Bubble_Sort} will be preferable. @node GNAT Bubble_Sort_G g-busorg ads,GNAT Byte_Order_Mark g-byorma ads,GNAT Bubble_Sort_A g-busora ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-g-g-busorg-ads}@anchor{354}@anchor{gnat_rm/the_gnat_library id43}@anchor{355} +@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-g-g-busorg-ads}@anchor{355}@anchor{gnat_rm/the_gnat_library id43}@anchor{356} @section @code{GNAT.Bubble_Sort_G} (@code{g-busorg.ads}) @@ -24690,7 +24701,7 @@ if the procedures can be inlined, at the expense of duplicating code for multiple instantiations. @node GNAT Byte_Order_Mark g-byorma ads,GNAT Byte_Swapping g-bytswa ads,GNAT Bubble_Sort_G g-busorg ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-byte-order-mark-g-byorma-ads}@anchor{356}@anchor{gnat_rm/the_gnat_library id44}@anchor{357} +@anchor{gnat_rm/the_gnat_library gnat-byte-order-mark-g-byorma-ads}@anchor{357}@anchor{gnat_rm/the_gnat_library id44}@anchor{358} @section @code{GNAT.Byte_Order_Mark} (@code{g-byorma.ads}) @@ -24706,7 +24717,7 @@ the encoding of the string. The routine includes detection of special XML sequences for various UCS input formats. @node GNAT Byte_Swapping g-bytswa ads,GNAT C_Time g-c_time ads,GNAT Byte_Order_Mark g-byorma ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-byte-swapping-g-bytswa-ads}@anchor{358}@anchor{gnat_rm/the_gnat_library id45}@anchor{359} +@anchor{gnat_rm/the_gnat_library gnat-byte-swapping-g-bytswa-ads}@anchor{359}@anchor{gnat_rm/the_gnat_library id45}@anchor{35a} @section @code{GNAT.Byte_Swapping} (@code{g-bytswa.ads}) @@ -24720,7 +24731,7 @@ General routines for swapping the bytes in 2-, 4-, and 8-byte quantities. Machine-specific implementations are available in some cases. @node GNAT C_Time g-c_time ads,GNAT Calendar g-calend ads,GNAT Byte_Swapping g-bytswa ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-c-time-g-c-time-ads}@anchor{35a}@anchor{gnat_rm/the_gnat_library id46}@anchor{35b} +@anchor{gnat_rm/the_gnat_library gnat-c-time-g-c-time-ads}@anchor{35b}@anchor{gnat_rm/the_gnat_library id46}@anchor{35c} @section @code{GNAT.C_Time} (@code{g-c_time.ads}) @@ -24732,7 +24743,7 @@ Provides the time_t, timeval and timespec types corresponding to the C types defined by the OS, as well as various conversion functions. @node GNAT Calendar g-calend ads,GNAT Calendar Time_IO g-catiio ads,GNAT C_Time g-c_time ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-calendar-g-calend-ads}@anchor{35c}@anchor{gnat_rm/the_gnat_library id47}@anchor{35d} +@anchor{gnat_rm/the_gnat_library gnat-calendar-g-calend-ads}@anchor{35d}@anchor{gnat_rm/the_gnat_library id47}@anchor{35e} @section @code{GNAT.Calendar} (@code{g-calend.ads}) @@ -24744,7 +24755,7 @@ Extends the facilities provided by @code{Ada.Calendar} to include handling of days of the week, an extended @code{Split} and @code{Time_Of} capability. @node GNAT Calendar Time_IO g-catiio ads,GNAT CRC32 g-crc32 ads,GNAT Calendar g-calend ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-calendar-time-io-g-catiio-ads}@anchor{35e}@anchor{gnat_rm/the_gnat_library id48}@anchor{35f} +@anchor{gnat_rm/the_gnat_library gnat-calendar-time-io-g-catiio-ads}@anchor{35f}@anchor{gnat_rm/the_gnat_library id48}@anchor{360} @section @code{GNAT.Calendar.Time_IO} (@code{g-catiio.ads}) @@ -24755,7 +24766,7 @@ of days of the week, an extended @code{Split} and @code{Time_Of} capability. @geindex GNAT.Calendar.Time_IO (g-catiio.ads) @node GNAT CRC32 g-crc32 ads,GNAT Case_Util g-casuti ads,GNAT Calendar Time_IO g-catiio ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-crc32-g-crc32-ads}@anchor{360}@anchor{gnat_rm/the_gnat_library id49}@anchor{361} +@anchor{gnat_rm/the_gnat_library gnat-crc32-g-crc32-ads}@anchor{361}@anchor{gnat_rm/the_gnat_library id49}@anchor{362} @section @code{GNAT.CRC32} (@code{g-crc32.ads}) @@ -24772,7 +24783,7 @@ of this algorithm see Aug. 1988. Sarwate, D.V. @node GNAT Case_Util g-casuti ads,GNAT CGI g-cgi ads,GNAT CRC32 g-crc32 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-case-util-g-casuti-ads}@anchor{362}@anchor{gnat_rm/the_gnat_library id50}@anchor{363} +@anchor{gnat_rm/the_gnat_library gnat-case-util-g-casuti-ads}@anchor{363}@anchor{gnat_rm/the_gnat_library id50}@anchor{364} @section @code{GNAT.Case_Util} (@code{g-casuti.ads}) @@ -24787,7 +24798,7 @@ without the overhead of the full casing tables in @code{Ada.Characters.Handling}. @node GNAT CGI g-cgi ads,GNAT CGI Cookie g-cgicoo ads,GNAT Case_Util g-casuti ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-cgi-g-cgi-ads}@anchor{364}@anchor{gnat_rm/the_gnat_library id51}@anchor{365} +@anchor{gnat_rm/the_gnat_library gnat-cgi-g-cgi-ads}@anchor{365}@anchor{gnat_rm/the_gnat_library id51}@anchor{366} @section @code{GNAT.CGI} (@code{g-cgi.ads}) @@ -24802,7 +24813,7 @@ builds a table whose index is the key and provides some services to deal with this table. @node GNAT CGI Cookie g-cgicoo ads,GNAT CGI Debug g-cgideb ads,GNAT CGI g-cgi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-cgi-cookie-g-cgicoo-ads}@anchor{366}@anchor{gnat_rm/the_gnat_library id52}@anchor{367} +@anchor{gnat_rm/the_gnat_library gnat-cgi-cookie-g-cgicoo-ads}@anchor{367}@anchor{gnat_rm/the_gnat_library id52}@anchor{368} @section @code{GNAT.CGI.Cookie} (@code{g-cgicoo.ads}) @@ -24817,7 +24828,7 @@ Common Gateway Interface (CGI). It exports services to deal with Web cookies (piece of information kept in the Web client software). @node GNAT CGI Debug g-cgideb ads,GNAT Command_Line g-comlin ads,GNAT CGI Cookie g-cgicoo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-cgi-debug-g-cgideb-ads}@anchor{368}@anchor{gnat_rm/the_gnat_library id53}@anchor{369} +@anchor{gnat_rm/the_gnat_library gnat-cgi-debug-g-cgideb-ads}@anchor{369}@anchor{gnat_rm/the_gnat_library id53}@anchor{36a} @section @code{GNAT.CGI.Debug} (@code{g-cgideb.ads}) @@ -24829,7 +24840,7 @@ This is a package to help debugging CGI (Common Gateway Interface) programs written in Ada. @node GNAT Command_Line g-comlin ads,GNAT Compiler_Version g-comver ads,GNAT CGI Debug g-cgideb ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-command-line-g-comlin-ads}@anchor{36a}@anchor{gnat_rm/the_gnat_library id54}@anchor{36b} +@anchor{gnat_rm/the_gnat_library gnat-command-line-g-comlin-ads}@anchor{36b}@anchor{gnat_rm/the_gnat_library id54}@anchor{36c} @section @code{GNAT.Command_Line} (@code{g-comlin.ads}) @@ -24842,7 +24853,7 @@ including the ability to scan for named switches with optional parameters and expand file names using wildcard notations. @node GNAT Compiler_Version g-comver ads,GNAT Ctrl_C g-ctrl_c ads,GNAT Command_Line g-comlin ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-compiler-version-g-comver-ads}@anchor{36c}@anchor{gnat_rm/the_gnat_library id55}@anchor{36d} +@anchor{gnat_rm/the_gnat_library gnat-compiler-version-g-comver-ads}@anchor{36d}@anchor{gnat_rm/the_gnat_library id55}@anchor{36e} @section @code{GNAT.Compiler_Version} (@code{g-comver.ads}) @@ -24860,7 +24871,7 @@ of the compiler if a consistent tool set is used to compile all units of a partition). @node GNAT Ctrl_C g-ctrl_c ads,GNAT Current_Exception g-curexc ads,GNAT Compiler_Version g-comver ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-ctrl-c-g-ctrl-c-ads}@anchor{36e}@anchor{gnat_rm/the_gnat_library id56}@anchor{36f} +@anchor{gnat_rm/the_gnat_library gnat-ctrl-c-g-ctrl-c-ads}@anchor{36f}@anchor{gnat_rm/the_gnat_library id56}@anchor{370} @section @code{GNAT.Ctrl_C} (@code{g-ctrl_c.ads}) @@ -24871,7 +24882,7 @@ of a partition). Provides a simple interface to handle Ctrl-C keyboard events. @node GNAT Current_Exception g-curexc ads,GNAT Debug_Pools g-debpoo ads,GNAT Ctrl_C g-ctrl_c ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-current-exception-g-curexc-ads}@anchor{370}@anchor{gnat_rm/the_gnat_library id57}@anchor{371} +@anchor{gnat_rm/the_gnat_library gnat-current-exception-g-curexc-ads}@anchor{371}@anchor{gnat_rm/the_gnat_library id57}@anchor{372} @section @code{GNAT.Current_Exception} (@code{g-curexc.ads}) @@ -24888,7 +24899,7 @@ This is particularly useful in simulating typical facilities for obtaining information about exceptions provided by Ada 83 compilers. @node GNAT Debug_Pools g-debpoo ads,GNAT Debug_Utilities g-debuti ads,GNAT Current_Exception g-curexc ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-debug-pools-g-debpoo-ads}@anchor{372}@anchor{gnat_rm/the_gnat_library id58}@anchor{373} +@anchor{gnat_rm/the_gnat_library gnat-debug-pools-g-debpoo-ads}@anchor{373}@anchor{gnat_rm/the_gnat_library id58}@anchor{374} @section @code{GNAT.Debug_Pools} (@code{g-debpoo.ads}) @@ -24905,7 +24916,7 @@ problems. See @code{The GNAT Debug_Pool Facility} section in the @cite{GNAT User’s Guide}. @node GNAT Debug_Utilities g-debuti ads,GNAT Decode_String g-decstr ads,GNAT Debug_Pools g-debpoo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-debug-utilities-g-debuti-ads}@anchor{374}@anchor{gnat_rm/the_gnat_library id59}@anchor{375} +@anchor{gnat_rm/the_gnat_library gnat-debug-utilities-g-debuti-ads}@anchor{375}@anchor{gnat_rm/the_gnat_library id59}@anchor{376} @section @code{GNAT.Debug_Utilities} (@code{g-debuti.ads}) @@ -24918,7 +24929,7 @@ to and from string images of address values. Supports both C and Ada formats for hexadecimal literals. @node GNAT Decode_String g-decstr ads,GNAT Decode_UTF8_String g-deutst ads,GNAT Debug_Utilities g-debuti ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-decode-string-g-decstr-ads}@anchor{376}@anchor{gnat_rm/the_gnat_library id60}@anchor{377} +@anchor{gnat_rm/the_gnat_library gnat-decode-string-g-decstr-ads}@anchor{377}@anchor{gnat_rm/the_gnat_library id60}@anchor{378} @section @code{GNAT.Decode_String} (@code{g-decstr.ads}) @@ -24942,7 +24953,7 @@ Useful in conjunction with Unicode character coding. Note there is a preinstantiation for UTF-8. See next entry. @node GNAT Decode_UTF8_String g-deutst ads,GNAT Directory_Operations g-dirope ads,GNAT Decode_String g-decstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-decode-utf8-string-g-deutst-ads}@anchor{378}@anchor{gnat_rm/the_gnat_library id61}@anchor{379} +@anchor{gnat_rm/the_gnat_library gnat-decode-utf8-string-g-deutst-ads}@anchor{379}@anchor{gnat_rm/the_gnat_library id61}@anchor{37a} @section @code{GNAT.Decode_UTF8_String} (@code{g-deutst.ads}) @@ -24963,7 +24974,7 @@ preinstantiation for UTF-8. See next entry. A preinstantiation of GNAT.Decode_Strings for UTF-8 encoding. @node GNAT Directory_Operations g-dirope ads,GNAT Directory_Operations Iteration g-diopit ads,GNAT Decode_UTF8_String g-deutst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-directory-operations-g-dirope-ads}@anchor{37a}@anchor{gnat_rm/the_gnat_library id62}@anchor{37b} +@anchor{gnat_rm/the_gnat_library gnat-directory-operations-g-dirope-ads}@anchor{37b}@anchor{gnat_rm/the_gnat_library id62}@anchor{37c} @section @code{GNAT.Directory_Operations} (@code{g-dirope.ads}) @@ -24976,7 +24987,7 @@ the current directory, making new directories, and scanning the files in a directory. @node GNAT Directory_Operations Iteration g-diopit ads,GNAT Dynamic_HTables g-dynhta ads,GNAT Directory_Operations g-dirope ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-directory-operations-iteration-g-diopit-ads}@anchor{37c}@anchor{gnat_rm/the_gnat_library id63}@anchor{37d} +@anchor{gnat_rm/the_gnat_library gnat-directory-operations-iteration-g-diopit-ads}@anchor{37d}@anchor{gnat_rm/the_gnat_library id63}@anchor{37e} @section @code{GNAT.Directory_Operations.Iteration} (@code{g-diopit.ads}) @@ -24988,7 +24999,7 @@ A child unit of GNAT.Directory_Operations providing additional operations for iterating through directories. @node GNAT Dynamic_HTables g-dynhta ads,GNAT Dynamic_Tables g-dyntab ads,GNAT Directory_Operations Iteration g-diopit ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-dynamic-htables-g-dynhta-ads}@anchor{37e}@anchor{gnat_rm/the_gnat_library id64}@anchor{37f} +@anchor{gnat_rm/the_gnat_library gnat-dynamic-htables-g-dynhta-ads}@anchor{37f}@anchor{gnat_rm/the_gnat_library id64}@anchor{380} @section @code{GNAT.Dynamic_HTables} (@code{g-dynhta.ads}) @@ -25006,7 +25017,7 @@ dynamic instances of the hash table, while an instantiation of @code{GNAT.HTable} creates a single instance of the hash table. @node GNAT Dynamic_Tables g-dyntab ads,GNAT Encode_String g-encstr ads,GNAT Dynamic_HTables g-dynhta ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-dynamic-tables-g-dyntab-ads}@anchor{380}@anchor{gnat_rm/the_gnat_library id65}@anchor{381} +@anchor{gnat_rm/the_gnat_library gnat-dynamic-tables-g-dyntab-ads}@anchor{381}@anchor{gnat_rm/the_gnat_library id65}@anchor{382} @section @code{GNAT.Dynamic_Tables} (@code{g-dyntab.ads}) @@ -25026,7 +25037,7 @@ dynamic instances of the table, while an instantiation of @code{GNAT.Table} creates a single instance of the table type. @node GNAT Encode_String g-encstr ads,GNAT Encode_UTF8_String g-enutst ads,GNAT Dynamic_Tables g-dyntab ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-encode-string-g-encstr-ads}@anchor{382}@anchor{gnat_rm/the_gnat_library id66}@anchor{383} +@anchor{gnat_rm/the_gnat_library gnat-encode-string-g-encstr-ads}@anchor{383}@anchor{gnat_rm/the_gnat_library id66}@anchor{384} @section @code{GNAT.Encode_String} (@code{g-encstr.ads}) @@ -25048,7 +25059,7 @@ encoding method. Useful in conjunction with Unicode character coding. Note there is a preinstantiation for UTF-8. See next entry. @node GNAT Encode_UTF8_String g-enutst ads,GNAT Exception_Actions g-excact ads,GNAT Encode_String g-encstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-encode-utf8-string-g-enutst-ads}@anchor{384}@anchor{gnat_rm/the_gnat_library id67}@anchor{385} +@anchor{gnat_rm/the_gnat_library gnat-encode-utf8-string-g-enutst-ads}@anchor{385}@anchor{gnat_rm/the_gnat_library id67}@anchor{386} @section @code{GNAT.Encode_UTF8_String} (@code{g-enutst.ads}) @@ -25069,7 +25080,7 @@ Note there is a preinstantiation for UTF-8. See next entry. A preinstantiation of GNAT.Encode_Strings for UTF-8 encoding. @node GNAT Exception_Actions g-excact ads,GNAT Exception_Traces g-exctra ads,GNAT Encode_UTF8_String g-enutst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-exception-actions-g-excact-ads}@anchor{386}@anchor{gnat_rm/the_gnat_library id68}@anchor{387} +@anchor{gnat_rm/the_gnat_library gnat-exception-actions-g-excact-ads}@anchor{387}@anchor{gnat_rm/the_gnat_library id68}@anchor{388} @section @code{GNAT.Exception_Actions} (@code{g-excact.ads}) @@ -25082,7 +25093,7 @@ for specific exceptions, or when any exception is raised. This can be used for instance to force a core dump to ease debugging. @node GNAT Exception_Traces g-exctra ads,GNAT Exceptions g-except ads,GNAT Exception_Actions g-excact ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-exception-traces-g-exctra-ads}@anchor{388}@anchor{gnat_rm/the_gnat_library id69}@anchor{389} +@anchor{gnat_rm/the_gnat_library gnat-exception-traces-g-exctra-ads}@anchor{389}@anchor{gnat_rm/the_gnat_library id69}@anchor{38a} @section @code{GNAT.Exception_Traces} (@code{g-exctra.ads}) @@ -25096,7 +25107,7 @@ Provides an interface allowing to control automatic output upon exception occurrences. @node GNAT Exceptions g-except ads,GNAT Expect g-expect ads,GNAT Exception_Traces g-exctra ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-exceptions-g-except-ads}@anchor{38a}@anchor{gnat_rm/the_gnat_library id70}@anchor{38b} +@anchor{gnat_rm/the_gnat_library gnat-exceptions-g-except-ads}@anchor{38b}@anchor{gnat_rm/the_gnat_library id70}@anchor{38c} @section @code{GNAT.Exceptions} (@code{g-except.ads}) @@ -25117,7 +25128,7 @@ predefined exceptions, and for example allows raising @code{Constraint_Error} with a message from a pure subprogram. @node GNAT Expect g-expect ads,GNAT Expect TTY g-exptty ads,GNAT Exceptions g-except ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-expect-g-expect-ads}@anchor{38c}@anchor{gnat_rm/the_gnat_library id71}@anchor{38d} +@anchor{gnat_rm/the_gnat_library gnat-expect-g-expect-ads}@anchor{38d}@anchor{gnat_rm/the_gnat_library id71}@anchor{38e} @section @code{GNAT.Expect} (@code{g-expect.ads}) @@ -25133,7 +25144,7 @@ It is not implemented for cross ports, and in particular is not implemented for VxWorks or LynxOS. @node GNAT Expect TTY g-exptty ads,GNAT Float_Control g-flocon ads,GNAT Expect g-expect ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-expect-tty-g-exptty-ads}@anchor{38e}@anchor{gnat_rm/the_gnat_library id72}@anchor{38f} +@anchor{gnat_rm/the_gnat_library gnat-expect-tty-g-exptty-ads}@anchor{38f}@anchor{gnat_rm/the_gnat_library id72}@anchor{390} @section @code{GNAT.Expect.TTY} (@code{g-exptty.ads}) @@ -25145,7 +25156,7 @@ ports. It is not implemented for cross ports, and in particular is not implemented for VxWorks or LynxOS. @node GNAT Float_Control g-flocon ads,GNAT Formatted_String g-forstr ads,GNAT Expect TTY g-exptty ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-float-control-g-flocon-ads}@anchor{390}@anchor{gnat_rm/the_gnat_library id73}@anchor{391} +@anchor{gnat_rm/the_gnat_library gnat-float-control-g-flocon-ads}@anchor{391}@anchor{gnat_rm/the_gnat_library id73}@anchor{392} @section @code{GNAT.Float_Control} (@code{g-flocon.ads}) @@ -25159,7 +25170,7 @@ library calls may cause this mode to be modified, and the Reset procedure in this package can be used to reestablish the required mode. @node GNAT Formatted_String g-forstr ads,GNAT Generic_Fast_Math_Functions g-gfmafu ads,GNAT Float_Control g-flocon ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-formatted-string-g-forstr-ads}@anchor{392}@anchor{gnat_rm/the_gnat_library id74}@anchor{393} +@anchor{gnat_rm/the_gnat_library gnat-formatted-string-g-forstr-ads}@anchor{393}@anchor{gnat_rm/the_gnat_library id74}@anchor{394} @section @code{GNAT.Formatted_String} (@code{g-forstr.ads}) @@ -25174,7 +25185,7 @@ derived from Integer, Float or enumerations as values for the formatted string. @node GNAT Generic_Fast_Math_Functions g-gfmafu ads,GNAT Heap_Sort g-heasor ads,GNAT Formatted_String g-forstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-generic-fast-math-functions-g-gfmafu-ads}@anchor{394}@anchor{gnat_rm/the_gnat_library id75}@anchor{395} +@anchor{gnat_rm/the_gnat_library gnat-generic-fast-math-functions-g-gfmafu-ads}@anchor{395}@anchor{gnat_rm/the_gnat_library id75}@anchor{396} @section @code{GNAT.Generic_Fast_Math_Functions} (@code{g-gfmafu.ads}) @@ -25192,7 +25203,7 @@ have a vector implementation that can be automatically used by the compiler when auto-vectorization is enabled. @node GNAT Heap_Sort g-heasor ads,GNAT Heap_Sort_A g-hesora ads,GNAT Generic_Fast_Math_Functions g-gfmafu ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-heasor-ads}@anchor{396}@anchor{gnat_rm/the_gnat_library id76}@anchor{397} +@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-heasor-ads}@anchor{397}@anchor{gnat_rm/the_gnat_library id76}@anchor{398} @section @code{GNAT.Heap_Sort} (@code{g-heasor.ads}) @@ -25206,7 +25217,7 @@ access-to-procedure values. The algorithm used is a modified heap sort that performs approximately N*log(N) comparisons in the worst case. @node GNAT Heap_Sort_A g-hesora ads,GNAT Heap_Sort_G g-hesorg ads,GNAT Heap_Sort g-heasor ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-heap-sort-a-g-hesora-ads}@anchor{398}@anchor{gnat_rm/the_gnat_library id77}@anchor{399} +@anchor{gnat_rm/the_gnat_library gnat-heap-sort-a-g-hesora-ads}@anchor{399}@anchor{gnat_rm/the_gnat_library id77}@anchor{39a} @section @code{GNAT.Heap_Sort_A} (@code{g-hesora.ads}) @@ -25222,7 +25233,7 @@ This differs from @code{GNAT.Heap_Sort} in having a less convenient interface, but may be slightly more efficient. @node GNAT Heap_Sort_G g-hesorg ads,GNAT HTable g-htable ads,GNAT Heap_Sort_A g-hesora ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-g-hesorg-ads}@anchor{39a}@anchor{gnat_rm/the_gnat_library id78}@anchor{39b} +@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-g-hesorg-ads}@anchor{39b}@anchor{gnat_rm/the_gnat_library id78}@anchor{39c} @section @code{GNAT.Heap_Sort_G} (@code{g-hesorg.ads}) @@ -25236,7 +25247,7 @@ if the procedures can be inlined, at the expense of duplicating code for multiple instantiations. @node GNAT HTable g-htable ads,GNAT IO g-io ads,GNAT Heap_Sort_G g-hesorg ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-htable-g-htable-ads}@anchor{39c}@anchor{gnat_rm/the_gnat_library id79}@anchor{39d} +@anchor{gnat_rm/the_gnat_library gnat-htable-g-htable-ads}@anchor{39d}@anchor{gnat_rm/the_gnat_library id79}@anchor{39e} @section @code{GNAT.HTable} (@code{g-htable.ads}) @@ -25249,7 +25260,7 @@ data. Provides two approaches, one a simple static approach, and the other allowing arbitrary dynamic hash tables. @node GNAT IO g-io ads,GNAT IO_Aux g-io_aux ads,GNAT HTable g-htable ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-io-g-io-ads}@anchor{39e}@anchor{gnat_rm/the_gnat_library id80}@anchor{39f} +@anchor{gnat_rm/the_gnat_library gnat-io-g-io-ads}@anchor{39f}@anchor{gnat_rm/the_gnat_library id80}@anchor{3a0} @section @code{GNAT.IO} (@code{g-io.ads}) @@ -25265,7 +25276,7 @@ Standard_Input, and writing characters, strings and integers to either Standard_Output or Standard_Error. @node GNAT IO_Aux g-io_aux ads,GNAT Lock_Files g-locfil ads,GNAT IO g-io ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-io-aux-g-io-aux-ads}@anchor{3a0}@anchor{gnat_rm/the_gnat_library id81}@anchor{3a1} +@anchor{gnat_rm/the_gnat_library gnat-io-aux-g-io-aux-ads}@anchor{3a1}@anchor{gnat_rm/the_gnat_library id81}@anchor{3a2} @section @code{GNAT.IO_Aux} (@code{g-io_aux.ads}) @@ -25279,7 +25290,7 @@ Provides some auxiliary functions for use with Text_IO, including a test for whether a file exists, and functions for reading a line of text. @node GNAT Lock_Files g-locfil ads,GNAT MBBS_Discrete_Random g-mbdira ads,GNAT IO_Aux g-io_aux ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-lock-files-g-locfil-ads}@anchor{3a2}@anchor{gnat_rm/the_gnat_library id82}@anchor{3a3} +@anchor{gnat_rm/the_gnat_library gnat-lock-files-g-locfil-ads}@anchor{3a3}@anchor{gnat_rm/the_gnat_library id82}@anchor{3a4} @section @code{GNAT.Lock_Files} (@code{g-locfil.ads}) @@ -25293,7 +25304,7 @@ Provides a general interface for using files as locks. Can be used for providing program level synchronization. @node GNAT MBBS_Discrete_Random g-mbdira ads,GNAT MBBS_Float_Random g-mbflra ads,GNAT Lock_Files g-locfil ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-mbbs-discrete-random-g-mbdira-ads}@anchor{3a4}@anchor{gnat_rm/the_gnat_library id83}@anchor{3a5} +@anchor{gnat_rm/the_gnat_library gnat-mbbs-discrete-random-g-mbdira-ads}@anchor{3a5}@anchor{gnat_rm/the_gnat_library id83}@anchor{3a6} @section @code{GNAT.MBBS_Discrete_Random} (@code{g-mbdira.ads}) @@ -25305,7 +25316,7 @@ The original implementation of @code{Ada.Numerics.Discrete_Random}. Uses a modified version of the Blum-Blum-Shub generator. @node GNAT MBBS_Float_Random g-mbflra ads,GNAT MD5 g-md5 ads,GNAT MBBS_Discrete_Random g-mbdira ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-mbbs-float-random-g-mbflra-ads}@anchor{3a6}@anchor{gnat_rm/the_gnat_library id84}@anchor{3a7} +@anchor{gnat_rm/the_gnat_library gnat-mbbs-float-random-g-mbflra-ads}@anchor{3a7}@anchor{gnat_rm/the_gnat_library id84}@anchor{3a8} @section @code{GNAT.MBBS_Float_Random} (@code{g-mbflra.ads}) @@ -25317,7 +25328,7 @@ The original implementation of @code{Ada.Numerics.Float_Random}. Uses a modified version of the Blum-Blum-Shub generator. @node GNAT MD5 g-md5 ads,GNAT Memory_Dump g-memdum ads,GNAT MBBS_Float_Random g-mbflra ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-md5-g-md5-ads}@anchor{3a8}@anchor{gnat_rm/the_gnat_library id85}@anchor{3a9} +@anchor{gnat_rm/the_gnat_library gnat-md5-g-md5-ads}@anchor{3a9}@anchor{gnat_rm/the_gnat_library id85}@anchor{3aa} @section @code{GNAT.MD5} (@code{g-md5.ads}) @@ -25330,7 +25341,7 @@ the HMAC-MD5 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT Memory_Dump g-memdum ads,GNAT Most_Recent_Exception g-moreex ads,GNAT MD5 g-md5 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-memory-dump-g-memdum-ads}@anchor{3aa}@anchor{gnat_rm/the_gnat_library id86}@anchor{3ab} +@anchor{gnat_rm/the_gnat_library gnat-memory-dump-g-memdum-ads}@anchor{3ab}@anchor{gnat_rm/the_gnat_library id86}@anchor{3ac} @section @code{GNAT.Memory_Dump} (@code{g-memdum.ads}) @@ -25343,7 +25354,7 @@ standard output or standard error files. Uses GNAT.IO for actual output. @node GNAT Most_Recent_Exception g-moreex ads,GNAT OS_Lib g-os_lib ads,GNAT Memory_Dump g-memdum ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-most-recent-exception-g-moreex-ads}@anchor{3ac}@anchor{gnat_rm/the_gnat_library id87}@anchor{3ad} +@anchor{gnat_rm/the_gnat_library gnat-most-recent-exception-g-moreex-ads}@anchor{3ad}@anchor{gnat_rm/the_gnat_library id87}@anchor{3ae} @section @code{GNAT.Most_Recent_Exception} (@code{g-moreex.ads}) @@ -25357,7 +25368,7 @@ various logging purposes, including duplicating functionality of some Ada 83 implementation dependent extensions. @node GNAT OS_Lib g-os_lib ads,GNAT Perfect_Hash_Generators g-pehage ads,GNAT Most_Recent_Exception g-moreex ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-os-lib-g-os-lib-ads}@anchor{3ae}@anchor{gnat_rm/the_gnat_library id88}@anchor{3af} +@anchor{gnat_rm/the_gnat_library gnat-os-lib-g-os-lib-ads}@anchor{3af}@anchor{gnat_rm/the_gnat_library id88}@anchor{3b0} @section @code{GNAT.OS_Lib} (@code{g-os_lib.ads}) @@ -25373,7 +25384,7 @@ including a portable spawn procedure, and access to environment variables and error return codes. @node GNAT Perfect_Hash_Generators g-pehage ads,GNAT Random_Numbers g-rannum ads,GNAT OS_Lib g-os_lib ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-perfect-hash-generators-g-pehage-ads}@anchor{3b0}@anchor{gnat_rm/the_gnat_library id89}@anchor{3b1} +@anchor{gnat_rm/the_gnat_library gnat-perfect-hash-generators-g-pehage-ads}@anchor{3b1}@anchor{gnat_rm/the_gnat_library id89}@anchor{3b2} @section @code{GNAT.Perfect_Hash_Generators} (@code{g-pehage.ads}) @@ -25391,7 +25402,7 @@ hashcode are in the same order. These hashing functions are very convenient for use with realtime applications. @node GNAT Random_Numbers g-rannum ads,GNAT Regexp g-regexp ads,GNAT Perfect_Hash_Generators g-pehage ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-random-numbers-g-rannum-ads}@anchor{3b2}@anchor{gnat_rm/the_gnat_library id90}@anchor{3b3} +@anchor{gnat_rm/the_gnat_library gnat-random-numbers-g-rannum-ads}@anchor{3b3}@anchor{gnat_rm/the_gnat_library id90}@anchor{3b4} @section @code{GNAT.Random_Numbers} (@code{g-rannum.ads}) @@ -25405,7 +25416,7 @@ however NOT suitable for situations requiring cryptographically secure randomness. @node GNAT Regexp g-regexp ads,GNAT Registry g-regist ads,GNAT Random_Numbers g-rannum ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-regexp-g-regexp-ads}@anchor{287}@anchor{gnat_rm/the_gnat_library id91}@anchor{3b4} +@anchor{gnat_rm/the_gnat_library gnat-regexp-g-regexp-ads}@anchor{288}@anchor{gnat_rm/the_gnat_library id91}@anchor{3b5} @section @code{GNAT.Regexp} (@code{g-regexp.ads}) @@ -25421,7 +25432,7 @@ simplest of the three pattern matching packages provided, and is particularly suitable for ‘file globbing’ applications. @node GNAT Registry g-regist ads,GNAT Regpat g-regpat ads,GNAT Regexp g-regexp ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-registry-g-regist-ads}@anchor{3b5}@anchor{gnat_rm/the_gnat_library id92}@anchor{3b6} +@anchor{gnat_rm/the_gnat_library gnat-registry-g-regist-ads}@anchor{3b6}@anchor{gnat_rm/the_gnat_library id92}@anchor{3b7} @section @code{GNAT.Registry} (@code{g-regist.ads}) @@ -25435,7 +25446,7 @@ registry API, but at a lower level of abstraction, refer to the Win32.Winreg package provided with the Win32Ada binding @node GNAT Regpat g-regpat ads,GNAT Rewrite_Data g-rewdat ads,GNAT Registry g-regist ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-regpat-g-regpat-ads}@anchor{3b7}@anchor{gnat_rm/the_gnat_library id93}@anchor{3b8} +@anchor{gnat_rm/the_gnat_library gnat-regpat-g-regpat-ads}@anchor{3b8}@anchor{gnat_rm/the_gnat_library id93}@anchor{3b9} @section @code{GNAT.Regpat} (@code{g-regpat.ads}) @@ -25450,7 +25461,7 @@ from the original V7 style regular expression library written in C by Henry Spencer (and binary compatible with this C library). @node GNAT Rewrite_Data g-rewdat ads,GNAT Secondary_Stack_Info g-sestin ads,GNAT Regpat g-regpat ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-rewrite-data-g-rewdat-ads}@anchor{3b9}@anchor{gnat_rm/the_gnat_library id94}@anchor{3ba} +@anchor{gnat_rm/the_gnat_library gnat-rewrite-data-g-rewdat-ads}@anchor{3ba}@anchor{gnat_rm/the_gnat_library id94}@anchor{3bb} @section @code{GNAT.Rewrite_Data} (@code{g-rewdat.ads}) @@ -25464,7 +25475,7 @@ full content to be processed is not loaded into memory all at once. This makes this interface usable for large files or socket streams. @node GNAT Secondary_Stack_Info g-sestin ads,GNAT Semaphores g-semaph ads,GNAT Rewrite_Data g-rewdat ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-secondary-stack-info-g-sestin-ads}@anchor{3bb}@anchor{gnat_rm/the_gnat_library id95}@anchor{3bc} +@anchor{gnat_rm/the_gnat_library gnat-secondary-stack-info-g-sestin-ads}@anchor{3bc}@anchor{gnat_rm/the_gnat_library id95}@anchor{3bd} @section @code{GNAT.Secondary_Stack_Info} (@code{g-sestin.ads}) @@ -25476,7 +25487,7 @@ Provides the capability to query the high water mark of the current task’s secondary stack. @node GNAT Semaphores g-semaph ads,GNAT Serial_Communications g-sercom ads,GNAT Secondary_Stack_Info g-sestin ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-semaphores-g-semaph-ads}@anchor{3bd}@anchor{gnat_rm/the_gnat_library id96}@anchor{3be} +@anchor{gnat_rm/the_gnat_library gnat-semaphores-g-semaph-ads}@anchor{3be}@anchor{gnat_rm/the_gnat_library id96}@anchor{3bf} @section @code{GNAT.Semaphores} (@code{g-semaph.ads}) @@ -25487,7 +25498,7 @@ secondary stack. Provides classic counting and binary semaphores using protected types. @node GNAT Serial_Communications g-sercom ads,GNAT SHA1 g-sha1 ads,GNAT Semaphores g-semaph ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-serial-communications-g-sercom-ads}@anchor{3bf}@anchor{gnat_rm/the_gnat_library id97}@anchor{3c0} +@anchor{gnat_rm/the_gnat_library gnat-serial-communications-g-sercom-ads}@anchor{3c0}@anchor{gnat_rm/the_gnat_library id97}@anchor{3c1} @section @code{GNAT.Serial_Communications} (@code{g-sercom.ads}) @@ -25499,7 +25510,7 @@ Provides a simple interface to send and receive data over a serial port. This is only supported on GNU/Linux and Windows. @node GNAT SHA1 g-sha1 ads,GNAT SHA224 g-sha224 ads,GNAT Serial_Communications g-sercom ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha1-g-sha1-ads}@anchor{3c1}@anchor{gnat_rm/the_gnat_library id98}@anchor{3c2} +@anchor{gnat_rm/the_gnat_library gnat-sha1-g-sha1-ads}@anchor{3c2}@anchor{gnat_rm/the_gnat_library id98}@anchor{3c3} @section @code{GNAT.SHA1} (@code{g-sha1.ads}) @@ -25512,7 +25523,7 @@ and RFC 3174, and the HMAC-SHA1 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT SHA224 g-sha224 ads,GNAT SHA256 g-sha256 ads,GNAT SHA1 g-sha1 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha224-g-sha224-ads}@anchor{3c3}@anchor{gnat_rm/the_gnat_library id99}@anchor{3c4} +@anchor{gnat_rm/the_gnat_library gnat-sha224-g-sha224-ads}@anchor{3c4}@anchor{gnat_rm/the_gnat_library id99}@anchor{3c5} @section @code{GNAT.SHA224} (@code{g-sha224.ads}) @@ -25525,7 +25536,7 @@ and the HMAC-SHA224 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT SHA256 g-sha256 ads,GNAT SHA384 g-sha384 ads,GNAT SHA224 g-sha224 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha256-g-sha256-ads}@anchor{3c5}@anchor{gnat_rm/the_gnat_library id100}@anchor{3c6} +@anchor{gnat_rm/the_gnat_library gnat-sha256-g-sha256-ads}@anchor{3c6}@anchor{gnat_rm/the_gnat_library id100}@anchor{3c7} @section @code{GNAT.SHA256} (@code{g-sha256.ads}) @@ -25538,7 +25549,7 @@ and the HMAC-SHA256 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT SHA384 g-sha384 ads,GNAT SHA512 g-sha512 ads,GNAT SHA256 g-sha256 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha384-g-sha384-ads}@anchor{3c7}@anchor{gnat_rm/the_gnat_library id101}@anchor{3c8} +@anchor{gnat_rm/the_gnat_library gnat-sha384-g-sha384-ads}@anchor{3c8}@anchor{gnat_rm/the_gnat_library id101}@anchor{3c9} @section @code{GNAT.SHA384} (@code{g-sha384.ads}) @@ -25551,7 +25562,7 @@ and the HMAC-SHA384 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT SHA512 g-sha512 ads,GNAT Signals g-signal ads,GNAT SHA384 g-sha384 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha512-g-sha512-ads}@anchor{3c9}@anchor{gnat_rm/the_gnat_library id102}@anchor{3ca} +@anchor{gnat_rm/the_gnat_library gnat-sha512-g-sha512-ads}@anchor{3ca}@anchor{gnat_rm/the_gnat_library id102}@anchor{3cb} @section @code{GNAT.SHA512} (@code{g-sha512.ads}) @@ -25564,7 +25575,7 @@ and the HMAC-SHA512 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT Signals g-signal ads,GNAT Sockets g-socket ads,GNAT SHA512 g-sha512 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-signals-g-signal-ads}@anchor{3cb}@anchor{gnat_rm/the_gnat_library id103}@anchor{3cc} +@anchor{gnat_rm/the_gnat_library gnat-signals-g-signal-ads}@anchor{3cc}@anchor{gnat_rm/the_gnat_library id103}@anchor{3cd} @section @code{GNAT.Signals} (@code{g-signal.ads}) @@ -25576,7 +25587,7 @@ Provides the ability to manipulate the blocked status of signals on supported targets. @node GNAT Sockets g-socket ads,GNAT Source_Info g-souinf ads,GNAT Signals g-signal ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sockets-g-socket-ads}@anchor{3cd}@anchor{gnat_rm/the_gnat_library id104}@anchor{3ce} +@anchor{gnat_rm/the_gnat_library gnat-sockets-g-socket-ads}@anchor{3ce}@anchor{gnat_rm/the_gnat_library id104}@anchor{3cf} @section @code{GNAT.Sockets} (@code{g-socket.ads}) @@ -25591,7 +25602,7 @@ on all native GNAT ports and on VxWorks cross ports. It is not implemented for the LynxOS cross port. @node GNAT Source_Info g-souinf ads,GNAT Spelling_Checker g-speche ads,GNAT Sockets g-socket ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-source-info-g-souinf-ads}@anchor{3cf}@anchor{gnat_rm/the_gnat_library id105}@anchor{3d0} +@anchor{gnat_rm/the_gnat_library gnat-source-info-g-souinf-ads}@anchor{3d0}@anchor{gnat_rm/the_gnat_library id105}@anchor{3d1} @section @code{GNAT.Source_Info} (@code{g-souinf.ads}) @@ -25605,7 +25616,7 @@ subprograms yielding the date and time of the current compilation (like the C macros @code{__DATE__} and @code{__TIME__}) @node GNAT Spelling_Checker g-speche ads,GNAT Spelling_Checker_Generic g-spchge ads,GNAT Source_Info g-souinf ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spelling-checker-g-speche-ads}@anchor{3d1}@anchor{gnat_rm/the_gnat_library id106}@anchor{3d2} +@anchor{gnat_rm/the_gnat_library gnat-spelling-checker-g-speche-ads}@anchor{3d2}@anchor{gnat_rm/the_gnat_library id106}@anchor{3d3} @section @code{GNAT.Spelling_Checker} (@code{g-speche.ads}) @@ -25617,7 +25628,7 @@ Provides a function for determining whether one string is a plausible near misspelling of another string. @node GNAT Spelling_Checker_Generic g-spchge ads,GNAT Spitbol Patterns g-spipat ads,GNAT Spelling_Checker g-speche ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spelling-checker-generic-g-spchge-ads}@anchor{3d3}@anchor{gnat_rm/the_gnat_library id107}@anchor{3d4} +@anchor{gnat_rm/the_gnat_library gnat-spelling-checker-generic-g-spchge-ads}@anchor{3d4}@anchor{gnat_rm/the_gnat_library id107}@anchor{3d5} @section @code{GNAT.Spelling_Checker_Generic} (@code{g-spchge.ads}) @@ -25630,7 +25641,7 @@ determining whether one string is a plausible near misspelling of another string. @node GNAT Spitbol Patterns g-spipat ads,GNAT Spitbol g-spitbo ads,GNAT Spelling_Checker_Generic g-spchge ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spitbol-patterns-g-spipat-ads}@anchor{3d5}@anchor{gnat_rm/the_gnat_library id108}@anchor{3d6} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-patterns-g-spipat-ads}@anchor{3d6}@anchor{gnat_rm/the_gnat_library id108}@anchor{3d7} @section @code{GNAT.Spitbol.Patterns} (@code{g-spipat.ads}) @@ -25646,7 +25657,7 @@ the SNOBOL4 dynamic pattern construction and matching capabilities, using the efficient algorithm developed by Robert Dewar for the SPITBOL system. @node GNAT Spitbol g-spitbo ads,GNAT Spitbol Table_Boolean g-sptabo ads,GNAT Spitbol Patterns g-spipat ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spitbol-g-spitbo-ads}@anchor{3d7}@anchor{gnat_rm/the_gnat_library id109}@anchor{3d8} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-g-spitbo-ads}@anchor{3d8}@anchor{gnat_rm/the_gnat_library id109}@anchor{3d9} @section @code{GNAT.Spitbol} (@code{g-spitbo.ads}) @@ -25661,7 +25672,7 @@ useful for constructing arbitrary mappings from strings in the style of the SNOBOL4 TABLE function. @node GNAT Spitbol Table_Boolean g-sptabo ads,GNAT Spitbol Table_Integer g-sptain ads,GNAT Spitbol g-spitbo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-boolean-g-sptabo-ads}@anchor{3d9}@anchor{gnat_rm/the_gnat_library id110}@anchor{3da} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-boolean-g-sptabo-ads}@anchor{3da}@anchor{gnat_rm/the_gnat_library id110}@anchor{3db} @section @code{GNAT.Spitbol.Table_Boolean} (@code{g-sptabo.ads}) @@ -25676,7 +25687,7 @@ for type @code{Standard.Boolean}, giving an implementation of sets of string values. @node GNAT Spitbol Table_Integer g-sptain ads,GNAT Spitbol Table_VString g-sptavs ads,GNAT Spitbol Table_Boolean g-sptabo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-integer-g-sptain-ads}@anchor{3db}@anchor{gnat_rm/the_gnat_library id111}@anchor{3dc} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-integer-g-sptain-ads}@anchor{3dc}@anchor{gnat_rm/the_gnat_library id111}@anchor{3dd} @section @code{GNAT.Spitbol.Table_Integer} (@code{g-sptain.ads}) @@ -25693,7 +25704,7 @@ for type @code{Standard.Integer}, giving an implementation of maps from string to integer values. @node GNAT Spitbol Table_VString g-sptavs ads,GNAT SSE g-sse ads,GNAT Spitbol Table_Integer g-sptain ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-vstring-g-sptavs-ads}@anchor{3dd}@anchor{gnat_rm/the_gnat_library id112}@anchor{3de} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-vstring-g-sptavs-ads}@anchor{3de}@anchor{gnat_rm/the_gnat_library id112}@anchor{3df} @section @code{GNAT.Spitbol.Table_VString} (@code{g-sptavs.ads}) @@ -25710,7 +25721,7 @@ a variable length string type, giving an implementation of general maps from strings to strings. @node GNAT SSE g-sse ads,GNAT SSE Vector_Types g-ssvety ads,GNAT Spitbol Table_VString g-sptavs ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sse-g-sse-ads}@anchor{3df}@anchor{gnat_rm/the_gnat_library id113}@anchor{3e0} +@anchor{gnat_rm/the_gnat_library gnat-sse-g-sse-ads}@anchor{3e0}@anchor{gnat_rm/the_gnat_library id113}@anchor{3e1} @section @code{GNAT.SSE} (@code{g-sse.ads}) @@ -25722,7 +25733,7 @@ targets. It exposes vector component types together with a general introduction to the binding contents and use. @node GNAT SSE Vector_Types g-ssvety ads,GNAT String_Hash g-strhas ads,GNAT SSE g-sse ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sse-vector-types-g-ssvety-ads}@anchor{3e1}@anchor{gnat_rm/the_gnat_library id114}@anchor{3e2} +@anchor{gnat_rm/the_gnat_library gnat-sse-vector-types-g-ssvety-ads}@anchor{3e2}@anchor{gnat_rm/the_gnat_library id114}@anchor{3e3} @section @code{GNAT.SSE.Vector_Types} (@code{g-ssvety.ads}) @@ -25731,7 +25742,7 @@ introduction to the binding contents and use. SSE vector types for use with SSE related intrinsics. @node GNAT String_Hash g-strhas ads,GNAT Strings g-string ads,GNAT SSE Vector_Types g-ssvety ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-string-hash-g-strhas-ads}@anchor{3e3}@anchor{gnat_rm/the_gnat_library id115}@anchor{3e4} +@anchor{gnat_rm/the_gnat_library gnat-string-hash-g-strhas-ads}@anchor{3e4}@anchor{gnat_rm/the_gnat_library id115}@anchor{3e5} @section @code{GNAT.String_Hash} (@code{g-strhas.ads}) @@ -25743,7 +25754,7 @@ Provides a generic hash function working on arrays of scalars. Both the scalar type and the hash result type are parameters. @node GNAT Strings g-string ads,GNAT String_Split g-strspl ads,GNAT String_Hash g-strhas ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-strings-g-string-ads}@anchor{3e5}@anchor{gnat_rm/the_gnat_library id116}@anchor{3e6} +@anchor{gnat_rm/the_gnat_library gnat-strings-g-string-ads}@anchor{3e6}@anchor{gnat_rm/the_gnat_library id116}@anchor{3e7} @section @code{GNAT.Strings} (@code{g-string.ads}) @@ -25753,7 +25764,7 @@ Common String access types and related subprograms. Basically it defines a string access and an array of string access types. @node GNAT String_Split g-strspl ads,GNAT Table g-table ads,GNAT Strings g-string ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-string-split-g-strspl-ads}@anchor{3e7}@anchor{gnat_rm/the_gnat_library id117}@anchor{3e8} +@anchor{gnat_rm/the_gnat_library gnat-string-split-g-strspl-ads}@anchor{3e8}@anchor{gnat_rm/the_gnat_library id117}@anchor{3e9} @section @code{GNAT.String_Split} (@code{g-strspl.ads}) @@ -25767,7 +25778,7 @@ to the resulting slices. This package is instantiated from @code{GNAT.Array_Split}. @node GNAT Table g-table ads,GNAT Task_Lock g-tasloc ads,GNAT String_Split g-strspl ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-table-g-table-ads}@anchor{3e9}@anchor{gnat_rm/the_gnat_library id118}@anchor{3ea} +@anchor{gnat_rm/the_gnat_library gnat-table-g-table-ads}@anchor{3ea}@anchor{gnat_rm/the_gnat_library id118}@anchor{3eb} @section @code{GNAT.Table} (@code{g-table.ads}) @@ -25787,7 +25798,7 @@ while an instantiation of @code{GNAT.Dynamic_Tables} creates a type that can be used to define dynamic instances of the table. @node GNAT Task_Lock g-tasloc ads,GNAT Time_Stamp g-timsta ads,GNAT Table g-table ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-task-lock-g-tasloc-ads}@anchor{3eb}@anchor{gnat_rm/the_gnat_library id119}@anchor{3ec} +@anchor{gnat_rm/the_gnat_library gnat-task-lock-g-tasloc-ads}@anchor{3ec}@anchor{gnat_rm/the_gnat_library id119}@anchor{3ed} @section @code{GNAT.Task_Lock} (@code{g-tasloc.ads}) @@ -25804,7 +25815,7 @@ single global task lock. Appropriate for use in situations where contention between tasks is very rarely expected. @node GNAT Time_Stamp g-timsta ads,GNAT Threads g-thread ads,GNAT Task_Lock g-tasloc ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-time-stamp-g-timsta-ads}@anchor{3ed}@anchor{gnat_rm/the_gnat_library id120}@anchor{3ee} +@anchor{gnat_rm/the_gnat_library gnat-time-stamp-g-timsta-ads}@anchor{3ee}@anchor{gnat_rm/the_gnat_library id120}@anchor{3ef} @section @code{GNAT.Time_Stamp} (@code{g-timsta.ads}) @@ -25819,7 +25830,7 @@ represents the current date and time in ISO 8601 format. This is a very simple routine with minimal code and there are no dependencies on any other unit. @node GNAT Threads g-thread ads,GNAT Traceback g-traceb ads,GNAT Time_Stamp g-timsta ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-threads-g-thread-ads}@anchor{3ef}@anchor{gnat_rm/the_gnat_library id121}@anchor{3f0} +@anchor{gnat_rm/the_gnat_library gnat-threads-g-thread-ads}@anchor{3f0}@anchor{gnat_rm/the_gnat_library id121}@anchor{3f1} @section @code{GNAT.Threads} (@code{g-thread.ads}) @@ -25836,7 +25847,7 @@ further details if your program has threads that are created by a non-Ada environment which then accesses Ada code. @node GNAT Traceback g-traceb ads,GNAT Traceback Symbolic g-trasym ads,GNAT Threads g-thread ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-traceback-g-traceb-ads}@anchor{3f1}@anchor{gnat_rm/the_gnat_library id122}@anchor{3f2} +@anchor{gnat_rm/the_gnat_library gnat-traceback-g-traceb-ads}@anchor{3f2}@anchor{gnat_rm/the_gnat_library id122}@anchor{3f3} @section @code{GNAT.Traceback} (@code{g-traceb.ads}) @@ -25848,7 +25859,7 @@ Provides a facility for obtaining non-symbolic traceback information, useful in various debugging situations. @node GNAT Traceback Symbolic g-trasym ads,GNAT UTF_32 g-utf_32 ads,GNAT Traceback g-traceb ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-traceback-symbolic-g-trasym-ads}@anchor{3f3}@anchor{gnat_rm/the_gnat_library id123}@anchor{3f4} +@anchor{gnat_rm/the_gnat_library gnat-traceback-symbolic-g-trasym-ads}@anchor{3f4}@anchor{gnat_rm/the_gnat_library id123}@anchor{3f5} @section @code{GNAT.Traceback.Symbolic} (@code{g-trasym.ads}) @@ -25857,7 +25868,7 @@ in various debugging situations. @geindex Trace back facilities @node GNAT UTF_32 g-utf_32 ads,GNAT UTF_32_Spelling_Checker g-u3spch ads,GNAT Traceback Symbolic g-trasym ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-utf-32-g-utf-32-ads}@anchor{3f5}@anchor{gnat_rm/the_gnat_library id124}@anchor{3f6} +@anchor{gnat_rm/the_gnat_library gnat-utf-32-g-utf-32-ads}@anchor{3f6}@anchor{gnat_rm/the_gnat_library id124}@anchor{3f7} @section @code{GNAT.UTF_32} (@code{g-utf_32.ads}) @@ -25876,7 +25887,7 @@ lower case to upper case fold routine corresponding to the Ada 2005 rules for identifier equivalence. @node GNAT UTF_32_Spelling_Checker g-u3spch ads,GNAT Wide_Spelling_Checker g-wispch ads,GNAT UTF_32 g-utf_32 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-utf-32-spelling-checker-g-u3spch-ads}@anchor{3f7}@anchor{gnat_rm/the_gnat_library id125}@anchor{3f8} +@anchor{gnat_rm/the_gnat_library gnat-utf-32-spelling-checker-g-u3spch-ads}@anchor{3f8}@anchor{gnat_rm/the_gnat_library id125}@anchor{3f9} @section @code{GNAT.UTF_32_Spelling_Checker} (@code{g-u3spch.ads}) @@ -25889,7 +25900,7 @@ near misspelling of another wide wide string, where the strings are represented using the UTF_32_String type defined in System.Wch_Cnv. @node GNAT Wide_Spelling_Checker g-wispch ads,GNAT Wide_String_Split g-wistsp ads,GNAT UTF_32_Spelling_Checker g-u3spch ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-wide-spelling-checker-g-wispch-ads}@anchor{3f9}@anchor{gnat_rm/the_gnat_library id126}@anchor{3fa} +@anchor{gnat_rm/the_gnat_library gnat-wide-spelling-checker-g-wispch-ads}@anchor{3fa}@anchor{gnat_rm/the_gnat_library id126}@anchor{3fb} @section @code{GNAT.Wide_Spelling_Checker} (@code{g-wispch.ads}) @@ -25901,7 +25912,7 @@ Provides a function for determining whether one wide string is a plausible near misspelling of another wide string. @node GNAT Wide_String_Split g-wistsp ads,GNAT Wide_Wide_Spelling_Checker g-zspche ads,GNAT Wide_Spelling_Checker g-wispch ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-wide-string-split-g-wistsp-ads}@anchor{3fb}@anchor{gnat_rm/the_gnat_library id127}@anchor{3fc} +@anchor{gnat_rm/the_gnat_library gnat-wide-string-split-g-wistsp-ads}@anchor{3fc}@anchor{gnat_rm/the_gnat_library id127}@anchor{3fd} @section @code{GNAT.Wide_String_Split} (@code{g-wistsp.ads}) @@ -25915,7 +25926,7 @@ to the resulting slices. This package is instantiated from @code{GNAT.Array_Split}. @node GNAT Wide_Wide_Spelling_Checker g-zspche ads,GNAT Wide_Wide_String_Split g-zistsp ads,GNAT Wide_String_Split g-wistsp ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-wide-wide-spelling-checker-g-zspche-ads}@anchor{3fd}@anchor{gnat_rm/the_gnat_library id128}@anchor{3fe} +@anchor{gnat_rm/the_gnat_library gnat-wide-wide-spelling-checker-g-zspche-ads}@anchor{3fe}@anchor{gnat_rm/the_gnat_library id128}@anchor{3ff} @section @code{GNAT.Wide_Wide_Spelling_Checker} (@code{g-zspche.ads}) @@ -25927,7 +25938,7 @@ Provides a function for determining whether one wide wide string is a plausible near misspelling of another wide wide string. @node GNAT Wide_Wide_String_Split g-zistsp ads,Interfaces C Extensions i-cexten ads,GNAT Wide_Wide_Spelling_Checker g-zspche ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-wide-wide-string-split-g-zistsp-ads}@anchor{3ff}@anchor{gnat_rm/the_gnat_library id129}@anchor{400} +@anchor{gnat_rm/the_gnat_library gnat-wide-wide-string-split-g-zistsp-ads}@anchor{400}@anchor{gnat_rm/the_gnat_library id129}@anchor{401} @section @code{GNAT.Wide_Wide_String_Split} (@code{g-zistsp.ads}) @@ -25941,7 +25952,7 @@ to the resulting slices. This package is instantiated from @code{GNAT.Array_Split}. @node Interfaces C Extensions i-cexten ads,Interfaces C Streams i-cstrea ads,GNAT Wide_Wide_String_Split g-zistsp ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id130}@anchor{401}@anchor{gnat_rm/the_gnat_library interfaces-c-extensions-i-cexten-ads}@anchor{402} +@anchor{gnat_rm/the_gnat_library id130}@anchor{402}@anchor{gnat_rm/the_gnat_library interfaces-c-extensions-i-cexten-ads}@anchor{403} @section @code{Interfaces.C.Extensions} (@code{i-cexten.ads}) @@ -25952,7 +25963,7 @@ for use with either manually or automatically generated bindings to C libraries. @node Interfaces C Streams i-cstrea ads,Interfaces Packed_Decimal i-pacdec ads,Interfaces C Extensions i-cexten ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id131}@anchor{403}@anchor{gnat_rm/the_gnat_library interfaces-c-streams-i-cstrea-ads}@anchor{404} +@anchor{gnat_rm/the_gnat_library id131}@anchor{404}@anchor{gnat_rm/the_gnat_library interfaces-c-streams-i-cstrea-ads}@anchor{405} @section @code{Interfaces.C.Streams} (@code{i-cstrea.ads}) @@ -25965,7 +25976,7 @@ This package is a binding for the most commonly used operations on C streams. @node Interfaces Packed_Decimal i-pacdec ads,Interfaces VxWorks i-vxwork ads,Interfaces C Streams i-cstrea ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id132}@anchor{405}@anchor{gnat_rm/the_gnat_library interfaces-packed-decimal-i-pacdec-ads}@anchor{406} +@anchor{gnat_rm/the_gnat_library id132}@anchor{406}@anchor{gnat_rm/the_gnat_library interfaces-packed-decimal-i-pacdec-ads}@anchor{407} @section @code{Interfaces.Packed_Decimal} (@code{i-pacdec.ads}) @@ -25980,7 +25991,7 @@ from a packed decimal format compatible with that used on IBM mainframes. @node Interfaces VxWorks i-vxwork ads,Interfaces VxWorks IO i-vxwoio ads,Interfaces Packed_Decimal i-pacdec ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id133}@anchor{407}@anchor{gnat_rm/the_gnat_library interfaces-vxworks-i-vxwork-ads}@anchor{408} +@anchor{gnat_rm/the_gnat_library id133}@anchor{408}@anchor{gnat_rm/the_gnat_library interfaces-vxworks-i-vxwork-ads}@anchor{409} @section @code{Interfaces.VxWorks} (@code{i-vxwork.ads}) @@ -25994,7 +26005,7 @@ mainframes. This package provides a limited binding to the VxWorks API. @node Interfaces VxWorks IO i-vxwoio ads,System Address_Image s-addima ads,Interfaces VxWorks i-vxwork ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id134}@anchor{409}@anchor{gnat_rm/the_gnat_library interfaces-vxworks-io-i-vxwoio-ads}@anchor{40a} +@anchor{gnat_rm/the_gnat_library id134}@anchor{40a}@anchor{gnat_rm/the_gnat_library interfaces-vxworks-io-i-vxwoio-ads}@anchor{40b} @section @code{Interfaces.VxWorks.IO} (@code{i-vxwoio.ads}) @@ -26017,7 +26028,7 @@ function codes. A particular use of this package is to enable the use of Get_Immediate under VxWorks. @node System Address_Image s-addima ads,System Assertions s-assert ads,Interfaces VxWorks IO i-vxwoio ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id135}@anchor{40b}@anchor{gnat_rm/the_gnat_library system-address-image-s-addima-ads}@anchor{40c} +@anchor{gnat_rm/the_gnat_library id135}@anchor{40c}@anchor{gnat_rm/the_gnat_library system-address-image-s-addima-ads}@anchor{40d} @section @code{System.Address_Image} (@code{s-addima.ads}) @@ -26033,7 +26044,7 @@ function that gives an (implementation dependent) string which identifies an address. @node System Assertions s-assert ads,System Atomic_Counters s-atocou ads,System Address_Image s-addima ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id136}@anchor{40d}@anchor{gnat_rm/the_gnat_library system-assertions-s-assert-ads}@anchor{40e} +@anchor{gnat_rm/the_gnat_library id136}@anchor{40e}@anchor{gnat_rm/the_gnat_library system-assertions-s-assert-ads}@anchor{40f} @section @code{System.Assertions} (@code{s-assert.ads}) @@ -26049,7 +26060,7 @@ by an run-time assertion failure, as well as the routine that is used internally to raise this assertion. @node System Atomic_Counters s-atocou ads,System Memory s-memory ads,System Assertions s-assert ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id137}@anchor{40f}@anchor{gnat_rm/the_gnat_library system-atomic-counters-s-atocou-ads}@anchor{410} +@anchor{gnat_rm/the_gnat_library id137}@anchor{410}@anchor{gnat_rm/the_gnat_library system-atomic-counters-s-atocou-ads}@anchor{411} @section @code{System.Atomic_Counters} (@code{s-atocou.ads}) @@ -26063,7 +26074,7 @@ on most targets, including all Alpha, AARCH64, ARM, ia64, PowerPC, SPARC V9, x86, and x86_64 platforms. @node System Memory s-memory ads,System Multiprocessors s-multip ads,System Atomic_Counters s-atocou ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id138}@anchor{411}@anchor{gnat_rm/the_gnat_library system-memory-s-memory-ads}@anchor{412} +@anchor{gnat_rm/the_gnat_library id138}@anchor{412}@anchor{gnat_rm/the_gnat_library system-memory-s-memory-ads}@anchor{413} @section @code{System.Memory} (@code{s-memory.ads}) @@ -26081,7 +26092,7 @@ calls to this unit may be made for low level allocation uses (for example see the body of @code{GNAT.Tables}). @node System Multiprocessors s-multip ads,System Multiprocessors Dispatching_Domains s-mudido ads,System Memory s-memory ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id139}@anchor{413}@anchor{gnat_rm/the_gnat_library system-multiprocessors-s-multip-ads}@anchor{414} +@anchor{gnat_rm/the_gnat_library id139}@anchor{414}@anchor{gnat_rm/the_gnat_library system-multiprocessors-s-multip-ads}@anchor{415} @section @code{System.Multiprocessors} (@code{s-multip.ads}) @@ -26094,7 +26105,7 @@ in GNAT we also make it available in Ada 95 and Ada 2005 (where it is technically an implementation-defined addition). @node System Multiprocessors Dispatching_Domains s-mudido ads,System Partition_Interface s-parint ads,System Multiprocessors s-multip ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id140}@anchor{415}@anchor{gnat_rm/the_gnat_library system-multiprocessors-dispatching-domains-s-mudido-ads}@anchor{416} +@anchor{gnat_rm/the_gnat_library id140}@anchor{416}@anchor{gnat_rm/the_gnat_library system-multiprocessors-dispatching-domains-s-mudido-ads}@anchor{417} @section @code{System.Multiprocessors.Dispatching_Domains} (@code{s-mudido.ads}) @@ -26107,7 +26118,7 @@ in GNAT we also make it available in Ada 95 and Ada 2005 (where it is technically an implementation-defined addition). @node System Partition_Interface s-parint ads,System Pool_Global s-pooglo ads,System Multiprocessors Dispatching_Domains s-mudido ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id141}@anchor{417}@anchor{gnat_rm/the_gnat_library system-partition-interface-s-parint-ads}@anchor{418} +@anchor{gnat_rm/the_gnat_library id141}@anchor{418}@anchor{gnat_rm/the_gnat_library system-partition-interface-s-parint-ads}@anchor{419} @section @code{System.Partition_Interface} (@code{s-parint.ads}) @@ -26117,11 +26128,11 @@ technically an implementation-defined addition). This package provides facilities for partition interfacing. It is used primarily in a distribution context when using Annex E -with @code{PolyORB}. `NB!' See the note in @ref{273,,PolyORB} regarding +with @code{PolyORB}. `NB!' See the note in @ref{274,,PolyORB} regarding the lifetime of this product. @node System Pool_Global s-pooglo ads,System Pool_Local s-pooloc ads,System Partition_Interface s-parint ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id142}@anchor{419}@anchor{gnat_rm/the_gnat_library system-pool-global-s-pooglo-ads}@anchor{41a} +@anchor{gnat_rm/the_gnat_library id142}@anchor{41a}@anchor{gnat_rm/the_gnat_library system-pool-global-s-pooglo-ads}@anchor{41b} @section @code{System.Pool_Global} (@code{s-pooglo.ads}) @@ -26138,7 +26149,7 @@ declared. It uses malloc/free to allocate/free and does not attempt to do any automatic reclamation. @node System Pool_Local s-pooloc ads,System Restrictions s-restri ads,System Pool_Global s-pooglo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id143}@anchor{41b}@anchor{gnat_rm/the_gnat_library system-pool-local-s-pooloc-ads}@anchor{41c} +@anchor{gnat_rm/the_gnat_library id143}@anchor{41c}@anchor{gnat_rm/the_gnat_library system-pool-local-s-pooloc-ads}@anchor{41d} @section @code{System.Pool_Local} (@code{s-pooloc.ads}) @@ -26155,7 +26166,7 @@ a list of allocated blocks, so that all storage allocated for the pool can be freed automatically when the pool is finalized. @node System Restrictions s-restri ads,System Rident s-rident ads,System Pool_Local s-pooloc ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id144}@anchor{41d}@anchor{gnat_rm/the_gnat_library system-restrictions-s-restri-ads}@anchor{41e} +@anchor{gnat_rm/the_gnat_library id144}@anchor{41e}@anchor{gnat_rm/the_gnat_library system-restrictions-s-restri-ads}@anchor{41f} @section @code{System.Restrictions} (@code{s-restri.ads}) @@ -26171,7 +26182,7 @@ compiler determined information on which restrictions are violated by one or more packages in the partition. @node System Rident s-rident ads,System Strings Stream_Ops s-ststop ads,System Restrictions s-restri ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id145}@anchor{41f}@anchor{gnat_rm/the_gnat_library system-rident-s-rident-ads}@anchor{420} +@anchor{gnat_rm/the_gnat_library id145}@anchor{420}@anchor{gnat_rm/the_gnat_library system-rident-s-rident-ads}@anchor{421} @section @code{System.Rident} (@code{s-rident.ads}) @@ -26187,7 +26198,7 @@ since the necessary instantiation is included in package System.Restrictions. @node System Strings Stream_Ops s-ststop ads,System Unsigned_Types s-unstyp ads,System Rident s-rident ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id146}@anchor{421}@anchor{gnat_rm/the_gnat_library system-strings-stream-ops-s-ststop-ads}@anchor{422} +@anchor{gnat_rm/the_gnat_library id146}@anchor{422}@anchor{gnat_rm/the_gnat_library system-strings-stream-ops-s-ststop-ads}@anchor{423} @section @code{System.Strings.Stream_Ops} (@code{s-ststop.ads}) @@ -26203,7 +26214,7 @@ stream attributes are applied to string types, but the subprograms in this package can be used directly by application programs. @node System Unsigned_Types s-unstyp ads,System Wch_Cnv s-wchcnv ads,System Strings Stream_Ops s-ststop ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id147}@anchor{423}@anchor{gnat_rm/the_gnat_library system-unsigned-types-s-unstyp-ads}@anchor{424} +@anchor{gnat_rm/the_gnat_library id147}@anchor{424}@anchor{gnat_rm/the_gnat_library system-unsigned-types-s-unstyp-ads}@anchor{425} @section @code{System.Unsigned_Types} (@code{s-unstyp.ads}) @@ -26216,7 +26227,7 @@ also contains some related definitions for other specialized types used by the compiler in connection with packed array types. @node System Wch_Cnv s-wchcnv ads,System Wch_Con s-wchcon ads,System Unsigned_Types s-unstyp ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id148}@anchor{425}@anchor{gnat_rm/the_gnat_library system-wch-cnv-s-wchcnv-ads}@anchor{426} +@anchor{gnat_rm/the_gnat_library id148}@anchor{426}@anchor{gnat_rm/the_gnat_library system-wch-cnv-s-wchcnv-ads}@anchor{427} @section @code{System.Wch_Cnv} (@code{s-wchcnv.ads}) @@ -26237,7 +26248,7 @@ encoding method. It uses definitions in package @code{System.Wch_Con}. @node System Wch_Con s-wchcon ads,,System Wch_Cnv s-wchcnv ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id149}@anchor{427}@anchor{gnat_rm/the_gnat_library system-wch-con-s-wchcon-ads}@anchor{428} +@anchor{gnat_rm/the_gnat_library id149}@anchor{428}@anchor{gnat_rm/the_gnat_library system-wch-con-s-wchcon-ads}@anchor{429} @section @code{System.Wch_Con} (@code{s-wchcon.ads}) @@ -26249,7 +26260,7 @@ in ordinary strings. These definitions are used by the package @code{System.Wch_Cnv}. @node Interfacing to Other Languages,Specialized Needs Annexes,The GNAT Library,Top -@anchor{gnat_rm/interfacing_to_other_languages doc}@anchor{429}@anchor{gnat_rm/interfacing_to_other_languages id1}@anchor{42a}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-other-languages}@anchor{12} +@anchor{gnat_rm/interfacing_to_other_languages doc}@anchor{42a}@anchor{gnat_rm/interfacing_to_other_languages id1}@anchor{42b}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-other-languages}@anchor{12} @chapter Interfacing to Other Languages @@ -26267,7 +26278,7 @@ provided. @end menu @node Interfacing to C,Interfacing to C++,,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id2}@anchor{42b}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-c}@anchor{42c} +@anchor{gnat_rm/interfacing_to_other_languages id2}@anchor{42c}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-c}@anchor{42d} @section Interfacing to C @@ -26407,7 +26418,7 @@ of the length corresponding to the @code{type'Size} value in Ada. @end itemize @node Interfacing to C++,Interfacing to COBOL,Interfacing to C,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id3}@anchor{4b}@anchor{gnat_rm/interfacing_to_other_languages id4}@anchor{42d} +@anchor{gnat_rm/interfacing_to_other_languages id3}@anchor{4b}@anchor{gnat_rm/interfacing_to_other_languages id4}@anchor{42e} @section Interfacing to C++ @@ -26624,7 +26635,7 @@ builds an opaque @code{Type_Info_Ptr} to reference a @code{std::type_info} object at a given @code{System.Address}. @node Interfacing to COBOL,Interfacing to Fortran,Interfacing to C++,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id5}@anchor{42e}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-cobol}@anchor{42f} +@anchor{gnat_rm/interfacing_to_other_languages id5}@anchor{42f}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-cobol}@anchor{430} @section Interfacing to COBOL @@ -26632,7 +26643,7 @@ Interfacing to COBOL is achieved as described in section B.4 of the Ada Reference Manual. @node Interfacing to Fortran,Interfacing to non-GNAT Ada code,Interfacing to COBOL,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id6}@anchor{430}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-fortran}@anchor{431} +@anchor{gnat_rm/interfacing_to_other_languages id6}@anchor{431}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-fortran}@anchor{432} @section Interfacing to Fortran @@ -26642,7 +26653,7 @@ multi-dimensional array causes the array to be stored in column-major order as required for convenient interface to Fortran. @node Interfacing to non-GNAT Ada code,,Interfacing to Fortran,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id7}@anchor{432}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-non-gnat-ada-code}@anchor{433} +@anchor{gnat_rm/interfacing_to_other_languages id7}@anchor{433}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-non-gnat-ada-code}@anchor{434} @section Interfacing to non-GNAT Ada code @@ -26666,7 +26677,7 @@ values or simple record types without variants, or simple array types with fixed bounds. @node Specialized Needs Annexes,Implementation of Specific Ada Features,Interfacing to Other Languages,Top -@anchor{gnat_rm/specialized_needs_annexes doc}@anchor{434}@anchor{gnat_rm/specialized_needs_annexes id1}@anchor{435}@anchor{gnat_rm/specialized_needs_annexes specialized-needs-annexes}@anchor{13} +@anchor{gnat_rm/specialized_needs_annexes doc}@anchor{435}@anchor{gnat_rm/specialized_needs_annexes id1}@anchor{436}@anchor{gnat_rm/specialized_needs_annexes specialized-needs-annexes}@anchor{13} @chapter Specialized Needs Annexes @@ -26687,7 +26698,7 @@ The Real-Time Systems Annex is fully implemented. Stub generation is fully implemented in the GNAT compiler. In addition, a complete compatible PCS is available as part of @code{PolyORB}, -a separate product. `NB!' See the note in @ref{273,,PolyORB} regarding the lifetime of this product. +a separate product. `NB!' See the note in @ref{274,,PolyORB} regarding the lifetime of this product. @item `Information Systems (Annex F)' @@ -26704,7 +26715,7 @@ in Ada 2005) is fully implemented. @end table @node Implementation of Specific Ada Features,Implementation of Ada 2022 Features,Specialized Needs Annexes,Top -@anchor{gnat_rm/implementation_of_specific_ada_features doc}@anchor{436}@anchor{gnat_rm/implementation_of_specific_ada_features id1}@anchor{437}@anchor{gnat_rm/implementation_of_specific_ada_features implementation-of-specific-ada-features}@anchor{14} +@anchor{gnat_rm/implementation_of_specific_ada_features doc}@anchor{437}@anchor{gnat_rm/implementation_of_specific_ada_features id1}@anchor{438}@anchor{gnat_rm/implementation_of_specific_ada_features implementation-of-specific-ada-features}@anchor{14} @chapter Implementation of Specific Ada Features @@ -26723,7 +26734,7 @@ facilities. @end menu @node Machine Code Insertions,GNAT Implementation of Tasking,,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features id2}@anchor{438}@anchor{gnat_rm/implementation_of_specific_ada_features machine-code-insertions}@anchor{184} +@anchor{gnat_rm/implementation_of_specific_ada_features id2}@anchor{439}@anchor{gnat_rm/implementation_of_specific_ada_features machine-code-insertions}@anchor{184} @section Machine Code Insertions @@ -26891,7 +26902,7 @@ according to normal visibility rules. In particular if there is no qualification is required. @node GNAT Implementation of Tasking,GNAT Implementation of Shared Passive Packages,Machine Code Insertions,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-tasking}@anchor{439}@anchor{gnat_rm/implementation_of_specific_ada_features id3}@anchor{43a} +@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-tasking}@anchor{43a}@anchor{gnat_rm/implementation_of_specific_ada_features id3}@anchor{43b} @section GNAT Implementation of Tasking @@ -26907,7 +26918,7 @@ to compliance with the Real-Time Systems Annex. @end menu @node Mapping Ada Tasks onto the Underlying Kernel Threads,Ensuring Compliance with the Real-Time Annex,,GNAT Implementation of Tasking -@anchor{gnat_rm/implementation_of_specific_ada_features id4}@anchor{43b}@anchor{gnat_rm/implementation_of_specific_ada_features mapping-ada-tasks-onto-the-underlying-kernel-threads}@anchor{43c} +@anchor{gnat_rm/implementation_of_specific_ada_features id4}@anchor{43c}@anchor{gnat_rm/implementation_of_specific_ada_features mapping-ada-tasks-onto-the-underlying-kernel-threads}@anchor{43d} @subsection Mapping Ada Tasks onto the Underlying Kernel Threads @@ -26976,7 +26987,7 @@ support this functionality when the parent contains more than one task. @geindex Forking a new process @node Ensuring Compliance with the Real-Time Annex,Support for Locking Policies,Mapping Ada Tasks onto the Underlying Kernel Threads,GNAT Implementation of Tasking -@anchor{gnat_rm/implementation_of_specific_ada_features ensuring-compliance-with-the-real-time-annex}@anchor{43d}@anchor{gnat_rm/implementation_of_specific_ada_features id5}@anchor{43e} +@anchor{gnat_rm/implementation_of_specific_ada_features ensuring-compliance-with-the-real-time-annex}@anchor{43e}@anchor{gnat_rm/implementation_of_specific_ada_features id5}@anchor{43f} @subsection Ensuring Compliance with the Real-Time Annex @@ -27027,7 +27038,7 @@ placed at the end. @c Support_for_Locking_Policies @node Support for Locking Policies,,Ensuring Compliance with the Real-Time Annex,GNAT Implementation of Tasking -@anchor{gnat_rm/implementation_of_specific_ada_features support-for-locking-policies}@anchor{43f} +@anchor{gnat_rm/implementation_of_specific_ada_features support-for-locking-policies}@anchor{440} @subsection Support for Locking Policies @@ -27061,7 +27072,7 @@ then ceiling locking is used. Otherwise, the @code{Ceiling_Locking} policy is ignored. @node GNAT Implementation of Shared Passive Packages,Code Generation for Array Aggregates,GNAT Implementation of Tasking,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-shared-passive-packages}@anchor{440}@anchor{gnat_rm/implementation_of_specific_ada_features id6}@anchor{441} +@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-shared-passive-packages}@anchor{441}@anchor{gnat_rm/implementation_of_specific_ada_features id6}@anchor{442} @section GNAT Implementation of Shared Passive Packages @@ -27159,7 +27170,7 @@ This is used to provide the required locking semantics for proper protected object synchronization. @node Code Generation for Array Aggregates,The Size of Discriminated Records with Default Discriminants,GNAT Implementation of Shared Passive Packages,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features code-generation-for-array-aggregates}@anchor{442}@anchor{gnat_rm/implementation_of_specific_ada_features id7}@anchor{443} +@anchor{gnat_rm/implementation_of_specific_ada_features code-generation-for-array-aggregates}@anchor{443}@anchor{gnat_rm/implementation_of_specific_ada_features id7}@anchor{444} @section Code Generation for Array Aggregates @@ -27190,7 +27201,7 @@ component values and static subtypes also lead to simpler code. @end menu @node Static constant aggregates with static bounds,Constant aggregates with unconstrained nominal types,,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features id8}@anchor{444}@anchor{gnat_rm/implementation_of_specific_ada_features static-constant-aggregates-with-static-bounds}@anchor{445} +@anchor{gnat_rm/implementation_of_specific_ada_features id8}@anchor{445}@anchor{gnat_rm/implementation_of_specific_ada_features static-constant-aggregates-with-static-bounds}@anchor{446} @subsection Static constant aggregates with static bounds @@ -27237,7 +27248,7 @@ Zero2: constant two_dim := (others => (others => 0)); @end example @node Constant aggregates with unconstrained nominal types,Aggregates with static bounds,Static constant aggregates with static bounds,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features constant-aggregates-with-unconstrained-nominal-types}@anchor{446}@anchor{gnat_rm/implementation_of_specific_ada_features id9}@anchor{447} +@anchor{gnat_rm/implementation_of_specific_ada_features constant-aggregates-with-unconstrained-nominal-types}@anchor{447}@anchor{gnat_rm/implementation_of_specific_ada_features id9}@anchor{448} @subsection Constant aggregates with unconstrained nominal types @@ -27252,7 +27263,7 @@ Cr_Unc : constant One_Unc := (12,24,36); @end example @node Aggregates with static bounds,Aggregates with nonstatic bounds,Constant aggregates with unconstrained nominal types,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-static-bounds}@anchor{448}@anchor{gnat_rm/implementation_of_specific_ada_features id10}@anchor{449} +@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-static-bounds}@anchor{449}@anchor{gnat_rm/implementation_of_specific_ada_features id10}@anchor{44a} @subsection Aggregates with static bounds @@ -27280,7 +27291,7 @@ end loop; @end example @node Aggregates with nonstatic bounds,Aggregates in assignment statements,Aggregates with static bounds,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-nonstatic-bounds}@anchor{44a}@anchor{gnat_rm/implementation_of_specific_ada_features id11}@anchor{44b} +@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-nonstatic-bounds}@anchor{44b}@anchor{gnat_rm/implementation_of_specific_ada_features id11}@anchor{44c} @subsection Aggregates with nonstatic bounds @@ -27291,7 +27302,7 @@ have to be applied to sub-arrays individually, if they do not have statically compatible subtypes. @node Aggregates in assignment statements,,Aggregates with nonstatic bounds,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-in-assignment-statements}@anchor{44c}@anchor{gnat_rm/implementation_of_specific_ada_features id12}@anchor{44d} +@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-in-assignment-statements}@anchor{44d}@anchor{gnat_rm/implementation_of_specific_ada_features id12}@anchor{44e} @subsection Aggregates in assignment statements @@ -27333,7 +27344,7 @@ a temporary (created either by the front-end or the code generator) and then that temporary will be copied onto the target. @node The Size of Discriminated Records with Default Discriminants,Image Values For Nonscalar Types,Code Generation for Array Aggregates,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features id13}@anchor{44e}@anchor{gnat_rm/implementation_of_specific_ada_features the-size-of-discriminated-records-with-default-discriminants}@anchor{44f} +@anchor{gnat_rm/implementation_of_specific_ada_features id13}@anchor{44f}@anchor{gnat_rm/implementation_of_specific_ada_features the-size-of-discriminated-records-with-default-discriminants}@anchor{450} @section The Size of Discriminated Records with Default Discriminants @@ -27413,7 +27424,7 @@ say) must be consistent, so it is imperative that the object, once created, remain invariant. @node Image Values For Nonscalar Types,Strict Conformance to the Ada Reference Manual,The Size of Discriminated Records with Default Discriminants,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features id14}@anchor{450}@anchor{gnat_rm/implementation_of_specific_ada_features image-values-for-nonscalar-types}@anchor{451} +@anchor{gnat_rm/implementation_of_specific_ada_features id14}@anchor{451}@anchor{gnat_rm/implementation_of_specific_ada_features image-values-for-nonscalar-types}@anchor{452} @section Image Values For Nonscalar Types @@ -27433,7 +27444,7 @@ control of image text is required for some type T, then T’Put_Image should be explicitly specified. @node Strict Conformance to the Ada Reference Manual,,Image Values For Nonscalar Types,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features id15}@anchor{452}@anchor{gnat_rm/implementation_of_specific_ada_features strict-conformance-to-the-ada-reference-manual}@anchor{453} +@anchor{gnat_rm/implementation_of_specific_ada_features id15}@anchor{453}@anchor{gnat_rm/implementation_of_specific_ada_features strict-conformance-to-the-ada-reference-manual}@anchor{454} @section Strict Conformance to the Ada Reference Manual @@ -27460,7 +27471,7 @@ behavior (although at the cost of a significant performance penalty), so infinite and NaN values are properly generated. @node Implementation of Ada 2022 Features,GNAT language extensions,Implementation of Specific Ada Features,Top -@anchor{gnat_rm/implementation_of_ada_2022_features doc}@anchor{454}@anchor{gnat_rm/implementation_of_ada_2022_features id1}@anchor{455}@anchor{gnat_rm/implementation_of_ada_2022_features implementation-of-ada-2022-features}@anchor{15} +@anchor{gnat_rm/implementation_of_ada_2022_features doc}@anchor{455}@anchor{gnat_rm/implementation_of_ada_2022_features id1}@anchor{456}@anchor{gnat_rm/implementation_of_ada_2022_features implementation-of-ada-2022-features}@anchor{15} @chapter Implementation of Ada 2022 Features @@ -30907,7 +30918,7 @@ RM references: 3.02.04 (31/5) 4.06 (51.1/5) @end itemize @node GNAT language extensions,Security Hardening Features,Implementation of Ada 2022 Features,Top -@anchor{gnat_rm/gnat_language_extensions doc}@anchor{456}@anchor{gnat_rm/gnat_language_extensions gnat-language-extensions}@anchor{457}@anchor{gnat_rm/gnat_language_extensions id1}@anchor{458} +@anchor{gnat_rm/gnat_language_extensions doc}@anchor{457}@anchor{gnat_rm/gnat_language_extensions gnat-language-extensions}@anchor{458}@anchor{gnat_rm/gnat_language_extensions id1}@anchor{459} @chapter GNAT language extensions @@ -30939,7 +30950,7 @@ These features might be removed or heavily modified at any time. @end menu @node How to activate the extended GNAT Ada superset,Curated Extensions,,GNAT language extensions -@anchor{gnat_rm/gnat_language_extensions how-to-activate-the-extended-gnat-ada-superset}@anchor{459} +@anchor{gnat_rm/gnat_language_extensions how-to-activate-the-extended-gnat-ada-superset}@anchor{45a} @section How to activate the extended GNAT Ada superset @@ -30980,7 +30991,7 @@ for use in playground experiments. @end cartouche @node Curated Extensions,Experimental Language Extensions,How to activate the extended GNAT Ada superset,GNAT language extensions -@anchor{gnat_rm/gnat_language_extensions curated-extensions}@anchor{45a}@anchor{gnat_rm/gnat_language_extensions curated-language-extensions}@anchor{6c} +@anchor{gnat_rm/gnat_language_extensions curated-extensions}@anchor{45b}@anchor{gnat_rm/gnat_language_extensions curated-language-extensions}@anchor{6c} @section Curated Extensions @@ -31003,7 +31014,7 @@ Features activated via @code{-gnatX} or @end menu @node Local Declarations Without Block,Deep delta Aggregates,,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions local-declarations-without-block}@anchor{45b} +@anchor{gnat_rm/gnat_language_extensions local-declarations-without-block}@anchor{45c} @subsection Local Declarations Without Block @@ -31096,7 +31107,7 @@ And as such the second `@w{`}A`@w{`} declaration is hiding the first one. @end cartouche @node Deep delta Aggregates,Fixed lower bounds for array types and subtypes,Local Declarations Without Block,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions deep-delta-aggregates}@anchor{45c} +@anchor{gnat_rm/gnat_language_extensions deep-delta-aggregates}@anchor{45d} @subsection Deep delta Aggregates @@ -31118,7 +31129,7 @@ The syntax of delta aggregates in the extended version is the following: @end menu @node Syntax,Legality Rules,,Deep delta Aggregates -@anchor{gnat_rm/gnat_language_extensions syntax}@anchor{45d} +@anchor{gnat_rm/gnat_language_extensions syntax}@anchor{45e} @subsubsection Syntax @@ -31164,7 +31175,7 @@ array_subcomponent_choice ::= @end example @node Legality Rules,Dynamic Semantics,Syntax,Deep delta Aggregates -@anchor{gnat_rm/gnat_language_extensions legality-rules}@anchor{45e} +@anchor{gnat_rm/gnat_language_extensions legality-rules}@anchor{45f} @subsubsection Legality Rules @@ -31201,7 +31212,7 @@ the object denoted by the base_expression, prior to any update.] @end enumerate @node Dynamic Semantics,Examples,Legality Rules,Deep delta Aggregates -@anchor{gnat_rm/gnat_language_extensions dynamic-semantics}@anchor{45f} +@anchor{gnat_rm/gnat_language_extensions dynamic-semantics}@anchor{460} @subsubsection Dynamic Semantics @@ -31258,7 +31269,7 @@ and assigned to the corresponding subcomponent of the anonymous object. @end itemize @node Examples,,Dynamic Semantics,Deep delta Aggregates -@anchor{gnat_rm/gnat_language_extensions examples}@anchor{460} +@anchor{gnat_rm/gnat_language_extensions examples}@anchor{461} @subsubsection Examples @@ -31286,7 +31297,7 @@ end; @end example @node Fixed lower bounds for array types and subtypes,Prefixed-view notation for calls to primitive subprograms of untagged types,Deep delta Aggregates,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions fixed-lower-bounds-for-array-types-and-subtypes}@anchor{461} +@anchor{gnat_rm/gnat_language_extensions fixed-lower-bounds-for-array-types-and-subtypes}@anchor{462} @subsection Fixed lower bounds for array types and subtypes @@ -31337,7 +31348,7 @@ lower bound of unconstrained array formals when the formal’s subtype has index ranges with static fixed lower bounds. @node Prefixed-view notation for calls to primitive subprograms of untagged types,Expression defaults for generic formal functions,Fixed lower bounds for array types and subtypes,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions prefixed-view-notation-for-calls-to-primitive-subprograms-of-untagged-types}@anchor{462} +@anchor{gnat_rm/gnat_language_extensions prefixed-view-notation-for-calls-to-primitive-subprograms-of-untagged-types}@anchor{463} @subsection Prefixed-view notation for calls to primitive subprograms of untagged types @@ -31387,7 +31398,7 @@ pragma Assert (V.Nth_Element(1) = 42); @end example @node Expression defaults for generic formal functions,String interpolation,Prefixed-view notation for calls to primitive subprograms of untagged types,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions expression-defaults-for-generic-formal-functions}@anchor{463} +@anchor{gnat_rm/gnat_language_extensions expression-defaults-for-generic-formal-functions}@anchor{464} @subsection Expression defaults for generic formal functions @@ -31418,7 +31429,7 @@ If the default is used (i.e. there is no actual corresponding to Copy), then calls to Copy in the instance will simply return Item. @node String interpolation,Constrained attribute for generic objects,Expression defaults for generic formal functions,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions string-interpolation}@anchor{464} +@anchor{gnat_rm/gnat_language_extensions string-interpolation}@anchor{465} @subsection String interpolation @@ -31585,7 +31596,7 @@ a double quote is " and an open brace is @{ @end example @node Constrained attribute for generic objects,Static aspect on intrinsic functions,String interpolation,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions constrained-attribute-for-generic-objects}@anchor{465} +@anchor{gnat_rm/gnat_language_extensions constrained-attribute-for-generic-objects}@anchor{466} @subsection Constrained attribute for generic objects @@ -31593,7 +31604,7 @@ The @code{Constrained} attribute is permitted for objects of generic types. The result indicates whether the corresponding actual is constrained. @node Static aspect on intrinsic functions,First Controlling Parameter,Constrained attribute for generic objects,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions static-aspect-on-intrinsic-functions}@anchor{466} +@anchor{gnat_rm/gnat_language_extensions static-aspect-on-intrinsic-functions}@anchor{467} @subsection @code{Static} aspect on intrinsic functions @@ -31602,7 +31613,7 @@ and the compiler will evaluate some of these intrinsics statically, in particular the @code{Shift_Left} and @code{Shift_Right} intrinsics. @node First Controlling Parameter,Unsigned_Base_Range aspect,Static aspect on intrinsic functions,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions first-controlling-parameter}@anchor{467} +@anchor{gnat_rm/gnat_language_extensions first-controlling-parameter}@anchor{468} @subsection First Controlling Parameter @@ -31702,7 +31713,7 @@ The result of a function is never a controlling result. @end itemize @node Unsigned_Base_Range aspect,Generalized Finalization,First Controlling Parameter,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions unsigned-base-range-aspect}@anchor{468} +@anchor{gnat_rm/gnat_language_extensions unsigned-base-range-aspect}@anchor{469} @subsection @code{Unsigned_Base_Range} aspect @@ -31728,7 +31739,7 @@ It ensures that arithmetic operations of type @code{Uns_64} are carried out using 64 bits. @node Generalized Finalization,,Unsigned_Base_Range aspect,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions generalized-finalization}@anchor{469} +@anchor{gnat_rm/gnat_language_extensions generalized-finalization}@anchor{46a} @subsection Generalized Finalization @@ -31800,7 +31811,7 @@ in this case. @item The @code{Adjust} and @code{Finalize} procedures are automatically considered as -having the @ref{46a,,No_Raise aspect} specified for them. In particular, the +having the @ref{46b,,No_Raise aspect} specified for them. In particular, the compiler has permission to enforce none of the guarantees specified by the RM 7.6.1 (14/1) and subsequent subclauses. @end itemize @@ -31861,7 +31872,7 @@ end P; @end menu @node Finalizable tagged types,Composite types,,Generalized Finalization -@anchor{gnat_rm/gnat_language_extensions finalizable-tagged-types}@anchor{46b} +@anchor{gnat_rm/gnat_language_extensions finalizable-tagged-types}@anchor{46c} @subsubsection Finalizable tagged types @@ -31871,7 +31882,7 @@ dispatching whenever it makes sense, i.e. when the object in question is of a class-wide type and the class includes at least one finalizable tagged type. @node Composite types,Interoperability with controlled types,Finalizable tagged types,Generalized Finalization -@anchor{gnat_rm/gnat_language_extensions composite-types}@anchor{46c} +@anchor{gnat_rm/gnat_language_extensions composite-types}@anchor{46d} @subsubsection Composite types @@ -31881,7 +31892,7 @@ in order to call the primitives of their components. The dynamic semantics is the same as for controlled components of composite types. @node Interoperability with controlled types,,Composite types,Generalized Finalization -@anchor{gnat_rm/gnat_language_extensions interoperability-with-controlled-types}@anchor{46d} +@anchor{gnat_rm/gnat_language_extensions interoperability-with-controlled-types}@anchor{46e} @subsubsection Interoperability with controlled types @@ -31891,7 +31902,7 @@ versa, but the stricter dynamic semantics, in other words that of controlled types, is applied in this case. @node Experimental Language Extensions,,Curated Extensions,GNAT language extensions -@anchor{gnat_rm/gnat_language_extensions experimental-language-extensions}@anchor{6d}@anchor{gnat_rm/gnat_language_extensions id2}@anchor{46e} +@anchor{gnat_rm/gnat_language_extensions experimental-language-extensions}@anchor{6d}@anchor{gnat_rm/gnat_language_extensions id2}@anchor{46f} @section Experimental Language Extensions @@ -31917,7 +31928,7 @@ Features activated via @code{-gnatX0} or @end menu @node Conditional when constructs,Implicit With,,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions conditional-when-constructs}@anchor{46f} +@anchor{gnat_rm/gnat_language_extensions conditional-when-constructs}@anchor{470} @subsection Conditional when constructs @@ -31986,7 +31997,7 @@ end; @end example @node Implicit With,Storage Model,Conditional when constructs,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions implicit-with}@anchor{470} +@anchor{gnat_rm/gnat_language_extensions implicit-with}@anchor{471} @subsection Implicit With @@ -32003,7 +32014,7 @@ end; @end example @node Storage Model,Attribute Super,Implicit With,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions storage-model}@anchor{471} +@anchor{gnat_rm/gnat_language_extensions storage-model}@anchor{472} @subsection Storage Model @@ -32020,7 +32031,7 @@ memory models, in particular to support interactions with GPU. @end menu @node Aspect Storage_Model_Type,Aspect Designated_Storage_Model,,Storage Model -@anchor{gnat_rm/gnat_language_extensions aspect-storage-model-type}@anchor{472} +@anchor{gnat_rm/gnat_language_extensions aspect-storage-model-type}@anchor{473} @subsubsection Aspect Storage_Model_Type @@ -32154,7 +32165,7 @@ end CUDA_Memory; @end example @node Aspect Designated_Storage_Model,Legacy Storage Pools,Aspect Storage_Model_Type,Storage Model -@anchor{gnat_rm/gnat_language_extensions aspect-designated-storage-model}@anchor{473} +@anchor{gnat_rm/gnat_language_extensions aspect-designated-storage-model}@anchor{474} @subsubsection Aspect Designated_Storage_Model @@ -32232,7 +32243,7 @@ begin @end example @node Legacy Storage Pools,,Aspect Designated_Storage_Model,Storage Model -@anchor{gnat_rm/gnat_language_extensions legacy-storage-pools}@anchor{474} +@anchor{gnat_rm/gnat_language_extensions legacy-storage-pools}@anchor{475} @subsubsection Legacy Storage Pools @@ -32283,7 +32294,7 @@ type Acc is access Integer_Array with Storage_Pool => My_Pool; can still be accepted as a shortcut for the new syntax. @node Attribute Super,Simpler Accessibility Model,Storage Model,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions attribute-super}@anchor{475} +@anchor{gnat_rm/gnat_language_extensions attribute-super}@anchor{476} @subsection Attribute Super @@ -32318,7 +32329,7 @@ end; @end example @node Simpler Accessibility Model,Case pattern matching,Attribute Super,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions simpler-accessibility-model}@anchor{476} +@anchor{gnat_rm/gnat_language_extensions simpler-accessibility-model}@anchor{477} @subsection Simpler Accessibility Model @@ -32349,7 +32360,7 @@ All of the refined rules are compatible with the [use of anonymous access types @end menu @node Stand-alone objects,Subprogram parameters,,Simpler Accessibility Model -@anchor{gnat_rm/gnat_language_extensions stand-alone-objects}@anchor{477} +@anchor{gnat_rm/gnat_language_extensions stand-alone-objects}@anchor{478} @subsubsection Stand-alone objects @@ -32397,7 +32408,7 @@ of the RM 4.6 rule “The accessibility level of the operand type shall not be statically deeper than that of the target type …”. @node Subprogram parameters,Function results,Stand-alone objects,Simpler Accessibility Model -@anchor{gnat_rm/gnat_language_extensions subprogram-parameters}@anchor{478} +@anchor{gnat_rm/gnat_language_extensions subprogram-parameters}@anchor{479} @subsubsection Subprogram parameters @@ -32490,7 +32501,7 @@ end; @end example @node Function results,,Subprogram parameters,Simpler Accessibility Model -@anchor{gnat_rm/gnat_language_extensions function-results}@anchor{479} +@anchor{gnat_rm/gnat_language_extensions function-results}@anchor{47a} @subsubsection Function results @@ -32618,7 +32629,7 @@ end; @end example @node Case pattern matching,Mutably Tagged Types with Size’Class Aspect,Simpler Accessibility Model,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions case-pattern-matching}@anchor{47a} +@anchor{gnat_rm/gnat_language_extensions case-pattern-matching}@anchor{47b} @subsection Case pattern matching @@ -32748,7 +32759,7 @@ message generated in such cases is usually “Capacity exceeded in compiling case statement with composite selector type”. @node Mutably Tagged Types with Size’Class Aspect,No_Raise aspect,Case pattern matching,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions mutably-tagged-types-with-size-class-aspect}@anchor{47b} +@anchor{gnat_rm/gnat_language_extensions mutably-tagged-types-with-size-class-aspect}@anchor{47c} @subsection Mutably Tagged Types with Size’Class Aspect @@ -32919,7 +32930,7 @@ parameter exists (that is, before leaving the corresponding callable construct). This is analogous to the RM 6.4.1(18) rule about discriminated parameters. @node No_Raise aspect,Inference of Dependent Types in Generic Instantiations,Mutably Tagged Types with Size’Class Aspect,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions id3}@anchor{47c}@anchor{gnat_rm/gnat_language_extensions no-raise-aspect}@anchor{46a} +@anchor{gnat_rm/gnat_language_extensions id3}@anchor{47d}@anchor{gnat_rm/gnat_language_extensions no-raise-aspect}@anchor{46b} @subsection No_Raise aspect @@ -32929,7 +32940,7 @@ be raised during the execution of the subprogram, it is caught at the end of this execution and @code{Program_Error} is propagated to the caller. @node Inference of Dependent Types in Generic Instantiations,External_Initialization Aspect,No_Raise aspect,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions inference-of-dependent-types-in-generic-instantiations}@anchor{47d} +@anchor{gnat_rm/gnat_language_extensions inference-of-dependent-types-in-generic-instantiations}@anchor{47e} @subsection Inference of Dependent Types in Generic Instantiations @@ -33006,7 +33017,7 @@ package Int_Array_Operations is new Array_Operations @end example @node External_Initialization Aspect,Finally construct,Inference of Dependent Types in Generic Instantiations,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions external-initialization-aspect}@anchor{47e} +@anchor{gnat_rm/gnat_language_extensions external-initialization-aspect}@anchor{47f} @subsection External_Initialization Aspect @@ -33047,7 +33058,7 @@ The maximum size of loaded files is limited to 2@w{^31} bytes. @end cartouche @node Finally construct,Continue statement,External_Initialization Aspect,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions finally-construct}@anchor{47f} +@anchor{gnat_rm/gnat_language_extensions finally-construct}@anchor{480} @subsection Finally construct @@ -33067,7 +33078,7 @@ configuration that does not exist in standard Ada. @end menu @node Syntax<2>,Legality Rules<2>,,Finally construct -@anchor{gnat_rm/gnat_language_extensions id4}@anchor{480} +@anchor{gnat_rm/gnat_language_extensions id4}@anchor{481} @subsubsection Syntax @@ -33082,7 +33093,7 @@ handled_sequence_of_statements ::= @end example @node Legality Rules<2>,Dynamic Semantics<2>,Syntax<2>,Finally construct -@anchor{gnat_rm/gnat_language_extensions id5}@anchor{481} +@anchor{gnat_rm/gnat_language_extensions id5}@anchor{482} @subsubsection Legality Rules @@ -33092,7 +33103,7 @@ to be transferred outside the finally part are forbidden. Goto & exit where the target is outside of the finally’s @code{sequence_of_statements} are forbidden @node Dynamic Semantics<2>,,Legality Rules<2>,Finally construct -@anchor{gnat_rm/gnat_language_extensions id6}@anchor{482} +@anchor{gnat_rm/gnat_language_extensions id6}@anchor{483} @subsubsection Dynamic Semantics @@ -33107,7 +33118,7 @@ execution, that is the finally block must be executed in full even if the contai aborted, or if the control is transferred out of the block. @node Continue statement,Destructors,Finally construct,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions continue-statement}@anchor{483} +@anchor{gnat_rm/gnat_language_extensions continue-statement}@anchor{484} @subsection Continue statement @@ -33125,7 +33136,7 @@ Note that @code{continue} is a keyword but it is not a reserved word. This is a configuration that does not exist in standard Ada. @node Destructors,Structural Generic Instantiation,Continue statement,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions destructors}@anchor{484} +@anchor{gnat_rm/gnat_language_extensions destructors}@anchor{485} @subsection Destructors @@ -33180,7 +33191,7 @@ When an object of type @code{T2} is finalized, there will be first a call to @code{T2'Destructor}, and then a call to @code{T1'Destructor} on the object. @node Structural Generic Instantiation,,Destructors,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions structural-generic-instantiation}@anchor{485} +@anchor{gnat_rm/gnat_language_extensions structural-generic-instantiation}@anchor{486} @subsection Structural Generic Instantiation @@ -33206,7 +33217,7 @@ where a name is accepted by the language. @end menu @node Syntax<3>,Legality Rules<3>,,Structural Generic Instantiation -@anchor{gnat_rm/gnat_language_extensions id7}@anchor{486} +@anchor{gnat_rm/gnat_language_extensions id7}@anchor{487} @subsubsection Syntax @@ -33218,7 +33229,7 @@ structural_generic_instance_name ::= name generic_actual_part @end example @node Legality Rules<3>,Static Semantics,Syntax<3>,Structural Generic Instantiation -@anchor{gnat_rm/gnat_language_extensions id8}@anchor{487} +@anchor{gnat_rm/gnat_language_extensions id8}@anchor{488} @subsubsection Legality Rules @@ -33244,7 +33255,7 @@ generic subprogram may be present in a single partition, unless whole-partition optimization is performed (e.g., via LTO). @node Static Semantics,,Legality Rules<3>,Structural Generic Instantiation -@anchor{gnat_rm/gnat_language_extensions static-semantics}@anchor{488} +@anchor{gnat_rm/gnat_language_extensions static-semantics}@anchor{489} @subsubsection Static Semantics @@ -33388,7 +33399,7 @@ end; @end example @node Security Hardening Features,Obsolescent Features,GNAT language extensions,Top -@anchor{gnat_rm/security_hardening_features doc}@anchor{489}@anchor{gnat_rm/security_hardening_features id1}@anchor{48a}@anchor{gnat_rm/security_hardening_features security-hardening-features}@anchor{16} +@anchor{gnat_rm/security_hardening_features doc}@anchor{48a}@anchor{gnat_rm/security_hardening_features id1}@anchor{48b}@anchor{gnat_rm/security_hardening_features security-hardening-features}@anchor{16} @chapter Security Hardening Features @@ -33412,7 +33423,7 @@ These features are supported only by the GCC back end, not by LLVM. @end menu @node Register Scrubbing,Stack Scrubbing,,Security Hardening Features -@anchor{gnat_rm/security_hardening_features register-scrubbing}@anchor{48b} +@anchor{gnat_rm/security_hardening_features register-scrubbing}@anchor{48c} @section Register Scrubbing @@ -33448,7 +33459,7 @@ programming languages, see @cite{Using the GNU Compiler Collection (GCC)}. @c Stack Scrubbing: @node Stack Scrubbing,Hardened Conditionals,Register Scrubbing,Security Hardening Features -@anchor{gnat_rm/security_hardening_features stack-scrubbing}@anchor{48c} +@anchor{gnat_rm/security_hardening_features stack-scrubbing}@anchor{48d} @section Stack Scrubbing @@ -33592,7 +33603,7 @@ Bar_Callable_Ptr. @c Hardened Conditionals: @node Hardened Conditionals,Hardened Booleans,Stack Scrubbing,Security Hardening Features -@anchor{gnat_rm/security_hardening_features hardened-conditionals}@anchor{48d} +@anchor{gnat_rm/security_hardening_features hardened-conditionals}@anchor{48e} @section Hardened Conditionals @@ -33682,7 +33693,7 @@ be used with other programming languages supported by GCC. @c Hardened Booleans: @node Hardened Booleans,Control Flow Redundancy,Hardened Conditionals,Security Hardening Features -@anchor{gnat_rm/security_hardening_features hardened-booleans}@anchor{48e} +@anchor{gnat_rm/security_hardening_features hardened-booleans}@anchor{48f} @section Hardened Booleans @@ -33743,7 +33754,7 @@ and more details on that attribute, see @cite{Using the GNU Compiler Collection @c Control Flow Redundancy: @node Control Flow Redundancy,,Hardened Booleans,Security Hardening Features -@anchor{gnat_rm/security_hardening_features control-flow-redundancy}@anchor{48f} +@anchor{gnat_rm/security_hardening_features control-flow-redundancy}@anchor{490} @section Control Flow Redundancy @@ -33911,7 +33922,7 @@ see @cite{Using the GNU Compiler Collection (GCC)}. These options can be used with other programming languages supported by GCC. @node Obsolescent Features,Compatibility and Porting Guide,Security Hardening Features,Top -@anchor{gnat_rm/obsolescent_features doc}@anchor{490}@anchor{gnat_rm/obsolescent_features id1}@anchor{491}@anchor{gnat_rm/obsolescent_features obsolescent-features}@anchor{17} +@anchor{gnat_rm/obsolescent_features doc}@anchor{491}@anchor{gnat_rm/obsolescent_features id1}@anchor{492}@anchor{gnat_rm/obsolescent_features obsolescent-features}@anchor{17} @chapter Obsolescent Features @@ -33931,7 +33942,7 @@ historical compatibility purposes. @end menu @node PolyORB,pragma No_Run_Time,,Obsolescent Features -@anchor{gnat_rm/obsolescent_features id2}@anchor{492}@anchor{gnat_rm/obsolescent_features polyorb}@anchor{273} +@anchor{gnat_rm/obsolescent_features id2}@anchor{493}@anchor{gnat_rm/obsolescent_features polyorb}@anchor{274} @section PolyORB @@ -33940,7 +33951,7 @@ release 28. After this release, there will be no new versions of this product. Contact AdaCore support to get recommendations for replacements. @node pragma No_Run_Time,pragma Ravenscar,PolyORB,Obsolescent Features -@anchor{gnat_rm/obsolescent_features id3}@anchor{493}@anchor{gnat_rm/obsolescent_features pragma-no-run-time}@anchor{494} +@anchor{gnat_rm/obsolescent_features id3}@anchor{494}@anchor{gnat_rm/obsolescent_features pragma-no-run-time}@anchor{495} @section pragma No_Run_Time @@ -33953,7 +33964,7 @@ preferred usage is to use an appropriately configured run-time that includes just those features that are to be made accessible. @node pragma Ravenscar,pragma Restricted_Run_Time,pragma No_Run_Time,Obsolescent Features -@anchor{gnat_rm/obsolescent_features id4}@anchor{495}@anchor{gnat_rm/obsolescent_features pragma-ravenscar}@anchor{496} +@anchor{gnat_rm/obsolescent_features id4}@anchor{496}@anchor{gnat_rm/obsolescent_features pragma-ravenscar}@anchor{497} @section pragma Ravenscar @@ -33962,7 +33973,7 @@ The pragma @code{Ravenscar} has exactly the same effect as pragma is part of the new Ada 2005 standard. @node pragma Restricted_Run_Time,pragma Task_Info,pragma Ravenscar,Obsolescent Features -@anchor{gnat_rm/obsolescent_features id5}@anchor{497}@anchor{gnat_rm/obsolescent_features pragma-restricted-run-time}@anchor{498} +@anchor{gnat_rm/obsolescent_features id5}@anchor{498}@anchor{gnat_rm/obsolescent_features pragma-restricted-run-time}@anchor{499} @section pragma Restricted_Run_Time @@ -33972,7 +33983,7 @@ preferred since the Ada 2005 pragma @code{Profile} is intended for this kind of implementation dependent addition. @node pragma Task_Info,package System Task_Info s-tasinf ads,pragma Restricted_Run_Time,Obsolescent Features -@anchor{gnat_rm/obsolescent_features id6}@anchor{499}@anchor{gnat_rm/obsolescent_features pragma-task-info}@anchor{49a} +@anchor{gnat_rm/obsolescent_features id6}@anchor{49a}@anchor{gnat_rm/obsolescent_features pragma-task-info}@anchor{49b} @section pragma Task_Info @@ -33998,7 +34009,7 @@ in the spec of package System.Task_Info in the runtime library. @node package System Task_Info s-tasinf ads,,pragma Task_Info,Obsolescent Features -@anchor{gnat_rm/obsolescent_features package-system-task-info}@anchor{49b}@anchor{gnat_rm/obsolescent_features package-system-task-info-s-tasinf-ads}@anchor{49c} +@anchor{gnat_rm/obsolescent_features package-system-task-info}@anchor{49c}@anchor{gnat_rm/obsolescent_features package-system-task-info-s-tasinf-ads}@anchor{49d} @section package System.Task_Info (@code{s-tasinf.ads}) @@ -34008,7 +34019,7 @@ to support the @code{Task_Info} pragma. The predefined Ada package standard replacement for GNAT’s @code{Task_Info} functionality. @node Compatibility and Porting Guide,GNU Free Documentation License,Obsolescent Features,Top -@anchor{gnat_rm/compatibility_and_porting_guide doc}@anchor{49d}@anchor{gnat_rm/compatibility_and_porting_guide compatibility-and-porting-guide}@anchor{18}@anchor{gnat_rm/compatibility_and_porting_guide id1}@anchor{49e} +@anchor{gnat_rm/compatibility_and_porting_guide doc}@anchor{49e}@anchor{gnat_rm/compatibility_and_porting_guide compatibility-and-porting-guide}@anchor{18}@anchor{gnat_rm/compatibility_and_porting_guide id1}@anchor{49f} @chapter Compatibility and Porting Guide @@ -34030,7 +34041,7 @@ applications developed in other Ada environments. @end menu @node Writing Portable Fixed-Point Declarations,Compatibility with Ada 83,,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide id2}@anchor{49f}@anchor{gnat_rm/compatibility_and_porting_guide writing-portable-fixed-point-declarations}@anchor{4a0} +@anchor{gnat_rm/compatibility_and_porting_guide id2}@anchor{4a0}@anchor{gnat_rm/compatibility_and_porting_guide writing-portable-fixed-point-declarations}@anchor{4a1} @section Writing Portable Fixed-Point Declarations @@ -34152,7 +34163,7 @@ If you follow this scheme you will be guaranteed that your fixed-point types will be portable. @node Compatibility with Ada 83,Compatibility between Ada 95 and Ada 2005,Writing Portable Fixed-Point Declarations,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-ada-83}@anchor{4a1}@anchor{gnat_rm/compatibility_and_porting_guide id3}@anchor{4a2} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-ada-83}@anchor{4a2}@anchor{gnat_rm/compatibility_and_porting_guide id3}@anchor{4a3} @section Compatibility with Ada 83 @@ -34180,7 +34191,7 @@ following subsections treat the most likely issues to be encountered. @end menu @node Legal Ada 83 programs that are illegal in Ada 95,More deterministic semantics,,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide id4}@anchor{4a3}@anchor{gnat_rm/compatibility_and_porting_guide legal-ada-83-programs-that-are-illegal-in-ada-95}@anchor{4a4} +@anchor{gnat_rm/compatibility_and_porting_guide id4}@anchor{4a4}@anchor{gnat_rm/compatibility_and_porting_guide legal-ada-83-programs-that-are-illegal-in-ada-95}@anchor{4a5} @subsection Legal Ada 83 programs that are illegal in Ada 95 @@ -34280,7 +34291,7 @@ the fix is usually simply to add the @code{(<>)} to the generic declaration. @end itemize @node More deterministic semantics,Changed semantics,Legal Ada 83 programs that are illegal in Ada 95,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide id5}@anchor{4a5}@anchor{gnat_rm/compatibility_and_porting_guide more-deterministic-semantics}@anchor{4a6} +@anchor{gnat_rm/compatibility_and_porting_guide id5}@anchor{4a6}@anchor{gnat_rm/compatibility_and_porting_guide more-deterministic-semantics}@anchor{4a7} @subsection More deterministic semantics @@ -34308,7 +34319,7 @@ which open select branches are executed. @end itemize @node Changed semantics,Other language compatibility issues,More deterministic semantics,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide changed-semantics}@anchor{4a7}@anchor{gnat_rm/compatibility_and_porting_guide id6}@anchor{4a8} +@anchor{gnat_rm/compatibility_and_porting_guide changed-semantics}@anchor{4a8}@anchor{gnat_rm/compatibility_and_porting_guide id6}@anchor{4a9} @subsection Changed semantics @@ -34350,7 +34361,7 @@ covers only the restricted range. @end itemize @node Other language compatibility issues,,Changed semantics,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide id7}@anchor{4a9}@anchor{gnat_rm/compatibility_and_porting_guide other-language-compatibility-issues}@anchor{4aa} +@anchor{gnat_rm/compatibility_and_porting_guide id7}@anchor{4aa}@anchor{gnat_rm/compatibility_and_porting_guide other-language-compatibility-issues}@anchor{4ab} @subsection Other language compatibility issues @@ -34383,7 +34394,7 @@ include @code{pragma Interface} and the floating point type attributes @end itemize @node Compatibility between Ada 95 and Ada 2005,Implementation-dependent characteristics,Compatibility with Ada 83,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-between-ada-95-and-ada-2005}@anchor{4ab}@anchor{gnat_rm/compatibility_and_porting_guide id8}@anchor{4ac} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-between-ada-95-and-ada-2005}@anchor{4ac}@anchor{gnat_rm/compatibility_and_porting_guide id8}@anchor{4ad} @section Compatibility between Ada 95 and Ada 2005 @@ -34455,7 +34466,7 @@ can declare a function returning a value from an anonymous access type. @end itemize @node Implementation-dependent characteristics,Compatibility with Other Ada Systems,Compatibility between Ada 95 and Ada 2005,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide id9}@anchor{4ad}@anchor{gnat_rm/compatibility_and_porting_guide implementation-dependent-characteristics}@anchor{4ae} +@anchor{gnat_rm/compatibility_and_porting_guide id9}@anchor{4ae}@anchor{gnat_rm/compatibility_and_porting_guide implementation-dependent-characteristics}@anchor{4af} @section Implementation-dependent characteristics @@ -34478,7 +34489,7 @@ transition from certain Ada 83 compilers. @end menu @node Implementation-defined pragmas,Implementation-defined attributes,,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide id10}@anchor{4af}@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-pragmas}@anchor{4b0} +@anchor{gnat_rm/compatibility_and_porting_guide id10}@anchor{4b0}@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-pragmas}@anchor{4b1} @subsection Implementation-defined pragmas @@ -34500,7 +34511,7 @@ avoiding compiler rejection of units that contain such pragmas; they are not relevant in a GNAT context and hence are not otherwise implemented. @node Implementation-defined attributes,Libraries,Implementation-defined pragmas,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide id11}@anchor{4b1}@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-attributes}@anchor{4b2} +@anchor{gnat_rm/compatibility_and_porting_guide id11}@anchor{4b2}@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-attributes}@anchor{4b3} @subsection Implementation-defined attributes @@ -34514,7 +34525,7 @@ Ada 83, GNAT supplies the attributes @code{Bit}, @code{Machine_Size} and @code{Type_Class}. @node Libraries,Elaboration order,Implementation-defined attributes,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide id12}@anchor{4b3}@anchor{gnat_rm/compatibility_and_porting_guide libraries}@anchor{4b4} +@anchor{gnat_rm/compatibility_and_porting_guide id12}@anchor{4b4}@anchor{gnat_rm/compatibility_and_porting_guide libraries}@anchor{4b5} @subsection Libraries @@ -34543,7 +34554,7 @@ be preferable to retrofit the application using modular types. @end itemize @node Elaboration order,Target-specific aspects,Libraries,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide elaboration-order}@anchor{4b5}@anchor{gnat_rm/compatibility_and_porting_guide id13}@anchor{4b6} +@anchor{gnat_rm/compatibility_and_porting_guide elaboration-order}@anchor{4b6}@anchor{gnat_rm/compatibility_and_porting_guide id13}@anchor{4b7} @subsection Elaboration order @@ -34579,7 +34590,7 @@ pragmas either globally (as an effect of the `-gnatE' switch) or locally @end itemize @node Target-specific aspects,,Elaboration order,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide id14}@anchor{4b7}@anchor{gnat_rm/compatibility_and_porting_guide target-specific-aspects}@anchor{4b8} +@anchor{gnat_rm/compatibility_and_porting_guide id14}@anchor{4b8}@anchor{gnat_rm/compatibility_and_porting_guide target-specific-aspects}@anchor{4b9} @subsection Target-specific aspects @@ -34592,10 +34603,10 @@ on the robustness of the original design. Moreover, Ada 95 (and thus Ada 2005, Ada 2012, and Ada 2022) are sometimes incompatible with typical Ada 83 compiler practices regarding implicit packing, the meaning of the Size attribute, and the size of access values. -GNAT’s approach to these issues is described in @ref{4b9,,Representation Clauses}. +GNAT’s approach to these issues is described in @ref{4ba,,Representation Clauses}. @node Compatibility with Other Ada Systems,Representation Clauses,Implementation-dependent characteristics,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-other-ada-systems}@anchor{4ba}@anchor{gnat_rm/compatibility_and_porting_guide id15}@anchor{4bb} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-other-ada-systems}@anchor{4bb}@anchor{gnat_rm/compatibility_and_porting_guide id15}@anchor{4bc} @section Compatibility with Other Ada Systems @@ -34638,7 +34649,7 @@ far beyond this minimal set, as described in the next section. @end itemize @node Representation Clauses,Compatibility with HP Ada 83,Compatibility with Other Ada Systems,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide id16}@anchor{4bc}@anchor{gnat_rm/compatibility_and_porting_guide representation-clauses}@anchor{4b9} +@anchor{gnat_rm/compatibility_and_porting_guide id16}@anchor{4bd}@anchor{gnat_rm/compatibility_and_porting_guide representation-clauses}@anchor{4ba} @section Representation Clauses @@ -34731,7 +34742,7 @@ with thin pointers. @end itemize @node Compatibility with HP Ada 83,,Representation Clauses,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-hp-ada-83}@anchor{4bd}@anchor{gnat_rm/compatibility_and_porting_guide id17}@anchor{4be} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-hp-ada-83}@anchor{4be}@anchor{gnat_rm/compatibility_and_porting_guide id17}@anchor{4bf} @section Compatibility with HP Ada 83 @@ -34761,7 +34772,7 @@ extension of package System. @end itemize @node GNU Free Documentation License,Index,Compatibility and Porting Guide,Top -@anchor{share/gnu_free_documentation_license doc}@anchor{4bf}@anchor{share/gnu_free_documentation_license gnu-fdl}@anchor{1}@anchor{share/gnu_free_documentation_license gnu-free-documentation-license}@anchor{4c0} +@anchor{share/gnu_free_documentation_license doc}@anchor{4c0}@anchor{share/gnu_free_documentation_license gnu-fdl}@anchor{1}@anchor{share/gnu_free_documentation_license gnu-free-documentation-license}@anchor{4c1} @chapter GNU Free Documentation License From patchwork Tue Jun 2 08:44:57 2026 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: 136245 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 133224BA23F5 for ; Tue, 2 Jun 2026 08:56:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 133224BA23F5 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=SoYvwrGe X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by sourceware.org (Postfix) with ESMTPS id DA7FB4BA23C8 for ; Tue, 2 Jun 2026 08:46:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DA7FB4BA23C8 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 DA7FB4BA23C8 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::329 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389965; cv=none; b=MlTzHo3qWod8sz4rUUW7O93Fe0vgs2vzn1wwDEd9+GIqKC+GoBA+s1yHyjZzB/qorGqpJxz9/N3undazmegUzWPsj3lHiSFfn0bp1m4pxQbKBDS4ceSSUXi5frnm/9cfxSZiE7SZeAJzzcrcepM5IvZ37cFYg5g4f22uPosaRnY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389965; c=relaxed/simple; bh=LxkLDoQNNvluhSk22KcZCnzJM7Rhigdsu7d3i7/ufEg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=X+Ea+H+EoLM5z35G1xPJUNGYmB8+3VN2EPoif/41t+JkTubI/b7slqX4Tg90+e8a8cyM98HQzkLwK2oLq9pBm4laiM7an/altX+TYrSbPwRitGUWhPZk846BMGRPLQjHRSTeYYSQmchFZ2A5Wn5S5y2Nr+JjPRsUY7zf20km0f0= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=SoYvwrGe DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DA7FB4BA23C8 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-49041fb8c23so83984545e9.0 for ; Tue, 02 Jun 2026 01:46:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389964; x=1780994764; 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=7I8ghAUYp2nvrZJxM5i9Bj+ppA7DNIGqmrcKpySrhrM=; b=SoYvwrGe9BYOeIRlZ4w8cajP9SoThK72fjnOFtCd1gem1P60YGiG2UT8SSNJn2FGeE BEzUQVrKVczBwLN03FHTImiRPfE6/TaOmzLBWEp+CKPVml50uKHffEAkFNokPN+CHuBf +AotkywW0/vxLLoM6Z2qRenHlJpP607CnTxDUBPI4ZClyagnClg0uq6EDlDX5Jub25XE VvvQGY2Q+hmBXS7nj029P2Wz6cP9QFjZVyA3TT/1+zyR47ENtGo9jB/JWzDVYI8M1T82 0G9iIbuWoIfqNth77Uc79EiZ7wZm5S2Gx2dyKUdFAUkOpDsPrOXvVzW1zkl1x6g4cf3E tWlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389964; x=1780994764; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=7I8ghAUYp2nvrZJxM5i9Bj+ppA7DNIGqmrcKpySrhrM=; b=oh1x9vktjv9RxLwJZir+BPcPfyuYvr77svrDcXL3kSXGRwxWHHVcPQ0F4x3Jf4LsqR 3pfRohrSAtQud8lBlWPYLjTuLdePUYmq8rG1iF8tAaSQHh3u4p5BW7Wzc7dK/Vti5uwg uW7R2GRTBHg2GSv2XLJ6i6czB2E1drePGmkvKhmmLZV5Q1+EXt1OyasJ4J7VsTKng4pB LWBnffsqFmzsxJCAXpS61BoHIhWa9Mq+KpftM3WEsd0HypWzprDw7fFfDj0C3WTK0NDv f3VAKWFTSLPV0vVo++CLUpHc2xVgoZbzCawwVKhKCxmiN8++3C7z6dHWA4Kk1CwGCTBv Uvbw== X-Gm-Message-State: AOJu0YyrnW2SKDmpci2fmtfp0NqXu/qkj7H/S24TEH3JGOTz63vhgesf dKirRpSRtV0XEshw/uvGEo/EXGlJxqqmGRK2iaFqKceiIlvHMQwF1TS2N5Fv+yrdDr4IkJbF9Oi MDBw= X-Gm-Gg: Acq92OF5qgPh6FojzBuwch9EGV++PzPmQDDnhrDvnPSutsTZKr5evZz7slZJJYDXgBq btflY7dZC9lKhiATJpLWKJTyCe37f7fr5jj7mIG7rs/KckyQw20BF1kdt1vKaejPJOYEBZcavrT 82AQSyxB5eZ29EKkt5J46SFXxIzDiRULdCamITLL+Ix3xq9FkH5Jx78gvAhsXoEgwosbvEM6hI8 qbvsGI4onbDFIt99fLDNTi3kcDb9o1c7VQUY5uzh0XCwgAVquQ1tsd8g9wnHqBrlCwESk1S3ODq FouXQlj6cr3edBsKlhWhJ+0zLyElPUhWNaFlfWAXet67LSMn37uryi+qqDNXkcL8dg0a78TgYci d8oYeRHf+NBgmwiTZgoiI0ai1V8lha36BLfzDjpNuWLHdBzPOqRtfNaI86QE4IGPzEL44pvR/HR B5sZGNfv07Dk/+sjbuPxpUkGv8l130yjekNTH3K2wwjjqpLbuw7ZCuFlDbVHmBXn4u2aECZhisK lUQBq1R7Hk7e8mIgqhS5An5lHl1MTA= X-Received: by 2002:a05:600c:34c1:b0:490:b3e3:91a9 with SMTP id 5b1f17b1804b1-490b3e39345mr4141925e9.16.1780389963761; Tue, 02 Jun 2026 01:46:03 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:03 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Bob Duff Subject: [COMMITTED 09/51] ada: Cleanup aspect specifications (Ins_Node) Date: Tue, 2 Jun 2026 10:44:57 +0200 Message-ID: <20260602084541.3829876-9-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Bob Duff Get rid of the Ins_Node parameters and variable. We still treat pragma Annotate specially, but at least the special case is more localized now. (It is quadratic in the number of pragmas Annotate, which is acceptable.) We should eventually remove this special case. In the compilation unit case, insert at the end of Pragmas_After, rather than the beginning. This is not necessary, but seems more uniform with the non-compilation-unit cases. Remove ??? marks. gcc/ada/ChangeLog: * sem_ch13.adb (Insert_Aitem): Remove Ins_Node formal parameter. (Analyze_One_Aspect): Likewise. (Analyze_Aspect_Specifications): Remove Ins_Node local variable. (Insert_After_Place): New function containing the special case for Annotate. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch13.adb | 70 +++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 37 deletions(-) diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 773fa64a3e8..5c786e7fb4c 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -395,7 +395,6 @@ package body Sem_Ch13 is procedure Insert_Aitem (N : Node_Id; - Ins_Node : in out Node_Id; Aitem : in out Node_Id; Is_Instance : Boolean); -- Aitem is a pragma or attribute definition clause generated from an @@ -417,13 +416,10 @@ package body Sem_Ch13 is procedure Analyze_One_Aspect (N : Node_Id; - Ins_Node : in out Node_Id; E : N_Entity_Id; Aspect : Node_Id); -- N and E are what was passed to Analyze_Aspect_Specifications. -- Aspect is one element of Aspect_Specifications (N). - -- Ins_Node is (in some cases) where to insert the Aitem; usually - -- equal to N. ----------------------------------------------------------- -- Visibility of Discriminants in Aspect Specifications -- @@ -2118,7 +2114,6 @@ package body Sem_Ch13 is procedure Insert_Aitem (N : Node_Id; - Ins_Node : in out Node_Id; Aitem : in out Node_Id; Is_Instance : Boolean) is @@ -2129,6 +2124,28 @@ package body Sem_Ch13 is Def : Node_Id; Decls : List_Id; -- List on which to prepend Aitem, if any + function Insert_After_Place return Node_Id; + -- When we call Insert_After below, this is the node after which to + -- insert Aitem. This is normally N, except if Aitem is a pragma + -- Annotate, then we insert it after other pragmas Annotate. + -- ???This should not be necessary; order should not matter, + -- so we should always insert immediately after N. + + function Insert_After_Place return Node_Id is + begin + return Result : Node_Id := N do + if Nkind (Aitem) = N_Pragma + and then Get_Pragma_Id (Aitem) = Pragma_Annotate + then + while Nkind (Next (Result)) = N_Pragma + and then Get_Pragma_Id (Next (Result)) = Pragma_Annotate + loop + Next (Result); + end loop; + end if; + end return; + end Insert_After_Place; + begin -- ???Preelaborate in a package body is illegal, but older compilers -- accepted it, and put the pragma after the body (which is also @@ -2234,32 +2251,17 @@ package body Sem_Ch13 is <> -- Here we insert Aitem AFTER N. For a compilation unit, that means - -- in the Pragmas_After field. For anything else, after N in some - -- list. + -- at the end of the Pragmas_After list. For anything else, after N in + -- some list. if Nkind (Parent (N)) = N_Compilation_Unit then if No (Pragmas_After (Aux_Decls_Node (Parent (N)))) then Set_Pragmas_After (Aux_Decls_Node (Parent (N)), New_List); end if; - Prepend_To (Pragmas_After (Aux_Decls_Node (Parent (N))), Aitem); - -- ???Should this be Append_To? + Append_To (Pragmas_After (Aux_Decls_Node (Parent (N))), Aitem); else - Insert_After (Ins_Node, Aitem); - - -- The order shouldn't matter, but for Annotate, some tests fail - -- in minor ways if we don't use Ins_Node to make the order of - -- pragmas match the order of aspects. For some other aspects, - -- such as Pre, some tests fail if we DO use Ins_Node. - -- ???Consider getting rid of Ins_Node, and just doing - -- "Insert_After (N, Aitem);" above. Or consider always - -- updating Ins_Node below. - - if Nkind (Aitem) = N_Pragma - and then Get_Pragma_Id (Aitem) = Pragma_Annotate - then - Ins_Node := Aitem; - end if; + Insert_After (Insert_After_Place, Aitem); end if; <> @@ -2285,7 +2287,6 @@ package body Sem_Ch13 is procedure Analyze_One_Aspect (N : Node_Id; - Ins_Node : in out Node_Id; E : N_Entity_Id; Aspect : Node_Id) is @@ -3795,7 +3796,7 @@ package body Sem_Ch13 is procedure Insert_Aitem (Is_Instance : Boolean := False) is begin Decorate_Aspect_Links (Aspect, Aitem); - Insert_Aitem (N, Ins_Node, Aitem, Is_Instance); + Insert_Aitem (N, Aitem, Is_Instance); Delay_Required := False; end Insert_Aitem; @@ -5912,15 +5913,6 @@ package body Sem_Ch13 is procedure Analyze_Aspect_Specifications (N : Node_Id; E : N_Entity_Id) is pragma Assert (Present (E)); - Aspect : Node_Id; - - Ins_Node : Node_Id := N; - -- Used to (sometimes) preserve order of pragmas relative to the aspects - -- whence they came. - - -- Start of processing for Analyze_Aspect_Specifications - - begin -- The general processing involves building an attribute definition -- clause or a pragma node that corresponds to the aspect. Then in order -- to delay the evaluation of this aspect to the freeze point, we attach @@ -5941,14 +5933,18 @@ package body Sem_Ch13 is -- deal with delay of visibility for the expression analysis. Thus, we -- just insert the pragma after the node N. + Aspect : Node_Id := First (Aspect_Specifications (N)); + + -- Start of processing for Analyze_Aspect_Specifications + + begin -- Loop through aspects - Aspect := First (Aspect_Specifications (N)); while Present (Aspect) loop -- Skip aspect if already analyzed, to avoid looping in some cases if not Analyzed (Aspect) then - Analyze_One_Aspect (N, Ins_Node, E, Aspect); + Analyze_One_Aspect (N, E, Aspect); end if; Next (Aspect); From patchwork Tue Jun 2 08:44:58 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 136248 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 514E34BA23E7 for ; Tue, 2 Jun 2026 08:58:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 514E34BA23E7 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=eHV7VGqa X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id 6602D4BA2E3A for ; Tue, 2 Jun 2026 08:46:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6602D4BA2E3A 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 6602D4BA2E3A Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::332 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389965; cv=none; b=wG35nV+knwXBKXOLGQddI34wGOurXV2lWsm48CE63QbUJhOivBuLCWSrMHE/brCOoJuOIVFdJjMxJh9rXWYpj6ovxVZkIu7fqeKtTUwZYvNFhU+CtJI7JVNVVhPKaAYH2Q9yRwyI23G3hABzL6CSGua+8eddw4xtn1ouSBSc+0s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389965; c=relaxed/simple; bh=dMxfDNil7Rse5SMpY/lp4++NsheaVaihAuKtX38jGtg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=l/y3B/e8fjpT8xuBi6hzS+suB5sBEnsk0G6eEMsX8Nayu1o862KVF0JqKr1bbC5ZQxhAnpA7NJ+ElNxFE/7SMnQldA/+Y5Oaw3vWnYVW8JlLKo1Zn29hd192pVZToMqlFrFBcoFxDJa9xnrF07ipak5DTZgcSbIRv2JoErDu2pU= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=eHV7VGqa DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6602D4BA2E3A Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4909e3fa4b2so39350955e9.0 for ; Tue, 02 Jun 2026 01:46:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389964; x=1780994764; 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=1K2l5sOpRxmX1i6rIVvI4lrcyf+YtG4TQb3rA00tHcg=; b=eHV7VGqagRpazOv/sOq3mxHXLSPV9K7knBBzeHTTrBzjKjLbAccmLy0veYumYeVZx5 o5uDYHjENlPzkUuTelCsFVq1GK3IX9sB96y5A425fLvPgWeFXnt/L+2uu0M53dzlXqvG 8dfKyfWEsWIjS4iaDegmeBApDVCWoftcJA6TuijseGSdYuMC58sbuTWfeZTPCO4fK8uM aEsJ0lnZqC6NPBD4M8F+a/CrczaIqPMRB6LOeD4JD84LJyCSw9HFUBD+/bxiz0cCYww4 /feS0tKkShDqZBBSqzPfKddwAf6Mwm8beK31D6+7Ql+w+b30dnLrloFjKWp4oVLduWCp oZOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389964; x=1780994764; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=1K2l5sOpRxmX1i6rIVvI4lrcyf+YtG4TQb3rA00tHcg=; b=h2JShefThJ6P04+BDJFy1MJMKVLWhWTXpkjpjMMfdfSoUbcpIzdMrCmAHtdBvoV0cQ SGg1y6S8erD5oTXWCCoB53MKQoX2kVb0tn/4HirHXQT6GhpjiM5vHkyOg/BV569JsH9C 7JpmkN2eOy72SZ57NZIp0cM11M4S4ZkK/e72Oh6QhZcN0EMIH9tNqzE0LssFBJkuuq0U +EQMSWpyfy8o97C6/BO6vxiMQhHnYO/kzKfAqtYKL/5rD4Bdyl+OfhYZyZThYtOQqQKu w2LqGOpfuFbjloXdd+oi74ZwJ/7JByVUdFri8fPdl4Wh3g3jsunI8gBxuFrD8AunGHW7 qzUQ== X-Gm-Message-State: AOJu0Yz1ro9sCA2M37dL+JP/hsndXBVS6hpfYE7q97OCPRb34OjfXpuh K33GzFT01p/dSLuOaXryxF/8APRTVn0N3L31YWWwBuvV3tzgo+F6Hipp3dxwywSSjeuCyLbmj+p k5/U= X-Gm-Gg: Acq92OEcvXIWy5dWMlRQb0N/YqvozUDBOkZyZW77d3ql4xq53ejulQWWuNtUMZxyW48 y2YX6iJK9bJvQrUrDkLPYp77evO2gG8+iduEitIZgvJ4SA739hQa30t7RnlOgy95Gzm8VPYHY9V Zn+khxHgWW9cAtU+cKXAfeC/wb8YQHoT3v9lgLNm3C6aaWf9B4u8oE7PJyn9XBu2K+mRKu8cJzD DBBjVNDFG00Ct1H2kih6BWfURzP/v897PnIAx7+Q5XG9TWZfG8ofiybOPy7Yst5V0gq2TfK9+k/ HKBDwmYonXNMP9oFj1L0W1b00PuMJHGpJRS9jI4rUgK2oha1RpC2dvG5xLc/iGk2gEwOGRCVPRW QbfjW+sjAikMou/zrD0yf9T0ciXiLtEcRhikkT6abEfOwoXyBm7soVZ53HERZ+otbZSval6bDDl gSHzirWOoI1ONY7yzgHoBIk27W4BDSbTEJDokgzfAPUvqPyw7TXpTMbl+h34sLZ3+vnYRfcVlSz 1bRzfibmfAqtgjm8kfgSwREaaCZT6E= X-Received: by 2002:a05:600c:c16b:b0:490:b355:9c8c with SMTP id 5b1f17b1804b1-490b3559fefmr11745015e9.23.1780389964411; Tue, 02 Jun 2026 01:46:04 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:04 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Tom Tromey Subject: [COMMITTED 10/51] ada: Update gnat-llvm debugging documentation Date: Tue, 2 Jun 2026 10:44:58 +0200 Message-ID: <20260602084541.3829876-10-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Tom Tromey With the latest patches to LLVM and gnat-llvm, I believe that types are represented correctly. This patch updates the documentation accordingly. gcc/ada/ChangeLog: * doc/gnat_ugn/building_executable_programs_with_gnat.rst (GNATLLVM): Update debugging documentation. * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- .../building_executable_programs_with_gnat.rst | 11 +---------- gcc/ada/gnat_ugn.texi | 11 +---------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst index 3db1b44d7fb..9efcc42afca 100644 --- a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst +++ b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst @@ -8003,16 +8003,7 @@ passed between C and Ada as simple as practical. GNAT LLVM currently provides limited support for debugging data. It provides full line number information for declarations and statements, -but not sufficient debugging data to display all Ada data -structures. GNAT LLVM outputs complete debugging data only for a -subset of types: scalar types; records whose field offsets are known -at compile time, including discriminated records fitting this -description; and arrays. Records that have a field whose size or -offset is only known at run time do not yet have correct debugging -data. You will not be able to use ``gdb`` print commands to look at -objects not of those types or to display components of those -types. You can use low-level ``gdb`` commands that display memory to -view such data provided you know how they're laid out. +and complete debugging data for all types. In some situations, a name in the source may not be available. Renamings are not currently emitted into the debugging data. When diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 130a50e91ee..b91a9e90975 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -17569,16 +17569,7 @@ passed between C and Ada as simple as practical. GNAT LLVM currently provides limited support for debugging data. It provides full line number information for declarations and statements, -but not sufficient debugging data to display all Ada data -structures. GNAT LLVM outputs complete debugging data only for a -subset of types: scalar types; records whose field offsets are known -at compile time, including discriminated records fitting this -description; and arrays. Records that have a field whose size or -offset is only known at run time do not yet have correct debugging -data. You will not be able to use @code{gdb} print commands to look at -objects not of those types or to display components of those -types. You can use low-level @code{gdb} commands that display memory to -view such data provided you know how they’re laid out. +and complete debugging data for all types. In some situations, a name in the source may not be available. Renamings are not currently emitted into the debugging data. When From patchwork Tue Jun 2 08:44:59 2026 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: 136237 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0E58C4BA23DB for ; Tue, 2 Jun 2026 08:48:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0E58C4BA23DB Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=cvWuJ5tc X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id 370104BA2E39 for ; Tue, 2 Jun 2026 08:46:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 370104BA2E39 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 370104BA2E39 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389966; cv=none; b=x6okk0s5oJLNPKfy0s6F53yn68bdwzxOGYBodRjbQg1RtNVvM3RcegQUc7N67OnTt8F4dzZ5+tvjmubAou4A3WPI7WN/sHR6AgnxGJtLas37BYywMRSmff9qexqfFK0O3+OzNOt8xNVCnaJ5VsqopMcTnW8+QQIn4x4/qLKLgEE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389966; c=relaxed/simple; bh=TP5AJRy1fz7S/Xh/8vL/xzhO9+ZMe1RdGIWf320clZw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=s6ZEYu+Zg60sKPjrVg91o6ICHrsPaRUfEUIF/3IJZMuDV3XaILRD3EwqmRuyGUqyUz+7PyOEN48pKJoejbMibNLmyjjW3p0bvQdkeFstqphVu2qN08diFObXv/O2TmEVgSTq21I4JkbW6BaYEl2pERNp4deMe1Ewxs8esQxHPdE= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=cvWuJ5tc DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 370104BA2E39 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-49050ff7cbdso101560305e9.2 for ; Tue, 02 Jun 2026 01:46:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389965; x=1780994765; 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=b371w+uaWbwU7hqEvc63ccadmVo9GaygOggs+rVZJsw=; b=cvWuJ5tcw/Xvp5UxsNkU49U8udZ22N9NV5YnxyDBt8v63F3ZYemENGZePP9g7FrlSJ xQKccM/o+4EL3MMyfOTJfY0aVKDDRJFUSV0X8vURIjuVeH+Mx17EQCMFzMgryADseiyg TpMK/jANW12m3bdX1qwYZ4GX/4F/lG1hVdvM0Lj1fyAqgMZzrDVAD7OseHsZY0obA58/ +C60yD78Ry1wZJdGoVKSEt8gvYFj59Z9P+bUvBJvMPj1gDtSpKU8muSBP7dzNv1tBwFJ EH28qxiqNbNJ2eb4yF7YVO9qjcyKfLaTVlp2cGz5SCrY/1CoTDSTMXKJmQnahvMHWov9 j0dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389965; x=1780994765; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=b371w+uaWbwU7hqEvc63ccadmVo9GaygOggs+rVZJsw=; b=tAv5nX7jXjQsGzxOND76w/u5B8u6zWVro5wq7EtuEEqfmDGYEqhQkqa65yrDjHm8w3 mKArDqtbm4xRdnHQJKpw7WIfWC7nUAcBNvMeRY28kdp/qj4dLd8VB8uY+w5/u8eumYir UMRMlTjkIxGiAzqYO1q7oDy1y+6k6VtUBBBdjrGG+RHQv7udevmsLbZq52EUuO0K+P7g tBARDwwZKdz4SJxzDEmzB2N1f5OWWjA1UDQZi8a9EgfHwNhaR/k9/BFJUGaiD1DrjeM3 x8GoS/5oYArgl1E9cX199MtmuchnwggI7aaN61/9+tQXV+8nmivTLheEQYFdPZFfL3z8 rkEA== X-Gm-Message-State: AOJu0YxB8dA7GOwPrMBlE/RAodic94AqfLs0L/pKXdHF+GeTFi90JdcZ 4GdyHCymrWsyqNkhsYgun7rquMG6el5mAz2G5G7H5J2CP42zwpSuWuKGxcsKYtlBIXmGW7aVnAr BUHQ= X-Gm-Gg: Acq92OE+l00Nzm2E1/4y/Aa2otj7yDU+jCxoiu8DX0o56KXUMRVDc2ApV3qS32pgV9K HsPTKW7M++fFa90rsM1AoP9YO3Tpwmc3NfkIws+kdXc4h2LrwqBwQouAQflKs3Q2cdFQkhUwaJd IodaRYxHvFnGx6rNKKjSS4jEkpKe81N5T+3opuHToYZBVJfxvycLCgFkbwbE07+EIh7JChl2UGu 6y6PtAErRXH39z29GF6u/IIxTySLdshL0h7QKLDBfGWXqZPZ1IRfIXL5oZkmqBAX63AM3LvkC8f Y1qOLJ1Q1uNm1/MZazHZ+DMVmCVZhU7Y/bKT3Uh6b5OoqIxwtkA4L2LqdJbtWyLlVFa+27wKQvT XLr8RfOZVP+49FQWJxuNQW20MztwY+jQLFIZWf2nVXRgWGBPYOb7izKXdQSamtk13rXceG9Lbtf N/BYMeRFBCqlzMEHV6Eax/yuI8RNoqTChVu7B88VL+k41CfKhjjqATgdTgeEdE9wPsR7lBvVDnt M5/hXmVOfsC6JAvZBk/hTD1A8wHGpvqZ2JcBKbxGA== X-Received: by 2002:a05:600c:c098:b0:490:50ff:7943 with SMTP id 5b1f17b1804b1-490a2923a87mr227755055e9.5.1780389965080; Tue, 02 Jun 2026 01:46:05 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:04 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 11/51] ada: Improve layout of record types from Sem Date: Tue, 2 Jun 2026 10:44:59 +0200 Message-ID: <20260602084541.3829876-11-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Eric Botcazou Compiling the unit with -gnatRh shows unused bits in the record types from the Sem unit. This change saves two 32-bit words for Scope_Stack_Entry. gcc/ada/ChangeLog: * sem.ads (Suppress_Stack_Entry): Move down Suppress component. (Scope_Stack_Entry): Reorder components to eliminate holes. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem.ads | 92 ++++++++++++++++++++++++------------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/gcc/ada/sem.ads b/gcc/ada/sem.ads index 75d496ff9e4..62d3aaea511 100644 --- a/gcc/ada/sem.ads +++ b/gcc/ada/sem.ads @@ -394,9 +394,6 @@ package Sem is Check : Check_Id; -- Check which is set (can be All_Checks for the All_Checks case) - Suppress : Boolean; - -- Set True for Suppress, and False for Unsuppress - Prev : Suppress_Stack_Entry_Ptr; -- Pointer to previous entry on stack @@ -406,6 +403,9 @@ package Sem is -- field is used as a forward pointer (null ends the list). This is -- used to free all entries in Sem.Init (which will be important if -- we ever setup the compiler to be reused). + + Suppress : Boolean; + -- Set True for Suppress, and False for Unsuppress end record; Suppress_Stack_Entries : Suppress_Stack_Entry_Ptr := null; @@ -500,10 +500,37 @@ package Sem is Entity : Scope_Kind_Id; -- Entity representing the scope + First_Use_Clause : Node_Id; + -- Head of list of Use_Clauses in this scope. The list is built when + -- the declarations in the scope are processed. The list is traversed + -- on scope exit to undo the effect of the use clauses. + Last_Subprogram_Name : String_Ptr; -- Pointer to name of last subprogram body in this scope. Used for -- testing proper alpha ordering of subprogram bodies in scope. + Node_To_Be_Wrapped : Node_Id; + -- Only used in transient scopes. Records the node that will be wrapped + -- by the transient block. + + Actions_To_Be_Wrapped : Scope_Actions; + -- Actions that have to be inserted at the start, at the end, or as + -- cleanup actions of a transient block. Used to temporarily hold these + -- actions until the block is created, at which time the actions are + -- moved to the block. + + Locked_Shared_Objects : Elist_Id; + -- List of shared passive protected objects that have been locked in + -- this transient scope (always No_Elist for non-transient scopes). + + Pending_Freeze_Actions : List_Id; + -- Used to collect freeze entity nodes and associated actions that are + -- generated in an inner context but need to be analyzed outside, such + -- as records and initialization procedures. On exit from the scope, + -- this list of actions is inserted before the scope construct and + -- analyzed to generate the corresponding freeze processing and + -- elaboration of other associated actions. + Save_Scope_Suppress : Suppress_Record; -- Save contents of Scope_Suppress on entry @@ -521,14 +548,19 @@ package Sem is Save_Default_Storage_Pool : Node_Id; -- Save contents of Default_Storage_Pool on entry to restore on exit - Save_SPARK_Mode : SPARK_Mode_Type; - -- Setting of SPARK_Mode on entry to restore on exit + Save_No_Tagged_Streams : Node_Id; + -- Setting of No_Tagged_Streams to restore on exit Save_SPARK_Mode_Pragma : Node_Id; -- Setting of SPARK_Mode_Pragma on entry to restore on exit - Save_No_Tagged_Streams : Node_Id; - -- Setting of No_Tagged_Streams to restore on exit + Save_SPARK_Mode : SPARK_Mode_Type; + -- Setting of SPARK_Mode on entry to restore on exit + + Component_Alignment_Default : Component_Alignment_Kind; + -- Component alignment to be applied to any record or array types that + -- are declared for which a specific component alignment pragma does not + -- set the alignment. Save_Default_SSO : Character; -- Setting of Default_SSO on entry to restore on exit @@ -536,6 +568,13 @@ package Sem is Save_Uneval_Old : Character; -- Setting of Uneval_Old on entry to restore on exit + Is_Active_Stack_Base : Boolean; + -- Set to true only when entering the scope for Standard_Standard from + -- from within procedure Semantics. Indicates the base of the current + -- active set of scopes. Needed by In_Open_Scopes to handle cases where + -- Standard_Standard can be pushed anew on the scope stack to start a + -- new active section (see comment above). + Is_Transient : Boolean; -- Marks transient scopes (see Exp_Ch7 body for details) @@ -546,45 +585,6 @@ package Sem is -- typically needed when the context of a child unit requires -- compilation of a sibling. In other cases the flag is set to False. -- See Sem_Ch10 (Install_Parents, Remove_Parents). - - Node_To_Be_Wrapped : Node_Id; - -- Only used in transient scopes. Records the node that will be wrapped - -- by the transient block. - - Actions_To_Be_Wrapped : Scope_Actions; - -- Actions that have to be inserted at the start, at the end, or as - -- cleanup actions of a transient block. Used to temporarily hold these - -- actions until the block is created, at which time the actions are - -- moved to the block. - - Pending_Freeze_Actions : List_Id; - -- Used to collect freeze entity nodes and associated actions that are - -- generated in an inner context but need to be analyzed outside, such - -- as records and initialization procedures. On exit from the scope, - -- this list of actions is inserted before the scope construct and - -- analyzed to generate the corresponding freeze processing and - -- elaboration of other associated actions. - - First_Use_Clause : Node_Id; - -- Head of list of Use_Clauses in current scope. The list is built when - -- the declarations in the scope are processed. The list is traversed - -- on scope exit to undo the effect of the use clauses. - - Component_Alignment_Default : Component_Alignment_Kind; - -- Component alignment to be applied to any record or array types that - -- are declared for which a specific component alignment pragma does not - -- set the alignment. - - Is_Active_Stack_Base : Boolean; - -- Set to true only when entering the scope for Standard_Standard from - -- from within procedure Semantics. Indicates the base of the current - -- active set of scopes. Needed by In_Open_Scopes to handle cases where - -- Standard_Standard can be pushed anew on the scope stack to start a - -- new active section (see comment above). - - Locked_Shared_Objects : Elist_Id; - -- List of shared passive protected objects that have been locked in - -- this transient scope (always No_Elist for non-transient scopes). end record; package Scope_Stack is new Table.Table ( From patchwork Tue Jun 2 08:45:00 2026 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: 136251 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D71614BA23DC for ; Tue, 2 Jun 2026 08:59:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D71614BA23DC Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=Zs0YBpp3 X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by sourceware.org (Postfix) with ESMTPS id 935834BA2E11 for ; Tue, 2 Jun 2026 08:46:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 935834BA2E11 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 935834BA2E11 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::329 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389967; cv=none; b=JkIAsMQfVIIGduzZfWt1/RaP8FUGbbRVkqy2NyMmvP12Be4VYN3ZS6yQKV/9enTO6gl5LB9zWTMncZhRKioARe+HVVZmpLhBhFdjLjJGheC1qFZtjA3sUmzjVkEF7A/VLsCnWFRGWp1MrfU4rPX4++JbfPGbXc02X1ZIKstEXn8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389967; c=relaxed/simple; bh=DVEaTEfP/LQ6hwav4U3KsXzNNKbKJsNLGvu5+afTGhg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=jdXf3HVKTtU0oysZi6wfEW0yPzpJz9BhsxTHdz+wKe0K2bs9EdI8DGx9ebl7IvzrHK1yjC+pRP19smLnwPwwhMf0DorZo4BCyLTBriweC0V3lVoKXunh3ma+NV+s/um60553vc7PvnQr5KesmpZo5FTG7nsxSDj4ijlnN1QVlgM= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=Zs0YBpp3 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 935834BA2E11 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-490ace40f4bso18713135e9.3 for ; Tue, 02 Jun 2026 01:46:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389966; x=1780994766; 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=kNEZA00znw7bUVeZIPQOwGzIAVgQZvel73Y5jKlHG3M=; b=Zs0YBpp3JbGJlqeGCg5fIyCjSuUydmR9k9PntqXpk9wi6lSJpOJHL+a+ez53b9Wg9q AUlvLMY7qHGZ9e/hxQzy8wvv/rzcKrM8wjRpAkA1GPY/9F5KitipODtd/+DjGTDsKiN3 vJM/hj2skE8L5M3miOk2x05GcYpD0SlloHMwkyswIkws98RFzomZ1clcq3wC6fESCz13 13wQgBp+uDeelHIYzJSUWAcYto9Lg0wyINUGcmm+DxUZWLjEBO+vp08hfFEt+Rm1nRcE V5XVn0wYvbunOzftua+Nx4ZwgrWc/e+XvWe+8MNZS8XIPLsTH5ePxJ68s8Br5pHPWpfc dNIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389966; x=1780994766; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=kNEZA00znw7bUVeZIPQOwGzIAVgQZvel73Y5jKlHG3M=; b=Xqlr6V9YI2xA+KgmJkD2PSryYyzhk37S36N7xGf7wgV0YMA0XBG/Mw8GB5ek8tyJkw 3fPclOJ+dWoYzFSOzkK+FjYM1bV2x2LTsseBHI/ZrOUAEAlJw5mxQxDNYd0nk71vn5Pi iIwXfnqesxwWTE4wKdeC4gnNw0NwuyG+oM8OGSfbexmUK4JUzS3UdEN5rLb64/2RqkmX M++qkopzTZSQt3u63pUEDHJkamtxIhfZAn45P2AZaH3Xy/Y6R5+fc19fOhU2cttib865 zCWYDyZSD7DkgOgOdVynRr/2lnO4ERO7DLUqFoFzNSrq6tWlAREq9tzIuGzjK8fy8FCa 72Lw== X-Gm-Message-State: AOJu0YxZKBTt/Md8YPgsKzeKnEg0ika1DEBbxCStLE/vAIzvwvt4CRvq u4GjyVutcJHB2qnI4nZcHkc1QtqvmCUOTrzyfF5qsu9QcgVL0t99me6RMGnHl0N48gLttnkRUEL lzaY= X-Gm-Gg: Acq92OEx1MTEEdX5P5hCCN2zGLJ4dRri99m6knpEjc24egeHYj3sVwGsbrZnEmG5FKS tqI7YCCyj8WRq5DTdBl4fBSFSvSd2eqrWZ0HL/wmPBx3I0I7q2mY7TNtyWCtWf7I20H2zhcLHlK yP3jMOjUwcseak3YbwxBQc+2eWN3zGhc3QAfSwkgpSpCzVcvhQC8XXrckOWWXgakVjErs48d79H QFnXt7HYGLmKoT6MOMinjtArylb8mSIe1c29eXWtLjFgVsBJlxlXz2j14z6ieRuTVjT9ta28sCm gpcEJ3PKCPIFY09nY2HFCTXmpydNMkR/LF516Gr1tjPlm5lrZe+OrI6QU1BlZzhriMXItts05Bx tHlEd5gJH205w/twFsOhyzWSjmSczgsT/am9vL53diOtiResKYS8MpysCaEyb+7Ovrm4nwOAv/G a3poi5Er3NAOid2JboybGrjriryfDE8htA8xX8JiHUMZwBetHVo15y+kdv1kBGGUcpBboAHM1Mv XcmSoTQMfQVJVytxW7v1T4/ezJ6D4g= X-Received: by 2002:a05:600c:870c:b0:490:b2a6:8c2a with SMTP id 5b1f17b1804b1-490b2a68d50mr23258445e9.5.1780389966428; Tue, 02 Jun 2026 01:46:06 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:06 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Ronan Desplanques Subject: [COMMITTED 12/51] ada: Add note about Sem_Aux being in binder closure Date: Tue, 2 Jun 2026 10:45:00 +0200 Message-ID: <20260602084541.3829876-12-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Ronan Desplanques I recently realized that Sem_Aux is in the binder's closure, unlike Sem_Util. This patch makes it explicit in a comment since it can be useful when choosing where to put a helper subprogram. gcc/ada/ChangeLog: * sem_aux.ads: Add note. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_aux.ads | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gcc/ada/sem_aux.ads b/gcc/ada/sem_aux.ads index cf80ec793ba..3bd3a466476 100644 --- a/gcc/ada/sem_aux.ads +++ b/gcc/ada/sem_aux.ads @@ -30,6 +30,11 @@ -- content of entities in the tree, so this package is used for routines that -- require more than minimal semantic knowledge. +-- However, this package is in the closure of the binder executable. If you're +-- looking for the home of a new helper function that uses significant +-- semantic knowledge, Sem_Util, which is not in the closure of the binder +-- executable, will be a more convenient place. + with Alloc; with Einfo.Entities; use Einfo.Entities; with Namet; use Namet; From patchwork Tue Jun 2 08:45:01 2026 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: 136256 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AE7304BA2E2C for ; Tue, 2 Jun 2026 09:03:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AE7304BA2E2C Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=GDKozqPe X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id 579474BA23D7 for ; Tue, 2 Jun 2026 08:46:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 579474BA23D7 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 579474BA23D7 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389968; cv=none; b=NxT9Q/0qr+rzHIup3Xxow7+M6SV+dIjZztg6NJ/IhpdZtRQx4e/Qo1Bo0TvJrVDF0PaVDtZ/ZsAoF1GgXkIs5M+PH+8JZvnsH4uizOcgVVhGAcD9oCLJh4RDmDZtUmZwzzxfyjslhDK+/RHRip3GxhPPczGKabkj1gommmHhjQw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389968; c=relaxed/simple; bh=K7/ihiuMyDJqHKETAEi/sY8mQhYwB6tYCjImHqQT5OA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=S0+Z50Mmtm/qzi3pKiGEd3wVYCOPHvfyymmFggwqGkT00DQGmKBi1lvOvxs7QiWXf1uyssGdCSGwa1xR9bGfrZBPXPOza3X+QBGvjne/40iXtbSG3WBRIfULcogzJvcnGa3uKETkQUb+hyI7BSpFUhmX/XsvrL6WQweDlpk/gNg= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=GDKozqPe DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 579474BA23D7 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-490b1bbcf3aso3971385e9.1 for ; Tue, 02 Jun 2026 01:46:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389967; x=1780994767; 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=wrIvznMjDSvSW8c1f6CheN1nx2/O24PAvv9Cbu/oHAE=; b=GDKozqPeAvwaga09BbpHPUj+2G95QuNL1Ig3j1X33ZGwlJ5ZITHMJJRQxQ2VD/FIVL aIRu963SLFS6VVvFP8bHA/cUK9M/kYpL0wqohTo5zFtdMsLA3mndoWJPD0gadhtuuRAP eIze4cANeCwngYM2joHhy/naAgattS0tWYLMDCN7P75lEupaZqZn2Ri+OKcqK2A8dwsI ZdeoGG4/VolDGkGLCkMGA78StYJJNHbrcsgvRFLS+F+Ggl/jgPSPlAoC1qtjyTOHmnGy O2A3NAcJflwXzQQdWIl7LPVMRMONQMMsUyazSiZHpLPkmXuSHiGbQNnYJ9rOq7MhX6zQ WB7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389967; x=1780994767; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=wrIvznMjDSvSW8c1f6CheN1nx2/O24PAvv9Cbu/oHAE=; b=hmIccXBjBm5ZhYxs6T57L7ikg7SCBtg9qUaZnwNblmxTTC/X7BVZW5BEUff5vRHS5D uaVyQuTEwlidIPhO71ZWvvyr+bXqkqumOi3oSxoqFrfOtHql+/Ym11ehC5qdrxjnr/ri 90gofWgEBH7JqPUZD3RNd2E8XBLTlrVsUD8FhPLW0P/Nh2L24IRz9OtTQkRdkVviWx47 gQl7/Y8lGOjVNlWs3C0hbEcLWsDNH3sIBlY/Xm9bwb6DmxScsLhhAxBM7NvZO9zMPvLF oHr6EZSe+0fjbZtwy94u6YXAlLgKoIaadMdS82RWLLsJFjOVbYPjUkb/whXf5rgDgB7Z 5iPQ== X-Gm-Message-State: AOJu0YxRgjftwSD95Vi62pBkEf0AA7y8VjO5qmk0Aanx7GGRR6MSMJqu QRXA0aW+goKXrloeE1Z6DVBiFcQFJCnHbe7E+eUKA05c7FfBtXvsfJqj1qyUhWVynnWJEXZwnXk G8Hw= X-Gm-Gg: Acq92OEeWvEXaa4FMkO2sx5jGGM4EB15v3uChrMbLRaOs2FC61BqkHbDysHuBytVPXa ysD5QruPl8zJhdrbxHh1PIbUc5/Tv2KYGuP7yqarPtc2APsZZqdafLeB0t3uAfLvQG2PIRghMhh KTvNmKuWdN6f3AjorBY6r015qWKooCgk0Qb7miZJidtSZ4Ml1mL9bHl1LnqPZ8/nqKOcqSn7MuG /3WuN6euDnWbf48PMw1tv1i2NUqelGyQnKNyIfl5oJbl0RofoP5c2AkzMB0YPXCHajIhjg8huP6 nuUGTNlUnVGP5JAO0Cmu1O/Eo5htlNJg+ae9/XIFjbT1rTSYEQxtUq92Y6H0ipX7ll76vZahJEp BaJAyfw26/V25Av7Qs1BgXd8ZWciOI45Pzo8/i8vAoXsS0TdAiIHmSpIxC+Z4fbdUN2l1EAnmK5 xofQUbrWeqSTJ0KRpcxBRb2oXPsTm7PCTfSYN7tvnJ2UimFIUVJ3NWVTB7ko2GrlyzxPU7r3zH6 OhUTJks13zgfaUn73MXu7IvvCgtAMs= X-Received: by 2002:a05:600c:3b8f:b0:490:688b:f9f8 with SMTP id 5b1f17b1804b1-490a29513efmr326798805e9.27.1780389967185; Tue, 02 Jun 2026 01:46:07 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:06 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 13/51] ada: Further streamlining work Date: Tue, 2 Jun 2026 10:45:01 +0200 Message-ID: <20260602084541.3829876-13-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Eric Botcazou This streamlines Build_Task_Allocate_Block from Exp_Ch9 by making it return the block statement only, changes Add_Task_Actuals_To_Build_In_Place_Call to deal with the master and activation chain actuals more consistently, as well as flattens an inner block in Make_Build_In_Place_Call_In_Allocator. No functional changes. gcc/ada/ChangeLog: * exp_ch9.ads (Build_Task_Allocate_Block): Change return type. * exp_ch9.adb (Build_Task_Allocate_Block): Likewise. Build an internal block entity instead of declaring an implicit label. * exp_aggr.adb (Convert_Aggr_In_Allocator): Adjust to above change. * exp_ch4.adb (Expand_N_Allocator): Likewise. * exp_ch6.adb (Add_Task_Actuals_To_Build_In_Place_Call): Add default value for Master_Actual parameter, change name of 4th parameter to Chain_Actual and deal with them consistently. (Make_Build_In_Place_Call_In_Allocator): Flatten block statement. Adjust call to Add_Task_Actuals_To_Build_In_Place_Call. (Make_Build_In_Place_Call_In_Anonymous_Context): Likewise. (Make_Build_In_Place_Call_In_Assignment): Likewise. (Make_Build_In_Place_Call_In_Object_Declaration): Likewise. * exp_ch7.adb (Build_Cleanup_Statements): Minor tweak. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_aggr.adb | 2 +- gcc/ada/exp_ch4.adb | 2 +- gcc/ada/exp_ch6.adb | 183 ++++++++++++++++++++----------------------- gcc/ada/exp_ch7.adb | 2 +- gcc/ada/exp_ch9.adb | 13 ++- gcc/ada/exp_ch9.ads | 3 +- 6 files changed, 94 insertions(+), 111 deletions(-) diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index 2f653dd123e..d0c25e8346a 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -3727,7 +3727,7 @@ package body Exp_Aggr is begin if Has_Task (Typ) then - Insert_Actions (N, Build_Task_Allocate_Block (Aggr, Stmts)); + Insert_Action (N, Build_Task_Allocate_Block (Aggr, Stmts)); else Insert_Actions (N, Stmts); end if; diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index fa567d32e5a..f39c80337e7 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -5089,7 +5089,7 @@ package body Exp_Ch4 is -- create a specific block to activate the created tasks. if Has_Task (Etyp) then - Insert_Actions (N, + Insert_Action (N, Build_Task_Allocate_Block (N, Init_Stmts), Suppress => All_Checks); else diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 6d434507d45..e43e360ec7b 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -175,20 +175,19 @@ package body Exp_Ch6 is procedure Add_Task_Actuals_To_Build_In_Place_Call (Function_Call : Node_Id; Function_Id : Entity_Id; - Master_Actual : Node_Id; - Chain : Node_Id := Empty); + Master_Actual : Node_Id := Empty; + Chain_Actual : Node_Id := Empty); -- Ada 2005 (AI-318-02): For a build-in-place call, if the result type - -- contains tasks, add two actual parameters: the master, and a pointer to - -- the caller's activation chain. Master_Actual is the actual parameter + -- contains tasks, add two actual parameters: the master, and a pointer + -- to the activation chain to pass. Master_Actual is the actual parameter -- expression to pass for the master. In most cases, this is the current - -- master (_master). The two exceptions are: If the function call is the + -- master (_master). The two exceptions are: if the function call is the -- initialization expression for an allocator, we pass the master of the - -- access type. If the function call is the initialization expression for a - -- return object, we pass along the master passed in by the caller. In most - -- contexts, the activation chain to pass is the local one, which is - -- indicated by No (Chain). However, in an allocator, the caller passes in - -- the activation Chain. Note: Master_Actual can be Empty, but only if - -- there are no tasks. + -- access type; if the function call is the initialization expression for + -- a return object, we pass along the master passed in by the caller. And + -- Chain_Actual is the reference to the activation chain to pass. In most + -- cases, the activation chain to pass is the local one (_chain). However, + -- in an allocator, it's the activation chain of the task allocation block. function Caller_Known_Size (Func_Call : Node_Id; @@ -628,18 +627,17 @@ package body Exp_Ch6 is procedure Add_Task_Actuals_To_Build_In_Place_Call (Function_Call : Node_Id; Function_Id : Entity_Id; - Master_Actual : Node_Id; - Chain : Node_Id := Empty) + Master_Actual : Node_Id := Empty; + Chain_Actual : Node_Id := Empty) is - Loc : constant Source_Ptr := Sloc (Function_Call); + Loc : constant Source_Ptr := Sloc (Function_Call); + Actual : Node_Id; - Chain_Actual : Node_Id; Chain_Formal : Node_Id; Master_Formal : Node_Id; begin - pragma Assert (Ekind (Function_Id) in E_Function - | E_Subprogram_Type); + pragma Assert (Ekind (Function_Id) in E_Function | E_Subprogram_Type); -- No such extra parameters are needed if there are no tasks @@ -661,27 +659,22 @@ package body Exp_Ch6 is Chain_Formal := Build_In_Place_Formal (Function_Id, BIP_Activation_Chain); - Chain_Actual := Make_Null (Loc); - Analyze_And_Resolve (Chain_Actual, Etype (Chain_Formal)); - Add_Extra_Actual_To_Call - (Function_Call, Chain_Formal, Chain_Actual); + Actual := Make_Null (Loc); + Analyze_And_Resolve (Actual, Etype (Chain_Formal)); + Add_Extra_Actual_To_Call (Function_Call, Chain_Formal, Actual); end if; return; end if; - Actual := Master_Actual; - -- Use a dummy _master actual in case of No_Task_Hierarchy if Restriction_Active (No_Task_Hierarchy) then Actual := Make_Integer_Literal (Loc, Library_Task_Level); - - -- In the case where we use the master associated with an access type, - -- the actual is an entity and requires an explicit reference. - - elsif Nkind (Actual) = N_Defining_Identifier then - Actual := New_Occurrence_Of (Actual, Loc); + elsif Present (Master_Actual) then + Actual := Master_Actual; + else + Actual := Make_Identifier (Loc, Name_uMaster); end if; -- Locate the implicit master parameter in the called function @@ -702,29 +695,25 @@ package body Exp_Ch6 is -- Create the actual which is a pointer to the current activation chain if Restriction_Active (No_Task_Hierarchy) then - Chain_Actual := Make_Null (Loc); - - elsif No (Chain) then - Chain_Actual := + Actual := Make_Null (Loc); + elsif Present (Chain_Actual) then + Actual := + Make_Attribute_Reference (Loc, + Prefix => Chain_Actual, + Attribute_Name => Name_Unrestricted_Access); + else + Actual := Make_Attribute_Reference (Loc, Prefix => Make_Identifier (Loc, Name_uChain), Attribute_Name => Name_Unrestricted_Access); - - -- Allocator case; make a reference to the Chain passed in by the caller - - else - Chain_Actual := - Make_Attribute_Reference (Loc, - Prefix => New_Occurrence_Of (Chain, Loc), - Attribute_Name => Name_Unrestricted_Access); end if; - Analyze_And_Resolve (Chain_Actual, Etype (Chain_Formal)); + Analyze_And_Resolve (Actual, Etype (Chain_Formal)); -- Build the parameter association for the new actual and add it to the -- end of the function's actuals. - Add_Extra_Actual_To_Call (Function_Call, Chain_Formal, Chain_Actual); + Add_Extra_Actual_To_Call (Function_Call, Chain_Formal, Actual); end Add_Task_Actuals_To_Build_In_Place_Call; ----------------------- @@ -8670,15 +8659,18 @@ package body Exp_Ch6 is Func_Call : constant Node_Id := Unqual_Conv (Function_Call); Func_Id : constant Entity_Id := Get_Function_Entity (Func_Call); Result_Subt : constant Entity_Id := Available_View (Etype (Func_Id)); + Has_Tasks : constant Boolean := Might_Have_Tasks (Result_Subt); - Ref_Func_Call : Node_Id; - New_Allocator : Node_Id; - Return_Obj_Access : Entity_Id; -- temp for function result - Temp_Init : Node_Id; -- initial value of Return_Obj_Access Alloc_Form : BIP_Allocation_Form; + Assign : Node_Id; + Chain : Node_Id; -- activation chain, in case of tasks + Master : Node_Id; -- master, in case of tasks + New_Allocator : Node_Id; Pool_Actual : Node_Id; -- Present if Alloc_Form = User_Storage_Pool + Ref_Func_Call : Node_Id; + Return_Obj_Access : Entity_Id; -- temp for function result Return_Obj_Actual : Node_Id; -- the temp.all, in caller-allocates case - Chain : Entity_Id; -- activation chain, in case of tasks + Temp_Init : Node_Id; -- initial value of Return_Obj_Access begin -- Mark the call as processed as a build-in-place call @@ -8821,58 +8813,54 @@ package body Exp_Ch6 is -- that the full types will be compatible, but the types not visibly -- compatible. - elsif Nkind (Function_Call) - in N_Type_Conversion | N_Unchecked_Type_Conversion + elsif Nkind (Function_Call) in N_Type_Conversion + | N_Unchecked_Type_Conversion then Ref_Func_Call := Unchecked_Convert_To (Acc_Type, Ref_Func_Call); end if; - declare - Assign : constant Node_Id := - Make_Assignment_Statement (Loc, - Name => New_Occurrence_Of (Return_Obj_Access, Loc), - Expression => Ref_Func_Call); - -- Assign the result of the function call into the temp. In the - -- caller-allocates case, this is overwriting the temp with its - -- initial value, which has no effect. In the callee-allocates case, - -- this is setting the temp to point to the object allocated by the - -- callee. Unchecked_Convert is needed for T'Input where T is derived - -- from a controlled type. + -- Assign the result of the function call into the temporary. In the + -- caller-allocates case, this is overwriting the temporary with its + -- initial value, which has no effect. In the callee-allocates case, + -- this is setting the temporary to point to the object allocated by + -- the callee. - Actions : List_Id; - -- Actions to be inserted. If there are no tasks, this is just the - -- assignment statement. If the allocated object has tasks, we need - -- to wrap the assignment in a block that activates them. The - -- activation chain of that block must be passed to the function, - -- rather than some outer chain. + Assign := + Make_Assignment_Statement (Loc, + Name => New_Occurrence_Of (Return_Obj_Access, Loc), + Expression => Ref_Func_Call); - begin - if Might_Have_Tasks (Result_Subt) then - Actions := - Build_Task_Allocate_Block (Allocator, New_List (Assign)); - Chain := Activation_Chain_Entity (Last (Actions)); - else - Actions := New_List (Assign); - Chain := Empty; - end if; + -- If the allocated object has tasks, we need to wrap the assignment in + -- a block that activates them. The activation chain of that block must + -- be passed to the function rather than some outer chain. - -- See the Needs_Cleanup predicate in Expand_Allocator_Expression + if Has_Tasks then + Assign := Build_Task_Allocate_Block (Allocator, New_List (Assign)); + Master := New_Occurrence_Of (Master_Id (Acc_Type), Loc); + Chain := + New_Occurrence_Of ( + Defining_Identifier (First (Declarations (Assign))), Loc); + else + Master := Empty; + Chain := Empty; + end if; - if Alloc_Form = Caller_Allocation - and then not For_Special_Return_Object (Allocator) - and then not (Is_Entity_Name (Name (Func_Call)) - and then No_Raise (Entity (Name (Func_Call)))) - and then not Restriction_Active (No_Exception_Propagation) - and then RTE_Available (RE_Free) - and then not Debug_Flag_QQ - then - Insert_Action (Allocator, - Build_Cleanup_For_Allocator (Loc, - Return_Obj_Access, Storage_Pool (Allocator), Actions)); - else - Insert_Actions (Allocator, Actions); - end if; - end; + -- See the Needs_Cleanup predicate in Expand_Allocator_Expression + + if Alloc_Form = Caller_Allocation + and then not For_Special_Return_Object (Allocator) + and then not (Is_Entity_Name (Name (Func_Call)) + and then No_Raise (Entity (Name (Func_Call)))) + and then not Restriction_Active (No_Exception_Propagation) + and then RTE_Available (RE_Free) + and then not Debug_Flag_QQ + then + Insert_Action (Allocator, + Build_Cleanup_For_Allocator (Loc, + Return_Obj_Access, Storage_Pool (Allocator), New_List (Assign))); + else + Insert_Action (Allocator, Assign); + end if; -- Add implicit actuals for the BIP formal parameters, if any @@ -8886,10 +8874,7 @@ package body Exp_Ch6 is (Func_Call, Func_Id, Ptr_Typ => Acc_Type); Add_Task_Actuals_To_Build_In_Place_Call - (Func_Call, - Func_Id, - Master_Actual => Master_Id (Acc_Type), - Chain => Chain); + (Func_Call, Func_Id, Master_Actual => Master, Chain_Actual => Chain); -- Add an implicit actual to the function call that provides access -- to the allocated object. An unchecked conversion to the (specific) @@ -9008,7 +8993,7 @@ package body Exp_Ch6 is (Func_Call, Func_Id); Add_Task_Actuals_To_Build_In_Place_Call - (Func_Call, Func_Id, Make_Identifier (Loc, Name_uMaster)); + (Func_Call, Func_Id); -- Pass a null value to the function since no return object is -- available on the caller side. @@ -9069,7 +9054,7 @@ package body Exp_Ch6 is (Func_Call, Func_Id); Add_Task_Actuals_To_Build_In_Place_Call - (Func_Call, Func_Id, Make_Identifier (Loc, Name_uMaster)); + (Func_Call, Func_Id); -- Add an implicit actual to the function call that provides access to -- the caller's return object. @@ -9401,7 +9386,7 @@ package body Exp_Ch6 is else Add_Task_Actuals_To_Build_In_Place_Call - (Func_Call, Func_Id, Make_Identifier (Loc, Name_uMaster)); + (Func_Call, Func_Id); end if; Add_Access_Actual_To_Build_In_Place_Call diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index c62529c4908..292327c67c5 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -1450,7 +1450,7 @@ package body Exp_Ch7 is New_Occurrence_Of (RTE (RE_Expunge_Unactivated_Tasks), Loc), Parameter_Associations => New_List ( - New_Occurrence_Of (Activation_Chain_Entity (N), Loc)))); + Make_Identifier (Loc, Name_uChain)))); -- Attempt to cancel an asynchronous entry call whenever the block which -- contains the abortable part is exited. diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index 77e19f905bd..e4a991074e1 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -4565,15 +4565,18 @@ package body Exp_Ch9 is function Build_Task_Allocate_Block (N : Node_Id; - Init_Stmts : List_Id) return List_Id + Init_Stmts : List_Id) return Node_Id is Loc : constant Source_Ptr := Sloc (N); Chain : constant Entity_Id := Make_Defining_Identifier (Loc, Name_uChain); - Blkent : constant Entity_Id := Make_Temporary (Loc, 'A'); + Blkent : constant Entity_Id := + New_Internal_Entity (E_Block, Current_Scope, Loc, 'B'); Block : Node_Id; begin + Set_Etype (Blkent, Standard_Void_Type); + Append_To (Init_Stmts, Make_Procedure_Call_Statement (Loc, Name => New_Occurrence_Of (RTE (RE_Activate_Tasks), Loc), @@ -4603,11 +4606,7 @@ package body Exp_Ch9 is Set_Activation_Chain_Entity (Block, Chain); - return New_List ( - Make_Implicit_Label_Declaration (Loc, - Defining_Identifier => Blkent, - Label_Construct => Block), - Block); + return Block; end Build_Task_Allocate_Block; ----------------------------------- diff --git a/gcc/ada/exp_ch9.ads b/gcc/ada/exp_ch9.ads index 3d882f2262d..8101636610e 100644 --- a/gcc/ada/exp_ch9.ads +++ b/gcc/ada/exp_ch9.ads @@ -109,11 +109,10 @@ package Exp_Ch9 is function Build_Task_Allocate_Block (N : Node_Id; - Init_Stmts : List_Id) return List_Id; + Init_Stmts : List_Id) return Node_Id; -- This function is used for allocators where the designated type is a task -- or contains tasks. In this case, the initialization call is replaced by: -- - -- blockname : label; -- blockname : declare -- _Chain : Activation_Chain; -- From patchwork Tue Jun 2 08:45:02 2026 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: 136240 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 631E54BA23D9 for ; Tue, 2 Jun 2026 08:51:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 631E54BA23D9 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=Gg1X+OgU X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id E572B4BA2E37 for ; Tue, 2 Jun 2026 08:46:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E572B4BA2E37 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 E572B4BA2E37 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389969; cv=none; b=U5C7nuAVlDTArZwuHX6NZWx05M69Dq5v1Sc1brYCZM8aZr/6k0hX9F5eEXLl6Jz7GlLrT3s7877LoBVpIoIsKyR0fAsmCKq3Jka5D7HPpIRU7D+Kgpx2Si7qsWbHLzUuiuFJqOshyF2t1Js93Gf/uIqJYKpgRCXewbbZ6Du04VA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389969; c=relaxed/simple; bh=pSF2HxzvFDRfUVX8PsmzJp93iX1FCl2Hg0XcTrKSLBo=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=DD7QtIVbTCzsZub4+3/HZrqGWapmWmx8P0aUZfwlTEghz0LE2pdelFWsA1BVzrLmuSTlWy9skIdNBzKwnfi3l0hzZ4ynXtj0o3RlZ8Gwum0/e0ju2lCp0cC9hegIrjT114U/2+4cIUCohHQFGPjohTTgkeD8ZlO3HhwsEu6mdLw= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=Gg1X+OgU DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E572B4BA2E37 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4905529b933so85884145e9.0 for ; Tue, 02 Jun 2026 01:46:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389968; x=1780994768; 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=OqZ6BJ1RjVGLHrLxGKRUCti7fWSiLAZFQxAdV/cv5og=; b=Gg1X+OgUXvXZ6xqsdzG+yIcWqxVtCoycAA+cFuqmLJW35IOpr751ar1ag+tLiDAAlv FH7Xjvj1kDxueR6hPVRdty6QuOtetDeBeyH1IX+Q9xi9UZENQJKFXg+GsHkTEQO1UoU6 7X+mKvg0IZuTJbWGUxBfk+Lhj0/iL+KLCTgyXKJUEoDx1Mk0yIZQIrUWp7uT7MbxnbpB EARvkyyWaKVSw0KBCKKpm0Lz6UxdZnNKCBv9kNxdres64FzxQZWGWCs9Mb69GRKATss1 /mYjHbqfye3PPX2/L+j6fF33dwgYX2qW7dZ2BwkcI2+dqOTR/dcX4FEF4NbCXNio7hst vAhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389968; x=1780994768; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=OqZ6BJ1RjVGLHrLxGKRUCti7fWSiLAZFQxAdV/cv5og=; b=tDVWfQyxUxELeDnlFggLx+PQw/lC/sP20QNAIZH3U0TWTR5KCPIKaSp/7xjPctpBJs u7r2hAORA8B+cCXlF5Ajf2mA3SkMPxqAncahRNP3k6qWM7JeMLVK4qDp4etCjUSu+Wwj bx11ThQUtC00Z859x6I0PO2zscrKqwxxB5XlyyR9O4EB9Vi9feglK5ZTTzvXkdAUQ5GB ELfjVDi10jx93/J0nM10cknGxkcL0h/QCHqyTyIEhBQmeUjfZEkL9R6G+l0ptTIV+KA8 OjLf+C6Iz7X8mIjF1D6IRARPtKBUAvJBIkG2EOG9ljlMlrL2Uz+CxI+On07MU3bdzcGU CpXw== X-Gm-Message-State: AOJu0YwsWVoUKBPzlo8qxZndYtBQpLsFQLLR/QSMCOLSxZNXu7owvMIM kgUBxzLfeeHonLGRGvoxF+QTKDdCM7Dts8iLh/QTcKC+CeeEK1f1B8txwe13FTtmFHS52sLGRQG U34M= X-Gm-Gg: Acq92OFcegL8L8XtDS7HgcRVLdhyeTYETiggiQAJlxGt0ceVQ8+tFXMh0tMQ4k1f3ew LUsuKzfI6bNWQAcCAcunEb2bXlVdOA6H9QkNLWhZPoWiqjttwQEQZ3OZt6lQGQSrAOTeVEIJ/2p VXJh2a/CF7uROW0Yps74NnfRtAZEZyhaA1D5gsESv9bPCqRW1qhyau/Dhs/EyuLbJy+cbwJapN1 CnmEgicTNMvSDvU9sWg273JqOx2JdcAvCTBBvNEf41dvPui5QYvN7PICey4XnsncOmJNLIe9Nv4 wO8ZxZd3UU4rD8CQC6OmDiizwb53g2+alovzAcH98lU84za3aIewLGhqYJHrMQ8u9cv/DzWcAu7 uUme91EBMiy/LhlE9t+4lqIRxt01D+3AkDaDraXL5Q1iEzxHW3cp0tEe0gbUpD+oU5CSdi1i/SD s5RUWxuBhU0S8LZ9SAiUkZz+tf2HrH9JyR7bXJmAk1nlwxGdoY3NLqG624jhWme2613g7p4OoKu n9ozyvcQx5YmsAOFjL+xPBamQxbEVU= X-Received: by 2002:a05:600d:844f:20b0:490:9dc3:3473 with SMTP id 5b1f17b1804b1-490a2923a64mr204735575e9.2.1780389967878; Tue, 02 Jun 2026 01:46:07 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:07 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Viljar Indus Subject: [COMMITTED 14/51] ada: Fix SPARK RM 6.9(23) check for limited private types Date: Tue, 2 Jun 2026 10:45:02 +0200 Message-ID: <20260602084541.3829876-14-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Viljar Indus The Check_Ghost_Equality_Op predicate was checking the type directly instead of its underlying type, so a limited private type whose full view is a non-limited record was incorrectly bypassing the check. Additionally, the check was never deferred to Process_Full_View, so equality operators declared in the visible part of a package were not re-checked once the full view became available. gcc/ada/ChangeLog: * ghost.adb (Check_Ghost_Equality_Op): Use Underlying_Type to look through the private view before checking Is_Record_Type and Is_Limited_Record. * sem_ch3.adb (Process_Full_View): After completing the full view, re-check any primitive equality operators on the private type against SPARK RM 6.9(23) via Check_Ghost_Equality_Op. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/ghost.adb | 10 +++++++++- gcc/ada/sem_ch3.adb | 21 +++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/gcc/ada/ghost.adb b/gcc/ada/ghost.adb index a87d044524b..afa6b97947f 100644 --- a/gcc/ada/ghost.adb +++ b/gcc/ada/ghost.adb @@ -1072,12 +1072,20 @@ package body Ghost is ----------------------------- procedure Check_Ghost_Equality_Op (Eq_Op : Entity_Id; Typ : Entity_Id) is + Underlying : constant Entity_Id := Underlying_Type (Typ); begin if not Is_Ghost_Entity (Eq_Op) then return; end if; - if not Is_Record_Type (Typ) or else Is_Limited_Record (Typ) then + -- Look through any private view to get the underlying record type, + -- since a limited private type whose full view is a non-limited record + -- does not have "only limited views" and must be checked. + + if No (Underlying) + or else not Is_Record_Type (Underlying) + or else Is_Limited_Record (Underlying) + then return; end if; diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 99799431d87..bc02601fe0c 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -22515,6 +22515,27 @@ package body Sem_Ch3 is (Underlying_Full_View (Full_T), Priv_T); end if; + -- Now that the full view is known, check any primitive equality + -- operators declared in the visible part against SPARK RM 6.9(23). + -- This check is deferred from Check_For_Primitive_Subprogram because + -- the full view of a private type is not available when the operator + -- is declared in the visible part of the package. + + if Has_Primitive_Operations (Priv_T) then + declare + Prim : Elmt_Id := First_Elmt (Primitive_Operations (Priv_T)); + Op : Entity_Id; + begin + while Present (Prim) loop + Op := Node (Prim); + if Chars (Op) = Name_Op_Eq then + Check_Ghost_Equality_Op (Op, Priv_T); + end if; + Next_Elmt (Prim); + end loop; + end; + end if; + <> Restore_Ghost_Region (Saved_Ghost_Config); end Process_Full_View; From patchwork Tue Jun 2 08:45:03 2026 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: 136242 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 925BA4BA2E37 for ; Tue, 2 Jun 2026 08:51:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 925BA4BA2E37 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=FJ8Nby3v X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id 8EA1B4BA2E2F for ; Tue, 2 Jun 2026 08:46:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8EA1B4BA2E2F 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 8EA1B4BA2E2F Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389969; cv=none; b=H+XfTltBBIHyIvEcE38UR2CUM9dqTztLYCm5TlzJWxZ4vFFl3i4Qzxfx+wCTkuGFSCVBJ/S0SE/fcQ+v+32UkN7QQq+S7ZP2WAnsyGdGz2zOYt/glnN8mkdgl7TvfF4+VJqCPQB7jQLTgqG2mK1Z/LzPZIpFKdZ4UXVM1NKV58I= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389969; c=relaxed/simple; bh=WfHE8mgfxSHMQb7dmjPHxvTAlRDHdFU2dmub+mt7VPo=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=An6KDn40VTh7YRK8DA8KbUXxykRTpv4xcWMlMxVm5dt8zQTOTF1buIDyDTpYVjXvnhZ99olDjMFHUsHfIZrgyV+geSZmfu3R7JtiBfLpCNykjrbPXF/mZRgQPZFIdbyweafGJuHfPpDqEhrdRdV8rN4HXjmaBKXAej35wWCsNMw= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=FJ8Nby3v DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8EA1B4BA2E2F Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-49068493267so62486465e9.1 for ; Tue, 02 Jun 2026 01:46:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389968; x=1780994768; 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=xbXFZ7TSXRoOD/iJZ3u8zsbph4KG5N8kEXjGwRmu+Ko=; b=FJ8Nby3vybApw4RNuBsfo29BYsnSPwGYROJIKuYs7wXFTEOSfohsDAd6KRrEaPczhj BnfzwJyVFWccZeuLS+l5mYkI7hdZdNHYVgaztaVC5W1iFxxqmxmwcysasrSWK+Iglvg+ 3V+Tb3Wfvg4HyCahXFkbPNooRgKybz0KYL3Iu2Agbb4Uc2+62AKb86HJ7PDtRBe0zu2U YMw9TlCRz51QkVUqt2rgj6X0pLShuBNMICOOZCViB/+aemrlE0xhYvuQSR3yM9DVsA5k eHz1A0xytazE4eCt4AmKIPspo46NCPYeC8XkoSD45oWeIQ1UN3sXliAP8lkZXAxZ+P64 ANJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389968; x=1780994768; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=xbXFZ7TSXRoOD/iJZ3u8zsbph4KG5N8kEXjGwRmu+Ko=; b=cVku0zRe1/YdhhVrtsThTPBbbSwI7VMMyskhoZ3Dr8Z7s5NOCZ2xYctdo9ZGvO5UDU PoIh9+em98bJAjuEzwDHD9v0P5/HiAShAMIKPGMxIDGlNDUT2pZOM08udVRbtjXEBiKK AjXRHqmFVaSZtHO69rOQI6r2+/PaAFDc+7MYr36d4BtGOJrHvHw45UlLSDO7j9WgnPiX 2uvysVWl6TJM2UwXsUzUIL19Xf1GYYYYAdZD7ihBEb7a+PYBBxlFxmFtXrqTt/V/enww AyXTUukhM0AQAA+oYX3PLMk0pEbT+IwiGrKEAENWAPdCVdjwK6/jyEQWW2z5GYtkpZvP P9ZQ== X-Gm-Message-State: AOJu0YwivfKUlyjDU71vK8zleuvdkA+S08P03oYkcg8NN5DJoD62RbLT CA2+CDcVK6qimBECiIAM4WrAiASmpVJ3YgFjZlzbX6Aeh0pBdF6PMSdzRlCqN9AeQnCTelnK8hV l2Hc= X-Gm-Gg: Acq92OHDyUuWkB4tjUxaNsq0xg+UfmPD6kpelhXh9prbivvwSvR4l7SunPg6wvF5eeP KXOdkzoreTRU10avFnqdiJH7ikCjVgemkrj7/VEHUy7L46yhjVLGO5vpaV2vszu6UdEaA62al6n km45uHjWOSDbE//EHAXUFRgFb5Hh/V1BACY/LDayis943oowLcgF264B+or+Ebq+jQjt4auRsCc T2YO/J1rhfSxLn57FiOBjF7QQwF1FWUOUiJh3p9+rv/uCg4SxwBOUAh1EchIWcQ4THWcLDu4hWK flL3WEt4kcqW8TIfbQk7geW0zqjPNf+ae8paui+SkXGKT2dLMieSxBYhqEgHGSNalXZDTPmQQj+ 0d3BD47S3CoBVaBz3TytUWpd5xL08AHm/vTP+vLFPDLWGhiBK/DZQ6v/kKGk+3XLs07ix0wrAxg 9TwOjEWfaDKU7snWbMYqWs+klhftiAwdsGEZPAOKE3W8TvuIFHhhTYAifhhkW5LdDUVdy2LQ3g8 3pmUntaRW57g6Eth+Dua3UtAPW7BOkFfDRPPy4Zug== X-Received: by 2002:a05:600c:4714:b0:490:a296:fdad with SMTP id 5b1f17b1804b1-490a296fe25mr239688335e9.24.1780389968557; Tue, 02 Jun 2026 01:46:08 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:08 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Mathias Aparicio Subject: [COMMITTED 15/51] ada: Fix memory leak in __gnat_setenv Date: Tue, 2 Jun 2026 10:45:03 +0200 Message-ID: <20260602084541.3829876-15-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Mathias Aparicio Before this patch, the code executed on Linux used `putenv`, which requires a memory allocation. However, the memory was explicitly freed only for Windows (`__MINGW32__`) and older VxWorks targets. Because Linux fell into the allocation block but not the free block, there was a memory leak. To fix the leak, `__gnat_setenv` now calls `setenv` for Linux, doing the same thing we were already doing for macOS. Note that putting Linux in the Windows block is not a solution because, on Linux, `putenv` uses the pointer directly and does not copy the string. Therefore, if the memory were freed right away, there would be a use-after-free. To be careful, we do not use `setenv` everywhere else (except for old VxWorks targets and Windows), because there might be problems with other configurations if we do so. gcc/ada/ChangeLog: * env.c (__gnat_setenv): Add __linux__ preprocessor macro directive to the setenv block. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/env.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/ada/env.c b/gcc/ada/env.c index 2931220f069..d37d2bc7a02 100644 --- a/gcc/ada/env.c +++ b/gcc/ada/env.c @@ -100,10 +100,11 @@ void __gnat_setenv (char *name, char *value) { #if (defined (__vxworks) && (defined (__RTP__) || _WRS_VXWORKS_MAJOR >= 7)) \ - || defined (__APPLE__) + || defined (__APPLE__) \ + || defined (__linux__) setenv (name, value, 1); -#else +#else /* Why don't we use setenv on all platforms where it's available??? */ size_t size = strlen (name) + strlen (value) + 2; char *expression; From patchwork Tue Jun 2 08:45:04 2026 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: 136244 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 230CA4BA2E39 for ; Tue, 2 Jun 2026 08:54:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 230CA4BA2E39 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=lGcBS8Yp X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id F12424BA2E3F for ; Tue, 2 Jun 2026 08:46:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F12424BA2E3F 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 F12424BA2E3F Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389971; cv=none; b=oLlRlE6D19A4poT4l7iagDOqc239OwDKhOOs47nQQYGQYinWyqess1fJ70PpvD1xwIyV86u1I6wG156P6bbiYH931PwUsHVIJZQZJdThmqUw90JrfPZCVMuP22j3KRXutXYpja6Z5zk2VZbC5rRlnWxXBoPnPv5aogJ4AMuoZBA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389971; c=relaxed/simple; bh=vZpnn8eLhXK9Qv/MAFk6Fcb5ZtsE0wArdYA2DZ+omvc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ayVM+W3FD76YbdOKh62D7qpTpamaHkSFtUv9GUsriIGT4nmfwgUk0aSNDnhNJq/Jqw5nLynwsATnkM1yGE2TH3Wg852CJWipXOHfpMp58fZrJc4uStpIQuhsbbJPzvx6B+DsyH0mNr4CkroYb9EELYWzBa2yVgSZgYt7Efo7kMw= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=lGcBS8Yp DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F12424BA2E3F Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4909e3fa4b2so39352005e9.0 for ; Tue, 02 Jun 2026 01:46:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389970; x=1780994770; 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=9B9io6HTTA8UbBUMROzTw4Lclzc1ncgbjx3cZH1GTz4=; b=lGcBS8YptjmW4U0U+1K3nZGqOi3BzxiIntV26RLCtlwKj3bjSH4UWV6mL41b+HLse2 eFqXGx+PhZ7BIKOMgfrESNiG1ax1+r3EixNRXfTVrxO2GWnOfHjmtyvodEFZeIL2DQV3 CLunf3Y+u9B0aYFz8YcR1s6guICuGTsu6qyOYn7v/ml6ExiSdIKZzSjVy2zFmEeSTfmz y1jMjYV52ldufwpSNEBM+rClR/CSuXYJ0N6deVAa16gHoOV5YHc+AZHASytsgxfV8gzH dEqmMvMleXFxWH+Pj7Xqt3OapBnLxsA2hoh3MUskL+c6IsHDPWDqdOSjrdY9aTKH1xMq LasQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389970; x=1780994770; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=9B9io6HTTA8UbBUMROzTw4Lclzc1ncgbjx3cZH1GTz4=; b=SX8Hi75FH223wb43GfCyeUQuVo1kCyAnaDtNkcmZesQslQ6g/OtqUNI81/2JleT2uJ yqFzCXwJ5Kxm3tMtrtu6UKNW/ZS7er2+Ro0Bhv8GoUGM4dJFFRZlriWlV5SofO8NG0kl T/rJhGo25UETY5NdcI+FOIsF/smneoDRxUG/kY1FC2EtLFnPLxrCOxasBodLI1nbmtfF x+GhoRqbUioaIe9LJAPb6pjZLWX/uxFO7sIUpb/gRJpoGReH8AU4r6DuIp1oYSbnEayj MJ0YSdFEjGdNmoYQkDLxjakU7lKzOsGWQdskFtYRVnCe9U5qq7eOimOG8aausba5/KzR Q4KA== X-Gm-Message-State: AOJu0Yz13on1ybLyLQ1CVWOPA+M+nzuJOrcdxGYoAJKVxGpQpftnPu7E dRw7AJ6r8CD4Dyt2erIgZLACLH02JIkM9kaaX9zL/we5TeOEmRh59A97xbTtZ8fh+5LHiRCzHFL ACWo= X-Gm-Gg: Acq92OESdL43afyQOrdN/kXcRMeooxrxZa2qognjSZTIThHdF2L1/ODeJ7cfn273xkI QNmAfp97ZBxmyhsPJyy6LGLIY7TE3QtkQB5vZDOOacZsrvSHS+zB5ZLkr6McV7i5iDftYJyHBoK cc0SZw2ENKzSE8rJKRg5frm/JQ03ufYVCipoqOTXtYPnmjMTEYBGcckuCKt0ohQWHQnk929KE/W l7HtFVdGPM0pmIU7lwzlbedpLF4NG/bMVpiDTAdUclvzQBEpnSeXzNOSW1SafUxw7ce5yspnhg+ 0p6KMsdhb/IIQWZq3EU2ysQCukH6Jqrtp6XuEvdvg+lPk85GCAWOP3aZXrDSfs5gEPqRk+/I5c1 S8kzBHgsS9aERM/IbIeVFw6gcpvVjVYFkPKxvnxM7LximT0UM4YrTaqEINWjrq1XYyyRwSzLOa8 0+x8+NDJogPWT3801KSPUKfIUrkIqDCgOp/V4ieDKoq1IUQLrBwQK4RM/C4gLA16xF7FwtmkHn0 XmU/6MIEEf4CsNmGq7sKV41ixAb+KpnJVFWjT4kZw== X-Received: by 2002:a05:600c:8508:b0:489:c57:7836 with SMTP id 5b1f17b1804b1-490a2952644mr236905895e9.27.1780389969883; Tue, 02 Jun 2026 01:46:09 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:08 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Viljar Indus Subject: [COMMITTED 16/51] ada: Improve error message for incorrect call arguments Date: Tue, 2 Jun 2026 10:45:04 +0200 Message-ID: <20260602084541.3829876-16-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Viljar Indus Enumeration literals are considered as zero argument functions. This is not obvious for most users and can create confusing error messages when an enumeration literal is referred to as a call. For example if there are indices applied to it. Instead create a dedicated error message for this scenario. gcc/ada/ChangeLog: * sem_util.adb (Normalize_Actuals): Improve error message. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_util.adb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 89060c31acd..1745accfe59 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -25981,7 +25981,19 @@ package body Sem_Util is if Reporting then if Is_Entity_Name (Name (N)) then - Error_Msg_N ("too many arguments in call to&", Name (N)); + if Ekind (S) = E_Enumeration_Literal then + Error_Msg_N ("cannot index enumeration literal &", Name (N)); + if Present (Homonym (S)) + and then Sloc (Homonym (S)) = Standard_Location + then + Error_Msg_NE + ("\\did you mean & in Standard'?", + Name (N), + Homonym (S)); + end if; + else + Error_Msg_N ("too many arguments in call to&", Name (N)); + end if; else Error_Msg_N ("too many arguments in call", N); end if; From patchwork Tue Jun 2 08:45:05 2026 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: 136255 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 43EDC4BA2E04 for ; Tue, 2 Jun 2026 09:03:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 43EDC4BA2E04 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=C8Tt1oa6 X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by sourceware.org (Postfix) with ESMTPS id CC7B14BA23DE for ; Tue, 2 Jun 2026 08:46:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CC7B14BA23DE 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 CC7B14BA23DE Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389972; cv=none; b=DYJ9HC6JGuAFy47a1tchHybCFnx5/AT/mjoQWwb+8ePKqNyTiDAj3tvhrWpO5nPgHm2LBTTzxwci2W4myscIsPvRk2+tSFoGxz1fOYbPihM4jbonrg27alu9FKubl6gAvCoVvuUjek9aO1jpbzZSmVClqTaSZfnfjXtw44RS8wA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389972; c=relaxed/simple; bh=CqKqb6QSNjuGNF09cG32fkANglGAN9Amik37wOHfhyc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=HpzNVYi3umEwZFq394JkshU7ILBJU/9ybipO5GHMiqDTRe9gr7y2e4Eb6MP/yIbjhF+AqtaLDefr5Qq3r6WnE8jawheK+XN+G5SzWrPmdj9ss8/sReILBeOysjMDfG3WxiQ7SBg+C7EF1mKgaGQtHu2td4D8zPhkQ07zTOr6PGY= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=C8Tt1oa6 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC7B14BA23DE Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-490a765d410so25325815e9.1 for ; Tue, 02 Jun 2026 01:46:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389971; x=1780994771; 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=8mV3tNZX+mxuVSmy79Xqr5VQmTt29hNAwW5uSQ5n9dE=; b=C8Tt1oa6HULitrMU8VOYKNRsImpA2JDF70tKYojUw2/5jtW7mM+e8bH8z6IVFJijzG c17mOAYpfY/3/VtwcVmPd3FIMUom3iCUbuND/wJAXWiSCzosC1R+28bXZ+CZxIaRDPPh KTOzkd5G0HYmZPd97VuYQ7KjEK4wHmdEVBCYKJfOM0Q5fjtRRdMO4CKDNerawE0UKQzt pSk+cZ8FXWTMOqnY01ioEbZ3NYHzdqDkKvOZEXB886AGkMyqd8STDpmK0jT6yAoqJBOX zZFdpatJ84W2cDF4J2ob1V91ntp2+/D4+tTBjPxxw3nalFqhu/9Ukk6wcahZBrU4iyXG IslA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389971; x=1780994771; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=8mV3tNZX+mxuVSmy79Xqr5VQmTt29hNAwW5uSQ5n9dE=; b=ZruT3vU2z2ZQaZs4DOOrPZweaMtZSipR6hRWDa6kzrmZMnDFcmtkTRSuebXCBtjSiT ku3FIv1ZLrz71WAjbTlC66QaQWJPlhW8ATldXBIx4mX4AyzJbjCFpFGFAbo3sFGthEDL ke8V8JPWUP+DIHDUefX6/09SlHutI76IKGvI4ChF6ZwJ5H4Db9rBN4ZsbNufAytF4/oL nWzs1ft2bQ4uF9v+Of2E/D3USzsQAso90EKwTd/lXdKkdsepm1vBAbEck7dPsPSzFLOL Wa6l4jiKTlLWYjioS+VnyYugAxIs6IGAq6LiSHnhMO727Fr5UXKw1JBOMIA9vZFTpYJm DPvw== X-Gm-Message-State: AOJu0YxWF1xv3lvNc7l3r4Zeorlf7QdXOV4xiX3sAlNmjZATbKYWhhuU IJ5u36D7yMbiRr1ScfubVoH3yPXt0VEhMX2a5bjDuBg+916TLip/r3ZMlWV//a9YP+TU0GTBDZW tsLE= X-Gm-Gg: Acq92OErfQ5kOe31gRdVILEO/dqOpvtjTpSyw96d8T1k9VZgO9MCO/M+p7ZD9fV3Xrq 7+5xUAmzHiPIP/JlpcQWwJYdK3HhkI29xx5j17M3LLyJWPi8MzvJh5WO2reBNzsm4t9Fmp7T/Wf Bm9pd4n8kSaSHbpqi6fV6f4uE9GzGaDRNakZLygcByBt/j1hmhJBIXBY//Fv46oBqc9GhwWy1sY V8DdQCLDQBFMexb4Tv0rJppLaUE3jzDOwRN3lQWDodMRTT7bxNIY93X3cChpooFDbxp7pCQJr8h 0y81wNzERs1ebKvhJwvzgkjCtUfyHgl1vo3/B9byLKzhTNEUpoE5MEI+47anZoaGQ6mFX9hPeoA PmkUTreFpPjCrCW6pH0/hCHu6hXp9MPHJ4bzIXy8iRktyg0zHAarCuRj1CR4spxdU5eVkZBgXz0 YulDn60iYJkjpqMLu+l+FH6y/8gdoJRZX79RCU6O7P134VmIUlyRn/seLTZlkMIcZoKMIrAU65A np1W8B3BrrU37K2JZj8G8M7HvLHRTE= X-Received: by 2002:a05:600d:6443:20b0:490:a1be:6b01 with SMTP id 5b1f17b1804b1-490a2923a7cmr205850575e9.4.1780389970640; Tue, 02 Jun 2026 01:46:10 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:10 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Viljar Indus Subject: [COMMITTED 17/51] ada: Support qualified error names from Standard Date: Tue, 2 Jun 2026 10:45:05 +0200 Message-ID: <20260602084541.3829876-17-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Viljar Indus Typically nodes from Standard were not printed without the fully qualified prefix names even when Error_Msg_Qual_Level was set. However in some cases it makes sense to emphasize that the variable is coming from Standard. Add a new variable called Error_Msg_Qual_For_Standard to enable qualified names for entities coming from Standard. gcc/ada/ChangeLog: * err_vars.ads (Error_Msg_Qual_For_Standard): New Variable. * errout.ads (Error_Msg_Qual_For_Standard): Likewise. * errout.adb (Set_Qualification): Print all qualified names when Error_Msg_Qual_For_Standard is set. * sem_util.adb (Normalize_Actuals): Improve error message. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/err_vars.ads | 7 +++++++ gcc/ada/errout.adb | 5 ++++- gcc/ada/errout.ads | 3 +++ gcc/ada/sem_util.adb | 8 +++++--- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/gcc/ada/err_vars.ads b/gcc/ada/err_vars.ads index 45ff26a4d56..179c65a84cf 100644 --- a/gcc/ada/err_vars.ads +++ b/gcc/ada/err_vars.ads @@ -55,6 +55,13 @@ package Err_Vars is -- not get reset by any Error_Msg call, so the caller is responsible -- for resetting it. + Error_Msg_Qual_For_Standard : Boolean := False; + -- Typically we do not want to specify the Standard package when presenting + -- entity names even when Error_Msg_Qual_Level is not zero. However + -- sometimes we want to emphasize the fact that it is the entity from + -- standard. Note that this value does not get reset by any Error_Msg call, + -- so the caller is responsible for resetting it. + Current_Error_Source_File : Source_File_Index := No_Source_File; -- Id of current messages. Used to post file name when unit changes. This -- is initialized to Main_Source_File at the start of a compilation, which diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb index ab5aaf0b737..2c427b7515e 100644 --- a/gcc/ada/errout.adb +++ b/gcc/ada/errout.adb @@ -4129,7 +4129,10 @@ package body Errout is procedure Set_Qualification (N : Nat; E : Entity_Id) is begin - if N /= 0 and then Scope (E) /= Standard_Standard then + if N /= 0 + and then + (Scope (E) /= Standard_Standard or else Error_Msg_Qual_For_Standard) + then Set_Qualification (N - 1, Scope (E)); Set_Msg_Node (Scope (E)); Set_Msg_Char ('.'); diff --git a/gcc/ada/errout.ads b/gcc/ada/errout.ads index be828d55c69..a9756f6b089 100644 --- a/gcc/ada/errout.ads +++ b/gcc/ada/errout.ads @@ -483,6 +483,9 @@ package Errout is -- not get reset by any Error_Msg call, so the caller is responsible -- for resetting it. + Error_Msg_Qual_For_Standard : Boolean renames + Err_Vars.Error_Msg_Qual_For_Standard; + Error_Msg_Warn : Boolean renames Err_Vars.Error_Msg_Warn; -- Used if current message contains a < insertion character to indicate -- if the current message is a warning message. Must be set appropriately diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 1745accfe59..5698b2f0fef 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -25986,10 +25986,12 @@ package body Sem_Util is if Present (Homonym (S)) and then Sloc (Homonym (S)) = Standard_Location then + Error_Msg_Qual_For_Standard := True; + Error_Msg_Qual_Level := 1; Error_Msg_NE - ("\\did you mean & in Standard'?", - Name (N), - Homonym (S)); + ("\\did you mean &'?", Name (N), Homonym (S)); + Error_Msg_Qual_For_Standard := False; + Error_Msg_Qual_Level := 0; end if; else Error_Msg_N ("too many arguments in call to&", Name (N)); From patchwork Tue Jun 2 08:45:06 2026 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: 136247 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F39284BA7980 for ; Tue, 2 Jun 2026 08:56:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F39284BA7980 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=HzqVt7kB X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by sourceware.org (Postfix) with ESMTPS id 65E914BA23DC for ; Tue, 2 Jun 2026 08:46:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 65E914BA23DC 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 65E914BA23DC Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::334 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389972; cv=none; b=KqG+qIO1LKaX4u8ITF9sJqLoSOoAfP/yomWeDjLIURmB+HPjcS2IYR93KURCD7nSu6sZvb4Y+hnJl00NwDsiTgSZL/aCS7M6GJmda/uauTm2ioFL9J9Emmm2BnuhKvD1HdPk7fTC080eW4mrCJzqR7VLX3SDbM29QzZWg0BKnnk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389972; c=relaxed/simple; bh=zxpuRyklQpzemKUtg/S5PhG59daxt4eCtsgnq0SajtM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=UeaQqzoLqQxl2DPsG3tEJFkn4a4MMff+IGH0pnpOtHfV2hRej5E7WctbzzNrAS+gko6f8MZZyhtWmSeXPIdWFgqZYVFMZAmrtMEa5Cq38Lv60wmupcPSJbkcoAugX271JLclFYVC4j8+eANMCp2tjee/0X/G0itJm7te6D+b17I= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=HzqVt7kB DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 65E914BA23DC Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-49050bfe053so79851775e9.3 for ; Tue, 02 Jun 2026 01:46:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389971; x=1780994771; 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=AjX37QQC5H206OZFs+fmvA3Jid8ukCSpT32RhZ+UOqc=; b=HzqVt7kBGVQFJqQVagcfTGo2GYUkXGm++8Ht6rQBTgHV8msxfKIOmQM72vCxBcM+Eg SCOuYVIN5dhI9Bg131tlP3SsQlzmzmWS76mQfe5QxQYYYYndkrfJMobi4mK9ntXpkzse W/bo8b5ZWfHdbdfRv3Y7vjggbEzvQ3S/PbBiUHUsc3kIOKgvYowhiKW4yXnznbbK9j2d 2Pw7+SQ/e4fAtMw9N/fBm1zOsAn5lrlZraPfJjk/H/rGHvEOy7m7FTiTVKiJM6Vm+cJP bTh3q7WphBLz0s0/VEOIuKkbDmlLHJKgJxTp+FIXTBHQsTe5y27zs0Nm5RiyfcyDUVfl yjFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389971; x=1780994771; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=AjX37QQC5H206OZFs+fmvA3Jid8ukCSpT32RhZ+UOqc=; b=klMS0a4JGcn5aTQ8cgbsouxlJp9J7APIqw7UDqsCt3VadPYsdCIgAKPbQSR5eFG69w Dc+pmRrJ9+hflPQEQXcVaOY/MFv+Pkic2LuuYs/EJrD2htMfzYqx1v1mfXuLu03F9NvC 4SbnXCttMJ7+KtUwSU31N+PbCJ/1I1f+Hh6RtfxmWHYTQ8xCGZgyA9zmUy1P2o8LcFbt 62Oz6nov55cbJxR6mh7+4okQ3OoPe8OiWJywc6FWatmJd2bkJRF6j3K9xfGqXP+ASUt8 4IdGo1eeYZniQ82qwFM/pbF10NerV39LSIPL5G6LkdBJZPVcnLab3hoxuEzw1o8Awsnf 33FA== X-Gm-Message-State: AOJu0YxNdTwqFfPGySlDqYOJxqnH7Hnl/itixWpyLcvwuYcr2qTmH23U AIzhmshVaEPWZgTRgo/qif24gOusgMreCCi4i1a7nkPCECcuC/1aLYzgUJv4jbA1k1gwk7v/bpP MKpo= X-Gm-Gg: Acq92OE5qbUmRwHCd5xmaACPBYm80IwTKvZ2xGuTDy/AaKRr0i79FgC9RscyPX3wZyk LeqWtYY/0jtj/EJwHCYyJQV+doSzz2WTxwuPYyC4D7I3CeS0VL7SCT5MwJ+eDcmNLlD8JmbL9+0 gZj2XGSPcTOgApVXZ4icMWWgTpCzk9H3WI6y//7FJDtbsBOZ9IRMzjuV+sReLrqrbzHAgTrXxaZ ahzFXKZO/20tyGp6CrD1QvsJlCdTj63Xf0aACYu0V2YOgVmtQVCzpAwT+wuFYA4AqBQrJseWLpK AzFRxfzMNAczaIu4dd9enbUod3/C7UXsWC8JP84Ez+xn289LWfwhZiuS8YxOulT+O07QOzu/XtF Jyk2MXJkUeHS8rxWOL5dqB3b4MQelVj6dF2QI4ff7KbIOGu1WnJ9PkB3UdGDmRAYfbibtNl1sjW 8Rq/J7PJh8FBMDbARQX1P5YoTaVnEbc0eLN0w+6JVvuHcLqPZiq+Yl1r8xsvyR4f6CsVQHX83AI h3h+A17Lruu1ws4nrO27O7elPhkw+E= X-Received: by 2002:a05:600c:a11:b0:490:b0f1:c27e with SMTP id 5b1f17b1804b1-490b0f1ce6dmr49446375e9.24.1780389971347; Tue, 02 Jun 2026 01:46:11 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:10 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Viljar Indus Subject: [COMMITTED 18/51] ada: Fix crash in Has_Assertion_Level_Argument Date: Tue, 2 Jun 2026 10:45:06 +0200 Message-ID: <20260602084541.3829876-18-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Viljar Indus This method would crash if the association was not a N_Component_Association. As it could be something else like an N_Iterated_Component_Association that does not have the choices attribute. gcc/ada/ChangeLog: * sem_util.adb (Has_Assertion_Level_Argument): Check for the correct type of association. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_util.adb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 5698b2f0fef..43850d6cfc2 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -11510,6 +11510,11 @@ package body Sem_Util is end if; Assoc := First (Assocs); + + if Nkind (Assoc) /= N_Component_Association then + return False; + end if; + Choice := First (Choices (Assoc)); if Nkind (Choice) = N_Identifier then From patchwork Tue Jun 2 08:45:07 2026 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: 136249 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F0C024BA23C9 for ; Tue, 2 Jun 2026 08:58:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F0C024BA23C9 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=UtetTEfY X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by sourceware.org (Postfix) with ESMTPS id 2E99F4BA2E2D for ; Tue, 2 Jun 2026 08:46:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2E99F4BA2E2D 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 2E99F4BA2E2D Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::335 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389973; cv=none; b=bck4wNQzHiR+Dh5BjobG6x6C14oZaIYGSbxKhlj+AvJyPt+10MoiF6YKhrPsxF8wSRYa1FhewQMi/F+KpvHUr5j2xuw/H4IWcG5uBmvoGFV8gHvxgrHGZZpvSfmLhw7gFCuZKszRPxbTZ7H7Ev/fSl0b8PutfZdDsmsLd8D8dWc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389973; c=relaxed/simple; bh=cedZeeUMl+SuWbM4R3XD6GAjI+JAaxNMgZKjEeQVLbY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=j3GMqhtzTlqO5lLyee8lIy5g8U0C91l8Jjm2QlkJm5e8nkhLdjyKP4bw7cMah+MIUn2su4QX6bVB88CxHnmfnmNn9+9EzyrPH7eLwKWvuF4Le8B7h6iJdao8fOoDIKkXoN/5xaoL26g9O4snXpoHeYfMKtwSCXM2wAFIHSJ/Dmo= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=UtetTEfY DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E99F4BA2E2D Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4906238c62eso90269755e9.3 for ; Tue, 02 Jun 2026 01:46:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389972; x=1780994772; 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=CMfBOT3phtBnMKrQdrDMXMp7N1nBV2WmonKXka4pu/o=; b=UtetTEfY9yXVcuyhorbbCZ98UuRB+fvQsMGhnAyik62ZazTXHMPn/uQk2ctqHbeMfl FxffWB8qyofMd/YHrxV1NyyU5ojFXtqmc+KO7Rp4yabxWq/M5Hz4ZKcqvPRgoIFLse3J l/FnaSZ38BZsVDhzYd6C3ZdbNiAcPlsdpL1MmjLTYgQgjZ/T80MAjJmzNzVQZ/h+8zHq Hk/1sjaliFiy82z6sXE1ZLZupoBKNdeh6Ygqn41qV8MyKD3DICleK/2R+PrpooK10haa C3aGFDs7uFnDJTo5oas0YscazsA9Tjcb2WOGZxZrQQDmkeFU917rvMIClN3q/aW1eEnO gh5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389972; x=1780994772; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=CMfBOT3phtBnMKrQdrDMXMp7N1nBV2WmonKXka4pu/o=; b=sVo6M0Hekw1OXf0mOQsOAACJfMhckOv9a/SuU0D18JK3UOeedgXZ2CYqNxxm+zfptA iiRzBGvyXy+ow7lpEqz61Nh70Ns2Mmvh2To10P0VURw+MDo4FFYsIpBy7MYQbNs4z8Hu v4A13GQiOp4SoSGaffmW9lOFtSkZcf/OyWXO9+h4n3SMmJQWZ70UmMHTmBMdDHnW4QC5 TWmQPWgBg4OOUAIB/vRdgqr1WZPcL7PE5iv65e/qgLQhvO4EaF/Z6xYkFqeudGTcW/pt FlOe5Yk/QlQw949vkJOPYVODhg+V3AZMDWSA02X0yWDNr+MwxdYbv4Ko2RnJBCZP1jD2 jCzQ== X-Gm-Message-State: AOJu0YzTJUtWWylzl2TwBwi2g/Je1reiPsXI4mayJGCiJCuEl/Dq2Ftt gaGkbR/OkokBmx+dMgIu8A7ayDb1WgRH7XywP5y48Vwr13g6j5wPJeknOFfMkbZcMCuxJ8HG0fk Tif8= X-Gm-Gg: Acq92OE7LHRzM1JbGDLJuBKMcV/31Qjt5X2jF0acLvl28isxTRhJU/s36UkWUDZ02Iz AEjhhc+jkF5kjBdUoaWkYzlgNPfUz4sdzipKjR2yOs10hhur0A/B2tlK2B99f1LcJLFb6RYGeC4 ybJ1ISzC5trbpsGh/Cte+oH5ze6a9/EQfF0DIew3cocqbdASn7hMr9pjUXJpAOWgQVMRn1BxIaf hCk7xWIyrnXoWYtbrSZJNuSyGdvnlkicIIYnxa773imARlNDHxSF0huJFEbMX+lJPb2BHnyePn2 LqZV5ENo+mLKQfEtF5T5aH97JIHAKhp5v4OrUY3KHBurKmcjow5FTNLdKvHPSssGwF8eerUZg59 2QMXadzTHri3Adi6kZzPQFBONwvCodiORN4tIuVe9x9wejfgXdPH7hzRx1IJhSBnkrSrQ8Mb0L8 ZFojcvaiM8sKTINVSgByZzUroMR3lN1vJaWrPDAgL6f0VfG71x8ng+Nu6M8p3FY7Ny3jhS/upHe VFjucUwqdQfR9wdOX3rPZbkJAaWTho= X-Received: by 2002:a05:600c:1c06:b0:490:a298:3859 with SMTP id 5b1f17b1804b1-490a29838b6mr299281225e9.24.1780389972052; Tue, 02 Jun 2026 01:46:12 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:11 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Ronan Desplanques Subject: [COMMITTED 19/51] ada: Fix indentation checks with "finally" Date: Tue, 2 Jun 2026 10:45:07 +0200 Message-ID: <20260602084541.3829876-19-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> 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, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Ronan Desplanques When the parser encounters the word "finally", it first considers it an identifier and then looks ahead and possibly recategorizes it as a keyword. The expected level of indentation depends on the final verdict, but indentation checks were performed right away. This patch fixes the issue by delaying the checks appropriately. gcc/ada/ChangeLog: * par.adb, par-util.adb (Check_Bad_Layout_At): New procedure. * par-ch3.adb (P_Declarative_Item): Use new procedure. * par-ch5.adb (P_Sequence_Of_Statements): Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/par-ch3.adb | 6 +++++- gcc/ada/par-ch5.adb | 4 ++-- gcc/ada/par-util.adb | 13 +++++++++++++ gcc/ada/par.adb | 3 +++ 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb index 77c6f12691a..c2f8eaf6c9d 100644 --- a/gcc/ada/par-ch3.adb +++ b/gcc/ada/par-ch3.adb @@ -4613,7 +4613,7 @@ package body Ch3 is Append (P_Generic, Decls); when Tok_Identifier => - Check_Bad_Layout; + Save_Scan_State (Scan_State); -- Special check for misuse of overriding not in Ada 2005 mode @@ -4632,6 +4632,10 @@ package body Ch3 is P_Identifier_Declarations (Decls, Done, In_Spec, In_Statements); end if; + if not Done then + Check_Bad_Layout_At (Scan_State); + end if; + when Tok_Package => Check_Bad_Layout; Append (P_Package (Pf_Decl_Gins_Pbod_Rnam_Stub_Pexp), Decls); diff --git a/gcc/ada/par-ch5.adb b/gcc/ada/par-ch5.adb index f66d77314f3..053b6d7ca16 100644 --- a/gcc/ada/par-ch5.adb +++ b/gcc/ada/par-ch5.adb @@ -497,8 +497,6 @@ package body Ch5 is -- Cases of statements starting with an identifier when Tok_Identifier => - Check_Bad_Layout; - -- Save scan pointers and line number in case block label Id_Node := Token_Node; @@ -802,6 +800,8 @@ package body Ch5 is end if; end if; + Check_Bad_Layout_At (Scan_State_Label); + -- Statement starting with operator symbol. This could be -- a call, a name starting an assignment, or a qualified -- expression. diff --git a/gcc/ada/par-util.adb b/gcc/ada/par-util.adb index 790d238696c..e5ee0fb8899 100644 --- a/gcc/ada/par-util.adb +++ b/gcc/ada/par-util.adb @@ -197,6 +197,19 @@ package body Util is end if; end Check_Bad_Layout; + ------------------------- + -- Check_Bad_Layout_At -- + ------------------------- + + procedure Check_Bad_Layout_At (Scan_State : Saved_Scan_State) is + S : Saved_Scan_State; + begin + Save_Scan_State (S); + Restore_Scan_State (Scan_State); + Check_Bad_Layout; + Restore_Scan_State (S); + end Check_Bad_Layout_At; + -------------------------- -- Check_Future_Keyword -- -------------------------- diff --git a/gcc/ada/par.adb b/gcc/ada/par.adb index 4fe825b57af..53966bc4c77 100644 --- a/gcc/ada/par.adb +++ b/gcc/ada/par.adb @@ -1324,6 +1324,9 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is -- is exdented from the current expected end column, and if so an -- error message is generated. + procedure Check_Bad_Layout_At (Scan_State : Saved_Scan_State); + -- Same as Check_Bad_Layout with Scan_State as the current scan state + procedure Check_Misspelling_Of (T : Token_Type); pragma Inline (Check_Misspelling_Of); -- This is similar to the function above, except that it does not From patchwork Tue Jun 2 08:45:08 2026 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: 136264 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C32FA4BA2E07 for ; Tue, 2 Jun 2026 09:10:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C32FA4BA2E07 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=EXdJ6579 X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id C298D4BA2E3C for ; Tue, 2 Jun 2026 08:46:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C298D4BA2E3C 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 C298D4BA2E3C Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389974; cv=none; b=YIsK5MbR6PxID4XM8PJPNNefzl881yVjSYdWs8ukkzlUl5aDezJecLL19WJrVkSxK5oyTIk66DUji7IMNKtHt85AHawLPICCVpF377uK8lZl4aP584wH79D0ZC5XimmJvUDb8XP5DBdef9kqS/qDjWRkG0lghkxgaWASZ9ruUk4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389974; c=relaxed/simple; bh=NT+eXZtRCFjEC855fVSI/1hHBGwKc6KgUX2t1c815YI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Ey6Ibueprtm7kjPhSIOIqm7eCFNJsSEhp1PRr8dgslt1btqVC0MxkuNHGGkcStXeOcx5dWr+mIAsQCBQAGdGBLfyXyECRYLROGbukNynJWv3pRdQy9++NEs2/qu0a3gjKFRSlOjeTysxpK8A70rtnhZrMjlOEQhwwpUYq1yo5yo= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=EXdJ6579 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C298D4BA2E3C Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-490aebf33e9so8025585e9.3 for ; Tue, 02 Jun 2026 01:46:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389973; x=1780994773; 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=CLSCrEnhin2FreiY0pDXaY3Vlzg2cEE2UPCcv7KjAgo=; b=EXdJ65799x8vkr0L3UXrOgUSBhTQdlJ+uEtrX1BclfZxhvD6DdF9j2JP4EocSBo+Qy odJ0UQ4dpwvyy8rNKkButh2R2NvwD6n+LD65UZLcGy1HHvUSsEfsZnjwNJ0pRENP1fWB mPCAlMSGun2gayFHkG6QD02WK8a7fQj2zWMweBRGb7E2v0omPa5iSLupC5CZ2JMhUuxB BH61X7RQmzWQ+m36mI3T+IhIMmxgVH2t5DIYwzVYWVm4yoJPLbGgjY6d0D/9Csd1FGAS JLfOfs4oIuqIFem7z6uAhffzXcDleeChxHapVxERjv2SYCKPTV7IdXr7xd84Vug363wh 1F0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389973; x=1780994773; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=CLSCrEnhin2FreiY0pDXaY3Vlzg2cEE2UPCcv7KjAgo=; b=HrQ6KT+EYhb/I9x0qBtvj9ZYHJu5TFgmg4N9qkCG2azYB/uOTSn4ExTVa8iq30Gihn QzAZDyeRzUitmYevjgdgXJBj+BBM3qqNpHPR7MzT0B1hwEScxg+u6PSoN53mMB2MheOq HauyOBfFLr0O9EDENUL6W1EUjCyHrR6oRVjr4CE6SXEttCWLuQdN6eR5y5N5LKVFv/7Y UsdKpkFltz7koxP83/I/mC1buCnsSs6ZqTCRQTzb+CpzBxIRtX9BhWBuP9zATNe0FKH3 11ebbceYoa3+44mrHO3OCjsq2mJ1ZJz2aRY3OBDpZg4RgzuiTEN52ECMkzMUW5F9P2UQ 5+6g== X-Gm-Message-State: AOJu0YybPfbTCCpG9KtwjNaQFcEULPDIvRTZLnBqNay3FkxQgDBiZ+Aq z/q8qbxA1FSMblWRaFkCG7W02H7oW+cijueXlK9cDSgF6IDOzRVfZUQqVoGeXt81KQuhvkVbd2Z ju7U= X-Gm-Gg: Acq92OHPa+moKr00IlV/cZ3JDgTbPAaZZlUfa4dsXyElcAGa5vhuPIHaALdhoL0vfcM BCF7qvCD95yAbkYYCDblmnF6ca1pg90jwUaPadvFXspNBVHfx2at+jK0rjO/GafdgwtbLOeFVJv qS2W/YT311g8GhzhcfG6SQT+2xD8x3rffz904JjTHm/KzbklnxpFMJrw/FLsUsF1biMjyB0IrNQ s85aJtWHbUvy73SkTEHXQulmBWEkIMGTayqIPCkds6k9NtQQuacNAVfvsMrbNFz8Isdbvc8sWsP 78a67pgiON/x+aFTu0Il6tvWYSd36ygX6Rft3vu4YszC7zVU2bZuCh9t/R9RyKti6wwHo1POARi wIdC4mtcpxrMhzjoUjNDlvRRGum6XuEWhKDnL2xcMnpIJc3ZVsQJaJj76FQiFnsI4LKW0jv8QlJ YholSbUsUawLD6leNeIoIXRpxENxtDzwgOT8R6RsRVTPloISAToyJgJxQDw8oStuH4505S3D/9P 7NhWmfeBtCKjs1gf4TBygNmzus/igY= X-Received: by 2002:a05:600c:4f53:b0:490:3f7a:108b with SMTP id 5b1f17b1804b1-490a2958dc4mr287317055e9.16.1780389972785; Tue, 02 Jun 2026 01:46:12 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:12 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Mathias Aparicio Subject: [COMMITTED 20/51] ada: Refactor Has_Assertion_Level_Argument for consistency Date: Tue, 2 Jun 2026 10:45:08 +0200 Message-ID: <20260602084541.3829876-20-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Mathias Aparicio First branches of `Has_Assertion_Level_Argument` test an equality and if met return False. This patch apply this logic for the two other if that returned False after the if. gcc/ada/ChangeLog: * sem_util.adb (Has_Assertion_Level_Argument): Invert the final check in aspect branch and the check in pragma branch to use early returns for consistency. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_util.adb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 43850d6cfc2..2590e411f0c 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -11517,20 +11517,20 @@ package body Sem_Util is Choice := First (Choices (Assoc)); - if Nkind (Choice) = N_Identifier then - return Present (Get_Assertion_Level (Chars (Choice))); + if Nkind (Choice) /= N_Identifier then + return False; end if; - return False; + return Present (Get_Assertion_Level (Chars (Choice))); else pragma Assert (Nkind (N) = N_Pragma); Assocs := Pragma_Argument_Associations (N); Assoc := First (Assocs); - if Present (Assoc) and then Chars (Assoc) /= No_Name then - return Present (Get_Assertion_Level (Chars (Assoc))); + if No (Assoc) or else Chars (Assoc) = No_Name then + return False; end if; - return False; + return Present (Get_Assertion_Level (Chars (Assoc))); end if; end Has_Assertion_Level_Argument; From patchwork Tue Jun 2 08:45:09 2026 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: 136260 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8D7BB4BA2E0B for ; Tue, 2 Jun 2026 09:06:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8D7BB4BA2E0B Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=iRL16KyE X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id 7B7144BA23C6 for ; Tue, 2 Jun 2026 08:46:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7B7144BA23C6 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 7B7144BA23C6 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::332 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389974; cv=none; b=PaxjZ1Kz5c9KBCqMwEQlag1KpCdOAx1ZcehnYyYpbE8mVi/gl7Z65a6mceFRjmLZ/XB/WD/Z5DkgErM+OXwfr7wQK2ktiKecctba4szcsMnAREo7FpcBVVDZsI4ZDMmY3bdQqJ1LUuOhBSIUFFVA0yEpmnX6dNLrWPNFtaft3xI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389974; c=relaxed/simple; bh=7cUVjyz1Q1mSRN1H+kMv1hIgtpKjaQe2doLkp8T32G0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=jg0bEqASt96OayTU9XeSAzzMpPv2xcEj+mB+73WWzVNJaAkW2zzugSVEq8eyY+E7kliwtXFTbxcR1y8R8faH5I+Sije5k9cprZbZazRdPtBqA60DV26rOKTaavb9EwRJ2A9g+ygKuoyHx50K6ZaAm2TM7dTKJoHQ/EjloYddxug= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=iRL16KyE DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7B7144BA23C6 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4906869f0cbso103154415e9.1 for ; Tue, 02 Jun 2026 01:46:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389973; x=1780994773; 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=vQ2jcV/R5qKCEc2nkYpSWJhukFBnOIi4a8u2ubftW6E=; b=iRL16KyEy9tfF/0sIWWnsDsJvhK5+fhyNA0tzwe9cxbJSQEL0XQdeULLtTPZYb4Nji 5/uKiiwD/rTc8GgXP8XyJngxK7C1jrAdVmIuead3C79KBL4DGkQKGMnjPtxLseMzselv 9ePXW167zYiryApj2AaAsxka6Gn0vZYH+T24UfekC15G8blMfhUu+BmJ0DYTgCROE47W rr9L9rWgOtQyDMZI3NvJkdeyuwmevDeUNS/n6JaCRDzoLQ/uWjXWb/6Kkn6YwlIUUbNO hvHL0RUOPlMKKoOrgGx5/tKhXVHzFSZvxCkQouwvxeZSUBHNcr9GJLu4y5DWLsu+8jNX +ciw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389973; x=1780994773; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=vQ2jcV/R5qKCEc2nkYpSWJhukFBnOIi4a8u2ubftW6E=; b=IsxTM6BANvXdIsyRmfjpVMOgKmzA6NePo3UxaD0fGdojrFM7cpBrI81s/Mbi2gOb3m KxNOe+QnUo59s/gYkQ7jJMtksUBoJobxVUZmVLvoI2bCDk15wr1n5wBHkmBrK+FY6dRO VLSkDv1+a8/Flec/vspOm1c+Lc6egXGW2httaqQ/8MXOo2V2XjMSe4+d9xh/G0eIwMJA VHwxaJynzOYfBaUj2nX+8tizmHR/ZMd15iIcqGZGtNYgPOmtvhmH7KZr6g6YYzg/lO2J UcU5IUc0ynxfigJMpsOUkWHUZ+NhTGKwHhd1ybZDhMlX0V97FYFgI4UAvpG+dBVwUQxK OBtA== X-Gm-Message-State: AOJu0YwZoS+Reit0GGgTsoXQ0F1yigR9JZr/jwQr+QbKXyhW36V3I5t5 eZMiF9LmjKVJgiH91M+ESKBKLh9FJQwnYxO0fx1B41Wr6PBZul0ArYMRB0wl4LjFUmAiUOU9vmQ f7Jg= X-Gm-Gg: Acq92OFKzv6sui3qBC1NdojyRvY00qH8bjh00U2sifMlOgEAliJFBFr1+N0XpMIqDw6 Q8kdgdLXSBfYX4GaQ9gKNGRnUM4O4KnTWawvgznY9fQzY8JKs49iOmaGuSAe2Xgtte/F2U/bqI1 oT/7R7NMOJHCf9Iq4mINE29vxJvj2pyXx3fouYB7IT49Xspl8f72ztDOdsTGt88ndVXOVcaO1Ro A8SprHwO3oDkXJO8fosheP9CIAQcjxbMINkXKk641f9tWfqw9sCmjDJtA3F2FaEMd4903GWqA7o Fwry5XSJ1DKNraK8VIR2DdbRxNGY80LcKtKCsbT9cSqpuIqt4DooAayGGFUoIl6ZjQmz9Q0cruL fL9OGG+Rtq/c4iJBTuLnzoyByAjVEBSowSJTjYYTM7/o5KX3A/DbcCVvci6nRdBB96lOWphTZlS /rfWqzG39dOvq1lOqtThsIJWPVgEiX8mM/KU5990FPDIMzYVNZjaVu095TetxK3zIceKwbCT+lh R2fswqlhpR8DEW7c0wab2oW0xVz3l0= X-Received: by 2002:a05:600c:8508:b0:490:625e:bb68 with SMTP id 5b1f17b1804b1-490a290ec6cmr275849015e9.3.1780389973421; Tue, 02 Jun 2026 01:46:13 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:13 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Ronan Desplanques Subject: [COMMITTED 21/51] ada: Remove doc for long gone field Date: Tue, 2 Jun 2026 10:45:09 +0200 Message-ID: <20260602084541.3829876-21-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Ronan Desplanques The field Contains_Ignored_Ghost_Code was removed by the transition to Gen_IL but its einfo.ads documentation stayed around. This patch removes this documentation. gcc/ada/ChangeLog: * einfo.ads (Contains_Ignored_Ghost_Code): Remove documentation. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/einfo.ads | 5 ----- 1 file changed, 5 deletions(-) diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index b0283e2a0b1..f8ea99719e0 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -730,11 +730,6 @@ package Einfo is -- Component_Type [implementation base type only] -- Defined in array types and string types. References component type. --- Contains_Ignored_Ghost_Code --- Defined in blocks, packages and their bodies, subprograms and their --- bodies. Set if the entity contains any ignored Ghost code in the form --- of declaration, procedure call, assignment statement or pragma. - -- Continue_Mark -- Defined in loop entities. It points to the loop's statement after -- which the label for continue statements must be inserted if one is From patchwork Tue Jun 2 08:45:10 2026 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: 136253 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1DCA24BA2E04 for ; Tue, 2 Jun 2026 09:02:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1DCA24BA2E04 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=ejfglK3k X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id 21E6D4BA2E37 for ; Tue, 2 Jun 2026 08:46:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 21E6D4BA2E37 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 21E6D4BA2E37 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::331 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389975; cv=none; b=xvv2qIe+IE9tkoL+tVkgt19pExg2vjYEBDfMgt19aZsW5xWa71XcvihZCZd3bav1qMYiucQrk04vVFfpE5OA7nf4lM/OIgWRU0rvqSjlS6IdJhpNlZXAZvgsARNlxx8zox5ZkLy9aM05SIsfqXi/xQ85t/7ociH4THneYmO5xpo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389975; c=relaxed/simple; bh=qp6NaayLdKmdrEJclVgXopJOR/TVaBdWU2FhzRCBp3o=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Hst5RWX8nndatocgDIx7ehLIUmiO5ndwkANKen2reUlIljcOCAZ9vKfNZTrqRDLt2x6lvLSKKaeo6mSZabpXTvKKQyUjKnBsRo9sy0tncobWs/8LSGKdsKCbuuOzF4deYpjLv5IdrgcZ5/lLz3ynLF7HWsUvV+89FvYH8G4JSX8= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=ejfglK3k DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 21E6D4BA2E37 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4903997fcb5so112828705e9.2 for ; Tue, 02 Jun 2026 01:46:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389974; x=1780994774; 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=JFN+DdRNtwPhTcN5XEHSp5tCWo9c02HGRBl2I88I8Dg=; b=ejfglK3kacXfs4UDWzbjWQqouolxs2T6Nn0yBddP1BAhQJFfa6lhh0PRYdfw1vi7KZ 5UX879JKecE2NU84b+flbD4cuVcnRt07pGFuzqtUZ3R2eS61MaHUedq29t6BbxHR3VuK +z1ws9f+4yIbaVDhI1AzTelsUo0a+krzKBxsxqPTn6jN5oGqMSo9fOajlVo6u14utHHS TqYAqh9htKyCasGWelvE8/rN2CsA4r9TDGzh5YA7QL9LkVADfFv8AG8olfPYLzHnd8UO JUs+lZMmTUcWpuYWBW2twTJ1xcoGslGEJRtsE8e5MI1TxOMjn+vtHNy/+z/DpOLefa1S qcYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389974; x=1780994774; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=JFN+DdRNtwPhTcN5XEHSp5tCWo9c02HGRBl2I88I8Dg=; b=iCMvYL/WH1BQwlGVJBzRL7sD9xcb13MSB/mhmWvbrWqw6+j/Ib1iHkkR4xO47ot67T Slsz4OgSuxNBv8oqvdCaS/+UjYD+cRVlnKUsiD0kmCeiOnlUZtWyH87FxNhc6JgCX81d mFDISej+UFlglDTiBZMX6BVfX5eDoDlb6H+gqWdo3771kYYPcYo2p8MMRe6QTNVbWAyY /g634pgXVvb8q9+wa37aHUvraxooNfXVjvwR5g8tOFzqWGUJXZOdMUsgSARVEtZq6QL3 LewBcCviTFbSQxDoSV5L8kPOqIzKis9BP8JcSHthkc4yc50yr7owdabLsI5WItUDt1sH SlgA== X-Gm-Message-State: AOJu0Yy2u1UYEfQhjpVqxRpx75jI0qrt9EUsCjYLmmsJwNERMMRtaSIx HmstaomFrJFC+dJ7Jv4Q50xTcM/fLkX17JwjUncw2JjnLn1vZGQ6PT0+xH9lak388WvlWBqrnFT il/8= X-Gm-Gg: Acq92OE2gV/fyq+ZVJ6HavieWRYSgaG8OGd60wVBznApH9JGR5L5iXjnYWDXEdWiDn/ hJT0jiL2VKuK20y07S7QlP1pvS/C+jW7Sy3uSRck4jBagdbnQ6CpKv9/63vIF+oK1O5CuvwQUzm gbwwxQtQHLRLRmkRv0+ADyYvYfEItpMruWYL7d7AWmJ9yoths3DzlxiuHgORNwgpR/5Rsn+j9tG qRkzfvisBLwd+aTIno2vWCXDy24Erh4w05tYK200QWx3QdgYdu+Jfs7yYTgig806ypi3pboSrRo 0RzSfY1SVf/wHxiB3D9BqkKIkeYrgWvHWQQ7fQjD8G+8EfbfSJhxLFjLi3+dVS3J7UJa6VydvD3 XwTjh/9NeCV77MR/BOn37IvaIWPlpSjQs5SnZmffy/1xudEtHxGW30neaBsIUgARhC148FYrMhx AbXVhYEKwpmVIbqOiI1jAPmeV2+rZlGP7j2nAiszPURUTPNqF/T+KRHv16d3xyEwywAfJYdYsyJ VllKOCWFP+3PnNUJxvhCP7RIuwPYxU= X-Received: by 2002:a05:600c:a4d:b0:490:b1ab:e41a with SMTP id 5b1f17b1804b1-490b1abea47mr41571135e9.32.1780389974056; Tue, 02 Jun 2026 01:46:14 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:13 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Ronan Desplanques Subject: [COMMITTED 22/51] ada: Tweak predicate name and documentation comment Date: Tue, 2 Jun 2026 10:45:10 +0200 Message-ID: <20260602084541.3829876-22-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Ronan Desplanques The old name was wrong because a type is not a subcomponent of itself. In other words, "is a subcomponent of" is not a reflexive relation. Also, the old comment implied that the Ekind of the return value was E_Component; it's actually a type. gcc/ada/ChangeLog: * sem_util.ads (Partially_Visible_Subcomponent): Rename into ... (Partially_Visible_Part): ...this. Improve documentation. * sem_util.adb: Likewise. * sem_ch3.adb (Analyze_Component_Declaration, Array_Type_Declaration): Adapt to renaming. * sem_ch7.adb (Install_Composite_Operations): Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch3.adb | 4 ++-- gcc/ada/sem_ch7.adb | 2 +- gcc/ada/sem_util.adb | 8 +++----- gcc/ada/sem_util.ads | 13 +++++++------ 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index bc02601fe0c..1f8d86eb631 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -2222,7 +2222,7 @@ package body Sem_Ch3 is -- If this component is private (or depends on a private type), flag the -- record type to indicate that some operations are not available. - P := Partially_Visible_Subcomponent (T); + P := Partially_Visible_Part (T); if Present (P) then @@ -6814,7 +6814,7 @@ package body Sem_Ch3 is end if; end if; - Priv := Partially_Visible_Subcomponent (Element_Type); + Priv := Partially_Visible_Part (Element_Type); if Present (Priv) then diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb index 90de70d2568..92b8f9a22b8 100644 --- a/gcc/ada/sem_ch7.adb +++ b/gcc/ada/sem_ch7.adb @@ -697,7 +697,7 @@ package body Sem_Ch7 is if Is_Type (Id) and then (Is_Limited_Composite (Id) or else Is_Private_Composite (Id)) - and then No (Partially_Visible_Subcomponent (Id)) + and then No (Partially_Visible_Part (Id)) then Set_Is_Limited_Composite (Id, False); Set_Is_Private_Composite (Id, False); diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 2590e411f0c..f53fe30da69 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -27004,10 +27004,8 @@ package body Sem_Util is -- Partially_Visible_Subcomponent -- ------------------------------------ - function Partially_Visible_Subcomponent - (Type_Id : Entity_Id) return Entity_Id - is - Ancestor : constant Entity_Id := Base_Type (Type_Id); + function Partially_Visible_Part (Type_Id : Entity_Id) return Entity_Id is + Ancestor : constant Entity_Id := Base_Type (Type_Id); function Trace_Components (T : Entity_Id; @@ -27091,7 +27089,7 @@ package body Sem_Util is begin return Trace_Components (Type_Id, False); - end Partially_Visible_Subcomponent; + end Partially_Visible_Part; ---------------------- -- Policy_In_Effect -- diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index df7296d527f..6934bd42a70 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -3041,12 +3041,13 @@ package Sem_Util is -- of the corresponding formal entity, otherwise returns Empty. Also -- handles the case of references to renamings of formals. - function Partially_Visible_Subcomponent - (Type_Id : Entity_Id) return Entity_Id; - -- If there exist any subcomponents of Type_Id whose types are currently - -- only partially visible, returns one such subcomponent. Otherwise returns - -- Empty. Used to enforce the rules on visibility of operations on - -- composite types, that depend on the full view of the subcomponent types. + function Partially_Visible_Part (Type_Id : Entity_Id) return Entity_Id; + -- If Type_Id is currently only partially visible, return Type_Id. + -- Otherwise, if there exist any subcomponents of Type_Id whose types are + -- currently only partially visible, returns the type of one such + -- subcomponent. Otherwise returns Empty. Used to enforce the rules on + -- visibility of operations on composite types, that depend on the full + -- view of the subcomponent types. -- -- We say that a type is "partially visible" when it has a partial view -- that is currently visible but no full view that is currently visible. From patchwork Tue Jun 2 08:45:11 2026 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: 136258 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D63004BA23C8 for ; Tue, 2 Jun 2026 09:06:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D63004BA23C8 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=UIYIl/pj X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id B01AA4BA2E1A for ; Tue, 2 Jun 2026 08:46:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B01AA4BA2E1A 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 B01AA4BA2E1A Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389975; cv=none; b=aUn3wKlpauECqidUBmh0O8PuO1waDwoC8VpHZ7w1YWWLfMQh4DIQMu0NC2EaYNjygttLsj+oxC6Fjb9aqkqHY/110M2t+cQIG9k2dI9xuwhqty5e3wyvNsa8ITee+22P9FFrcG4cUIEg2S99hYiaUnpYOZMf10J+8OYeW1lm8KA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389975; c=relaxed/simple; bh=gsvI7nZjOtYgDrJy7lT0yWUUgSG4i1HPHSUlPe+KCfw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=KBvw3X41ExPhO+w2JJxaFyjL8G9qyzHm5nrO7BXhpV/GtXfM9yU3y2O2yg7UYBM/HJdnYKI55TwnPx5nOOBXv92+/YEx60HWY0exatO1wJWU5MvvpJDc9aREh/IKbV+hl2ndNAv6/TudPbDku0emfoPiuPVyNIGT3gnvjpLSrBQ= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=UIYIl/pj DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B01AA4BA2E1A Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-490a7629380so22449095e9.0 for ; Tue, 02 Jun 2026 01:46:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389975; x=1780994775; 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=lOLg9HMg73v7rOSmIHjwJlkVzqs6Igjv8EZ/6fD/N44=; b=UIYIl/pjFmLYhGduVhG92yUMQL9qQOXsFTpTFxTI1WQIl/s9EdcZPin/fUsIVgXrvF 8S/zfYN1HH315tJzwWQy39ZFMtXC8lRXAOF3DUkXsgB/LRZv8SgtofYYJr4qPi3XkD8P fdgHuF31jq4DWaC92cpxCnyAX7fp/H0CJ0I5rdbuyJBV6e0BM4a1eJFYEnImpjUX3/AE PjMxW0NlUsLjzwitcRWHYtAsFUi28bGZdRW2RfrHTsDmc02IxZ2P/ftKzCkAPIfkErGO 2uJ0a1MrIqtTdkE17FtEENpc21VQE1P1z0wYFd3hq+l3Q93TNK42zJ7Hjsb7SugZm02+ MTwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389975; x=1780994775; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=lOLg9HMg73v7rOSmIHjwJlkVzqs6Igjv8EZ/6fD/N44=; b=GWkmTHfiSJeEQQa/66a1d/qJ2LfKsva2dgB6lCbDGiCaFY4QoLV0hQ/Z3BBF309fQ5 cFmCRdf0EWGEYbZ/aRz1kGXw2SPOt1kVKPtiu7Vg/bFDsOoLn+DQOM8Gl7FhvDFQw/c2 8kFhh65jjDGf07avWhjuL3P2rrSIMS95B6LAg3vzBPbzNvOKmDOOvNMGFusH7tu7B14p vLk1XlLtLC6OepSMupYRSQfptBbsHRk1OjuLZjeNOd5OuVoZYC+0OmpwCG7DYRCd4xfv ePN0aC3ME6dOu2mI83yVngUaJ7eOV6Mzduqzk9qw/6e4pV4cxuQFYkoJozQuc9Cu5nhb MbJA== X-Gm-Message-State: AOJu0YxhOb25ZekYc8Zisyl/ccmhXqdd1Cv/rjqo8/qsW5VyGaAT3Pg8 IDa2yvJ5B6uhpRpQLf1besmLYMhFq5O8ArHXK7LFj4heVPQDFjU3SXwV5GzQiHh5Qzg2CDZ/bwp 1Krs= X-Gm-Gg: Acq92OERHv4rdeJtLjvBIMIHVj1zug8UAFIwwcxVBMNpgRyayrkqy0szX1SO6SJu1vz 0G9viJ1vqFSoL7h9re1BBRGLcBZQGoEpex4DfqoCvuvVLStpp0qTAWPhtPBJjCv+uzYz/TVGHLG GcdPH2DyHHSMSWQlXWDQPvbddwUYhz3kcRM7rVUC1WqTLq61b7R2JlFxTMT22wvBw0cEzZrRcDt 7/irxQVp+ExVDOHe7dww27laEjDFNA+keY64R23UPexn2UxAhJacrA3YZ6PNgg6MCP+Nki7+BXG A66fdmpwXoI9Vobpy42IEYkOedZ8zUbE0hPF7qVxUBKKLNIEENrGUocwZSUAyfT/UyXaTGKdzir V2x3A2pDb/gXeGKiXw7sIFr8zB62yApJizuo7hbd4rA1965cLnkm2NyFhjbv/ra8Ym1/bjdxfnU qhRfueLTPORqws5UB5hgqbDmfZHWKB+qQhH2+1San96GDo+T7oNGBwbCWiem0LADe+xOhxDg+ld H8gxjsnZKX05MuQIaWHlwxwtWWEbGNWjJMgcGDPPg== X-Received: by 2002:a05:600c:2d4a:b0:490:5057:f602 with SMTP id 5b1f17b1804b1-490a293dffcmr162747395e9.17.1780389974731; Tue, 02 Jun 2026 01:46:14 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:14 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: =?utf-8?q?Marc_Poulhi=C3=A8s?= Subject: [COMMITTED 23/51] ada: Minor cleanup in macro test Date: Tue, 2 Jun 2026 10:45:11 +0200 Message-ID: <20260602084541.3829876-23-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org The majority of the macros checked have already been checked a few line above. Only difference is __CYGWIN32__, so check for its absence instead of the presence of the others. gcc/ada/ChangeLog: * sysdep.c (getc_immediate_common): Cleanup macro test. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sysdep.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/gcc/ada/sysdep.c b/gcc/ada/sysdep.c index b8735b5ad66..7752693a20a 100644 --- a/gcc/ada/sysdep.c +++ b/gcc/ada/sysdep.c @@ -409,12 +409,7 @@ getc_immediate_common (FILE *stream, /* Set RAW mode, with no echo */ termios_rec.c_lflag = termios_rec.c_lflag & ~ICANON & ~ECHO; -#if defined (__linux__) || defined (__sun__) \ - || defined (__MACHTEN__) || defined (__hpux__) \ - || defined (_AIX) || (defined (__svr4__) && defined (__i386__)) \ - || defined (__Lynx__) || defined (__FreeBSD__) || defined (__OpenBSD__) \ - || defined (__GLIBC__) || defined (__APPLE__) || defined (__DragonFly__) \ - || defined (__QNX__) +#if !defined (__CYGWIN32__) eof_ch = termios_rec.c_cc[VEOF]; /* If waiting (i.e. Get_Immediate (Char)), set MIN = 1 and wait for From patchwork Tue Jun 2 08:45:12 2026 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: 136257 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 64F734BA23C7 for ; Tue, 2 Jun 2026 09:06:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 64F734BA23C7 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=PVaKyzp4 X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id 39EFD4BA2E2C for ; Tue, 2 Jun 2026 08:46:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 39EFD4BA2E2C 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 39EFD4BA2E2C Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389977; cv=none; b=ArvUDExkbxdAd9dHZRXPQXv0COWX4WXdBISMiJQJa2Ux0w5aPZzYCNYAU+irTh81XvpxtI5GvZurgRdaqa9Ao1JIeRGLiki+hn0GDkh2YvZK4bJPuVziiEO4kQoSQcSMtu1m+SUeMmXih/2Vr6J/sj4EWU/iUsgloK2LX8gPSvU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389977; c=relaxed/simple; bh=9wGe/AowE8RL91lvnEIouOu73keyAcAeS5FJ/IAhdj8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=tLMoARsg97riqZnODGZBVULSnAVKJOlPa9N0HpvqKqDBLDZ469IWM4ifSpDE5aDG590lBFxB740CXzhLQgQJ+Ll4s7XJQOu1FdLhcRGWjK23yQ8FZfIO0epsujDnH6mGRZhiKIQzwgmvxzNi/TsMZYhZ8TRp7Kcu2aZqPROx5mk= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=PVaKyzp4 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 39EFD4BA2E2C Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-45fd464d51fso1218555f8f.3 for ; Tue, 02 Jun 2026 01:46:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389976; x=1780994776; 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=/pOI5z8DNFY8W1FkdluMvGSZOk+teHHmg/GKjVXQgYY=; b=PVaKyzp4g5eQy5BPfeF3i9db363KpysRBue9y6B6EEnpCa7Bm1cvc5YtgiHC/ZdkjN NjCO4GBjX0bZDe/xxhnKyB0F+ZGqaUvLA5h4318qDfwIcJFXjMCfoDexlvowbRXxqijo sV6XMtblBtJ36sMR8MbJj19Qt8otkn6RUdy/GP2TwPPpElhU82HUXHvZSPWpoWh6ueJ4 MTG3jLisSpX6Ci7Cgj6uCZoguAwYSfXy+CWsThGH9hBU0iJwCSw9rs5Qx5oNIy2dy6Kb /ktFaE8E/9DjT4NSL152/NQzvvhpz49cfN4wcMlMmlmz37wWZQkAFMD8lFFwKwzEGCEZ ENIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389976; x=1780994776; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=/pOI5z8DNFY8W1FkdluMvGSZOk+teHHmg/GKjVXQgYY=; b=ro7VkNNH6J8WOhUrKdjNr3tD3Kov1cuDLMKQn7q1OdvPgCWDxr9uYD4HKKYjSkvOjs MW0CkM0adggk3A67NG31AAaCOTHo4iKKNLpQmIJRl1Mzp90Ul6mQpex0UT0cU3T4plr/ GOGCRu7IyimDP4YG9rJLUpWKvYjk3dvJw17pqw7mbpeT5vbhsJK2iK5JGuPN23XFObuG 5JLJcN4Kxc5ffABqVJ6tXAQ88mTzGvUFov4hf2eq1JHOpzSD6tRjJnrbjyGyQOaYmWfG xLfPMHQDip3waZ1EB/K5o4/Pb1dkLOCBbrw7grYj0UdawWQk98j/kJ6QdHcw69bQXiAQ 1MeA== X-Gm-Message-State: AOJu0YzngUF1A188scSccgioe9/Is3Db0zDJ7x76r1tq7hJ91ZteJN9r SSFHj0CV7HhwZFi0qS4uO3MGxIJWQACX5fSAT4rdjp04QryMCsTkk+WiVx83CG34uC+H+50MzBG I+iY= X-Gm-Gg: Acq92OHoxgjIKO5XSKSjuUxAMR1/4fySAIvAotbwyDNW7vhdmCzx8SuQM41FaoM0Zm3 UAP6m/g5SjU6tltQa8hlCWl5mmAkIXesewlrLU/uvkoWLob3HmGB5ARpmv1Nh+JNF7Mmtsb3wE2 6u61Q1gTwtfFaYoO8oAbSs+nWCnj+KQyZ3HU1zJPEJNpC3G5BlU9qH5V6DENBl9+HSjHK9PvcAb HXJEUozVf2bPS+tAy4PvlwFzZiev+u3NzqynOBZkgRh81qo7leCw2I6P8VP4A5T1dHlQm9AF/0w ogBo1FJggsN2n760h6VoaCTUV3gCyPyQmiDcqoLXGadr592ZZHKUJpJTEfXy26UsOo7Dc6TzV0Q /Iy9xRCn1Zfthev3S4Ancby5D4RtRkGQzT0oCwTbc0zJFzjnmcE3zhStBn8Z4e0SOjfPJhLRZiO K9ZyXHggBbW2yG3Er5lYTHWKqd77nWw+WEr7LHU6MTpQVF9sC+pMPteq1dYzCV8FJ14hItCw0Sk nf3tdAQENTH/SGlPyW4XVOWHbqYHhY= X-Received: by 2002:a05:600c:3b27:b0:490:958f:2a5c with SMTP id 5b1f17b1804b1-490a292fbb2mr257469025e9.17.1780389976062; Tue, 02 Jun 2026 01:46:16 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:15 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 24/51] ada: Fix missing dispatching for default implementation of S'Class'{Read, Write} Date: Tue, 2 Jun 2026 10:45:12 +0200 Message-ID: <20260602084541.3829876-24-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Eric Botcazou Note that 'Output and 'Put_Image are also affected since they share a common implementation with the others. gcc/ada/ChangeLog: PR ada/18205 * exp_attr.adb (Rewrite_Attribute_Proc_Call): Skip the conversion to the formal type only if the actual is of a class-wide type. Generate a dispatching call when both the prefix is a class-wide type and the subprogram is a dispatching operation. (Expand_N_Attribute_Reference) : Use U_Type consistently and remove an useless invocation of Root_Type. : Minor comment tweak. : Likewise. : Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_attr.adb | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb index 403b5899ce5..b299dacebfc 100644 --- a/gcc/ada/exp_attr.adb +++ b/gcc/ada/exp_attr.adb @@ -2233,6 +2233,8 @@ package body Exp_Attr is Formal_Typ : constant Entity_Id := Etype (Formal); Is_Written : constant Boolean := Ekind (Formal) /= E_In_Parameter; + Call : Node_Id; + begin -- The expansion depends on Item, the second actual, which is -- the object being streamed in or out. @@ -2286,8 +2288,8 @@ package body Exp_Attr is -- operation is not inherited), we are all set, and can use the -- argument unchanged. - if not Is_Class_Wide_Type (Entity (Pref)) - and then not Is_Class_Wide_Type (Etype (Item)) + if not Is_Class_Wide_Type (Item_Typ) + and then not Is_Class_Wide_Type (Formal_Typ) and then Base_Type (Item_Typ) /= Base_Type (Formal_Typ) then -- Perform an unchecked conversion when either the argument or @@ -2333,11 +2335,21 @@ package body Exp_Attr is -- And now rewrite the call - Rewrite (N, - Make_Procedure_Call_Statement (Loc, - Name => New_Occurrence_Of (Pname, Loc), - Parameter_Associations => Exprs)); + Call := Make_Procedure_Call_Statement (Loc, + Name => New_Occurrence_Of (Pname, Loc), + Parameter_Associations => Exprs); + -- If the attribute has not been specified for a CW type, then we + -- must dispatch to the attribute of the specific type identified + -- by the tag of Item. + + if Is_Class_Wide_Type (Entity (Pref)) + and then Is_Dispatching_Operation (Pname) + then + Set_Controlling_Argument (Call, Item); + end if; + + Rewrite (N, Call); Analyze (N); end Rewrite_Attribute_Proc_Call; @@ -4951,9 +4963,9 @@ package body Exp_Attr is -- Dispatching case with class-wide type - elsif Is_Class_Wide_Type (P_Type) then + elsif Is_Class_Wide_Type (U_Type) then - if Is_Mutably_Tagged_Type (P_Type) then + if Is_Mutably_Tagged_Type (U_Type) then -- In mutably tagged case, rewrite -- T'Class'Input (Strm) @@ -5003,7 +5015,7 @@ package body Exp_Attr is end if; Read_Controlling_Tag (P_Type, Cntrl); - Fname := Find_Prim_Op (Root_Type (P_Type), TSS_Stream_Input); + Fname := Find_Prim_Op (U_Type, TSS_Stream_Input); -- For tagged types, use the primitive Input function @@ -6642,8 +6654,7 @@ package body Exp_Attr is end if; -- Tagged type case, use the primitive Put_Image function. Note - -- that this will dispatch in the class-wide case which is what we - -- want. + -- that this will dispatch in the class-wide case as required. elsif Is_Tagged_Type (U_Type) then Pname := Find_Optional_Prim_Op (U_Type, TSS_Put_Image); @@ -7064,7 +7075,7 @@ package body Exp_Attr is end; -- Tagged type case, use the primitive Read function. Note that - -- this will dispatch in the class-wide case which is what we want + -- this will dispatch in the class-wide case as required. elsif Is_Tagged_Type (U_Type) then @@ -8790,7 +8801,7 @@ package body Exp_Attr is end; -- Tagged type case, use the primitive Write function. Note that - -- this will dispatch in the class-wide case which is what we want + -- this will dispatch in the class-wide case as required. elsif Is_Tagged_Type (U_Type) then From patchwork Tue Jun 2 08:45:13 2026 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: 136262 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A185B4BA23CD for ; Tue, 2 Jun 2026 09:09:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A185B4BA23CD Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=Yk54cRaH X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by sourceware.org (Postfix) with ESMTPS id 7A17F4BA23D2 for ; Tue, 2 Jun 2026 08:46:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7A17F4BA23D2 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 7A17F4BA23D2 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389978; cv=none; b=u+i+uhBIR0KYZot51l4hwmmkdm+0sklBcznpHbI2lQolKkWDmz4aI8m/Libf5FXeSnAu4nB8krs8iYGhmaXcVjhHsrqNl+y+F5wXmKNT1kZ39W0d5rqcb1Kb9ro2PZdvq7lQ0JY/CATKnEXL8ddLmUd7j4UN2Qjkwbq857RC4wM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389978; c=relaxed/simple; bh=WlZYPa/GZU2Z9sCrYjq3CuLc5nFTJsR3/nlMToGLmsU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=LfWQG/sazCu1JiQhtdykjUrukTAJ9O6An1PHCN2f7msfWS4QB6U5+wlaFaCeArgD6f6GQFbOTWRdWQ7a5dzWKmnG3dG3gR8V4ztUHmihOwf0mzUpCc8ih4Kvc4FYPQKDhP8V7qFYtrG6D92lfa1vBVtpSEGWRca+gj3KnCi9uD0= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=Yk54cRaH DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7A17F4BA23D2 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-490a7876f8cso21483515e9.3 for ; Tue, 02 Jun 2026 01:46:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389977; x=1780994777; 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=1aoP8JnSJVfcSCTjAjHA83RTjVmAcYlXz9zYbrudYLM=; b=Yk54cRaH6WejfU5tND7LlAjGc9FywAgvaoMcLFaajt+EoyUUQXKWj5ZdB6W/kB1gTU YWlois4L72qAJLNp9Z0EyCWPpXAc77i8Qbq1ZLMQmjvzauDoA0iQMrcm1lf2r5vEYb7y 0LbyzBLRt9b8ucM2ksMlTCAzcYI2YkhnxcHjOCvSpE7EEv+OsT9NV695wMXJ3QSEPXs1 VU7Z4ILZnQsQz/uxveg03u87JGJ4ioqhg09L7n8Ptp5c9Szayc3diBsyr4UBQcLZXkT/ w07h4NJgx1FX5jzA5LI6Lb5Fy/ne9lWF7fhcTJG/TkkVmlB8kYLaBfIi8yg5H4F90Ec8 2NsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389977; x=1780994777; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=1aoP8JnSJVfcSCTjAjHA83RTjVmAcYlXz9zYbrudYLM=; b=i4slENOqDBovxjt39PTzlnpSkjabD6++9A+3mhm+hCWXiJwwx40JCPxGketK1CUpiF dC6fJvbEVttMZ1tcthv8mABqhecS6IigHTpshpri2m8RBP2RoGEuqIIQ2wlot8QhH6qf PwKf/nvxk1bsu/QiLd9nTPjTVZrLxIuMwC1BugxDdK0AlaIkBGn8lz3n4hzgIYDmk55s E+WuH/MaGqzW0TYIFsbnSuUPkkxkp406ccLJ3fJLNzsFHnQ6wwztNBItV3v/WV69dMbs 9lPyQbgLn0VPDrJVAnkaeGiOk8dL68cngwybhFbpqpgEml8bn0RNtLBXYCIT6YRlouxo Aleg== X-Gm-Message-State: AOJu0YzxbOW3e4yBRlzyVPkHNGflo+EYNkSlomMOztBPBi6vizDeUvTk sDiCONEp6BIBRQVzYdv80lcPPZXxOYHWClP9hD0h0n+fakWbSB56EhtuQZJSVvd1Cb4BourTKlr NueU= X-Gm-Gg: Acq92OFgcBjFG6hXWn1GST+OfS2VMSxikdvJVc3IjiseZs1KCmQL3EQBbJzXQiRO/YR gdeTavTFIUvdnNSmyCEjXnN6cvOszIFNxsoCsMSGMCMN2+FHRiSy8/N1iTCngZf2pZHki/6rNhi fNFx16/t6CDgiYz6J+Nmf6tEoWpD/4b/MwALvm+yA0TT2hULILmPHUKH8uo/k4NnlP5mmH/sbNJ 8RCsSaomvRnUpenpk3SuHgHwXxqdCip8XHqiqO0+T3OGZpul5wn6ck3Vp4k8KLwL7/0K+Un8f2c 5Ex4vHY6GKYTISZeDi/T+Lyu4PVVJy/HClVLUpTbAEOXXjEYK6XaL1RovNmRXEzEhvcop0FaE+f NOhDWjjwfi73yJlDLmVyB0q/WWrPGuduF4CS2x4fZwxcc2pmacgHyL5Ki4fm9YQtss0w0HF6oa9 YTJODNI8mFHGrec1GPKvwE90TXUagoyNCSLm6SS8sKkNYSQtlYSN5l6ujYDfhKiRQuBXajivnpi AUvvHCw+u/ao/Daf9ZQEXHB3bITXLs= X-Received: by 2002:a05:600c:8582:b0:490:9df1:f0d5 with SMTP id 5b1f17b1804b1-490a2958b12mr204714925e9.28.1780389977469; Tue, 02 Jun 2026 01:46:17 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:16 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Viljar Indus Subject: [COMMITTED 25/51] ada: Avoid referencing ignored ghost nodes in finalizer Date: Tue, 2 Jun 2026 10:45:13 +0200 Message-ID: <20260602084541.3829876-25-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Viljar Indus gcc/ada/ChangeLog: * exp_ch7.adb (Processing_Actions): Avoid processing ignored ghost declarations. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch7.adb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index 292327c67c5..f4f30dcc85d 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -2430,6 +2430,14 @@ package body Exp_Ch7 is Strict : Boolean := False) is begin + -- No need to process ignored ghost declarations as they will be + -- removed later and therefore do not need finalization + -- primitives. + + if Is_Ignored_Ghost_Node (Decl) then + return; + end if; + -- Library-level tagged type if Nkind (Decl) = N_Full_Type_Declaration then From patchwork Tue Jun 2 08:45:14 2026 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: 136267 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C40E24BA23CB for ; Tue, 2 Jun 2026 09:12:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C40E24BA23CB Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=gvMd6ZXq X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id 75E2F4BA23DC for ; Tue, 2 Jun 2026 08:46:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 75E2F4BA23DC 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 75E2F4BA23DC Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389979; cv=none; b=HE2G7O5EESzfrATuRoqn57+sNCCRHvT3PPfQRaiBVppgT3FrbflO1YJRUsYTbC5Y4qQxhsZRYdybFUlWMA27AOLm0jh1okeYckfRVQhB0XrzTwfSy/1IgPINbbpLZ97rTml1isl/q7IUBVtfpJUxYpJk1rEsCTECPD4FIrpMn50= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389979; c=relaxed/simple; bh=UOUHyR+CQdyTtZWw27vIZWnvm4VX62VPySaL2EWS2OM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=h+jfGPfmfODHY5+mz9uKHhF/QeYL9NTX2d834ucwfpB3ZSMuQNcqKBiTEEqZNgX1wdRUpBrUa2Q+Q9X7woBeozphMJh2n6LDDY651OoRkLTLQWsui7+F90hkZjsazVKj10PYKMrl+PJGj/9A5cmvDTjTfZ6tpZsDo/czgFOJRKk= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=gvMd6ZXq DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 75E2F4BA23DC Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-49068493267so62488495e9.1 for ; Tue, 02 Jun 2026 01:46:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389978; x=1780994778; 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=4/+Uq8T+EeaZ+f0hODDnDoJwRTR8m7GO58qm8A8Unhk=; b=gvMd6ZXqPNMfggYeWlcrz/DF+H5LsHmWwDPe+YHWkTpbG9XPg8dj6iMmbfbDsHxpCS lGuUbHnpgPCnpFRBgwGbdbtBHjTvbYwlZRNGbsHnnvyDXRXnnM361efh6FO5XbS3Ars0 aY9t7ihtV2k4h8jTpOHBYRIllpkJtPP1lFU/FjUSGS2iLHmclKvAoT7MQNZVb3nye+Kz ofIl2SxYcDpTVOFf/MdgEfogIfTBznU0CbsUHN/iYdC3xS2dXmzfYR/GjsUeqnyka44u urLDsdrDNSQbTqhh+EEur5JyuiJCnSAvPCgSEHOYrKnjQp5vZdixFNtF/IJYYE7YULGq W6ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389978; x=1780994778; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=4/+Uq8T+EeaZ+f0hODDnDoJwRTR8m7GO58qm8A8Unhk=; b=WhAvX0M90c3xDq0VDyvMSybLNw+fiuoINI4dv7YZP3vgQ0HH4z9p0JLI0pU0GSR/39 HtSMVGcVu3tqsyb88vRTK6IhK9PO4pW8RJkZORHOGjgnvIU/FiHbq1n1vudOqfZR/tFP rJrt2MkV7Ivzo6ccXlFKMzSKw9cEZNPjW+YDNJ9AP4JhYwomi8iuZ0zO2bLbzhTRyrgk 8zlGof3C3yA1i2DUvzKizDR/DVPP2r3f5FlKgY6QycxRGYA5tEpI1/ODw91muIczU8nf bdWNJ2ndXSvMQRCVX3ZhKt0lK5KLetIqIqTRhp7O5yoNWtdIKsw/Kw2bAFB3ePFCLb+Z qSow== X-Gm-Message-State: AOJu0YxsWMvklvqixPBnpGCo13Jx3HQCfieCooUvpJO0ypgHpKBuxfNh xshjuCYdxJqGP+RuuTz6j3q8IsmvTBoVloH/Ozd8W4iWHS+Am/Qe54ZIuAmfoaX90afm7nC/DOf xmI4= X-Gm-Gg: Acq92OH+bSnD+oUNh0nN69qylXqcdOeZMtiwDY8ERLCLXMfOwAuVtvOd/qrpdx9aRA4 7b4LeNus15NdoEHP7H/39+6VUcIUG+OE5Gjl50TdmFz3lGv0L8XBg3XxH1Id+tyyCJ9hp4qqES5 jPzL26q7LafmlVXBJvUBzOsONFlt53/rhg/udtD1cWqDR0yY0B8GxsXbpJ7VNFsr48ff8PGTLiW HMFNMQqUAvWhVan9gWN4CXhou8KiuCUc0tBuRHtcgCInWe0j2alvnNiFTyj+gdFF3BmbNInAM1N qR/Il+sb6g+h26eIKRFe16TaoHrWvx3f0V8NuYyaplVQ/fq8IR2Yn2aId5z1jVvdP+Cg12D6u1l gPcXBsPTIxgZ+GSO12ioN0qh1+qu+65c/0UiZGPFulsHDj4HKhfyuvVbpCvxPZ5fJhXIbRK3Cll EL+Rpdws0hv341snHCrHXr3Lnc/u7tdK9kuR/tjNdyfdxp9HCHFg62I/kJ4chOUVBe49ElGxaCm KfMrZullB8G1JhIzH3OcRDFETfrHudQwVXHNNfHew== X-Received: by 2002:a05:600c:8b10:b0:490:5cb3:e94a with SMTP id 5b1f17b1804b1-490a2900d9dmr258692735e9.2.1780389978288; Tue, 02 Jun 2026 01:46:18 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:17 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 26/51] ada: Replace Activation_Chain_Entity field by Has_Activation_Chain_Entity flag Date: Tue, 2 Jun 2026 10:45:14 +0200 Message-ID: <20260602084541.3829876-26-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> 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, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Eric Botcazou The former lives on selected nodes while the latter lives on scope entities. This is more consistent because 1) activation chains are entities attached to a scope and 2) master entities already use the Has_Master_Entity flag. The ultimate goal is to make transient scopes compatible with task types. No functional changes. gcc/ada/ChangeLog: PR ada/42413 * gen_il-fields.ads (Opt_Field_Enum): Remove Activation_Chain_Entity and add Has_Activation_Chain_Entity. * gen_il-gen-gen_entities.adb (Entity_Kind): Add new semantic flag Has_Activation_Chain_Entity. * gen_il-gen-gen_nodes.adb (N_Subprogram_Body): Remove Activation_Chain_Entity field. (N_Task_Body): Likewise. (N_Package_Declaration): Likewise. (N_Block_Statement): Likewise. (N_Extended_Return_Statement): Likewise. (N_Entry_Body): Likewise. * einfo.ads (Has_Activation_Chain_Entity): Document new flag. * sinfo.ads (Activation_Chain_Entity): Delete documentation. * exp_ch9.adb (Build_Activation_Chain_Entity): Replace uses of Activation_Chain_Entity by Has_Activation_Chain_Entity. (Build_Task_Activation_Call): Retrieve the activation chain entity by means of new helper function Activation_Chain_Entity. (Build_Task_Allocate_Block): Set Has_Activation_Chain_Entity in lieu of Activation_Chain_Entity. (Expand_N_Task_Body): Likewise. (Find_Enclosing_Context): Fix handling of N_Entry_Body. * sem_ch7.adb (May_Need_Implicit_Body): Replace test on Activation_Chain_Entity by Has_Activation_Chain_Entity. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/einfo.ads | 18 +++++ gcc/ada/exp_ch9.adb | 104 +++++++++++++++++++--------- gcc/ada/gen_il-fields.ads | 2 +- gcc/ada/gen_il-gen-gen_entities.adb | 1 + gcc/ada/gen_il-gen-gen_nodes.adb | 6 -- gcc/ada/sem_ch7.adb | 2 +- gcc/ada/sinfo.ads | 19 ----- 7 files changed, 94 insertions(+), 58 deletions(-) diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index f8ea99719e0..9c293f47814 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -1488,6 +1488,17 @@ package Einfo is -- for Ghost entities without an assertion level, or a user-defined -- assertion level. +-- Has_Activation_Chain_Entity +-- Defined in entities that can appear in the scope stack (see spec +-- of Sem). It is set if an activation chain entity (_chain) has been +-- declared and initialized in the corresponding scope. + +-- Note that E_Return_Statement also has this attribute, although it is +-- not really a task activator: this chain is only used to store the +-- tasks temporarily, and is not used for activating them. On successful +-- completion of the return statement, the created tasks are moved onto +-- the caller's chain, and the caller activates them. + -- Has_Aliased_Components [implementation base type only] -- Defined in array type entities. Indicates that the component type -- of the array is aliased. Should this also be set for records to @@ -5320,6 +5331,7 @@ package Einfo is -- Contains_Ignored_Ghost_Code -- Delay_Cleanups -- Discard_Names + -- Has_Activation_Chain_Entity -- Has_Master_Entity -- Has_Nested_Block_With_Handler -- Is_Exception_Handler @@ -5632,6 +5644,7 @@ package Einfo is -- Delay_Cleanups -- Discard_Names -- Elaboration_Entity_Required + -- Has_Activation_Chain_Entity -- Has_Completion -- Has_Controlling_Result -- Has_Expanded_Contract (non-generic case only) @@ -5773,6 +5786,7 @@ package Einfo is -- E_Loop -- First_Exit_Statement + -- Has_Activation_Chain_Entity -- Has_Exit -- Has_Loop_Entry_Attributes -- Has_Master_Entity @@ -5887,6 +5901,7 @@ package Einfo is -- Elaborate_Body_Desirable (non-generic case only) -- Elaboration_Entity_Required -- From_Limited_With + -- Has_Activation_Chain_Entity -- Has_All_Calls_Remote -- Has_Completion -- Has_Forward_Instantiation @@ -5998,6 +6013,7 @@ package Einfo is -- Default_Expressions_Processed -- Delay_Cleanups -- Discard_Names + -- Has_Activation_Chain_Entity -- Has_Completion -- Has_Expanded_Contract (non-generic case only) -- Has_Master_Entity @@ -6169,6 +6185,7 @@ package Einfo is -- Return_Applies_To -- First_Entity $$$ -- Last_Entity $$$ + -- Has_Activation_Chain_Entity -- E_Signed_Integer_Type -- E_Signed_Integer_Subtype @@ -6254,6 +6271,7 @@ package Einfo is -- Contract -- SPARK_Aux_Pragma -- Delay_Cleanups + -- Has_Activation_Chain_Entity -- Has_Master_Entity -- Has_Storage_Size_Clause (base type only) -- Ignore_SPARK_Mode_Pragmas diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index e4a991074e1..ee98ab3b541 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -995,7 +995,7 @@ package body Exp_Ch9 is -- If activation chain entity has not been declared already, create one - if No (Activation_Chain_Entity (Context)) then + if not Has_Activation_Chain_Entity (Context_Id) then declare Loc : constant Source_Ptr := Sloc (Context); Chain : Entity_Id; @@ -1004,8 +1004,6 @@ package body Exp_Ch9 is begin Chain := Make_Defining_Identifier (Sloc (N), Name_uChain); - Set_Activation_Chain_Entity (Context, Chain); - Decl := Make_Object_Declaration (Loc, Defining_Identifier => Chain, @@ -1024,6 +1022,8 @@ package body Exp_Ch9 is else Analyze (Decl); end if; + + Set_Has_Activation_Chain_Entity (Context_Id); end; end if; end Build_Activation_Chain_Entity; @@ -4395,6 +4395,9 @@ package body Exp_Ch9 is function Activation_Call_Loc return Source_Ptr; -- Find a suitable source location for the activation call + function Activation_Chain_Entity (N : Node_Id) return Entity_Id; + -- Return the entity of the activation chain associated with N + ------------------------- -- Activation_Call_Loc -- ------------------------- @@ -4415,13 +4418,60 @@ package body Exp_Ch9 is end if; end Activation_Call_Loc; + ----------------------------- + -- Activation_Chain_Entity -- + ----------------------------- + + function Activation_Chain_Entity (N : Node_Id) return Entity_Id is + K : constant Node_Kind := Nkind (N); + Def_Id : constant Entity_Id := + (if K = N_Subprogram_Body and then Is_Task_Body_Procedure (N) + then Corresponding_Spec (Original_Node (N)) + else Unique_Defining_Entity (N)); + -- For task body procedures, the entity is chained on the task spec + + E : Entity_Id; + + begin + if not Has_Activation_Chain_Entity (Def_Id) then + return Empty; + end if; + + E := First_Entity (Def_Id); + while Present (E) loop + exit when Chars (E) = Name_uChain; + Next_Entity (E); + end loop; + + -- For package and subprogram bodies, entities first chained on the + -- spec may subsequently be moved to the body when they are created + -- during the analysis of the body, see the manipulation at the end + -- of Analyze_{Package,Subprogram}_Body_Helper. + + if No (E) + and then K in N_Package_Body | N_Subprogram_Body + and then Present (Corresponding_Spec (N)) + then + E := First_Entity (Defining_Entity (N)); + while Present (E) loop + exit when Chars (E) = Name_uChain; + Next_Entity (E); + end loop; + end if; + + -- The entity must be present if the flag is set + + pragma Assert (Present (E)); + + return E; + end Activation_Chain_Entity; + -- Local variables Chain : Entity_Id; Call : Node_Id; Loc : Source_Ptr; Name : Node_Id; - Owner : Node_Id; Stmt : Node_Id; -- Start of processing for Build_Task_Activation_Call @@ -4443,25 +4493,16 @@ package body Exp_Ch9 is return; end if; - -- Obtain the activation chain entity. Block statements, entry bodies, - -- subprogram bodies, and task bodies keep the entity in their nodes. - -- Package bodies on the other hand store it in the declaration of the - -- corresponding package spec. - - Owner := N; - - if Nkind (Owner) = N_Package_Body then - Owner := Unit_Declaration_Node (Corresponding_Spec (Owner)); - end if; - -- An extended return statement is not really a task activator, but it -- does have an activation chain on which to store tasks temporarily. -- On successful return, the tasks on this chain are moved to the chain -- passed in by the caller. - pragma Assert (Nkind (Owner) /= N_Extended_Return_Statement); + pragma Assert (Nkind (N) /= N_Extended_Return_Statement); - Chain := Activation_Chain_Entity (Owner); + -- Obtain the activation chain entity + + Chain := Activation_Chain_Entity (N); -- Nothing to do when there are no tasks to activate. This is indicated -- by a missing activation chain entity; also skip generating it when @@ -4604,7 +4645,7 @@ package body Exp_Ch9 is Has_Created_Identifier => True, Is_Task_Allocation_Block => True); - Set_Activation_Chain_Entity (Block, Chain); + Set_Has_Activation_Chain_Entity (Blkent); return Block; end Build_Task_Allocate_Block; @@ -11334,16 +11375,15 @@ package body Exp_Ch9 is -- callings sequence is identical. procedure Expand_N_Task_Body (N : Node_Id) is - Loc : constant Source_Ptr := Sloc (N); - Ttyp : constant Entity_Id := Corresponding_Spec (N); - Call : Node_Id; - New_N : Node_Id; + Loc : constant Source_Ptr := Sloc (N); + Ttyp : constant Entity_Id := Corresponding_Spec (N); + Call : Node_Id; Insert_Nod : Node_Id; - -- Used to determine the proper location of wrapper body insertions + New_N : Node_Id; begin - -- if no task body procedure, means we had an error in configurable + -- If no task body procedure, means we had an error in configurable -- run-time mode, and there is no point in proceeding further. if No (Task_Body_Procedure (Ttyp)) then @@ -11386,14 +11426,16 @@ package body Exp_Ch9 is Set_At_End_Proc (New_N, At_End_Proc (N)); -- If the task contains generic instantiations, cleanup actions are - -- delayed until after instantiation. Transfer the activation chain to - -- the subprogram, to insure that the activation call is properly - -- generated. It the task body contains inner tasks, indicate that the - -- subprogram is a task master. + -- delayed until after instantiation. Propagate the activation chain + -- to the subprogram, to ensure that the activation call is properly + -- generated, and indicate that the subprogram body is a task master. if Delay_Cleanups (Ttyp) then - Set_Activation_Chain_Entity (New_N, Activation_Chain_Entity (N)); - Set_Is_Task_Master (New_N, Is_Task_Master (N)); + Set_Has_Activation_Chain_Entity + (Task_Body_Procedure (Ttyp), Has_Activation_Chain_Entity (Ttyp)); + Set_Has_Master_Entity + (Task_Body_Procedure (Ttyp), Has_Master_Entity (Ttyp)); + Set_Is_Task_Master (New_N, Is_Task_Master (N)); end if; Rewrite (N, New_N); @@ -13051,7 +13093,7 @@ package body Exp_Ch9 is end if; elsif Nkind (Context) = N_Entry_Body then - Context_Id := Defining_Identifier (Context); + Context_Id := Corresponding_Spec (Context); elsif Nkind (Context) = N_Subprogram_Body then if Present (Corresponding_Spec (Context)) then diff --git a/gcc/ada/gen_il-fields.ads b/gcc/ada/gen_il-fields.ads index 956dc72374f..31e7cb458fd 100644 --- a/gcc/ada/gen_il-fields.ads +++ b/gcc/ada/gen_il-fields.ads @@ -61,7 +61,6 @@ package Gen_IL.Fields is Access_To_Subprogram_Definition, Access_Types_To_Process, Actions, - Activation_Chain_Entity, Acts_As_Spec, Actual_Designated_Subtype, Aggregate_Bounds_Or_Ancestor_Type, @@ -558,6 +557,7 @@ package Gen_IL.Fields is Generic_Homonym, Generic_Renamings, Ghost_Assertion_Level, + Has_Activation_Chain_Entity, Has_Aliased_Components, Has_Alignment_Clause, Has_All_Calls_Remote, diff --git a/gcc/ada/gen_il-gen-gen_entities.adb b/gcc/ada/gen_il-gen-gen_entities.adb index 84bcc429642..716c1d33f7a 100644 --- a/gcc/ada/gen_il-gen-gen_entities.adb +++ b/gcc/ada/gen_il-gen-gen_entities.adb @@ -64,6 +64,7 @@ begin -- Gen_IL.Gen.Gen_Entities Sm (Freeze_Node, Node_Id), Sm (From_Limited_With, Flag), Sm (Ghost_Assertion_Level, Node_Id), + Sm (Has_Activation_Chain_Entity, Flag), Sm (Has_Aliased_Components, Flag, Impl_Base_Type_Only), Sm (Has_Alignment_Clause, Flag), Sm (Has_All_Calls_Remote, Flag), diff --git a/gcc/ada/gen_il-gen-gen_nodes.adb b/gcc/ada/gen_il-gen-gen_nodes.adb index eeaa55d9b8f..23ec869f4f3 100644 --- a/gcc/ada/gen_il-gen-gen_nodes.adb +++ b/gcc/ada/gen_il-gen-gen_nodes.adb @@ -737,7 +737,6 @@ begin -- Gen_IL.Gen.Gen_Nodes Sy (Handled_Statement_Sequence, Node_Id, Default_Empty), Sy (Bad_Is_Detected, Flag), Sy (At_End_Proc, Node_Id, Default_Empty), - Sm (Activation_Chain_Entity, Node_Id), Sm (Acts_As_Spec, Flag), Sm (Corresponding_Entry_Body, Node_Id), Sm (Has_Relative_Deadline_Pragma, Flag), @@ -760,7 +759,6 @@ begin -- Gen_IL.Gen.Gen_Nodes Sy (Declarations, List_Id, Default_No_List), Sy (Handled_Statement_Sequence, Node_Id, Default_Empty), Sy (At_End_Proc, Node_Id, Default_Empty), - Sm (Activation_Chain_Entity, Node_Id), Sm (Is_Task_Master, Flag))); Cc (N_Implicit_Label_Declaration, N_Later_Decl_Item, @@ -770,7 +768,6 @@ begin -- Gen_IL.Gen.Gen_Nodes Cc (N_Package_Declaration, N_Later_Decl_Item, (Sy (Specification, Node_Id), Sy (Aspect_Specifications, List_Id, Default_No_List), - Sm (Activation_Chain_Entity, Node_Id), Sm (Corresponding_Body, Node_Id), Sm (Parent_Spec, Node_Id))); @@ -915,7 +912,6 @@ begin -- Gen_IL.Gen.Gen_Nodes Sy (Is_Asynchronous_Call_Block, Flag), Sy (Is_Task_Allocation_Block, Flag), Sy (At_End_Proc, Node_Id, Default_Empty), - Sm (Activation_Chain_Entity, Node_Id), Sm (Cleanup_Actions, List_Id), Sm (Exception_Junk, Flag), Sm (Is_Abort_Block, Flag), @@ -1016,7 +1012,6 @@ begin -- Gen_IL.Gen.Gen_Nodes Cc (N_Extended_Return_Statement, N_Statement_Other_Than_Procedure_Call, (Sy (Return_Object_Declarations, List_Id), Sy (Handled_Statement_Sequence, Node_Id, Default_Empty), - Sm (Activation_Chain_Entity, Node_Id), Sm (Procedure_To_Call, Node_Id), Sm (Return_Statement_Entity, Node_Id), Sm (Storage_Pool, Node_Id))); @@ -1277,7 +1272,6 @@ begin -- Gen_IL.Gen.Gen_Nodes Sy (Handled_Statement_Sequence, Node_Id, Default_Empty), Sy (At_End_Proc, Node_Id, Default_Empty), Sy (Aspect_Specifications, List_Id, Default_No_List), - Sm (Activation_Chain_Entity, Node_Id), Sm (Corresponding_Spec, Node_Id))); Cc (N_Entry_Call_Alternative, Node_Kind, diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb index 92b8f9a22b8..1b9d5f848c7 100644 --- a/gcc/ada/sem_ch7.adb +++ b/gcc/ada/sem_ch7.adb @@ -2717,7 +2717,7 @@ package body Sem_Ch7 is begin if not Has_Completion (E) and then Nkind (P) = N_Package_Declaration - and then (Present (Activation_Chain_Entity (P)) or else Has_RACW (E)) + and then (Has_Activation_Chain_Entity (E) or else Has_RACW (E)) then B := Make_Package_Body (Sloc (E), diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index 1ec49fb5e93..01f08ec4a22 100644 --- a/gcc/ada/sinfo.ads +++ b/gcc/ada/sinfo.ads @@ -749,20 +749,6 @@ package Sinfo is -- how this field is used, as well as the description of the specific use -- for a particular node type. - -- Activation_Chain_Entity - -- This is used in tree nodes representing task activators (blocks, - -- subprogram bodies, package declarations, and task bodies). It is - -- initially Empty, and then gets set to point to the entity for the - -- declared Activation_Chain variable when the first task is declared. - -- When tasks are declared in the corresponding declarative region this - -- entity is located by name (its name is always _Chain) and the declared - -- tasks are added to the chain. Note that N_Extended_Return_Statement - -- also has this attribute, although it is not really a task activator: - -- this chain is only used to store the tasks temporarily, and is not - -- used for activating them. On successful completion of the return - -- statement, the tasks are moved to the caller's chain, and the caller - -- activates them. - -- Acts_As_Spec -- A flag set in the N_Subprogram_Body node for a subprogram body which -- is acting as its own spec. In the case of a library-level subprogram @@ -5199,7 +5185,6 @@ package Sinfo is -- Identifier block direct name (set to Empty if not present) -- Declarations (set to No_List if no DECLARE part) -- Handled_Statement_Sequence - -- Activation_Chain_Entity -- Cleanup_Actions -- At_End_Proc (set to Empty if no clean up procedure) -- Exception_Junk @@ -5498,7 +5483,6 @@ package Sinfo is -- Specification -- Declarations -- Handled_Statement_Sequence - -- Activation_Chain_Entity -- Corresponding_Spec -- At_End_Proc (set to Empty if no clean up procedure) -- Acts_As_Spec @@ -5695,7 +5679,6 @@ package Sinfo is -- Specification -- Corresponding_Body -- Parent_Spec - -- Activation_Chain_Entity -------------------------------- -- 7.1 Package Specification -- @@ -6034,7 +6017,6 @@ package Sinfo is -- Declarations -- Handled_Statement_Sequence -- Is_Task_Master - -- Activation_Chain_Entity -- Corresponding_Spec -- Was_Originally_Stub @@ -6218,7 +6200,6 @@ package Sinfo is -- Entry_Body_Formal_Part -- Declarations -- Handled_Statement_Sequence - -- Activation_Chain_Entity -- Corresponding_Spec -- At_End_Proc (set to Empty if no clean up procedure) From patchwork Tue Jun 2 08:45:15 2026 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: 136263 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7EC2E4BA23E1 for ; Tue, 2 Jun 2026 09:09:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7EC2E4BA23E1 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=hzTYXLBG X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id 3216F4BA23CD for ; Tue, 2 Jun 2026 08:46:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3216F4BA23CD 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 3216F4BA23CD Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389980; cv=none; b=w2kpoXF8U0gYAt5hAbLohNt0BuD7soT3fBjmh3sdsrF1yEgBO/UJnYbSJqysI1V5c7hPFg4mmyDiDqh/KhAsQEq9gaiRq/TIKsj7j45CIKCT+ZMntkdfl0LQ5Z50ZIerDcqIYm1WobAWTjjcT8l36mBQI+MsyMN9sB6zpGTo9lU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389980; c=relaxed/simple; bh=mLfF57cAIjzqmeXhtUU82fBrzUsdGzsTTrtezbY3h6k=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=RvmQIUoGDkIJL6isKxJPYrvSVdyMrJMKIXmC3WBOugRcOtu74Mr3EUn/3bQ20QzT8TAQsKDXaYQxmDQPq2InkyMIJEthvoXyErkAkXRZVHjuR3lYPgfTZgrCTs0+BxmEyzV+4n+CNsK9WTQZEH/DJKHHw9kCprrKzEWoClNCqu0= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=hzTYXLBG DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3216F4BA23CD Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4909e3fa4b2so39353915e9.0 for ; Tue, 02 Jun 2026 01:46:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389979; x=1780994779; 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=T6oxreO4FCeZt7beSKmaYWD5XfCWJGUWy6RrtZjgCT4=; b=hzTYXLBGgMIuDU2ga4IzAo/6Cgf9u0uP8W6tOczNr4WfRwUS/ZzrvfKWDllTmb28Pr BYBbTAa9GgFV1O5MGJZzfDaQfo/O+USB3gO90bCvzNOd8c73GJNNo6KSlcfiel/9kbP2 NFWkHTY7e0qoD+phjZeNjr9Tpla03L/5h7SaMFV9kcBg7T9cR6Wb74COlh3LtOKo/HjX 7srhD9cKQbYWzspS43bU1ntyH9xZjAR4oFoTbxcZv+UraacIM87DnJkvMSjGCo/Wtmsp WPbN6vi1iCxqZ8XQs83OaxnbIwDHv4AI+wu7jOKi6Ljgsm3pbVJObDTuotOdUlqih4ZX IFBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389979; x=1780994779; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=T6oxreO4FCeZt7beSKmaYWD5XfCWJGUWy6RrtZjgCT4=; b=dh5iBqQSnDGjV+2StzdTiZa4tTS7ltDBmUDlyB8Rm4Bqdi8/ny7IWVwRq6kIbQOZhY scSYzDUPo00i4wr3jajlhDD82rTicE9d8qMA1GXrh2vHVuxIlV6YolFdIX+zcEHx/H/i 7DFueTl+yuyyqKUplDXbhKzRLE0tMN2BiZ4iAo9IuDgNavaCsHkmrdAUeMdfs7jyyUJn txUHlC0LIsBZzbX/qR9gj+fpEWmzSyTduZuMFZ2GYvXGTHhACOW2x+oZgpaj/J3DDvlP qglJywlGRDedY2jQukNpwarB74Ht3pf+lxHLC1UZtgs6ii1KCbrbTaI5PoZZbmwoiu+r IGWw== X-Gm-Message-State: AOJu0YyTenKS9C0RVYSOjprGllZevI7991fT6kIHjWLk78khPO8wc+PL 9/6fE4CEdj7ViHGyPCG0D6U/t8ADp/4oARz2A2fGw/4k44VGlqsCfJgoTGrQv87ScqzzSXS0aQJ kAM0= X-Gm-Gg: Acq92OGFIdUjbNlJINY1sbiBXaHYQQ/KNpcI7eqaqgMLlsVkute95mQ7t4TaSCe8aww XRUULiAxejWIKJaaoAx8d6eNRzQwSMoqiVzNSMgEofiAeqm8/kg46IG6LJB5Jwhsq2cpapvyFcc +BopgEu3RxV/RbtVcS+wHs1ZFixxHLGEn3vLnWJ9H4K9NnOTtF+gg2efn+I/qfkgUpfiW9/vT6L G0304LHt0fCkrHeSX1wq2YchtsS2elhEpK8+gmN2cjRoPCJ3IvaSyG82ySvjjUsvZrQJHG7BwZv Ts20qvWmQ0zKS1SoI/UlCvjIehrB7N/4eKHUAaisPs7G3x0mZjLowfb1554xjk3ovuMipoE2DWI SXF94y+acwYz+6lCXKoWnWOAC3llbPivSyXAwWwFEKOWru+cEPj7d/F/WeAiK9hjdUpQ0qQNj8d k/o/YwrnQztRrrpsUhadJq2C9r3TSiO2wrDio5iWUnyvpxcn4oph5IaSSHzlSseSZksML6pv3Bz 26brIxNMKe3lX3tJC549iNhKlmvCZQ= X-Received: by 2002:a05:600c:6286:b0:490:5cd8:d21c with SMTP id 5b1f17b1804b1-490a3186815mr239570735e9.14.1780389979033; Tue, 02 Jun 2026 01:46:19 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:18 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 27/51] ada: Small tweaks in task activation support code Date: Tue, 2 Jun 2026 10:45:15 +0200 Message-ID: <20260602084541.3829876-27-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> 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, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Eric Botcazou This streamlines Build_Activation_Chain_Entity, factors out common code in Exp_Ch9, and changes the category of the Is_Task_Allocation_Block flag. No functional changes. gcc/ada/ChangeLog: PR ada/42413 * exp_aggr.adb (Build_Record_Aggr_Code): Minor tweak. * exp_ch9.adb (Make_Task_Activation_Call): New helper function. (Build_Activation_Chain_Entity): Streamline. (Build_Master_Entity): Rename local variable. (Build_Task_Activation_Call): Call Make_Task_Activation_Call. (Build_Task_Allocate_Block): Likewise. Set Is_Task_Allocation_Block separately after having created the block. * gen_il-gen-gen_nodes.adb (N_Block_Statement): Change the category of Is_Task_Allocation_Block flag from syntactic to semantic. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_aggr.adb | 28 +++--- gcc/ada/exp_ch9.adb | 141 ++++++++++++++++--------------- gcc/ada/gen_il-gen-gen_nodes.adb | 2 +- 3 files changed, 92 insertions(+), 79 deletions(-) diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index d0c25e8346a..ba8bf71912b 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -3345,21 +3345,27 @@ package body Exp_Aggr is Generate_Finalization_Actions; end if; - -- Ada 2005 (AI-287): If the component type has tasks then - -- generate the activation chain and master entities (except - -- in case of an allocator because in that case these entities - -- are generated by Build_Task_Allocate_Block). + -- Ada 2005 (AI-287): If the component type has tasks, then + -- generate the activation chain entity, except in the case + -- of an allocator, where it will be created by the call to + -- Build_Task_Allocate_Block from Convert_Aggr_In_Allocator. - declare - Inside_Allocator : Boolean := False; - P : Node_Id := Parent (N); + if Has_Task (Ctype) then + declare + Inside_Allocator : Boolean := False; + P : Node_Id; - begin - if Is_Task_Type (Ctype) or else Has_Task (Ctype) then + begin + P := Parent (N); while Present (P) loop if Nkind (P) = N_Allocator then Inside_Allocator := True; exit; + + -- Prevent the search from going too far + + elsif Is_Body_Or_Package_Declaration (P) then + exit; end if; P := Parent (P); @@ -3368,8 +3374,8 @@ package body Exp_Aggr is if not Inside_Init_Proc and not Inside_Allocator then Build_Activation_Chain_Entity (N); end if; - end if; - end; + end; + end if; if not Restriction_Active (No_Default_Initialization) then Append_List_To (L, diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index ee98ab3b541..22c3515a46d 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -454,6 +454,11 @@ package body Exp_Ch9 is -- Determine whether Id is a function or a procedure and is marked as a -- private primitive. + function Make_Task_Activation_Call + (Loc : Source_Ptr; + Chain : Entity_Id) return Node_Id; + -- Build a call to Activate_Tasks with Chain as the single parameter + function Make_Unlock_Statement (Prot_Type : E_Protected_Type_Id; Op_Spec : N_Subprogram_Specification_Id; @@ -971,9 +976,10 @@ package body Exp_Ch9 is ----------------------------------- procedure Build_Activation_Chain_Entity (N : Node_Id) is - Context : Node_Id; - Context_Id : Entity_Id; - Decls : List_Id; + Context : Node_Id; + Context_Id : Entity_Id; + Context_Decls : List_Id; + Decl : Node_Id; -- Start of processing for Build_Activation_Chain_Entity @@ -991,41 +997,35 @@ package body Exp_Ch9 is return; end if; - Find_Enclosing_Context (N, Context, Context_Id, Decls); + Find_Enclosing_Context (N, Context, Context_Id, Context_Decls); - -- If activation chain entity has not been declared already, create one + -- Nothing to do if the context already has an activation chain entity - if not Has_Activation_Chain_Entity (Context_Id) then - declare - Loc : constant Source_Ptr := Sloc (Context); - Chain : Entity_Id; - Decl : Node_Id; - - begin - Chain := Make_Defining_Identifier (Sloc (N), Name_uChain); - - Decl := - Make_Object_Declaration (Loc, - Defining_Identifier => Chain, - Aliased_Present => True, - Object_Definition => - New_Occurrence_Of (RTE (RE_Activation_Chain), Loc)); - - Prepend_To (Decls, Decl); - - -- Ensure that _chain appears in the proper scope of the context - - if Context_Id /= Current_Scope then - Push_Scope (Context_Id); - Analyze (Decl); - Pop_Scope; - else - Analyze (Decl); - end if; - - Set_Has_Activation_Chain_Entity (Context_Id); - end; + if Has_Activation_Chain_Entity (Context_Id) then + return; end if; + + Decl := + Make_Object_Declaration (Sloc (N), + Defining_Identifier => + Make_Defining_Identifier (Sloc (N), Name_uChain), + Aliased_Present => True, + Object_Definition => + New_Occurrence_Of (RTE (RE_Activation_Chain), Sloc (N))); + + Prepend_To (Context_Decls, Decl); + + -- Ensure that _chain appears in the proper scope of the context + + if Context_Id /= Current_Scope then + Push_Scope (Context_Id); + Analyze (Decl); + Pop_Scope; + else + Analyze (Decl); + end if; + + Set_Has_Activation_Chain_Entity (Context_Id); end Build_Activation_Chain_Entity; ---------------------------- @@ -3034,10 +3034,10 @@ package body Exp_Ch9 is ------------------------- procedure Build_Master_Entity (N : Node_Id) is - Context : Node_Id; - Context_Id : Entity_Id; - Decl : Node_Id; - Decls : List_Id; + Context : Node_Id; + Context_Id : Entity_Id; + Context_Decls : List_Id; + Decl : Node_Id; begin -- No action needed if the run-time has no tasking support @@ -3051,16 +3051,16 @@ package body Exp_Ch9 is -- proper insertion point is the component list. if Is_Record_Type (Current_Scope) then - Context := N; + Context := N; Context_Id := Current_Scope; - Decls := List_Containing (Context); + Context_Decls := List_Containing (Context); -- Default case for object declarations and access types. Note that the -- context is updated to the nearest enclosing body, block, package, or -- return statement. else - Find_Enclosing_Context (N, Context, Context_Id, Decls); + Find_Enclosing_Context (N, Context, Context_Id, Context_Decls); end if; pragma Assert (not Is_Finalizer (Context_Id)); @@ -3076,7 +3076,7 @@ package body Exp_Ch9 is -- The master is inserted at the start of the declarative list of the -- context. - Prepend_To (Decls, Decl); + Prepend_To (Context_Decls, Decl); -- In certain cases where transient scopes are involved, the immediate -- scope is not always the proper master scope. Ensure that the master @@ -4471,7 +4471,6 @@ package body Exp_Ch9 is Chain : Entity_Id; Call : Node_Id; Loc : Source_Ptr; - Name : Node_Id; Stmt : Node_Id; -- Start of processing for Build_Task_Activation_Call @@ -4530,19 +4529,7 @@ package body Exp_Ch9 is Loc := Activation_Call_Loc; - if Restricted_Profile then - Name := New_Occurrence_Of (RTE (RE_Activate_Restricted_Tasks), Loc); - else - Name := New_Occurrence_Of (RTE (RE_Activate_Tasks), Loc); - end if; - - Call := - Make_Procedure_Call_Statement (Loc, - Name => Name, - Parameter_Associations => - New_List (Make_Attribute_Reference (Loc, - Prefix => New_Occurrence_Of (Chain, Loc), - Attribute_Name => Name_Unchecked_Access))); + Call := Make_Task_Activation_Call (Loc, Chain); if Nkind (N) = N_Package_Declaration then if Present (Private_Declarations (Specification (N))) then @@ -4617,14 +4604,9 @@ package body Exp_Ch9 is begin Set_Etype (Blkent, Standard_Void_Type); + Set_Has_Activation_Chain_Entity (Blkent); - Append_To (Init_Stmts, - Make_Procedure_Call_Statement (Loc, - Name => New_Occurrence_Of (RTE (RE_Activate_Tasks), Loc), - Parameter_Associations => New_List ( - Make_Attribute_Reference (Loc, - Prefix => New_Occurrence_Of (Chain, Loc), - Attribute_Name => Name_Unchecked_Access)))); + Append_To (Init_Stmts, Make_Task_Activation_Call (Loc, Chain)); Block := Make_Block_Statement (Loc, @@ -4642,10 +4624,9 @@ package body Exp_Ch9 is Handled_Statement_Sequence => Make_Handled_Sequence_Of_Statements (Loc, Init_Stmts), - Has_Created_Identifier => True, - Is_Task_Allocation_Block => True); + Has_Created_Identifier => True); - Set_Has_Activation_Chain_Entity (Blkent); + Set_Is_Task_Allocation_Block (Block); return Block; end Build_Task_Allocate_Block; @@ -14020,6 +14001,32 @@ package body Exp_Ch9 is return L; end Make_Initialize_Protection; + ------------------------------- + -- Make_Task_Activation_Call -- + ------------------------------- + + function Make_Task_Activation_Call + (Loc : Source_Ptr; + Chain : Entity_Id) return Node_Id + is + Name : Node_Id; + + begin + if Restricted_Profile then + Name := New_Occurrence_Of (RTE (RE_Activate_Restricted_Tasks), Loc); + else + Name := New_Occurrence_Of (RTE (RE_Activate_Tasks), Loc); + end if; + + return + Make_Procedure_Call_Statement (Loc, + Name => Name, + Parameter_Associations => + New_List (Make_Attribute_Reference (Loc, + Prefix => New_Occurrence_Of (Chain, Loc), + Attribute_Name => Name_Unchecked_Access))); + end Make_Task_Activation_Call; + --------------------------- -- Make_Task_Create_Call -- --------------------------- diff --git a/gcc/ada/gen_il-gen-gen_nodes.adb b/gcc/ada/gen_il-gen-gen_nodes.adb index 23ec869f4f3..09438f44a0c 100644 --- a/gcc/ada/gen_il-gen-gen_nodes.adb +++ b/gcc/ada/gen_il-gen-gen_nodes.adb @@ -910,13 +910,13 @@ begin -- Gen_IL.Gen.Gen_Nodes Sy (Handled_Statement_Sequence, Node_Id, Default_Empty), Sy (Has_Created_Identifier, Flag), Sy (Is_Asynchronous_Call_Block, Flag), - Sy (Is_Task_Allocation_Block, Flag), Sy (At_End_Proc, Node_Id, Default_Empty), Sm (Cleanup_Actions, List_Id), Sm (Exception_Junk, Flag), Sm (Is_Abort_Block, Flag), Sm (Is_Expanded_Dispatching_Call, Flag), Sm (Is_Initialization_Block, Flag), + Sm (Is_Task_Allocation_Block, Flag), Sm (Is_Task_Master, Flag))); Cc (N_Case_Statement, N_Statement_Other_Than_Procedure_Call, From patchwork Tue Jun 2 08:45:16 2026 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: 136270 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B9A5D4BA2E1A for ; Tue, 2 Jun 2026 09:15:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B9A5D4BA2E1A Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=hSsqzJxL X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id 0CE7C4BA23C6 for ; Tue, 2 Jun 2026 08:46:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0CE7C4BA23C6 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 0CE7C4BA23C6 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::331 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389981; cv=none; b=Ep/xLdaRT6ki0mooS38r16pg7JRqDC18yJ/PhJ4kJ22KH4RSaokbwOEPZm0LljgHbJjaUhevpZ5shhxDXMW5tHyDDur5+1SSP0Ezb9EPgqDnHGk+6cerf5lsx5McZ0dCmu+/O/kHKNgove/rWJ6A7p2uElp9qe3csJAbkz/omW8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389981; c=relaxed/simple; bh=V2d1vXidS+fuOi2rE+9LmlirACbsw/0bBW3nl8G+spQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ee4XRODRf879bFDKMipuuFzrMRuRqCga0jofNYz1e/icBVI18Jnn0I19QW0eyKr3DBV7PYUqLHriH0FwteIMd8gJdpgnJRnKehscGIWcLRFymVhmKmadAWVhGgrhlG/GBW5esoizUaBdQTjTxWR3y9tqB/zYf908JbVH4MZJQKY= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=hSsqzJxL DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0CE7C4BA23C6 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-490abf12f0fso8675795e9.0 for ; Tue, 02 Jun 2026 01:46:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389980; x=1780994780; 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=JlzJbSO9R2w1IVTs5HCGsJiDG90UDGDSowWn8aw3JHo=; b=hSsqzJxLBAV3Kalxsav8GK7DgB2JWmTuWTVpDcXgvZuzpug653ECphVjDERaTJ+kUC BrWij8YJByTcwIm4PdX/7qkkRUqHdSQy9+WmtLCcoqiiATqLT72PS2Blg8cZRrxi+BMG 9fquXjqElyCzzSEtNQN2eV0rVEkgp8qUbV/ntlLbHaX5IfB+3Tadyj4SFnPA9pH4h2FW ZcJxGNXjn/UNpqyXeq9MwXKLMv0oGbTmRG6gtyAwW/eG53W/1QxWblV3ypb9Br8USL9z X3Fh21LoybXuG+0L8stojO/IR+cC6X8scZ3B4D2kpq1IMcV6GGdBE1qDIeWVGC5r9Ve6 5ivg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389980; x=1780994780; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=JlzJbSO9R2w1IVTs5HCGsJiDG90UDGDSowWn8aw3JHo=; b=oFdqqc4KfFQ5WhnVbZcrk8Nfiff36fCf8JeCZXxSHNeiAxpGfWK2Wu6fnfX/IZOa6F kmM+/7ZNrKWsRrgNpc+3stK40B3g636TgreVNU3gb6tY3J8mQtOQrn0uL1qNVoSaj3Gt RAkS29RGFc7Ctb5TzH6F2hnVUfunBOTQhjpFS2icRA0Kv/Y6XwxmouAsp3uMHqOwR/On qlKbre4sX3u36e4YkCjdg59PBGKirZnMkarFXaZcaiAxsCRLy9yuAkw6TB/+73ENX2qY ozvkLSIngVQs8xIgGzMlJIKHBCAz1A8cRUuH+8uXqgvS5/bn+Xf3wGRjWEzB1NZClIwa jjoA== X-Gm-Message-State: AOJu0YxvaFa+St8Ej6cj6sPAFGWXBYCk0DGkuq/Vbqs8WvFIfcg49MVH vCJwYSHvUXnDIkFN0qzFTcLaTAjmgJyWuwc/psYXb7WyFKaypseZGUr8by4q5SEUuPMDthxCrVM j0pY= X-Gm-Gg: Acq92OFbCGilK5bmmdj2Vz3BCNc52VOtzHw3Z4JH706xIahVLX31BOj6yfpXRih5IYq j+3WiErtHbsFe4VDoK709rm+rZK1iv+rmDmOgrCIOe62/0a7nqdLZ/KvXyxQ5kthMOQpnOStQ1R A3IL89c57wvvST4McBjk8WmnkAPvBIvGrGWnd7GdkZ6+hbtnUoVMsB5T637Suwt+yQV7gjoVJF1 suuJDfdO+iPjZb9CXjzGMrnHWkr5ae1g5GGwBSlmQTWyp6IUSfIy2v8WCewHci8Q/njNWyfVW0f tNvg9W3u+2fk92JSnOLjZiNZQoJoDDFS4D38Oo8COxeuoe2PFDfJx87BsMy5+fYsp82MZdh6Vzr IDVDu9wX4PKkRQIDDPXaICVNsJunv3WeOuUy0Tk2LLIn0C3k937gJDUM0luGLR75S1ksJqT2SZq jByF1HXAmzFgoiJJBvAqY4Em910uu9WNOPM2KKjtNswpzwHWeqQ+xJzJUrEP9afbdGq3cWbzTH7 2HAhNVkO9IBpcBAmlhfzPv4GEMQChc= X-Received: by 2002:a05:600c:3b97:b0:490:adce:251c with SMTP id 5b1f17b1804b1-490b0e4d010mr53096655e9.4.1780389979861; Tue, 02 Jun 2026 01:46:19 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:19 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 28/51] ada: Fix problematic call to function returning task in anonymous context Date: Tue, 2 Jun 2026 10:45:16 +0200 Message-ID: <20260602084541.3829876-28-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 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, PROLO_LEO1, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Eric Botcazou The problem is that the task returned by the call to the function is never activated. This is fixed by creating a transient scope around the call, as is done for controlled types, after making transient scopes compatible with task types. gcc/ada/ChangeLog: PR ada/42413 * exp_ch4.adb (Process_Transients_In_Expression): Deal with a task activation chain present in the statement list. * exp_ch6.adb (Make_Build_In_Place_Call_In_Anonymous_Context): Also establish a transient scope if the result type has tasks. * exp_ch7.adb (Make_Transient_Block): Deal with Has_Master_Entity and Has_Activation_Chain_Entity set on the transient scope. * exp_ch9.ads (Make_Task_Activation_Call): New declaration from... * exp_ch9.adb (Make_Task_Activation_Call): ...here. (Build_Activation_Chain_Entity): Deal with transient scopes. (Build_Master_Entity): Likewise. (Find_Enclosing_Context): Likewise. * sem_elab.adb (Activation_Processor.Process_Activation): Deal with N_Expression_With_Actions nodes. * sem_util.adb (Current_Entity_In_Scope): Prevent transient scopes from being transparent for _Chain and _Master entities. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch4.adb | 16 +++++--- gcc/ada/exp_ch6.adb | 17 +++++---- gcc/ada/exp_ch7.adb | 50 +++++++++++++++++++++---- gcc/ada/exp_ch9.adb | 88 ++++++++++++++++++++++++++------------------ gcc/ada/exp_ch9.ads | 5 +++ gcc/ada/sem_elab.adb | 8 ++++ gcc/ada/sem_util.adb | 5 ++- 7 files changed, 133 insertions(+), 56 deletions(-) diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index f39c80337e7..2763aed4f9a 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -255,7 +255,8 @@ package body Exp_Ch4 is -- case expressions. Inspect and process actions list Stmts of expression -- Expr for transient objects. If such objects are found, the routine will -- generate code to finalize them when the enclosing context is elaborated - -- or evaluated. + -- or evaluated. Moreover, if the declaration of a _Chain entity is found, + -- the routine will append a call to Activate_Tasks on the entity to Stmts. -- This specific processing is required for these expressions because the -- management of transient objects for expressions implemented in Exp_Ch7 @@ -15226,10 +15227,15 @@ package body Exp_Ch4 is Decl := First (Stmts); while Present (Decl) loop - if Nkind (Decl) = N_Object_Declaration - and then Is_Finalizable_Transient (Decl, Expr) - then - Process_Transient_In_Expression (Decl); + if Nkind (Decl) = N_Object_Declaration then + if Is_Finalizable_Transient (Decl, Expr) then + Process_Transient_In_Expression (Decl); + + elsif Chars (Defining_Identifier (Decl)) = Name_uChain then + Insert_After_And_Analyze (Last (Stmts), + Make_Task_Activation_Call + (Sloc (Decl), Defining_Identifier (Decl))); + end if; end if; Next (Decl); diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index e43e360ec7b..968a7db4914 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -8932,20 +8932,21 @@ package body Exp_Ch6 is Warn_BIP (Func_Call); - -- If the build-in-place function returns a controlled object, then the - -- object needs to be finalized immediately after the context is exited, - -- which requires the creation of a transient scope and a named object. - -- If the build-in-place function returns a definite subtype, then an - -- object also needs to be created and an access value designating it - -- passed as an actual. + -- object needs to be created and an access value designating it needs + -- to be passed as an actual. + + -- If the build-in-place function returns either a controlled object or + -- an object that contains tasks, then the object needs to be finalized + -- immediately after the context is exited, which requires the creation + -- of a transient scope and a named object. -- Insert a temporary before the call initialized with function call to -- reuse the BIP machinery which takes care of adding the extra build-in -- place actuals. - if Needs_Fin or else Known_Size or else Has_Tasks then - if Needs_Fin then + if Known_Size or else Needs_Fin or else Has_Tasks then + if Needs_Fin or else Has_Tasks then Establish_Transient_Scope (Func_Call, Manage_Sec_Stack => not Known_Size); end if; diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index f4f30dcc85d..c303a6145df 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -499,11 +499,11 @@ package body Exp_Ch7 is (Loc : Source_Ptr; Action : Node_Id; Par : Node_Id) return Node_Id; - -- Action is a single statement or object declaration. Par is the proper - -- parent of the generated block. Create a transient block whose name is - -- the current scope and the only handled statement is Action. If Action - -- involves controlled objects or secondary stack usage, the corresponding - -- cleanup actions are performed at the end of the block. + -- Action is a single statement. Par is the proper parent of the generated + -- block. Create a transient block whose name is the current scope and the + -- only handled statement is Action. If Action involves controlled objects + -- or task objects or secondary stack usage, corresponding cleanup actions + -- are performed at the end of the block. procedure Store_Actions_In_Scope (AK : Scope_Action_Kind; L : List_Id); -- Shared processing for the Store_xxx_Actions_In_Scope routines: attach @@ -8720,7 +8720,6 @@ package body Exp_Ch7 is -- Local variables - Decls : constant List_Id := New_List; Instrs : constant List_Id := New_List (Action); Trans_Id : constant Entity_Id := Current_Scope; @@ -8819,12 +8818,49 @@ package body Exp_Ch7 is Block := Make_Block_Statement (Loc, Identifier => New_Occurrence_Of (Trans_Id, Loc), - Declarations => Decls, + Declarations => New_List, Handled_Statement_Sequence => Make_Handled_Sequence_Of_Statements (Loc, Statements => Instrs), Has_Created_Identifier => True); Set_Parent (Block, Par); + -- If the transient scope contains a _Master entity, mark it as being + -- a task master since Build_Master_Entity could not do it. + + Set_Is_Task_Master (Block, Has_Master_Entity (Trans_Id)); + + -- If the transient scope contains a _Chain entity, try to find its + -- declaration in the actions to be executed before the main action. + -- If found, generate a call to Activate_Tasks on the entity and, in + -- either case, set Is_Task_Allocation_Block to block the subsequent + -- generation of the same call by Build_Task_Activation_Call. + + if Has_Activation_Chain_Entity (Trans_Id) then + declare + Before_Actions : List_Id + renames Scope_Stack.Table (Scope_Stack.Last). + Actions_To_Be_Wrapped (Before); + Act : Node_Id; + + begin + Act := First (Before_Actions); + while Present (Act) loop + if Nkind (Act) = N_Object_Declaration + and then Chars (Defining_Identifier (Act)) = Name_uChain + then + Append_To (Before_Actions, + Make_Task_Activation_Call + (Loc, Defining_Identifier (Act))); + exit; + end if; + + Next (Act); + end loop; + + Set_Is_Task_Allocation_Block (Block); + end; + end if; + -- Insert actions stuck in the transient scopes as well as all freezing -- nodes needed by those actions. Do not insert cleanup actions here, -- they will be transferred to the newly created block. diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index 22c3515a46d..7c875448dc2 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -34,6 +34,7 @@ with Elists; use Elists; with Errout; use Errout; with Exp_Ch3; use Exp_Ch3; with Exp_Ch6; use Exp_Ch6; +with Exp_Ch7; use Exp_Ch7; with Exp_Ch11; use Exp_Ch11; with Exp_Dbug; use Exp_Dbug; with Exp_Sel; use Exp_Sel; @@ -427,10 +428,12 @@ package body Exp_Ch9 is Context_Decls : out List_Id); -- Subsidiary routine to procedures Build_Activation_Chain_Entity and -- Build_Master_Entity. Given an arbitrary node in the tree, find the - -- nearest enclosing body, block, package, or return statement and return - -- its constituents. Context is the enclosing construct, Context_Id is - -- the scope of Context_Id and Context_Decls is the declarative list of - -- Context. + -- enclosing body, block, package, or return statement and return its + -- constituents. Context is the enclosing construct, Context_Id is the + -- scope of Context and Context_Decls is the list of declarations of + -- Context. When the current scope is transient and will give rise to + -- a block, Context is the node to be wrapped, Context_Id is the scope + -- and Context_Decls is No_List. function First_Protected_Operation (D : List_Id) return Node_Id; -- Given the declarations list for a protected body, find the @@ -454,11 +457,6 @@ package body Exp_Ch9 is -- Determine whether Id is a function or a procedure and is marked as a -- private primitive. - function Make_Task_Activation_Call - (Loc : Source_Ptr; - Chain : Entity_Id) return Node_Id; - -- Build a call to Activate_Tasks with Chain as the single parameter - function Make_Unlock_Statement (Prot_Type : E_Protected_Type_Id; Op_Spec : N_Subprogram_Specification_Id; @@ -1013,16 +1011,21 @@ package body Exp_Ch9 is Object_Definition => New_Occurrence_Of (RTE (RE_Activation_Chain), Sloc (N))); - Prepend_To (Context_Decls, Decl); + if Present (Context_Decls) then + Prepend_To (Context_Decls, Decl); - -- Ensure that _chain appears in the proper scope of the context + -- Ensure that _Chain appears in the proper scope of the context + + if Context_Id /= Current_Scope then + Push_Scope (Context_Id); + Analyze (Decl); + Pop_Scope; + else + Analyze (Decl); + end if; - if Context_Id /= Current_Scope then - Push_Scope (Context_Id); - Analyze (Decl); - Pop_Scope; else - Analyze (Decl); + Insert_Action (N, Decl); end if; Set_Has_Activation_Chain_Entity (Context_Id); @@ -3073,32 +3076,35 @@ package body Exp_Ch9 is Decl := Build_Master_Declaration (Sloc (N)); - -- The master is inserted at the start of the declarative list of the - -- context. + if Present (Context_Decls) then + -- The master is inserted at the start of the declarative list of the + -- context. - Prepend_To (Context_Decls, Decl); + Prepend_To (Context_Decls, Decl); - -- In certain cases where transient scopes are involved, the immediate - -- scope is not always the proper master scope. Ensure that the master - -- declaration and entity appear in the same context. + -- Ensure that _Master appears in the proper scope of the context + + if Context_Id /= Current_Scope then + Push_Scope (Context_Id); + Analyze (Decl); + Pop_Scope; + else + Analyze (Decl); + end if; + + -- Mark its associated construct as being a task master, but masters + -- associated with return statements are already marked at this stage + -- (see Analyze_Subprogram_Body_Helper). + + if Nkind (Context) /= N_Extended_Return_Statement then + Mark_Construct_As_Task_Master (Context); + end if; - if Context_Id /= Current_Scope then - Push_Scope (Context_Id); - Analyze (Decl); - Pop_Scope; else - Analyze (Decl); + Insert_Action (N, Decl); end if; Set_Has_Master_Entity (Context_Id); - - -- Mark its associated construct as being a task master, but masters - -- associated with return statements are already marked at this stage - -- (see Analyze_Subprogram_Body_Helper). - - if Nkind (Context) /= N_Extended_Return_Statement then - Mark_Construct_As_Task_Master (Context); - end if; end Build_Master_Entity; --------------------------------------- @@ -13008,6 +13014,18 @@ package body Exp_Ch9 is Context_Decls : out List_Id) is begin + -- First deal with a transient scope that will give rise to a block + + if Scope_Is_Transient + and then Nkind (Node_To_Be_Wrapped) not in N_Declaration + | N_Renaming_Declaration + then + Context := Node_To_Be_Wrapped; + Context_Id := Current_Scope; + Context_Decls := No_List; + return; + end if; + -- Traverse the parent chain looking for an enclosing body, block, -- package or return statement. diff --git a/gcc/ada/exp_ch9.ads b/gcc/ada/exp_ch9.ads index 8101636610e..41b809f94aa 100644 --- a/gcc/ada/exp_ch9.ads +++ b/gcc/ada/exp_ch9.ads @@ -308,6 +308,11 @@ package Exp_Ch9 is -- All the above declarations are inserted in the order shown to the front -- of Decls. + function Make_Task_Activation_Call + (Loc : Source_Ptr; + Chain : Entity_Id) return Node_Id; + -- Build a call to Activate_Tasks with Chain as the single parameter + function Make_Task_Create_Call (Task_Rec : Entity_Id) return Node_Id; -- Given the entity of the record type created for a task type, build -- the call to Create_Task diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb index 5e3823c3649..22adac2186b 100644 --- a/gcc/ada/sem_elab.adb +++ b/gcc/ada/sem_elab.adb @@ -2936,6 +2936,14 @@ package body Sem_Elab is (List => Private_Declarations (Context), Task_Objs => Task_Objs); + -- Process all task objects in the actions when the activation + -- call appears in an EWA node. + + elsif Nkind (Context) = N_Expression_With_Actions then + Traverse_List + (List => Actions (Context), + Task_Objs => Task_Objs); + -- Otherwise the context must be a block or a body. Process all -- task objects found in the declarations. diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index f53fe30da69..6f28f1cc4cd 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -6762,7 +6762,10 @@ package body Sem_Util is elsif Scope_Is_Transient then while Present (E) loop - exit when Scope (E) = CS or else Scope (E) = Scope (CS); + exit when Scope (E) = CS + or else (Scope (E) = Scope (CS) + and then N /= Name_uChain + and then N /= Name_uMaster); E := Homonym (E); end loop; From patchwork Tue Jun 2 08:45:17 2026 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: 136246 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 31BA14BA23C9 for ; Tue, 2 Jun 2026 08:56:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 31BA14BA23C9 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=ff+Xw7Vq X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id CE5524BA2E32 for ; Tue, 2 Jun 2026 08:46:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CE5524BA2E32 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 CE5524BA2E32 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389982; cv=none; b=PUqQTDbR5ZUksrMUgRAECTwmKSUXlI+I18oR585qZsMvFA+vSlwIArBuyFPDWwOeRzY4rRX/jC4S5NB72jYfZSWpblMXwW6qWfmvffyvfW6QjqwsG5VL/aa7mWsqGX0LT2BMG8k8rzKR997fTnoIqgcRnBlHO6QwrcTQ/muDbBg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389982; c=relaxed/simple; bh=1eg4UWQgf6uuRMaU5+Q+S9VOqnxdPsGMHRCnp4I8Ais=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=RCE+k65iSosWDCh1dYJz4SfO4WYFm+ndjgqcCjgk7D+SwaxiWV7Tw5hcqgCskrsWAyUJrSXliWWuT55fKgJutJFaslv7M1QRHrIKc72sRlP+j27tDuaygoE4JtJ86tnJY/GnSQl5jCDwWRhRM1uVE/fL+YnjaG5C77SXDMkski4= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=ff+Xw7Vq DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CE5524BA2E32 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-490a765d410so25328315e9.1 for ; Tue, 02 Jun 2026 01:46:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389981; x=1780994781; 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=rZyBpJTA/P6+uSmFd6i4Ac8lxYhwIT/7FtoknhK6VkQ=; b=ff+Xw7Vqx1W8hMKLPFbdc+IghKJT4x1O+pXSIPfWfK9/3WKm0wjQZTUCNusVdakakC PHVDO1p1WJ9GE/fWgWnhP9G2mZkn7ZdOiRlwYtgGAcUSXrZEcyFMBMIhDTXA1oIudQA3 qGbO/67uuM6cUNbf9yA/zwrd0dp7JHvwlSj8Lvtg59n9LbUg7CoIxWzeAH70fk1ZT2dq o5CZKVgapN6s/h8utlP+BrI/u9CW8dq5qmB+4sEYwGqo9Wy44JuioV3Mo5Zgh6HZkPr3 op0AgQM0jRKQqoaKnwuuwLsswZ17OpO9Oib7c9rCwy81p/h5HrUTUHz0twY5aOqlH4Jx T4fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389981; x=1780994781; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=rZyBpJTA/P6+uSmFd6i4Ac8lxYhwIT/7FtoknhK6VkQ=; b=lWk1hJJK724tNWc5G0v/cyoVw11Ml5gQbPALL/Iax/9RK+uOlQKeCAtIgWwCXoxqaQ IyxtAF5Xe07gRUOp2mObUJdoCRk5ISW5l5nozzAPn7vUZFvclwl1ES2lSJpR/2JlvpCE bRJawQAFFwDE5gAQHuiH+rG7BVk7MxG0iDzPB/GX1nu1bi3+ozeguEB3lCJ3LgBReBZj JjVPPTh4H0txw4z4hjdZXZPux2YAybcw+U3neULPtJSZ/oWz1aTplzhtXzoA9E9Ne+xp uRvzGS4Ce4JJGcoCxjRn5nwA+48nSX1TfsJ+wkicPfQAAOnMx4MgjVZV4Q4awtXSZsYz uYeg== X-Gm-Message-State: AOJu0Yw4HvA/1JDrZ8YtCBmKtTy+gy2d0DTDeZlxE7edZ81e8gz4TgL/ pTYERUCHXkEmBvM+Tnu/2otVN5DVy9FCwvROvmZitLib2R26FiQyQniuPXaxmTqWIEEolRFq6rT gVfw= X-Gm-Gg: Acq92OFEC2RTNfiNC4hL9RcFNwjjkl98cGB/f7Bt2AeNoeoC2/sKmE3yaitcUVKcG1q 5nDfSYrrL1F8TPG5rB25jV3ThW53/AwZi93YNNycdl7Lsy8lYSMcZ8uCG2hjlKNYpDDUSu+hgvf S/APk4JjkduWju3+T2JX86PblPp4v7O3lzsnCrM3VhkYy9sOUqbvAdGQpVxLbhvCZmQcpXRsKZX QBnxODxzEYIy7+4HjvQM3KZbuwPJZ/GeFPfzEVr3KKilqYB6rpLBhJeY3kFmQ9zfpb+T6JDQ+nF Qcm2zsgml8mN9ZRwgwUy+Rfu+dMWZvPMgY5fmHs9qSGFmPuNROJJFycRME6rNryeOK/rNckgOT0 VAc3fUq6c9lnE3YLf7Nq1k4X+hDIkt5ZMQYutRiYvE3Tc/WVNiRuATjPHA3kd9ROCXn87ehlFvS wiGQ4IrtbDu2mzrxybjZ7ofw6V7IqTu9ksneUMxBWh0UBFr5Jb7HDzwyjMMY1zeePtspfQdsmYt SfA10mEackDb4PL8uvf7Bg7h3Z4Nm8= X-Received: by 2002:a05:600c:c11c:b0:490:4663:691b with SMTP id 5b1f17b1804b1-490a2923a3bmr221126635e9.7.1780389980620; Tue, 02 Jun 2026 01:46:20 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:20 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED 29/51] ada: Simplify interfacing with localtime wrappers Date: Tue, 2 Jun 2026 10:45:17 +0200 Message-ID: <20260602084541.3829876-29-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Piotr Trojanek Interface from Ada to C for calling localtime was over-complicated, including access types, aliased variables and suppressed CodePeer messages. None of this is necessary if we just rely on the Ada RM and what it guarantees when interfacing for parameters of elementary types depending on their IN/OUT mode. gcc/ada/ChangeLog: * libgnat/a-calend.adb (localtime_tzoff): Simplify interface. * sysdep.c (__gnat_localtime_tzoff): Remove duplicated specs; pass "in" parameters via copy and "out" parameters via pointers. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/a-calend.adb | 23 +++++++---------------- gcc/ada/sysdep.c | 27 +++++++++++---------------- 2 files changed, 18 insertions(+), 32 deletions(-) diff --git a/gcc/ada/libgnat/a-calend.adb b/gcc/ada/libgnat/a-calend.adb index d2f84f084aa..ecb84d9ff38 100644 --- a/gcc/ada/libgnat/a-calend.adb +++ b/gcc/ada/libgnat/a-calend.adb @@ -692,15 +692,10 @@ is Nanos_In_56_Years : constant := (14 * 366 + 42 * 365) * Nanos_In_Day; - type int_Pointer is access all Interfaces.C.int; - type long_Pointer is access all Interfaces.C.long; - - type OS_Time_Pointer is access all System.OS_Lib.OS_Time; - procedure localtime_tzoff - (timer : OS_Time_Pointer; - is_historic : int_Pointer; - off : long_Pointer); + (timer : System.OS_Lib.OS_Time; + is_historic : Interfaces.C.int; + off : out Interfaces.C.long); pragma Import (C, localtime_tzoff, "__gnat_localtime_tzoff"); -- This routine is a interfacing wrapper around the library function -- __gnat_localtime_tzoff. Parameter 'timer' represents a Unix-based @@ -713,9 +708,9 @@ is Adj_Cent : Integer; Date_N : Time_Rep; - Flag : aliased Interfaces.C.int; - Offset : aliased Interfaces.C.long; - Secs_T : aliased System.OS_Lib.OS_Time; + Flag : Interfaces.C.int; + Offset : Interfaces.C.long; + Secs_T : System.OS_Lib.OS_Time; -- Start of processing for UTC_Time_Offset @@ -759,11 +754,7 @@ is Flag := (if Is_Historic then 1 else 0); - localtime_tzoff - (Secs_T'Unchecked_Access, - Flag'Unchecked_Access, - Offset'Unchecked_Access); - pragma Annotate (CodePeer, Modified, Offset); + localtime_tzoff (Secs_T, Flag, Offset); return Long_Integer (Offset); end UTC_Time_Offset; diff --git a/gcc/ada/sysdep.c b/gcc/ada/sysdep.c index 7752693a20a..20cc3db4917 100644 --- a/gcc/ada/sysdep.c +++ b/gcc/ada/sysdep.c @@ -654,16 +654,17 @@ long __gnat_invalid_tzoff = 259273; /* Definition of __gnat_localtime_r used by a-calend.adb */ +extern void +__gnat_localtime_tzoff (OS_Time, int, long *); + #if defined (__MINGW32__) /* Reentrant localtime for Windows. */ -extern void -__gnat_localtime_tzoff (const OS_Time *, const int *, long *); - static const unsigned long long w32_epoch_offset = 11644473600ULL; + void -__gnat_localtime_tzoff (const OS_Time *timer, const int *is_historic, long *off) +__gnat_localtime_tzoff (OS_Time timer, int is_historic, long *off) { TIME_ZONE_INFORMATION tzi; @@ -676,7 +677,7 @@ __gnat_localtime_tzoff (const OS_Time *timer, const int *is_historic, long *off) signifies that the date is NOT historic, see the body of Ada.Calendar.UTC_Time_Offset. */ - if (*is_historic == 0) { + if (is_historic == 0) { *off = tzi.Bias; /* The system is operating in the range covered by the StandardDate @@ -707,7 +708,7 @@ __gnat_localtime_tzoff (const OS_Time *timer, const int *is_historic, long *off) BOOL status; /* First convert unix time_t structure to windows FILETIME format. */ - utc_time.ull_time = ((unsigned long long) *timer + w32_epoch_offset) + utc_time.ull_time = ((unsigned long long) timer + w32_epoch_offset) * 10000000ULL; /* If GetTimeZoneInformation does not return a value between 0 and 2 then @@ -752,11 +753,8 @@ __gnat_localtime_tzoff (const OS_Time *timer, const int *is_historic, long *off) spec is required. Only use when ___THREADS_POSIX4ad4__ is defined, the Lynx convention when building against the legacy API. */ -extern void -__gnat_localtime_tzoff (const OS_Time *, const int *, long *); - void -__gnat_localtime_tzoff (const OS_Time *timer, const int *is_historic, long *off) +__gnat_localtime_tzoff (OS_Time timer, int is_historic, long *off) { *off = 0; } @@ -771,16 +769,13 @@ extern void (*Lock_Task) (void); #define Unlock_Task system__soft_links__unlock_task extern void (*Unlock_Task) (void); -extern void -__gnat_localtime_tzoff (const OS_Time *, const int *, long *); - void -__gnat_localtime_tzoff (const OS_Time *timer ATTRIBUTE_UNUSED, - const int *is_historic ATTRIBUTE_UNUSED, +__gnat_localtime_tzoff (OS_Time timer ATTRIBUTE_UNUSED, + int is_historic ATTRIBUTE_UNUSED, long *off ATTRIBUTE_UNUSED) { struct tm tp ATTRIBUTE_UNUSED; - const time_t time = (time_t) *timer; + const time_t time = (time_t) timer; /* AIX, HPUX, Sun Solaris */ #if defined (_AIX) || defined (__hpux__) || defined (__sun__) From patchwork Tue Jun 2 08:45:18 2026 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: 136268 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7B7E24BA23E7 for ; Tue, 2 Jun 2026 09:13:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7B7E24BA23E7 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=E/STgCqc X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id 60DC84BA23D9 for ; Tue, 2 Jun 2026 08:46:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 60DC84BA23D9 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 60DC84BA23D9 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::434 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389982; cv=none; b=x7rizzT81K+H+yx2QfkJuHGTPVb97xbdXfG/NOwLxBCDb3dC5HlFjUJ6cPQvK3S9in7ZdTccW/j1KEej66CBD4WMz/4Jl02VJpQWK/YZwqubL2mAll9L4E8sCKGAHstr23F7FWQMQjvMZOSvcfWFLRt/Zf9yyjVif88qLxg2xco= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389982; c=relaxed/simple; bh=eiBe/OifC1RSOpxP1cHrbiV+4XxCCk+LZpQQVbhawF8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=wsZ1yvuqjETtD9dPoPQhWVjRi0ct1geLd5+/lMk4UYF8vkzEXAvLRgOO/Ysnpvkz+QPeO9ub3ShOjSh2VgEkTCEo6YXaCeHucA7kHIuPNszAx2RG5i+PF5YcCo1HTtBwTbIl0ipIXUyjKLhqTsli2RFWG+HyB0GiZMPsILZ63oU= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=E/STgCqc DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 60DC84BA23D9 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-45eedcdaeaaso3348414f8f.3 for ; Tue, 02 Jun 2026 01:46:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389981; x=1780994781; 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=3u72wwbycoDRvc6qcOCvS9EFpYZ72WnQYl0ScaDvLeE=; b=E/STgCqciIfSYJW0u7LTVJU3rwrAP8N+Y/MoutCxMg5z+abZlSxY8GkMKcYx/It4Go n7zVe0Um5ALQf50iEF5XWjOlF9aX+NH9NOIaGK6FRf1N7RZE2tADtJbzNitMkOUysp// Goy7eSqXp17J3Gdz+eOmhPVTSILN8IzceX0EiMB10rGywQGf7gTiGmonru8ityIB8I2q qj/Vvu/dQOYgYaH7r3D2b4cIT8l1zdT5QNFwl0rwNVOn1qez/kRwtC0YcaCkO15mqlji PHy/mqfdUZlu0uFE+OU5p1eAHjVIePIc54K5n5L6CriCXXqNrsQQPAyiXSCzIw4Rp3vs kTEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389981; x=1780994781; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=3u72wwbycoDRvc6qcOCvS9EFpYZ72WnQYl0ScaDvLeE=; b=QK/x3n90T6fjRsC/HQrxjUjCN2kKAuktLXPFD+vvO6bPSi/06ZazKThkggUluQkLUl eFSE4/RygbxTRtlmk2/FppDPWywzHR1po9MYV02cMCX+n2u23ghrHUb/0gD58NU+04H6 QnbePewslAe0qXpb9SSif7/paidxw6hUcwnYocE5ZrL3oOuh8ApcaBmE54yzuAg/2eVd jYbfViBBPBcusquPmDBE30T294RJWI1z0FzpOG+QS22ZWQNpHgtKUkocMM2NXVYPFgBr ky7qHnNstirc7NZj1/2x5qie6MC0W3mXyGjb+iwmhjYyLP3mdzeiuBY6fxWiNSEXzqnX LCUQ== X-Gm-Message-State: AOJu0Yxe6gOetPXphoJIvTem69R+XjP21UTOAQiOR+IuapZGo8EBMmUl sWAytKxXeJEdJG+vbyxGLmcw7zEEIa9D7thkE9R7ZsP9RqvR0UBC7kg1jQYr3R7+1SE5Y7Que9E v/S4= X-Gm-Gg: Acq92OHXMrWv1a05nja0oMDrbthQflWFURwlP51r8vbQxc9kKX29qIbt0j8g9ZKYtcP uDnLEGmoxCVujVE1zQbdnI85Tl3aQIlylweBTXZZSfZ3QQgH/CX29m2yp5C02lCIL5WAjIvTd4u VoOU5oWNVegWuStXDUYiC1omDnmUFLdwiXKVVOVSgM/IkbUyC9eROUkPy7XnCXZPiyOaPr+xpRy r1DWijxtHdryZoQllEPos0Qw1ur1oeyz166LccuDl7MGaEt7pSeJNuKGgO04yw+lo8Xh9PpWB74 ay+kNSPuTAJMdI/YSwdypaSsnl9bbnrq9urYWzwhB/mPLFE/hR0LAcW9lwExIWbRHwrhxz0ijdX ummltWXkYoIayvO+6e1Fy1qIhBDJFlNEY1gBkxK+IYaYzO2bZ/RIiSBrzv5uug8Sm8uzI48tqRr 04mM8Xm3+nxjRcVwKZtRYb4GmIFhLdCQsppCXLM12aH8U8oxZDS5ahT3RRva0Mz2orx2sCwdeh0 gzzp0XQ2ok0mgzeCHH8y6FvaMzSc3A= X-Received: by 2002:a05:600c:8207:b0:490:b265:7940 with SMTP id 5b1f17b1804b1-490b26579a6mr28951235e9.23.1780389981267; Tue, 02 Jun 2026 01:46:21 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:20 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED 30/51] ada: Simplify interfacing with gmtime wrapper Date: Tue, 2 Jun 2026 10:45:18 +0200 Message-ID: <20260602084541.3829876-30-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Piotr Trojanek Interface from Ada to C for calling gmtime was over-complicated. Now we just rely on the Ada RM and what it guarantees when interfacing for parameters of elementary types depending on their IN/OUT mode. gcc/ada/ChangeLog: * adaint.c, adaint.h (__gnat_to_gm_time): Adapt C side, while keeping the explicit conversion to time_t, if this ever needs to be debugged. * libgnat/s-os_lib.adb (To_GM_Time): Adapt Ada side. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/adaint.c | 4 ++-- gcc/ada/adaint.h | 2 +- gcc/ada/libgnat/s-os_lib.adb | 29 ++++++++++++++--------------- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index 95351a5f4ef..5fb25571774 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -444,11 +444,11 @@ __gnat_current_time_string (char *result) } void -__gnat_to_gm_time (OS_Time *p_time, int *p_year, int *p_month, int *p_day, +__gnat_to_gm_time (OS_Time date, int *p_year, int *p_month, int *p_day, int *p_hours, int *p_mins, int *p_secs) { struct tm *res; - time_t time = (time_t) *p_time; + time_t time = (time_t) date; res = gmtime (&time); if (res) diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h index ca92e08f858..c8973c16cde 100644 --- a/gcc/ada/adaint.h +++ b/gcc/ada/adaint.h @@ -146,7 +146,7 @@ extern int __gnat_in_child_after_fork; extern OS_Time __gnat_current_time (void); extern void __gnat_current_time_string (char *); -extern void __gnat_to_gm_time (OS_Time *, int *, int *, +extern void __gnat_to_gm_time (OS_Time, int *, int *, int *, int *, int *, int *); extern void __gnat_to_os_time (OS_Time *, int, int, int, diff --git a/gcc/ada/libgnat/s-os_lib.adb b/gcc/ada/libgnat/s-os_lib.adb index df11e75afc9..ae8ef2b1a08 100644 --- a/gcc/ada/libgnat/s-os_lib.adb +++ b/gcc/ada/libgnat/s-os_lib.adb @@ -1304,16 +1304,15 @@ package body System.OS_Lib is Second : out Second_Type) is procedure To_GM_Time - (P_OS_Time : Address; - P_Year : Address; - P_Month : Address; - P_Day : Address; - P_Hours : Address; - P_Mins : Address; - P_Secs : Address); + (Date : OS_Time; + P_Year : out Integer; + P_Month : out Integer; + P_Day : out Integer; + P_Hours : out Integer; + P_Mins : out Integer; + P_Secs : out Integer); pragma Import (C, To_GM_Time, "__gnat_to_gm_time"); - T : OS_Time := Date; Y : Integer; Mo : Integer; D : Integer; @@ -1342,13 +1341,13 @@ package body System.OS_Lib is Locked_Processing : begin SSL.Lock_Task.all; To_GM_Time - (P_OS_Time => T'Address, - P_Year => Y'Address, - P_Month => Mo'Address, - P_Day => D'Address, - P_Hours => H'Address, - P_Mins => Mn'Address, - P_Secs => S'Address); + (Date => Date, + P_Year => Y, + P_Month => Mo, + P_Day => D, + P_Hours => H, + P_Mins => Mn, + P_Secs => S); SSL.Unlock_Task.all; exception From patchwork Tue Jun 2 08:45:19 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 136273 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DA03B4BA2E27 for ; Tue, 2 Jun 2026 09:18:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DA03B4BA2E27 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=LDMzDQiP X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id 0FAC24BA23C8 for ; Tue, 2 Jun 2026 08:46:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0FAC24BA23C8 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 0FAC24BA23C8 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389983; cv=none; b=IdqbojuXFcNkt/VfahYzDzGxg+nddmSrsS+UI/PugG7/dyeO9JeMLrANa6GFqnNztI6BuQFYnDbnXrEd9AOtxn0csRyUPZzZiYqUQHRoHHaxUU+7GbQ/XG0SaJPWKiafq4oghCilzFrZHkZCg5oZXPTirw9b80brrrWdspT9r4s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389983; c=relaxed/simple; bh=oWDh59xrn5YmtxcY7kFxXTYjmZgFf1PKbQ8nSL/Djao=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=GZgCp/P/7HT8gz9HPdw9dnq5RvMJ4mrrfH7RB+ut022wuNrVajJDBL9THDQdFk6jca3VtOfxvKL5sPXUiOqp79LRllRX7rg5YdiUATcPwzOWN9SQNxnXyMG5jbNxNslD+f0JbSH+km+TEYtFR968As5CX2gWJAwUMm/g0l06QZw= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=LDMzDQiP DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0FAC24BA23C8 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-490a7876f8cso21484355e9.3 for ; Tue, 02 Jun 2026 01:46:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389982; x=1780994782; 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=/tmum562+o+4O74b8aNVu/c1gW+1a81F7VXLQkGBo8c=; b=LDMzDQiPdqbalkiIxz0uGzd/qIFMi8rz68zzUQS0Hk+wV5tyxqzTFV50BGd3ogUbyF ofefAIy/4J1mnACjSP+TdZFwiq4beQzJbo4K4/S/cbQduS6Gb3GbPWhmyDQDkIwEctyR GU8GH0FsPwCtT3BpuedSsz9KWXVpBFpfKuEywl1odXUH88wAEVJqzvN41XRXPiyKqOWp ANmAUJ+K7FqOJdAXM+2NcpP3oqWQR97YyV6E5tEKWbu2Yydg/Idt22LcwvLl9we/CcTH XR19qWf7Ztkw5NE5J4QiSyF30heHSoEwyLWT3ndralLtfUYzoxSNRHb0iea8c6Xnq17W m0Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389982; x=1780994782; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=/tmum562+o+4O74b8aNVu/c1gW+1a81F7VXLQkGBo8c=; b=WwOqkIMvQXsnHPfk2PeguDL1udfrqagWY35M7omzxEerjsM8Kq80q5C5WW3xy9WLDu 4En2hI8DBB+m9tWgmKlNHocZlB3kekJpfYaO/791aWkjPOCUEXvnw8jJFtPUuCDigOpG W5IiHjQqpEbtkwOKbJGJWKZYcvN7EJHWQ2H4mdh2F71drYcWPvzk37gz1BOf1D/vlGP3 oRM9biGcFgE7NSfGqvUuJj8CfP07D67SGTx28DOubuxhVwtlinnZAqgjqqmjDyU+5a80 kNCa7tOmlW0Zz0iX1g7+5XRRuGms2AjkEdAWYFfDSQmFcjF7Mys25CHjParr3bJjZk/9 7XnQ== X-Gm-Message-State: AOJu0YzYPrndw+mqp6RXINFMeknyISJL1bUVXI7y8cD5gE8R75+YoWmf WBgFHKYieNchJgY+Dw07AeyYTS3zhyiwuKtY2KuUnBUW0UF5nIB/7LsZJumy9zZ3Njbk2MIODUj pD+g= X-Gm-Gg: Acq92OGa86sxVFvYffwHbaMToDe7rIU37wigRaIHGCuYq62dWfP9us/TIjp6mUdU8br F2k9STVQ8ZYDeuM4RU1t3XbZLbGPefHIax8Y5l/n8MNvO1BknzA2TwQfDhDJO8zTjwVlnHayZFx XSOlSobA5RjlocCj+0Fs6wBwksC16MKo93YJQWaLHNpTmEWQeaUxxcEeHR48fzKR7wwzI/xAKPG pZVDI2QecUq8g7qKXwYdU62mgwj4IlWOf1hSoqard9RMiof7UvwEjCdXCB85S4QO92hLSkKOE+M HgmNrbCTc/l/jVKyaMLXFnacaxi33YPCK3OItke4PSEagKVlZ/AeIFT/EwK6LNbG+9OVKOCtwRG yLKBcQrX3OrH3DBv0gGYeffiBhOYcvNkap+Q19w3LS4Jq7P9COcwbtKvQbDIwtOaZO9dKReMOvF Sr7dGV6zH7Y1SxUP4cpjM29ZzrFkdVhV7/skCAn5MMqLu0qzpq5tBtI4l6TkGtID2kBOsMxjA4O 9rDaK9aTKvdQpo/CfqtRQJXWqCUoE51VGG6Q0GmxA== X-Received: by 2002:a05:600c:c492:b0:490:9d1b:f088 with SMTP id 5b1f17b1804b1-490a29e4383mr255656005e9.2.1780389981940; Tue, 02 Jun 2026 01:46:21 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:21 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Sebastian Poeplau Subject: [COMMITTED 31/51] ada: Document inline assembler limitations in GNAT LLVM Date: Tue, 2 Jun 2026 10:45:19 +0200 Message-ID: <20260602084541.3829876-31-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Sebastian Poeplau gcc/ada/ChangeLog: * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Mention inline assembler limitations. * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- .../doc/gnat_ugn/building_executable_programs_with_gnat.rst | 4 ++++ gcc/ada/gnat_ugn.texi | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst index 9efcc42afca..32c5d6efa71 100644 --- a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst +++ b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst @@ -8037,6 +8037,10 @@ GNAT LLVM doesn't support Convention C++, which provides so-called 'name mangling' by encoding parameter and return datatypes into a function name. +The inline assembler in GNAT LLVM is not yet feature complete. For example, it +can't handle more than one output variable, and it doesn't support all +constraints. + .. only:: PRO Unlike the GCC versions of GNAT, GNAT LLVM doesn't include any diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index b91a9e90975..567caabd14e 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -17603,6 +17603,10 @@ GNAT LLVM doesn’t support Convention C++, which provides so-called ‘name mangling’ by encoding parameter and return datatypes into a function name. +The inline assembler in GNAT LLVM is not yet feature complete. For example, it +can’t handle more than one output variable, and it doesn’t support all +constraints. + We provide two options that you can use to build code with GNAT LLVM: @@ -30266,8 +30270,8 @@ to permit their use in free software. @printindex ge -@anchor{d2}@w{ } @anchor{gnat_ugn/gnat_utility_programs switches-related-to-project-files}@w{ } +@anchor{d2}@w{ } @c %**end of body @bye From patchwork Tue Jun 2 08:45:20 2026 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: 136275 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F341C4BA2E2F for ; Tue, 2 Jun 2026 09:21:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F341C4BA2E2F Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=g+UMXAv/ X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id DA8064BA23EB for ; Tue, 2 Jun 2026 08:46:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DA8064BA23EB 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 DA8064BA23EB Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389984; cv=none; b=pj9ZcUZPpgomNsPnbsq3oDCMqKFnhwrG6BBPIc1ZREQx1T3U2kslqPBn2yiTP/qkDfk1D1/oNBoZyaVHsklHZ1pIVd1vsskReVs6kKfVT4pn20m/bDxDHun5MeeGxKdaFVIS3Ys0Xvp1TMrDEqT6x6MHITJP9GcfCihMIMW8cWY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389984; c=relaxed/simple; bh=hpSMTUIDsp6mDp4obHkV0i2F4J67bNoNK6BrxYmc/kk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=nxQO1sPk6PKxaavXoQHiScgqKkk4RSD4XZHQf6KfvcgNTDME11Vj+irjlIOiWywnfDdmF9MHU3v2iIXPRzhNij0L2aHPK3eHPKcj23IyqqMZZioKf2B0mXq1gN2QnThsMeTTUVoHIPUW04kLZGYAJcrgvwAYWBomC4Xdg8GwP70= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=g+UMXAv/ DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DA8064BA23EB Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-490a765d410so25328765e9.1 for ; Tue, 02 Jun 2026 01:46:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389983; x=1780994783; 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=QtXononjuNc3UPG3Mw2aCAAZvMGZRXcbs2fVVnEwgPY=; b=g+UMXAv/dh+x3ez422TnSduzwkBOqc8oSlOIeQ2J0TNCS9XyZvCyMHJaNc2ZwrqpPR bwPCK9kIhbYQx/P+lp+QQPhWFYZb1PAtp1Uh/KVKerMyZvT621bmZoc1Zaqs81IFUuXw YqwTdE9mdtYdBTBHNOUn+svz5tECSByAPe6sHraQuDJtZu1QKLrlcBrmhFiig/vEhySn CKU+v5pldoQbdfqrWSRBRDsxi+7FCNWFGFstf/t+k7Ps67YTCYiTLU9qtokfKW9dk4KB FF8AQ3UtYv35EpdBzdfn71PgxMAhV/soBpzMHdON4nmIZxxf6S1jTwAJ/My7zDuYZakA sxqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389983; x=1780994783; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=QtXononjuNc3UPG3Mw2aCAAZvMGZRXcbs2fVVnEwgPY=; b=Y/ol6gvbSXrqihZTkqTpWJobpuiJYpMCYt3kTsUJdu1lcQX5UNUXqARRN+lcAeUgPV Avbq50puwlkqGy3Z3QABdkKKm3OlJoCrFZ4eb9ra3x51ivXXOyv7TsFZSt8GlAKhy/oA ZlRdnfoKBNEM+qTQKGpvoyHxHI0gbV27KlEM9npD2xUCOf5QzCfgaPBj856O8xGAcV50 MDixhnFKg3EH7A5JcJvfddOvSbSNFXojl5wn2FrnW4mHOsBQIzXMhyb1RLcyc4kLbcxX /uT37sW4LK35IAQWogMFNMEedCmvd/MdbDspK4I4M4A+4iAG1ootrG+zJwjZWKvmQ+d9 m1DA== X-Gm-Message-State: AOJu0YxKqsAn8Jpl/34ni//A6ZCNFYx5XRO1phqmgbg+Suz6xi3Yq0ll Xg4LTOZYOACB/PJDqG4b5ehBdQ61mAVXKrmoxgCycMZflQFYJK4nF/sfT+QT3UJZZJg+mVX+Bkj G5kk= X-Gm-Gg: Acq92OEYm8dTEjOWUiuYvWx+UQSq13GDU6+PfJ2qipP6xiOyCeKw2U30bg9ZBlBDIyI ICvh9sDsV4qqVDE73+47ZnFpLWPqaPK7M3SEOLlojDNe1VHAVu17jWA19JTLNSnt2eQxIzOAT7Y Dy7eQnMhP9c1IRbnuxHI0ILAd6YU9WYBNppDvGowRZJkOQaaopq403y5AWSqjZRgdo0xgu3EtdD ikhFeZNV3/4bRmlbj7ycQF4BDZAPkerEDBiELD+WU+qncVZPbCkz3jrOOdfKKuSwe03OOuL+NTo s6rxmWlrnkUZwAY/GKyvxwsK9t40JCZuTXc3o0EeYY9wQaCQtEAZyYI3xG42ZOcc2g3GGNB6uF2 200+UUWz0FkqSnQusbfXZfODDSQ4lZultio7Fska1SoEIo6Y0Dl0beikD0v/93ZobHKdTqfBGfF 7npOUuhAEdao3HEWizNLFZJlLUQyXCfXBuDwpza0PH9rn9huftvQYlAmrU+2egWqlt4r62rfzlD 542w5KW+ST4e6zRSfA4FkIBxkl6jkV1U3hIHgb9Eg== X-Received: by 2002:a05:600c:6091:b0:490:6237:521b with SMTP id 5b1f17b1804b1-490a2b6b21cmr272621655e9.27.1780389982590; Tue, 02 Jun 2026 01:46:22 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:22 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Gary Dismukes Subject: [COMMITTED 32/51] ada: Linker_Section not inherited by object from unconstrained parent subtype Date: Tue, 2 Jun 2026 10:45:20 +0200 Message-ID: <20260602084541.3829876-32-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Gary Dismukes In the case of an object_declaration with a subtype_indication whose subtype_mark denotes an unconstrained parent subtype (like "type Unconstrained_String is new String") that itself specifies the Linker_Section aspect or pragma, the object is not being inherited from the type like it should be, and so will not be allocated in the section specified by the aspect or pragma. gcc/ada/ChangeLog: * sem_ch3.adb (Copy_Parent_Attributes): Inherit Linker_Section_Pragma. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch3.adb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 1f8d86eb631..e07d24c1565 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -5800,6 +5800,8 @@ package body Sem_Ch3 is Set_Treat_As_Volatile (Id, Treat_As_Volatile (T)); Set_Is_Generic_Type (Id, Is_Generic_Type (Base_Type (T))); Set_Convention (Id, Convention (T)); + Set_Linker_Section_Pragma + (Id, Linker_Section_Pragma (Base_Type (T))); end Copy_Parent_Attributes; -- Start of processing for Analyze_Subtype_Declaration From patchwork Tue Jun 2 08:45:21 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 136261 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 12CD54BA2E30 for ; Tue, 2 Jun 2026 09:08:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 12CD54BA2E30 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=IqeTFlbF X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by sourceware.org (Postfix) with ESMTPS id 5BEF04BA2E2F for ; Tue, 2 Jun 2026 08:46:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5BEF04BA2E2F 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 5BEF04BA2E2F Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::336 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389984; cv=none; b=dB6e8YMzOf1X3jpRMvVvMkwGwg3Jh89iTESv6UDF020K4liT6l/mXJLjZcZcZcsjFK9OOj82FD3JuFz8H1DVqySTuWtPsjl5tEtycC5HXWZihtX/+1zOUhy1ft4cFwxRUTpAYAl9MF/OzpYnF/Kh4EGlGXBfDhItnNbWWoWaGH8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389984; c=relaxed/simple; bh=Y6KMr/8Ey7keuLqOFprBp6cpswvhgZMmOcEe7Jp91xk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=opVM13I5mlwOwXtQsTLvR7QArNp82pFQ63PTFqwyh8aD65UNSZLy/6Sgju+sEDMD+9G2Xi8zaWeiMk5LMm/jmvB1IGTRyunaifKV0BTsq7cLWdqOx9hWIMjsCepBZhyFZmmV0t0SAY+LTX3aIBKppT+PWU4hPK3uhY0r3n3xGFg= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=IqeTFlbF DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5BEF04BA2E2F Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-490ace40f4bso18717485e9.3 for ; Tue, 02 Jun 2026 01:46:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389983; x=1780994783; 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=GmX/AHhek9dtwdvLiTkihMAhGcbek97GdpxQFrNOm0o=; b=IqeTFlbFDxiqKqTchtxCgQa4uHYqYo5NIAhq3LDzQfmVDbrE8bI8ah1M18guC9stNE lVmUNwNAAPXD//dJKHVAdol28g3ouUzWMLIgrGG+/deYK7CbcyJvF23fx3XeItwBNn2r qTztAj29ib+USC4pZ8wA5bod7nGOnt8f5p3Z8UVuhJsjwKzUccUW5XPjiy4OhP+4mDhc 9y5ZYCSpgs1x4UocLvHZqSDnom6MrO/gnU5mSZsaq7VF9eQMO8hmLRy4X8UpmL9XJw6R jtwVfZ9uexS9EnrQMvClkuplEjE17qVSAeR3j62nX6fSEHBXrEAwqQFvE42UgHtV7VGv zIOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389983; x=1780994783; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=GmX/AHhek9dtwdvLiTkihMAhGcbek97GdpxQFrNOm0o=; b=cAFdfQz7h8JxMTbiq4fdohE8GcvygxbCz3GY6d+mDwe3NAKchb3+w6uF3jnIqHn04r eoUQzDgpznPhBCoMgt6GBnH+fTNWFI6RrSpz5+D/6mwS7aZAXvWMDhODr6d/ub0OubIM Gc/0ITCnDM09QzucF9SM4JpGLQ3IviFeWteVFcE6Vb93NqsNcpi9vdr4I1b4Z8nqBRZ+ pXyOw3NDNj3R2fS9ipctbDYDKpQ4Ma7eaX9fQYFTIaGfuKA/iH+dOoCTxJKhlD9rZBRD fzC9twCv93XduIyv1gJdCsW9JeAjbryyXLjksbq0dEjtsVC2jQ63NbBRAlamkFUQ4KfT JCgg== X-Gm-Message-State: AOJu0YyfCRu6YwxIA5FIIe/2AzVy6+FZRN6dHCpzwYogn/0FE5saDUsg WIr7TFWXqSqDmkio62CL+nr7lYh8Rl21WdsH5uVi43fd08LP7owg1jSMfSN93DANutFh0wMABu4 10uI= X-Gm-Gg: Acq92OHm1Qq73cPPThUG9X2SPDzTwmTyhZAdTokpI4xsdO1pDHj1AzFudchqGVlvN7N mrP4waJnEznAwtebyC1Po3G0iJM/+J/S83+gw8YUQG8QJB1ax0eSaKpd8Wt7CzghX5fWPK58wQW MCFG8gRGAkM1CPLBDTO8e980r63yMdBHR06ZtkzUDfksVmnZwCMN4Q1VpZdAaaDXrdTd83pc+l/ gboDyI+uclJkkaa8PwxkeM0hdo7uAatqn44/5ke4CxRCQwuhj0ll5lUA2TRLVH82oqvFxwfsrD0 GtfIwLgoaTTMMC/zyovahrp00Am0XMISSDhNtCqpSaaz9vYMQnZt99A22N90tMlq087AgZyjXmf UYfoYdgS1pCon2yUVEAZUYIAo6ygfh0WuAO+C5eDEbVdCP4K8DEtE/0Ou/YUVzyrEw1kSqw/xZ8 ysQaUbo5IiJN9Ff+SX8fUvBg//8WNc7qnylKVjyVs4/29CTqtgRXD/1wUub23EpktXavZNGxlkB YBACGrjYZZZgWxDDCT69djd31zyDOs= X-Received: by 2002:a05:600c:1d11:b0:48e:8741:fd42 with SMTP id 5b1f17b1804b1-490a291fa6fmr267363565e9.12.1780389983290; Tue, 02 Jun 2026 01:46:23 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:22 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 33/51] ada: Fix a couple of glitches in GNAT-LLVM section of User's Guide Date: Tue, 2 Jun 2026 10:45:21 +0200 Message-ID: <20260602084541.3829876-33-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Eric Botcazou gcc/ada/ChangeLog: * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Fix a couple of glitches. * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- .../doc/gnat_ugn/building_executable_programs_with_gnat.rst | 4 ++-- gcc/ada/gnat_ugn.texi | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst index 32c5d6efa71..c69b958804c 100644 --- a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst +++ b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst @@ -8021,7 +8021,7 @@ is either an ``out`` parameter or the function return value, if any. The debug information reflects these transformations and not the original Ada source code. -GNAT LLVM doesn't fully implement the :switch:`-fcheck-stack` switch. +GNAT LLVM doesn't fully implement the :switch:`-fstack-check` switch. When you specify it, the code generated by GNAT LLVM tests for allocating overly-large items on the stack, but not all cases of stack overflow. For example, if you have a very deep recursion where each call only uses a @@ -8029,7 +8029,7 @@ small amount of stack and the total stack depth exceeds the amount of available stack, the program will be terminated by a signal instead of raising an Ada exception. -GNAT LLVM doesn't support the ``Scalar_Storage_Order`` pragma except when +GNAT LLVM doesn't support the ``Scalar_Storage_Order`` attribute except when it's used to confirm the chosen storage order. This is because this facility is provided by GCC but not by LLVM. diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 567caabd14e..6350a4a99ef 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -17587,7 +17587,7 @@ is either an @code{out} parameter or the function return value, if any. The debug information reflects these transformations and not the original Ada source code. -GNAT LLVM doesn’t fully implement the @code{-fcheck-stack} switch. +GNAT LLVM doesn’t fully implement the @code{-fstack-check} switch. When you specify it, the code generated by GNAT LLVM tests for allocating overly-large items on the stack, but not all cases of stack overflow. For example, if you have a very deep recursion where each call only uses a @@ -17595,7 +17595,7 @@ small amount of stack and the total stack depth exceeds the amount of available stack, the program will be terminated by a signal instead of raising an Ada exception. -GNAT LLVM doesn’t support the @code{Scalar_Storage_Order} pragma except when +GNAT LLVM doesn’t support the @code{Scalar_Storage_Order} attribute except when it’s used to confirm the chosen storage order. This is because this facility is provided by GCC but not by LLVM. From patchwork Tue Jun 2 08:45:22 2026 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: 136266 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 911024BA2E30 for ; Tue, 2 Jun 2026 09:12:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 911024BA2E30 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=JFs4tAj0 X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id F1D1C4BA2E1B for ; Tue, 2 Jun 2026 08:46:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F1D1C4BA2E1B 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 F1D1C4BA2E1B Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::333 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389985; cv=none; b=oahXQkHhiPb/tngrOUQH5FXPO3Z4v1tHTiKFdsobTUPh5UNlzPR14QYY1dYF0KrG0s8YjmQUPsQCH9T+8PKq5rMSaV3AA8TIGrgSsrRgZAUziqitAawAw6rdR9on529NSonidBaj2OBmFc3Hn9Y1LJQ62EsAa3yl/4I4y5Yh8xo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389985; c=relaxed/simple; bh=2QjmpQBv/7Jqhh1/umKDk05XxSqXAS6OW4YThRaUGxk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=BNOVjXTrFSx35GHSLwvrA2bVEXZeMqE4FtEYHVb2VQK0j3xkaF5tLlFeT/PJmzZTsTvQ2bPPBW1h3hQG7O+ZeBzoNRq+yWCU/8+nXGq3tEeX7/McgHpk7r7UCidpF1dNUbHxHvd26rGTm2bSZYR8YKPodzYmZYdGdRRRcZbhh+c= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=JFs4tAj0 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F1D1C4BA2E1B Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-490b09e4cccso5853215e9.0 for ; Tue, 02 Jun 2026 01:46:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389984; x=1780994784; 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=anuJwy55brOSKlu/y6pLIl0giSYtVC+txUWMFyE9WHc=; b=JFs4tAj0EoCJdMFJb72zpW9ruYfeT8lQdDsqoA1GXcNz0Z9BhQDDBb/SgJNzVajGCT cw0sHYJqIxW0i/x+eaY9PXXJ6wMjYTc7Od07E3nxY5golxb2JkSB/j53je5mMuUGHhV1 i6VEI9HYPrKgzcFKOXYgFMoYopp9u3C0N/7VmJ1vlK8VV7D7GwKH4x04bctPlvxokZ2V 3g/522wVHxG1XGS2GBnKnJdr2631pHoumIF9U8yIPgVKZ9dvRnswltT7iJnN48GeYewT K29sPJdcLW9yTJrG4Z85mqIDgd9hAKjpVFQrskgU9+3IBcegdUKz6RzScqhTSQVhBlw0 IHzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389984; x=1780994784; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=anuJwy55brOSKlu/y6pLIl0giSYtVC+txUWMFyE9WHc=; b=hXzGkPGcxmd8aAm9b0CpjbHpw1tlzX8tqF5r2eJlB4TPHl81B2aNzl72LArc0jdAE+ H5X/hZW7gNnjXLKW8CHMwITYJue95f0MiQeCysPQPSq/W2XWjL42C7hOLY+iBIN+fZj4 /Y0KHnC/pJ2ow4U8N8lI6FNBlsrs2nxu2r0bcuTDrBEKODs8upecUI6b0Lt0A7nyEwKJ msX4BsUIDuWNbvihBrJJ5fYWRDa1n78Pe7lXb2wrPC/OZ7yyEomtB/g9TdzGqeafoao8 /ximY0TCyO4rw7RsRxGMtxAxFFBFzyBJG5xvFF3W5WLrJrjNAjzIC6teOW/2ioAUGgTc mBFA== X-Gm-Message-State: AOJu0YyPuf47WbbaRRIn+WqUNAeU3ws1WIKc9vWUb23Fa1DUyD9XYsQr Hd1gDZGAIecvtMiGfsLsGv5YOebvUNjetjs/toa4Py5wKJiY7XOZ+vJUJQBH3pgvwjYDdxAkxiV v3ks= X-Gm-Gg: Acq92OFU0H5tYcDgp6gA73KM78p6NcuQsbDygzbhDTJlpB2UVrlgXBc8BFCJfeeuW93 S/vAEz8zUi2ZiyuMuUPISJs7TCJ3Et6dcPf8Z0Qf0RVO19dl+BJrRvG2JwHLEcP5kwZZPJlv2mX Pu3kJE0qpG/9n8aCC9n6LBrJiEivituWkxDiuQY4CvXMEmnJZkGzIn5AoJ2eEQDWnsMCs8vZm4Q LLmfx1e06XDgSbNkR43c/Ndm3UiqehDT1+MoCQqqnGZQalqdgDqwShUdMElzNpm/nn8Wir5IUTX DjZtIWTpge9nJsN+8WPesibzrYFIB4lFwhRrQ0PUeU4S0gab1SPBVAg86nHeRf7vv7VYmiXiHig h8ADDS27Oebc7dQ6D/Dk0VnzzlggDvrKGpJriWNrYQ1szxT4sbU9E0a82gC40gEgx6pcQfxl2Sb 9TNa8YZTA1dFOYbRWJ+KrEe1ge/HgrwCHstA5R2iI44TwqOQcBrE8cFm4O0Psza97gJazmfBSwQ 8q68zKWpzzlvvButiUBiIqyOP4U0K0= X-Received: by 2002:a05:600c:1c0a:b0:490:846d:e2de with SMTP id 5b1f17b1804b1-490a293fcfcmr276690085e9.28.1780389983932; Tue, 02 Jun 2026 01:46:23 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:23 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Mathias Aparicio Subject: [COMMITTED 34/51] ada: Expand check for setenv availability with _POSIX_VERSION Date: Tue, 2 Jun 2026 10:45:22 +0200 Message-ID: <20260602084541.3829876-34-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Mathias Aparicio Before this patch, the check for setenv availability was hard-coded to a fixed list of platforms. Now expand the OR clause to also accept any system conforming to ISO POSIX.1-2001, which includes setenv in unistd.h. This avoids falling back to the putenv-based #else branch on other POSIX-compliant systems. gcc/ada/ChangeLog: * env.c (__gnat_setenv): Add _POSIX_VERSION >= 200112L to setenv availability check. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/env.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gcc/ada/env.c b/gcc/ada/env.c index d37d2bc7a02..254fe4dbbcf 100644 --- a/gcc/ada/env.c +++ b/gcc/ada/env.c @@ -99,12 +99,16 @@ __gnat_getenv (char *name, int *len, char **value) void __gnat_setenv (char *name, char *value) { +/* We use setenv on a few operating systems where we are sure it's available, + plus on all platforms that claim to support a POSIX version where setenv is + mandatory */ #if (defined (__vxworks) && (defined (__RTP__) || _WRS_VXWORKS_MAJOR >= 7)) \ || defined (__APPLE__) \ - || defined (__linux__) + || defined (__linux__) \ + || _POSIX_VERSION >= 200112L setenv (name, value, 1); -#else /* Why don't we use setenv on all platforms where it's available??? */ +#else size_t size = strlen (name) + strlen (value) + 2; char *expression; From patchwork Tue Jun 2 08:45:23 2026 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: 136271 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CDA134BA2E2F for ; Tue, 2 Jun 2026 09:16:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CDA134BA2E2F Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=SYa6QKHZ X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by sourceware.org (Postfix) with ESMTPS id A7B874BA23D2 for ; Tue, 2 Jun 2026 08:46:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A7B874BA23D2 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 A7B874BA23D2 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::336 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389985; cv=none; b=oJP+PtZ61go5ib+YlzHoaFcw/39Y+s2AGkxSP1H/pBwpx7aqU/zGXOZMIbr42TMAf57fjKh6ARv7HPflJqAM3g531NhwxEsxnxuphn/WtOuxlIRC+GX3kvpokuKfLudv7y0zyKxmh/mmMInnjuwaTzn3pcCwWFlN7Jn03HfDvls= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389985; c=relaxed/simple; bh=UM0mYTwextcZmQmNDtfLEssIcZcl+pXiJGTqCYKR7uk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=F3236LRXg0JmeWgrsMktu7BZsrGzN233tVCVAASp5lJl4Y8EwIRQEH9k8gcEmkJR4442G3d1/WzJIm1WcQdwyQi3eRnReSaojc7s3iyMxMaHEwRmCJau4ZQ+iZNesbUfLTlK+W+M56ucWuvdgwMcgpbJUHn5uGcpAH7ovGTiVZE= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=SYa6QKHZ DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A7B874BA23D2 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-490a7876f8cso21484725e9.3 for ; Tue, 02 Jun 2026 01:46:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389984; x=1780994784; 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=QlhU5K3Ar1tj1PdfiPRNXnpY5DWJDKneqCIs3n3BcIk=; b=SYa6QKHZFhpsZWpzG/d7F+yWyG5V3tlKFcqX8W8waJCv575sgK7ECfyqTlX5/62HDK 3WhAPAoVTvsOzq7mnR/9nJN1T/+GYmp3t+34/7M+YK3Sncd2H4hMe+GffoUBWgeu+Vai Fpoqzj/8pC8A3R2gheIrcT9/kL6flJq8x9nyimMsdeGlkcgiNkwx30zHmAWN0mptn8mc nTHAaPMzFesdY7ElF0Iiv0IuBm3WpXZosF9RzJnnbMX2wAiGY+J6z16VzLXL/mxlhd8c 2kwJ/mwNYADLnA2k1vuAvCrVCEYfIuZ2868IRva1IkXosuAzGU2HeT7Jl+8PgEIGSkr+ 1YdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389984; x=1780994784; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=QlhU5K3Ar1tj1PdfiPRNXnpY5DWJDKneqCIs3n3BcIk=; b=BIPshXCS6AUQ+An8u7058dzWzyoN68lNN+KHUQjRl+UChGP9/t90uwKpd7EXJGQuKo k3IENQnciXm1mqRCCNwsH8FF0l7DWifEIlE6hRXS22EIR1CyNFevJuj2PXOC25n1738k lpNE1wQrhnwgMbEsYMhKQOTwuHLoyyng43w0f9nPDQixHLj2g0r9dO+R/ghLdUQ/042m +fVW5rV7a0ZWXO7ZkDOdOnLvqGiIj7XrT+Venjx8ufKChASv1T55MldcbCEgmS+0gG9w RFvlxyMqoAF395k2/75AZHfYfcH1DFP5zM7Nzr9GN8DwN7xLtkaB2sM35HXSA6WS4kgx YUCQ== X-Gm-Message-State: AOJu0YyIf9vnLKYjFODrFDsWIh/b5PP7vnMyPC0qKkk92HuWoEG+kKSI nlBJFWPTMl3putgIoVkULalsc3Knxn9pOSq74WNDgms7/1Zqf6PXj0v0zn+OFdw+drHG6HcJmXH LqaU= X-Gm-Gg: Acq92OGPAt/dp+csSmXbkLydzc9bkzKCR2HGYRcBQLedJRmKq5P1UMPOOXH00k+67Cu svUqrtQy7723Q6LHHrYRqyl8ZUi8fP5CCkIRHAntk1gA/rt+pE7r9Jdran+BU2JYZ0Tu5AP3WDo rSUz0PXSkz2NQq0P7o2vsGZhDcZHywrS1WUmHg0Se81lK/gwLiRF3soNOSWl9YT0ops/lvcoM7v m1ZIKwYgHLfjI0vGOQwBg+LvtiyY6eL1zOqWNoa611U9+ylmi3uiKP56rA/j1uypkGyNqv2DmKo CEaj9l7lkf0HgGCReWsN+Mle5TEmWbt8xgBBymqNt4sAd++nQ4ogxJEBU3XAPbplzBCkYh6SUlf aitf6TGYPiUSS/1J24254qrbNiCfjVvuk5lzonxoxOMRYAtGM49XYU7y1YjKqSrlcRkCDvJCXN9 xay36VWblSxP3KA0S/lNDsd6Dkx6wr6kGu7tJn6gpz3FjRANGjXXxaDJyonWDD2O/NoSO0x45Sa rhH8uTqcEuBohUOE1h/91yz3/2nIK0= X-Received: by 2002:a05:600c:1988:b0:488:aa33:dcbd with SMTP id 5b1f17b1804b1-490a2950c9emr261205335e9.26.1780389984609; Tue, 02 Jun 2026 01:46:24 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:24 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: =?utf-8?q?Marc_Poulhi=C3=A8s?= Subject: [COMMITTED 35/51] ada: Fix Expression_Copy field documentation Date: Tue, 2 Jun 2026 10:45:23 +0200 Message-ID: <20260602084541.3829876-35-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org The field has been added to N_Aspect_Specification nodes in "Implement Aspects as fields under nodes" commited in late 2023. gcc/ada/ChangeLog: * sinfo.ads : Mention it is present in N_Aspect_Specification nodes. : Add Expression_Copy field. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sinfo.ads | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index 01f08ec4a22..3609fd8ef3b 100644 --- a/gcc/ada/sinfo.ads +++ b/gcc/ada/sinfo.ads @@ -1250,10 +1250,11 @@ package Sinfo is -- temporary for them. -- Expression_Copy - -- Present in N_Pragma_Argument_Association nodes. Contains a copy of the - -- original expression. This field is best used to store pragma-dependent - -- modifications performed on the original expression such as replacement - -- of the current type instance or substitutions of primitives. + -- Present in N_Pragma_Argument_Association and N_Aspect_Specification + -- nodes. Contains a copy of the original expression. This field is best + -- used to store pragma-dependent modifications performed on the original + -- expression such as replacement of the current type instance or + -- substitutions of primitives. -- File_Index -- Present in N_External_Initializer nodes. Contains a Source_File_Index @@ -7606,6 +7607,7 @@ package Sinfo is -- Next_Rep_Item -- Class_Present Set if 'Class present -- Is_Ignored + -- Expression_Copy -- Is_Checked -- Is_Delayed_Aspect -- Is_Disabled From patchwork Tue Jun 2 08:45:24 2026 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: 136276 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 89B114BA23CE for ; Tue, 2 Jun 2026 09:23:39 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by sourceware.org (Postfix) with ESMTPS id D91EE4BA2E2C for ; Tue, 2 Jun 2026 08:46:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D91EE4BA2E2C 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 D91EE4BA2E2C Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::335 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389988; cv=none; b=niHNprlqJv9/M6JIZD5T9vOld46FsTayebsaFF8zqGTYLOfTIliD16NXAeHd1qHJz6+s9jduFJ1hsXh3kXa72qhgecf3xeG+WHAUQuyNk/GNAJZyFbbsyR8hH5zZVkY/YB1mgbVIODgPoghS/z1DmST4mqbHvUFSqlsKLTb1S3M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389988; c=relaxed/simple; bh=3TKgGDrs3eEv6dmAuivD94IiXOO9KoY6rC8M4stmSl0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=XNRyTkiG4EHWiJViUDFFsFhsRctXUHAt43zb3TZ46XszKd0MGWmGI8WXyl4AqvhF6UNYGVamptUdj6qMfijUm6mbAYpjFdm5OqrHPctVZKBuQGhoNJsFlQyEshyUcBvHvOL04ME+d6gSraGvQ4AgeDZ3C1Os4drWyXpMiHL/Htw= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=as/M0RC9 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D91EE4BA2E2C Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=as/M0RC9 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4909e3fa4b2so39355715e9.0 for ; Tue, 02 Jun 2026 01:46:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389987; x=1780994787; 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=5dv/QIhWhFtI/Of4iW/9jQnPPDccnj1WFxGTvtsnZq8=; b=as/M0RC9M1kA8SojV+bvYVsVyibQ7HGkXos2mwdPBBCsMGpClH5QxvFs4UEd15fJ5Y BX9btWcfxDzOdnFb4Smtk33dBKmTuCsv6bNgkPLOpej0MPi67pvpzFjDDNaDKTliXgY4 byTKH2KxmmRtvG417pUE3L5ItuwfddTe4+Uq7IkfyphfK2W8SSwhn4RCvkAO56dyoVxk UpyYN69MZ9RIQxqkaFTA5XxQxgfk9trWT6eh5Vel5/gZFVR02Mk4kKxK4WURGB2aS8Vs Sr5gFdlbIoqQWUDqiyElAQwh7s80bRH94cOp/VKWCfaGfCHha7GMprRv4mr/pEHuhqsa 6uJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389987; x=1780994787; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=5dv/QIhWhFtI/Of4iW/9jQnPPDccnj1WFxGTvtsnZq8=; b=so6BAdlHCSp3uhrss8+O7YJTShJEGTUFfi89se7jRAbGbUNdb0ds4xWazsHuSD0Hww CpRYUtabq77CcpJKm4wv5q6EsLIqSLuSH77fWeov2QL+PYfWBslZYYYZcR9QbTtB01wb 3KTC8t2F47whXDp04xBp2Fy2FPA09UHzn6rKOvSOqOJTSAElxcL2qx5NfpjjJw51Vj87 HowEdiMzzeL4ZVVWN+UkQaQlRTXGgsay4VwMUiPf1YfdlSUIy3aqpTSYG3KqSyiIoX5R /yzX4svno9ftTGVtmBHDRuNs2jtfH3qNJw6rjUmiCs2IKc4eA5ndtznRcPdsNUxzQcpp 5UuQ== X-Gm-Message-State: AOJu0YyxJj0/3QBJmdi4hA/L2xdhSV+00aoI3Wvc+OMr9KhFBVKVwyer GtAOBH18eGXUONBZsqrKAPhBsKFqKdpV+74UqOjb6FuWWl/tG5uoi4P41QKnkp3046neau4Vrd3 1Jqk= X-Gm-Gg: Acq92OFjBr1TYI7Vv4Dy9DWmDK9gvsNJEQbXU9IURGOk37PbysdMNJn8vTVl8PvBmLk eAZnYQ6O+Wc6iAwBeuEZ/aesbhCu0ycF3QRYy8f7J2pmPK8lE8jTenYlzDbBN6KzqWbZ8tkp2AZ yDcayIMMKD7MhW8P29Qa3BJzzTfu1SjUDGnubeF5KPLwFFjDbvaMPPCpWGc8lKSPeLPNu4Vl0mN 3X3nALyBgNf1xSSDea/6nuV5kA2niYNhpZPQW7/2NWfpol+0xNYKRCkjveiuSJNRwvHoMMm0Bxx +G0c1xcKymoYQ1Z/RrQDI5zNHFt9qF5i2SiIQt5y50hYOErmXIsKza3vGuiBU4wW/30nPmlyHxs +N4Myhjggyua/LtIQ6TAknsUWpXjoHkDEvVBDGcQGwG6fEWINUeG/hn97TmGoh2SZoPuxpef22P FowZYQLpTeS10ETNwTguHB7qvfXAVVFyo+Y3br4clIW+rsZYHudrq/gWrG8oK0p+G/ol4i0LVTE PiCmMa8UTubxpVugCJFJzmUF3HpzIU= X-Received: by 2002:a05:600d:8444:20b0:490:7136:ad02 with SMTP id 5b1f17b1804b1-490b078f2d5mr45753915e9.7.1780389986706; Tue, 02 Jun 2026 01:46:26 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:25 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED 36/51] ada: Simplify host and target suffix queries Date: Tue, 2 Jun 2026 10:45:24 +0200 Message-ID: <20260602084541.3829876-36-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> 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, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Piotr Trojanek Code cleanup for host and target suffixes, which are stored in C runtime code. gcc/ada/ChangeLog: * libgnat/s-os_lib.adb (Get_Debuggable_Suffix, Get_Executable_Suffix, Get_Object_Suffix, Get_Target_Debuggable_Suffix, Get_Target_Executable_Suffix, Get_Target_Object_Suffix): Access strings like we do in Gnatlink. * adaint.c (__gnat_object_suffix, __gnat_executable_suffix, __gnat_debuggable_suffix): Now constants, just like the ones for target suffixes. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/adaint.c | 45 ++------------- gcc/ada/libgnat/s-os_lib.adb | 106 +++++++---------------------------- 2 files changed, 25 insertions(+), 126 deletions(-) diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index 5fb25571774..cf885126067 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -698,51 +698,18 @@ __gnat_get_current_dir (char *dir, int *length) dir[*length] = '\0'; } -/* Return the suffix for object files. */ +/* Suffix for object files. */ -void -__gnat_get_object_suffix_ptr (int *len, const char **value) -{ - *value = HOST_OBJECT_SUFFIX; +const char *__gnat_object_suffix = HOST_OBJECT_SUFFIX; - if (*value == 0) - *len = 0; - else - *len = strlen (*value); +/* Suffix for executable files. */ - return; -} +const char *__gnat_executable_suffix = HOST_EXECUTABLE_SUFFIX; -/* Return the suffix for executable files. */ - -void -__gnat_get_executable_suffix_ptr (int *len, const char **value) -{ - *value = HOST_EXECUTABLE_SUFFIX; - - if (!*value) - *len = 0; - else - *len = strlen (*value); - - return; -} - -/* Return the suffix for debuggable files. Usually this is the same as the +/* Suffix for debuggable files. Usually this is the same as the executable extension. */ -void -__gnat_get_debuggable_suffix_ptr (int *len, const char **value) -{ - *value = HOST_EXECUTABLE_SUFFIX; - - if (*value == 0) - *len = 0; - else - *len = strlen (*value); - - return; -} +const char *__gnat_debuggable_suffix = HOST_EXECUTABLE_SUFFIX; /* Returns the OS filename and corresponding encoding. */ diff --git a/gcc/ada/libgnat/s-os_lib.adb b/gcc/ada/libgnat/s-os_lib.adb index ae8ef2b1a08..0caab7e045e 100644 --- a/gcc/ada/libgnat/s-os_lib.adb +++ b/gcc/ada/libgnat/s-os_lib.adb @@ -35,6 +35,7 @@ with System.Case_Util; with System.CRTL; with System.Soft_Links; with Interfaces.C; +with Interfaces.C.Strings; package body System.OS_Lib is @@ -1034,22 +1035,11 @@ package body System.OS_Lib is --------------------------- function Get_Debuggable_Suffix return String_Access is - procedure Get_Suffix_Ptr (Length, Ptr : Address); - pragma Import (C, Get_Suffix_Ptr, "__gnat_get_debuggable_suffix_ptr"); - - Result : String_Access; - Suffix_Length : Integer; - Suffix_Ptr : Address; + Suffix : constant Interfaces.C.Strings.chars_ptr; + pragma Import (C, Suffix, "__gnat_debuggable_suffix"); begin - Get_Suffix_Ptr (Suffix_Length'Address, Suffix_Ptr'Address); - Result := new String (1 .. Suffix_Length); - - if Suffix_Length > 0 then - Strncpy (Result.all'Address, Suffix_Ptr, size_t (Suffix_Length)); - end if; - - return Result; + return new String'(Interfaces.C.Strings.Value (Suffix)); end Get_Debuggable_Suffix; --------------------------- @@ -1057,22 +1047,11 @@ package body System.OS_Lib is --------------------------- function Get_Executable_Suffix return String_Access is - procedure Get_Suffix_Ptr (Length, Ptr : Address); - pragma Import (C, Get_Suffix_Ptr, "__gnat_get_executable_suffix_ptr"); - - Result : String_Access; - Suffix_Length : Integer; - Suffix_Ptr : Address; + Suffix : constant Interfaces.C.Strings.chars_ptr; + pragma Import (C, Suffix, "__gnat_executable_suffix"); begin - Get_Suffix_Ptr (Suffix_Length'Address, Suffix_Ptr'Address); - Result := new String (1 .. Suffix_Length); - - if Suffix_Length > 0 then - Strncpy (Result.all'Address, Suffix_Ptr, size_t (Suffix_Length)); - end if; - - return Result; + return new String'(Interfaces.C.Strings.Value (Suffix)); end Get_Executable_Suffix; ----------------------- @@ -1080,22 +1059,11 @@ package body System.OS_Lib is ----------------------- function Get_Object_Suffix return String_Access is - procedure Get_Suffix_Ptr (Length, Ptr : Address); - pragma Import (C, Get_Suffix_Ptr, "__gnat_get_object_suffix_ptr"); - - Result : String_Access; - Suffix_Length : Integer; - Suffix_Ptr : Address; + Suffix : constant Interfaces.C.Strings.chars_ptr; + pragma Import (C, Suffix, "__gnat_object_suffix"); begin - Get_Suffix_Ptr (Suffix_Length'Address, Suffix_Ptr'Address); - Result := new String (1 .. Suffix_Length); - - if Suffix_Length > 0 then - Strncpy (Result.all'Address, Suffix_Ptr, size_t (Suffix_Length)); - end if; - - return Result; + return new String'(Interfaces.C.Strings.Value (Suffix)); end Get_Object_Suffix; ---------------------------------- @@ -1103,23 +1071,11 @@ package body System.OS_Lib is ---------------------------------- function Get_Target_Debuggable_Suffix return String_Access is - Target_Exec_Ext_Ptr : Address; - pragma Import - (C, Target_Exec_Ext_Ptr, "__gnat_target_debuggable_extension"); - - Result : String_Access; - Suffix_Length : Integer; + Suffix : constant Interfaces.C.Strings.chars_ptr; + pragma Import (C, Suffix, "__gnat_target_debuggable_extension"); begin - Suffix_Length := Integer (CRTL.strlen (Target_Exec_Ext_Ptr)); - Result := new String (1 .. Suffix_Length); - - if Suffix_Length > 0 then - Strncpy - (Result.all'Address, Target_Exec_Ext_Ptr, size_t (Suffix_Length)); - end if; - - return Result; + return new String'(Interfaces.C.Strings.Value (Suffix)); end Get_Target_Debuggable_Suffix; ---------------------------------- @@ -1127,23 +1083,11 @@ package body System.OS_Lib is ---------------------------------- function Get_Target_Executable_Suffix return String_Access is - Target_Exec_Ext_Ptr : Address; - pragma Import - (C, Target_Exec_Ext_Ptr, "__gnat_target_executable_extension"); - - Result : String_Access; - Suffix_Length : Integer; + Suffix : constant Interfaces.C.Strings.chars_ptr; + pragma Import (C, Suffix, "__gnat_target_executable_extension"); begin - Suffix_Length := Integer (CRTL.strlen (Target_Exec_Ext_Ptr)); - Result := new String (1 .. Suffix_Length); - - if Suffix_Length > 0 then - Strncpy - (Result.all'Address, Target_Exec_Ext_Ptr, size_t (Suffix_Length)); - end if; - - return Result; + return new String'(Interfaces.C.Strings.Value (Suffix)); end Get_Target_Executable_Suffix; ------------------------------ @@ -1151,23 +1095,11 @@ package body System.OS_Lib is ------------------------------ function Get_Target_Object_Suffix return String_Access is - Target_Object_Ext_Ptr : Address; - pragma Import - (C, Target_Object_Ext_Ptr, "__gnat_target_object_extension"); - - Result : String_Access; - Suffix_Length : Integer; + Suffix : constant Interfaces.C.Strings.chars_ptr; + pragma Import (C, Suffix, "__gnat_target_object_extension"); begin - Suffix_Length := Integer (CRTL.strlen (Target_Object_Ext_Ptr)); - Result := new String (1 .. Suffix_Length); - - if Suffix_Length > 0 then - Strncpy - (Result.all'Address, Target_Object_Ext_Ptr, size_t (Suffix_Length)); - end if; - - return Result; + return new String'(Interfaces.C.Strings.Value (Suffix)); end Get_Target_Object_Suffix; ------------ From patchwork Tue Jun 2 08:45:25 2026 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: 136277 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 871534BA2E19 for ; Tue, 2 Jun 2026 09:23:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 871534BA2E19 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=OepAgQmP X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id 92D974BA23DB for ; Tue, 2 Jun 2026 08:46:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 92D974BA23DB 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 92D974BA23DB Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::333 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389988; cv=none; b=Kty2o1g8C1Nv/nUgNFLVQCsLl2MGdlv/l0HgamNRXI8OGfDbf51YLfubnAoIfWi7gwyGxs5hIHS9IKMPkR116ix1CVmqwUs5QYurPrJC1y0zI2G+zD3QKuj9fOwZRwG4n38PIRGnAnNkZXLcRYkYdtFka7BT37tEee08i7Cjbag= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389988; c=relaxed/simple; bh=VP/HC1E13wC87OJ6H4t52Qsr8b/kU+KfMDA+JPWRfR4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=SMXDskfs9FCh8QATSnqNC9hCT69ldR69g6PQPAo+BZlH2cWQMWZy+uxOWlnRRaUrhUaOse7CUFJu+EZeOVRXtDP77Yx9rJkm1eAcKpkE100EgIQEuJnni2SCF8MMC9Pba5eTH/RZDm+ISzyi8iVw8vhKcduvwtnQgFv31y2vmVU= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=OepAgQmP DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 92D974BA23DB Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-490aebf33e9so8027605e9.3 for ; Tue, 02 Jun 2026 01:46:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389987; x=1780994787; 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=xpC1EYLt/gLMZLwuCqIcyyVPi7c8oUIdWy+qltndQsE=; b=OepAgQmPygG33sdZGVWPKuYd/1Afy9SACx7g1+h1a6gK96wMnyBLdWnwUv9pTKH7Qv ye0LuShRL917p31woLdjnPonW/IzyFbG4qSAqpOxr52ehPRq8dK7t+ts4l0X4ULKxAxv J1YBVQfMv/mXHOB1Lip1dLqU72MMBIZZQT2Ds34jB1tA9/q8L1yRyBbH49a6Gh61YF2I hs9iWhNE1aWmlv69snhgDzt45pE+P7iOI+6PiQg79xIN1kTPcM6PMmMeuz2DRpfFpYqW E6fm/x/+d/pRCr2MHGpwVxxmrZsny9CSErpfO2ZMyvAT9kmPVmdJfNNob51nkFRh4iNn C4xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389987; x=1780994787; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=xpC1EYLt/gLMZLwuCqIcyyVPi7c8oUIdWy+qltndQsE=; b=aZPy4P+GKamOVcXhAthHaA82hPAaSotujxynzVelfXSXz1XWxDcgADG+M0cl1uenAE SC+sYWTPKddaXEoLq5rKASmlOFM1FwvVscbeRB839FoqvWLPUzFsuOI3Ix4NJTIVlpIi 2JAPs/cS/uQlIvSEJECkmYgDnSZP31W9u/+6gitV/KtmiGrgmuUDAUHY3Ij3+NONkm73 nOAkftErhSj0yCsXoxPJjuHSieofYc9N8FDT4l9xe2z+wTUlR4Tk0g0Nn2nJGzx9dlLI k/1BIfdTbnCsy+Ixx7RIwnsXLOrjCVzAuVEeC5xkmdPm/3bnJg9/qjzHkx63LCKaUad9 nISA== X-Gm-Message-State: AOJu0Yw+sjvccHdvVwM6uHdXjqbwYN5zftlN8TPNbs/LEDgQRWsX6bBD U4VC8MnpwFPs4Tufpeza9Gg7DdqNaJJLIYrYdH25f15GZnFbxvc9YlP1DXfmfiPr9XIbuLNgnZj dztc= X-Gm-Gg: Acq92OGc6ezUh5a2xQ30jJExYkfaXY/rq2rqFbaKsmyfCkdmZRjB66lo4pLWlB4Lg33 o9NJsBiGUHw9Is6xm0JMuGXnONFTagXwzkqjtO5fZNhFfoqnuuJTMkapK8YgIxt+fSluT4xXn3Y qbdTNXjyYJ4+yymscUa4jpmGqkaUkmMhRLdOyNlaM1gVtyol3OTE9kOmyn1NwTREy70GfLckKJp jICGc1i4jbFW8VzB6+SYxKeowEOSlzBcvU0Oku3z5qldNhaoN4BEG4i5quGfIQl4gWLHnFQDwRv wAET9A/Y5RjJ87htVOg633DrwdXs++ko1Cy4NYd8QDUafrWPtq5Le4TEL8K+RfPNOTaSJfVkCmo +9yMNgQIYnG8jJJuwH4oTeAEQFKL68Ew+hJ0yJ3H4RGAg7jDW8NfYxHvfhGnr2lw1kCbSp7ZbeG KbUd4AQre/+YV2aRi7N6NEcVOaOqED/UR4TrEIXx9IHHhPGWVgTRuF/46VBrL6V5B2AUEcu2fwH Jt4yB0cGxeWwaoky5RC836gzs53GGs= X-Received: by 2002:a05:600c:c3cf:20b0:490:47e0:e13f with SMTP id 5b1f17b1804b1-490a292a3bamr198159625e9.3.1780389987442; Tue, 02 Jun 2026 01:46:27 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:27 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 37/51] ada: Fix crash on allocator of class-wide interface as actual in subprogram call Date: Tue, 2 Jun 2026 10:45:25 +0200 Message-ID: <20260602084541.3829876-37-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Eric Botcazou The crash occurs because the type of the allocator lacks the Master_Id to be passed to the function initializing the allocator, which is required because the interface is limited and therefore may be the progenitor of a type that contains tasks. It comes from a couple of problems: 1) the special conversion trick used in Resolve_Actuals to force the displacement of the pointer, which blocks the proper resolution of the allocator (its E_Allocator_Type is not replaced), and 2) the lack of Master_Id on the E_Access_Subtype created for the subtype of the parameter in the subprogram call, which is the not null variant of a named access type. The former problem is solved by resolving the allocator explicitly, while the latter is solved by changing Master_Id to live on root types only (in accordance with RM 9.3(2), which says that it should designate the master construct that elaborates the ultimate ancestor of a given access type). The change contains a couple of additional fixes: 3) the proper resolution of the allocator causes missing accessibility checks to be generated, which in turn generates a fair amount of useless access checks and 4) an incorrect transient scope would be created around the allocator when the type of the parameter is named, while it's only needed for an anonymous access type. gcc/ada/ChangeLog: * gen_il-gen-gen_entities.adb (Access_Kind): Add Root_Type_Only for the Master_Id field. * einfo.ads (Master_Id): Document that it lives on root types only. * accessibility.adb (Apply_Accessibility_Check_For_Allocator): Avoid generating secondary useless checks. * exp_ch3.adb (Build_Initialization_Call): Use the Master_Id of the type of target reference directly. (Build_Master): Minor tweak. (Expand_N_Full_Type_Declaration): Do not call Build_Master for a derived access type declaration. * exp_ch4.adb (Expand_N_Allocator): Test Master_Id directly on the access type. * sem_res.adb (Resolve_Actuals): In the case of an allocator, if the designated type is a CW interface, call Convert_To_And_Rewrite to add the special conversion but nevertheless resolve the allocator to the type of the formal afterward; do not establish a transient scope if the type is a named access type. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/accessibility.adb | 3 +- gcc/ada/einfo.ads | 6 ++-- gcc/ada/exp_ch3.adb | 11 +++--- gcc/ada/exp_ch4.adb | 2 +- gcc/ada/gen_il-gen-gen_entities.adb | 2 +- gcc/ada/sem_res.adb | 54 +++++++++++++---------------- 6 files changed, 38 insertions(+), 40 deletions(-) diff --git a/gcc/ada/accessibility.adb b/gcc/ada/accessibility.adb index 396c8914f9a..9b5d0fba73a 100644 --- a/gcc/ada/accessibility.adb +++ b/gcc/ada/accessibility.adb @@ -1169,7 +1169,8 @@ package body Accessibility is Insert_Action (N, Make_Implicit_If_Statement (N, Condition => Cond, - Then_Statements => Stmts)); + Then_Statements => Stmts), + Suppress => All_Checks); end if; end Apply_Accessibility_Check_For_Allocator; diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index 9c293f47814..b156de6ee05 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -3688,7 +3688,7 @@ package Einfo is -- having Has_Machine_Radix_Clause True. This happens when a type is -- derived from a type with a clause present. --- Master_Id +-- Master_Id [root type only] -- Defined in access types and subtypes. Empty unless Has_Task is set for -- the designated type, in which case it points to the entity for the -- Master_Id for the access type master. Also set for access-to-limited- @@ -5252,7 +5252,7 @@ package Einfo is -- E_Access_Type -- E_Access_Subtype -- Direct_Primitive_Operations $$$ type - -- Master_Id + -- Master_Id (root type only) -- Directly_Designated_Type -- Associated_Storage_Pool (root type only) -- Finalization_Collection (root type only) @@ -5704,7 +5704,7 @@ package Einfo is -- E_General_Access_Type -- First_Entity $$$ -- Renamed_Entity $$$ - -- Master_Id + -- Master_Id (root type only) -- Directly_Designated_Type -- Associated_Storage_Pool (root type only) -- Finalization_Collection (root type only) diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 843dc173c25..12cbd58a42b 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -2564,8 +2564,7 @@ package body Exp_Ch3 is Append_To (Args, Make_Integer_Literal (Loc, Library_Task_Level)); elsif Present (Target_Ref) then Append_To (Args, - New_Occurrence_Of - (Master_Id (Base_Type (Root_Type (Etype (Target_Ref)))), Loc)); + New_Occurrence_Of (Master_Id (Etype (Target_Ref)), Loc)); else Append_To (Args, Make_Identifier (Loc, Name_uMaster)); end if; @@ -6882,8 +6881,8 @@ package body Exp_Ch3 is -- but testing Comes_From_Source may be too general in this case -- (affects some test output)??? - elsif not Is_Param_Block_Component_Type (Ptr_Typ) - and then Is_Limited_Class_Wide_Type (Desig_Typ) + elsif Is_Limited_Class_Wide_Type (Desig_Typ) + and then not Is_Param_Block_Component_Type (Ptr_Typ) then Build_Master_Entity (N); Build_Master_Renaming (Ptr_Typ); @@ -6901,7 +6900,9 @@ package body Exp_Ch3 is begin if Is_Access_Type (Def_Id) then - Build_Master (Def_Id); + if Nkind (Type_Definition (N)) /= N_Derived_Type_Definition then + Build_Master (Def_Id); + end if; if Ekind (Def_Id) = E_Access_Protected_Subprogram_Type then Expand_Access_Protected_Subprogram_Type (N); diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 2763aed4f9a..1bad0f9a3c8 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -4976,7 +4976,7 @@ package body Exp_Ch4 is -- created when expanding the function declaration. if Has_Task (Etyp) then - if No (Master_Id (Base_Type (PtrT))) then + if No (Master_Id (PtrT)) then -- The designated type was an incomplete type, and the -- access type did not get expanded. Salvage it now. diff --git a/gcc/ada/gen_il-gen-gen_entities.adb b/gcc/ada/gen_il-gen-gen_entities.adb index 716c1d33f7a..60de3aa27d8 100644 --- a/gcc/ada/gen_il-gen-gen_entities.adb +++ b/gcc/ada/gen_il-gen-gen_entities.adb @@ -652,7 +652,7 @@ begin -- Gen_IL.Gen.Gen_Entities Sm (Is_Local_Anonymous_Access, Flag), Sm (Is_Param_Block_Component_Type, Flag, Base_Type_Only), Sm (Is_Pure_Unit_Access_Type, Flag), - Sm (Master_Id, Node_Id), + Sm (Master_Id, Node_Id, Root_Type_Only), Sm (No_Pool_Assigned, Flag, Root_Type_Only), Sm (No_Strict_Aliasing, Flag, Base_Type_Only), Sm (Storage_Size_Variable, Node_Id, Impl_Base_Type_Only))); diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 08d45ebca33..028e170021e 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -4513,51 +4513,47 @@ package body Sem_Res is end if; end if; - -- (Ada 2005: AI-251): If the actual is an allocator whose - -- directly designated type is a class-wide interface, we build - -- an anonymous access type to use it as the type of the - -- allocator. Later, when the subprogram call is expanded, if - -- the interface has a secondary dispatch table the expander - -- will add a type conversion to force the correct displacement - -- of the pointer. - if Nkind (A) = N_Allocator then declare DDT : constant Entity_Id := Directly_Designated_Type (Base_Type (Etype (F))); begin - -- Displace the pointer to the object to reference its - -- secondary dispatch table. + -- Ada 2005, AI-251: If the actual is an allocator whose + -- directly designated type is a class-wide interface, we + -- build a type conversion to force the displacement of + -- the pointer to reference the secondary dispatch table. + -- Note that we need to resolve the allocator explicitly, + -- otherwise its E_Allocator_Type will never be replaced, + -- since it's now the operand of a type conversion. if Is_Class_Wide_Type (DDT) and then Is_Interface (DDT) then - Rewrite (A, Convert_To (Etype (F), Relocate_Node (A))); + Convert_To_And_Rewrite (Etype (F), A); Flag_Interface_Pointer_Displacement (A); - - Analyze_And_Resolve (A, Etype (F), - Suppress => Access_Check); + Resolve (Expression (A), Etype (F)); + Analyze_And_Resolve + (A, Etype (F), Suppress => Access_Check); end if; - -- Ada 2005, AI-162:If the actual is an allocator, the - -- innermost enclosing statement is the master of the - -- created object. This needs to be done with expansion - -- enabled only, otherwise the transient scope will not - -- be removed in the expansion of the wrapped construct. + -- Ada 2005, AI-162: If the actual of an access parameter + -- is an allocator, the innermost enclosing statement is + -- the master of the created object. When the expander is + -- active, establish a transient scope to embody it. - if Expander_Active - and then (Needs_Finalization (DDT) - or else Has_Task (DDT)) - then - Establish_Transient_Scope - (A, Manage_Sec_Stack => False); + if Ekind (Etype (F)) = E_Anonymous_Access_Type then + Check_Restriction (No_Access_Parameter_Allocators, A); + + if Expander_Active + and then (Needs_Finalization (DDT) + or else Might_Have_Tasks (DDT)) + then + Establish_Transient_Scope + (A, Manage_Sec_Stack => False); + end if; end if; end; - - if Ekind (Etype (F)) = E_Anonymous_Access_Type then - Check_Restriction (No_Access_Parameter_Allocators, A); - end if; end if; -- (Ada 2005): The call may be to a primitive operation of a From patchwork Tue Jun 2 08:45:26 2026 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: 136250 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DF0974BA23DE for ; Tue, 2 Jun 2026 08:59:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DF0974BA23DE Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=hokdQOgc X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id 34F1E4BA2E0D for ; Tue, 2 Jun 2026 08:46:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 34F1E4BA2E0D 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 34F1E4BA2E0D Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389989; cv=none; b=kXY1OgIfsdmAk7S/BLELBAnb4Ug+zlvFjV8njbSdToxoJ2TVSXOkiMrhiWAKypk92hf2qgWi5ckXaPjUa0LSRVe3cE6QazmEOVSs6219a01MjObpzV04dEvkdX5+/eHRAy3gmzLvSNAGOfaxoCRyYjgVTeWK17RCTj1PZma3mpw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389989; c=relaxed/simple; bh=+pDx2DlugBCRc3fuwC/7Hl7x05oSWRgflVCNsVkUdRs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=FEkJObXpqi/6L1wi7EOkK0yNrAhYjyBKY0Uy45pd0YqFx0eKu5Dwse4kS38yO22If+MA+RkB0gHOrTngYXcB81fekBlZPirgMj2CCxUUiJnxYxf+gnR0RsSsjxR7kAO/TeBBH1Tf27c9E2QqYtrhhFI4L9ve3oUHtpn68hg8HRE= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=hokdQOgc DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 34F1E4BA2E0D Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-490aaeabdb4so11340195e9.1 for ; Tue, 02 Jun 2026 01:46:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389988; x=1780994788; 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=GcpsiEvGqXfvU5R01G3zl49i+VGK980ShMXTuV5rNqw=; b=hokdQOgc4eDMfQjv5ttcB/zjFEh+AUnBTc/Vh+o76YF0SlquwP5XGhjeJbQoKQkTvy uebEybciagXj0Qim6qTn4zLEigpZexhKxfRJBxsjaB+BFUlExCJ4ZyIKgUFh1Ll89bib 1otIkG0QBUjb/NG4w1JbmKmUjjjSH4ZmWcufdYpzv8MZjwAbpX/YAWlME6Cwt4sKoIyK vhcHtJTUfSrkyo3gzUj7BpSHMAF1nRXIvHRwtMWN2QRYlSAE3fxL5a80NV8ciiD7Qh0U ZBdpkZ1Qoe55ZrZCSiMZ45BA3Yqwj9gCjy8+7hpGTuFBCJf/Oo3mDY8ujWhzmtO1ScB6 bDIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389988; x=1780994788; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=GcpsiEvGqXfvU5R01G3zl49i+VGK980ShMXTuV5rNqw=; b=MN91+H3vvHae9ZqVnmVud03m6KAcm/hxhmDOsEP7lzD1dvXVOdnJWaszfO3q+z9RS2 m22bVFzy9hmVzZ44IHwRZipm0hHgfW065Ngfr+yU1zC/hk1+r7SwK3ToeArSilKFUGD0 CdG+DavuHUHgeFg/tJLNE36TdTAsQiUFyNiWAeKeVaIkhurNgj9nOwL6nE4V08bmCzNK lVPqmRAVeYZmZlwGSMRzfe2g7gaObdNFY8nFDK/gSYzhAJ1RxYHId74lKkOplrYpFmYL jYCDHnDJF3nitYatrBpI4VwWoPpabM15btRfZp0zIfL3cGNeq1+oYpVHQwKxXwWg+/m6 8jhw== X-Gm-Message-State: AOJu0YzLA6OhBddRpHra803DPf9yyZROw7w2eEAuArn517exGS/IZbjL WcpZJL5OC4pVffUr5+2T4Dl5+373D65qq0CS6UeP8I2yUJ7rCxAMqxCOoY+7YPBWXjPNNl6zrkl NUqI= X-Gm-Gg: Acq92OFwkaUujF0qYAWS+4rnNt8QNesIzlb+vcQUc6n+XFSWVACmw+aIpqTwwb3IM4+ mahBWaOjsXZdrRIDMzWtI4zO9ylFAepPI7higjcbF8pNaXiwGu65G+WYk0RAwFj+0PiOAG+awMR R3nTXKYXObrV65gBlTRilnP9cBPQbMYdMFDEIVRMHnd/mYfoFSambD9bQbfp7US936Ik1wiTfwy GJJuh+OB053KzNswT495RuCZEK2sAIB4+kGjyYL4CGf0HPDiDxUfUuuz7IMnOxVT72Vi0G+j8R5 wwXVReewguH7VGWrebs/UqXRA7tVTVsh2NY53Tilav7fdo0sJ0mddIf3yK1tMtQkzPIYo9dtkXt 1YTK27sLC5Fm2wAztFPKMAWApl83VwiakLt+loqAVF7ue4aE+OUNo30c9fFCh/Lkk/wFI9UP5Iy FaykhyeFan8WUwZbncsMBMTeGQpchmpTsbPeoakeW7r9hX8AQrZsZmGJvaletdsdxvlMHzLM4Gx OL5JnBEHjxSSGwdBrprbx60c658wjE= X-Received: by 2002:a7b:ce03:0:b0:490:5527:3be2 with SMTP id 5b1f17b1804b1-490a29647aamr192217695e9.32.1780389988198; Tue, 02 Jun 2026 01:46:28 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:27 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 38/51] ada: Minor comment fixes Date: Tue, 2 Jun 2026 10:45:26 +0200 Message-ID: <20260602084541.3829876-38-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Eric Botcazou gcc/ada/ChangeLog: * krunch.ads: Fix a few typos in the description. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/krunch.ads | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/ada/krunch.ads b/gcc/ada/krunch.ads index a38245d2d58..8b583a05062 100644 --- a/gcc/ada/krunch.ads +++ b/gcc/ada/krunch.ads @@ -23,13 +23,13 @@ -- -- ------------------------------------------------------------------------------ --- This procedure implements file name crunching +-- This procedure implements file name crunching: -- First, the name is divided into segments separated by minus signs and -- underscores, then all minus signs and underscores are eliminated. If -- this leaves the name short enough, we are done. --- If not, then the longest segment is located (left-most if there are +-- If not, then the longest segment is located (leftmost if there are -- two of equal length), and shortened by dropping its last character. -- This is repeated until the name is short enough. @@ -50,7 +50,7 @@ -- ou st wi fix 9 -- ou st wi fi 8 --- Final file name: OUSTWIFX.ADB +-- Final file name: OUSTWIFI.ADB -- A special rule applies for children of System, Ada, Gnat, and Interfaces. -- In these cases, the following special prefix replacements occur: @@ -81,7 +81,7 @@ -- a- st wi fix 9 -- a- st wi fi 8 --- Final file name: A-STWIFX.ADB +-- Final file name: A-STWIFI.ADB -- Since children of units named A, G, I or S might conflict with the names -- of predefined units, the naming rule in that case is that the first hyphen From patchwork Tue Jun 2 08:45:27 2026 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: 136272 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D19DE4BA2E05 for ; Tue, 2 Jun 2026 09:18:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D19DE4BA2E05 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=KKw86BGV X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id 0A2064BA2E27 for ; Tue, 2 Jun 2026 08:46:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0A2064BA2E27 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 0A2064BA2E27 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::333 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389990; cv=none; b=Dlal/3zCIQ1F7//rmvgVTjGm4CKv1R3PxVubeRv2aQ4UQy9mJqqrpXrKiPQqMcKUCpkxevuvxs6x9HPgRljLchOiG5Sj7s5kvPHtPeyGOxMonXIJrHozZTpp8EAL/tLylm59a2TgsHeq8SQdaMNSLR3/VYUhrYlN7+WI9V5RDio= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389990; c=relaxed/simple; bh=G975TA0PtB2psDpyBSDpGQCokgxHROJtv1tOq10Wojw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=c0iX6knaEUzBhk0lacibGT4YEBErtHtLVdp+39E6pfvIakmLRXXynD4R6ZDVHL5VijYwiTFFxke/WUJneVWo/MO/vke6zEpt6lcOdZkkFO9jGr4hmrnIw4T9UxH5tKs04qO63giJI4+MLCLhEhJ6WiIPYD9us+q7cu9cUeP9NBc= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=KKw86BGV DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0A2064BA2E27 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-49041fb8c23so83988125e9.0 for ; Tue, 02 Jun 2026 01:46:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389989; x=1780994789; 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=OFCAp9cWxB/3aZ1GMU0SLPI1N579EkjpJ239IH9ZPQg=; b=KKw86BGVFEttpAt+DD1eJ+cWVKKVJe4j45QqFUQpQXQB3F6MAeA2VUqjcSJJ7u6cvv x0BiZC+Oo3sof4t1vWfxO5n2VdXvgOabNT1KZJQLG/OEl1G1VmWkXstAG9mAsMTo7c3F Sm+mWbx+/Hg4Cn/KcC1h0HFDHW/p4xLz3JWlhIqOhfO2cx/eCwa6jcpR5qv1Dzb+RAgS sFjSGnCFg2e8j15nvHo8Apu4emYGG56eFxqAgECgavdMZ8KQtHQbvLhzMJD9w6tQ+eGB t7aDI6R9CCL2jJJS2ipFfVnyQpYf+QYgzN/X1hB+2mcvuxqkYHqVS3PzW6HjtWpiL3gj ogdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389989; x=1780994789; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=OFCAp9cWxB/3aZ1GMU0SLPI1N579EkjpJ239IH9ZPQg=; b=WWWjAltlrB5vFhfuY7RCXyOwVCir9Pm3taJGH55tNupglMsVTej3PBdlZNx8VCvUgf 0MlyJi0ng88EjWxyPBJOYA5arCeDCg5rp6SGv3xAwJTxLsHdRQdxbYeW2DGxzs/omXPQ jhPepBVLYVSTKzJAn9g6CRaRmG6i8ZOS1aBnG1q5KJ9FvwNTkMMKoaeFC14bWqGx0t3q lLMlTuRcoae5zx3CkVxfvpbpQk4B4aRpRfd/bezNbvxzgi4XKOV85Gp8WDPsLC5wXlUu 4s25mn/tM8I8Ixlyd7upphJSqtVwu/nVpjS5L4IW/8bveiBQBh40WlFDIi80oZWo2sD+ h4jA== X-Gm-Message-State: AOJu0YxY/hGkAijxQact0Um5s4CrZRW/iS0CFdB/Ql+Wl9LgLt8OBCkh lI7vUvrIrpPyhd15A7vJdAWCpymn/0Fpji6ISye5Qzfhbo/0EnXH9h1l+gO1g7w9KE8xw2VGM5x pz1I= X-Gm-Gg: Acq92OFocPl3UGdv0AuP3U5xKutEtPuNODjYGfvq5asrCEbq06vh3yqgQ9KYL7JW6by zsfXgLwoPf5oH24vcNGiipPtVM2B1JNmGqPZUEfjT8/nnEwpuT8KenfkbD3fTqk9NyeGyTJfk0N Evrb32MQS7nnLY2OjVmk4yUuJps5pRX7QgNzAQbhSXclTH2QefrLs/Oq0PIR/2gbpcJR079zKRj /7F/Cjuz7WTmpDlvKKX2xawOelR2VG+Pzc4rSLUizU4od5hdG+b2Rsk31VF4Whf6tVo9GE3HV1F SrZ3tmXXjhBrknO/E8lgSElV5HtQ0AXBXoL8UtMESlbjIFIFfwdrkCywszWJciKv4b/tCcZ9elx 2T3vsVOX5FrzZidKWppF940hc+Gerr2V9zPB5HcpqeM0ldkC+EI+kJxRrbmfpTZXfCGNTxFeCHR HpR9urbcCoeB+u11XxX8siODXHTRj7g68XMAqvP4Yvn0Lei+upfpTYrhgpqMZ4z5mmLOgwPl9HC /HhSfF2wLUieZXxcHaYV7g6L+Onk4wMigiJ2KKgLg== X-Received: by 2002:a05:600c:8582:b0:48f:d1c0:721e with SMTP id 5b1f17b1804b1-490a2921e1fmr207803405e9.12.1780389988959; Tue, 02 Jun 2026 01:46:28 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:28 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Viljar Indus Subject: [COMMITTED 39/51] ada: Remove implicit WITHs from ignored ghost regions Date: Tue, 2 Jun 2026 10:45:27 +0200 Message-ID: <20260602084541.3829876-39-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Viljar Indus Create implicit withs with the same ghost policy as the region they originate from. Ensure that the list of Implicit_Withs is consistent after ignored ghost nodes have been replaced with Null_Statements. Omit the No_Dependence on ignored implicit WITHs gcc/ada/ChangeLog: * rtsfind.adb (Maybe_Add_With): Ensure conistent Implicit_With nodes traversal after ignored ghost nodes have been removed. Omit checks on ignored WITH clauses. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/rtsfind.adb | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/gcc/ada/rtsfind.adb b/gcc/ada/rtsfind.adb index f1f697d2e93..14d32372c80 100644 --- a/gcc/ada/rtsfind.adb +++ b/gcc/ada/rtsfind.adb @@ -1284,10 +1284,10 @@ package body Rtsfind is -- for this unit to the current compilation unit. declare - LibUnit : constant Node_Id := Unit (Cunit (U.Unum)); - Saved_GM : constant Ghost_Mode_Type := Ghost_Config.Ghost_Mode; - Clause : Node_Id; - Withn : Node_Id; + LibUnit : constant Node_Id := Unit (Cunit (U.Unum)); + Clause : Node_Id; + Withn : Node_Id; + Orig : Node_Id; begin Clause := U.First_Implicit_With; @@ -1296,21 +1296,29 @@ package body Rtsfind is return; end if; + -- RTE can be accessed after ignored ghost code has been removed. + -- Use the Orignal_Node to iterate over the implicit with clause + -- chain. + + while Nkind (Clause) /= N_With_Clause loop + Orig := Original_Node (Clause); + + -- Break out of an infinite loop if something has gone horribly + -- wrong. + + exit when Orig = Clause; + Clause := Orig; + end loop; + pragma Assert (Nkind (Clause) = N_With_Clause); + Clause := Next_Implicit_With (Clause); end loop; - -- We want to make sure that the "with" we create below isn't - -- marked as ignored ghost code because this list may be walked - -- later, after ignored ghost code is converted to a null - -- statement. - - Ghost_Config.Ghost_Mode := None; Withn := Make_With_Clause (Standard_Location, Name => Make_Unit_Name (U, Defining_Unit_Name (Specification (LibUnit)))); - Ghost_Config.Ghost_Mode := Saved_GM; Set_Corresponding_Spec (Withn, U.Entity); Set_First_Name (Withn); @@ -1322,7 +1330,13 @@ package body Rtsfind is Mark_Rewrite_Insertion (Withn); Append (Withn, Context_Items (Cunit (Current_Sem_Unit))); - Check_Restriction_No_Dependence (Name (Withn), Current_Error_Node); + + -- We can add the dependency now for analysis but the with clause was + -- generated in an ignored context, meaning it will be removed later. + + if Ghost_Config.Ghost_Mode /= Ignore then + Check_Restriction_No_Dependence (Name (Withn), Current_Error_Node); + end if; end; end Maybe_Add_With; From patchwork Tue Jun 2 08:45:28 2026 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: 136269 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 691994BA23C8 for ; Tue, 2 Jun 2026 09:15:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 691994BA23C8 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=Tc/ILfC8 X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id A62244BA2E2B for ; Tue, 2 Jun 2026 08:46:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A62244BA2E2B 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 A62244BA2E2B Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::331 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389990; cv=none; b=eVbuC+NsDNuKjjnJ+4OZ1EPzUs53hkHtW9Fc0h2ZFMwI5efwLChWuRL/13fy1oXeThrageC1sSV6+QQek18tdbZkhGBUC2j+wo9W+/PhC57hIu7/aucBcAMC5J5oknQWmcAM0LX17LPaM2WOCAkOwiw8jcpNFeNPQS1RP9nIHUc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389990; c=relaxed/simple; bh=R8nnEE/GuMvWGWu8ecw1LwzKfiOCl/3YCdvb+AWvuA0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ARQBa+GTbp3yZF+YfrBdQ5r/wIa3YCXK9qhq5xDqS/Mh99fvYkftFrKvIrTt7Bfk3oFRqTmMQaQ+9yJWTu4C51h7mUAXfJZpFUJcbgYGuOapRryx4/tSw8TnY5fOJJW1COZQ/CAbB9I5pLS9J+QwSGHpy6cUm/DwHJN0NFBPd1U= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=Tc/ILfC8 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A62244BA2E2B Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-490a7629380so22451835e9.0 for ; Tue, 02 Jun 2026 01:46:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389989; x=1780994789; 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=dcwqMiApvrD0G+UoBPkfNVePk+2UxKDOpdPxqOQi+UA=; b=Tc/ILfC8L8t+gRxKqhazGnbrMH6/ej5fQapcUY7fagHyqZYsH81H8brppJjgXLD6x8 O4ylqbvZSp5bqYtjiBFCnvLt2KFRcaLxqFpDakzpFMiu5f4dgCNFhY38sTB/XN0dPwkR E6KgXuDJVOn+W+bvwUFzYavssSv60pm213k6NdQ1d6VJn6PhPbXq7AzSgm8AmrszLt6k FKqsOejNof10zIeLh2VWqGgKsZ6ttQjvAoGfBppkcyqF6AUUYUB7Pb8sa+vb8zAtMw+/ P8Ujte4Hb872i2NU/Bc4tABKLn3jSIZXlLJaKmiYU5f3iWf0IGtK+CEiBwmQhOUB/s4k IvuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389989; x=1780994789; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=dcwqMiApvrD0G+UoBPkfNVePk+2UxKDOpdPxqOQi+UA=; b=X6BQ7ZkNR09CLhGm6QomAbzuyG/XdTuhZbBDpC+cy0ojPYEojQMAj/B8bj+0+SjngJ aIkVskBGnVviwVxrzo9RU0Uts87CrvtwCO3+1pyH1rEQcJy6zfxMollmDBoBZVuoIlIx ewTGdEyaqcMo3qWuv4MTwv00CEBTldcgCJA7XWXfjVTygss22vgVqwLuu7l0PykWbzki jWXDPa425EzLJRVolkEvziOjDKY38ount48tOoDxwZydop35JCM0oIIF5VMXJMY7E9wK /uIZosTqOWkLQKlWIr2g/MlyoRTgqP/Y4ek23EAQOfrymTH7+Si2PMhsbOIDr3rEXh18 08rw== X-Gm-Message-State: AOJu0Yz8ui7SeR8YenaBNCdc7Y+VSFG/lwMNrGYqLNVaR9ZpqHNNzofx 4HuaOBmUPfMaVQ4mvxDB69nMVTNXgjxTEtmOq2Gw74Bi3lGaZSWahtAPxAEtG1g3PcNDmnrqf4k R8us= X-Gm-Gg: Acq92OEhgSDj+nh5fH5v+++17eCWfc8kEmFAFXemjXZ0xrWpBJylZIFnz1X7IHEg1MB ESUJLKydXyapg2ClnqP8zX6HhXIfrbeHeKJYr1mgh2YmAHwWluGRnbDufBum5RfNiqNulRkOdFB KzofU9IbXw6cXg5RKvltmBnmXxUuN6xulRWGgyTM7coPhWwvsIvpClNb3RfwgvDAqiJTOIxn/1R JppgqMS7kSc28w4PfhjnAcPka6Try+bfmf7v/XuB/T+3Y2R/u1gkckL0dh1pr1uHlHw0jEKAyJ7 hbtjWG3rltiFzCyKuxeJu1rZh32ORmd4f8fbN7/eSGcPxEyrHSd2yUzUxUQ+CiyNYIzx5MLJ4RI wuZwd8Zl8pMrZHJWNVHuw04lDMzTLp8yvwB2E6XjSzmr6mmFAtmOlzr3mW6dtIdKGrRvXNhAjdt TtE18hkiSht91XhCv6tcyy/mJynHbOaAd708jY8RDYy1J/ZWjZjNyEO9de74783RyZJhP7JZaKn UIpPJUmdFw4LsEEWwiYuRZ+0s3p6mE= X-Received: by 2002:a05:600c:e489:20b0:490:4ee0:82ff with SMTP id 5b1f17b1804b1-490a2957d95mr182340155e9.27.1780389989655; Tue, 02 Jun 2026 01:46:29 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:29 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Viljar Indus Subject: [COMMITTED 40/51] ada: Remove unnecessary workaround Date: Tue, 2 Jun 2026 10:45:28 +0200 Message-ID: <20260602084541.3829876-40-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Viljar Indus Technically this is no longer necessary as everything will be removed along with the ignored ghost code removal. gcc/ada/ChangeLog: * sem_prag.adb (Analyze_Pragma): Remove overflow supression workaround. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_prag.adb | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index a22ae61cd55..81de61ae9eb 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -15698,33 +15698,7 @@ package body Sem_Prag is -- Now go ahead and analyze the if statement In_Assertion_Expr := In_Assertion_Expr + 1; - - -- One rather special treatment. If we are now in Eliminated - -- overflow mode, then suppress overflow checking since we do - -- not want to drag in the bignum stuff if we are in Ignore - -- mode anyway. This is particularly important if we are using - -- a configurable run time that does not support bignum ops. - - if Scope_Suppress.Overflow_Mode_Assertions = Eliminated then - declare - Svo : constant Boolean := - Scope_Suppress.Suppress (Overflow_Check); - begin - Scope_Suppress.Overflow_Mode_Assertions := Strict; - Scope_Suppress.Suppress (Overflow_Check) := True; - Analyze (N); - Scope_Suppress.Suppress (Overflow_Check) := Svo; - Scope_Suppress.Overflow_Mode_Assertions := Eliminated; - end; - - -- Not that special case - - else - Analyze (N); - end if; - - -- All done with this check - + Analyze (N); In_Assertion_Expr := In_Assertion_Expr - 1; -- Check is active or expansion not active. In these cases we can From patchwork Tue Jun 2 08:45:29 2026 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: 136254 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3330A4BA23E1 for ; Tue, 2 Jun 2026 09:03:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3330A4BA23E1 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=GNmUBEi+ X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by sourceware.org (Postfix) with ESMTPS id 546724BA2E19 for ; Tue, 2 Jun 2026 08:46:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 546724BA2E19 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 546724BA2E19 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::329 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389991; cv=none; b=EXYNqzib/FURozpV2Dzkad0YI62HwooIZ9iTReu2VpTYqoyJjdLeg/SLam1AmksC+VNr08L76Dr3BGPV4grWRJwn61eT6C/9vyGCTE7M7rk4wfFYglWzPSjYG7uMqTLC7CT59JJvLXW8375Ys1KHDtEtLUwxOncdEOfGnfo/WOk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389991; c=relaxed/simple; bh=+9YXdx9rP4WQjb14Q10rORV/R8f4DWx/4AQEpc+AWJE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=mwC3R/hzSfIfyuPlFI+HCYWGe6k0Zg1NBbFjhPmaDKPzASSzqzMLuemnqjycrNw1ZoCI8JZW/W8SL3w9ZHFOQDkE/KSh9hDqUraEQLob+qRG0b6pIFFJMqxVlrjCcKSU60iDGW4YQ0d9MZgfzx3xGwI1FeXL1o+/5gdHi0JqfNY= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=GNmUBEi+ DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 546724BA2E19 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4903d730b1fso99644495e9.2 for ; Tue, 02 Jun 2026 01:46:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389990; x=1780994790; 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=QhqbPDo85BHryg9VKfwJIFmHIBpd/UXfqq1z8DOByeI=; b=GNmUBEi+YruFHCFhmpQ2tixmkFgmj/gIc5bk1mZKudhrTKsGXYOD6K5Z3BHNyA7m2t KiSUwh9Q4QK4YIlBgTqBL6tuAU5Hdmo2LMHjVUm2H1oqqIYYwNM92HEQoU0aZMmrqmGg LdEPqETKm6eINCCQl9tHRGtpICqVA486fxDAq8zQI4s+tLUj9d1Jj49HQY58HpD5q2o7 wTQdTF0+kxzBXbR++J6rfCozRyrAnG2ZOttS3u7jhVZK981cdz5uhM72f5UE4zEJ5ish aX+1USri6lXo2/fHLwZK9FaPhLsl2PPQy1A6P6MXqpqsY/OVFCVydMBGUI1K6kEx83vn I5bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389990; x=1780994790; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=QhqbPDo85BHryg9VKfwJIFmHIBpd/UXfqq1z8DOByeI=; b=gxrVXywjAVIY3FctmV/6uzdj1C0lH3XaYTKjSxuFboUdDOcOXK1eCJfS4ZtiCFRjvi NSmuRK79rrMk1PZJQwzdgmxTlM9QBAC/bF7Zg/P7gGOwA9W37CU3y1fm3ikQ5uWqTwgE Dee7p8kL0StctYaiFnqbcSKT3JdCslLopQV/0BH5bZ/YoVtA/PddfNHdwaIRZGGbc7Fs ylfJQ+5vkmP66z1mnpaFOChS/2ep/ykSiX9Lnn9ZbKPwHVcTpQNG9J2yfl2bV0+GsbYR SqXsLT9sqriUkqSvHbYKUnP1o7Uz4/LCyNvqVB1aYcEgbNalRba82YC3pfxOqyAs4cYz 2ztA== X-Gm-Message-State: AOJu0YxP9heg3gAKtdoCAeR7YZ2xM+BFHhrx9QF1w8CNZuW5VqF78zea DnslSwGtB/AbjPDf6AU2TauOlyvg1EqVP4I2YycnoDNq/h9pq0hhdn3Xk7BKFo/ltNfvmT3vwXh IQkM= X-Gm-Gg: Acq92OECg+xLkgp8kra6wwfy8wCG7J/0bZ7wUkI//yzsrRxED27cG6w9pbIAuc0qu0U KYBAaBZnYtlp9kVKapYjS0INQ7aD/QITveueW3T78NuNSExy44YEpcwmrIKv06qYpdS9J9OCw8L AbP70F2QPVSv6DVdxlEqiq9jrw+brcQX+wq228gjbYiGqjnw8sIDjCr6jdUvaWPfMEEu+Dls60U 4IPMJKn2uKZ7trc5/vzIhF+/4GZNzF37VfdBtzGspT+2GsTFehfo/aodO3h/aUZl3BU8Rsa0NBi eMay3Wr70RGtnH8tQ9sosrudLYxiqymFEwiDbBkp3zRL145hbYQMVLE+S5jMxjJ9eq5wnhi97tX ei+qkbC/TZjE2mGOTVHRhbxPm2SDfOd/83kDiCK4qng1GwL/yyylTozjQjLewkrncAMz6UcoUXV dr+5PsXz6JVrjCva8UysGoTWl7bjF18QnmhTUErJovhFvJf4isSfjaVaBornXPm9IHq3cY8wD8I NapuQwhNA9JwmIRTZpKeTvSsFkB5MA= X-Received: by 2002:a05:600c:870c:b0:490:b2a6:8c2a with SMTP id 5b1f17b1804b1-490b2a68d50mr23284725e9.5.1780389990327; Tue, 02 Jun 2026 01:46:30 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:29 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: =?utf-8?q?Marc_Poulhi=C3=A8s?= Subject: [COMMITTED 41/51] ada: Adjust expansion disabling for ghost expression functions Date: Tue, 2 Jun 2026 10:45:29 +0200 Message-ID: <20260602084541.3829876-41-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org When analyzing a Ghost expression function, expansion was disabled, which was an issue when some entities needed to be frozen (which is often the case as expression function are often the first freezing point of entities). The previous change: "Warn on unmodified parameters of expression functions" now triggers the disabling of the expander because it marks the body of expression function as "coming from source". This change adjust the disabling condition by excluding body coming from expression function. gcc/ada/ChangeLog: * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Do not disable expander if body comes from an expression function. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch6.adb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 568b7d46db6..fd12a557108 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -3743,9 +3743,14 @@ package body Sem_Ch6 is -- user entities, as internally generated entitities might still need -- to be expanded (e.g. those generated for types). + -- Do not disable expansion if the body comes from an expression + -- function as they are often the first freezing point of entities and + -- expansion is needed to freeze them properly. + if not CodePeer_Mode and then Present (Ghost_Config.Ignored_Ghost_Region) and then Comes_From_Source (Body_Id) + and then not From_Expression_Function then Expander_Active := False; end if; From patchwork Tue Jun 2 08:45:30 2026 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: 136279 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 842984BA2E32 for ; Tue, 2 Jun 2026 09:26:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 842984BA2E32 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=MnCZFVvQ X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id C81BC4BA2E0B for ; Tue, 2 Jun 2026 08:46:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C81BC4BA2E0B 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 C81BC4BA2E0B Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389993; cv=none; b=lSdsfR1E+MVSudg9TupNLlqyHyYzBxcfkxw7tRngf0LstjmLPwV4sIUs9Qptx7hgHfLzpIifWc/I0Ev55mxiPnldpf1zY8lRmlEHckeRAsLp0vklQIoh3wgNx1BJ7MDJUAVr+o+fgaE50nZIlgRCbN8THK9yBNnEojVqCXtDiNI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389993; c=relaxed/simple; bh=Y5m1J+iOaKzxvhJTlrPyJVS2GBiv+5r6kt4AWbB4IgE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=wHXTmSSZc1qT3eE06VqU6YFDaXHEx1eLHpXD0Vu2lgtgvNRiYBRQIda/ymqS43UQwjy6Nftqk8AjUu1iQrQ6jotoZ3vL898xJoAmLZesAOSHv4pzPa7DVgbiQp8zY35mSG0SZ9a416CAWSbLuviGjXP1EN6+VoUQ69A3MeKWnQE= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=MnCZFVvQ DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C81BC4BA2E0B Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4909e3fa4b2so39356725e9.0 for ; Tue, 02 Jun 2026 01:46:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389992; x=1780994792; 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=n3bW1PuXMp30XyUiQKCL3qJNfgSQ4NW0lot8JPcv/Eo=; b=MnCZFVvQgx5WIiZ85QIaIpfP1z/lYT5P1Y4os/ivRP7d+uH/4l1u13unOlm2K8Qkwr D8nTZrAC3q04HqA2VMhWPnIJA+kg7l3BOCL9uNRGgw2EtP4Mn+E6YAIJ5uiIpHv4iJbm W46NY/RfT1ONnM6wdsr8kjmYFwiopwh59XSoYKEdOln8sGtrG2uNTWmTqUyBK8HfpD80 XjZNOM3NhhnhpmRSVqSGWirrN2FhX/Jge4vb7ijmyDuzJkA0GIPgSdiDJs9gdMS7N9nt E2407oQSkvufpqdsnR9oAIaAMlTpVmeuqq1+VBihZV4YxkgOQk29wxl9xYKUnd2OeDUH 67GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389992; x=1780994792; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=n3bW1PuXMp30XyUiQKCL3qJNfgSQ4NW0lot8JPcv/Eo=; b=G9jxJhCwv7Rp4jA0SziKt30XfkKVLIJyLoxQuDfIuEXw2YitcyqqvpzLF4jlDMFet8 cznDpKnyiwnNupgkDMsGtM973+I87A1fKrEDFFwuYAt/TDNSNLZyFk2lzqspfC4XCISS TI/QXIHx9gXeMX705YccKj8QeiVnuJZelRG2DSydS7v1/D1uuoa4IAIGR8rX44uhz7wj aKluV2yNOHM0uQXR7KNRE2P41WeYDGSYmSEd0K8WEfTwSwdXdUJOdN2FR/OsWLE/DwBb j3EqW+V/dqgb+w2t5jEJWwKyt5n9/I3j+Hr5yEvyhzXKgXanyiXCwTRk1Z2YlifXZ5Ch CZQA== X-Gm-Message-State: AOJu0Yxay0pys+DR2tbvIMuHUTfWOi/2PaLoeTSp0aCprCTYawFKLORl FIxeCvgsHOzqgRR27Ls5CCVVEEhmMb45/CW7TUR6n2Ujb6KWsrVja/xeC3sMn+WoPjOJvVE5ys7 kxf8= X-Gm-Gg: Acq92OGiqg+DU120J7G6nQg+rzS9hDRw1xd0yuwZB86svcZRZPHxzxEGxXv0cy1Ozbd Gd4/diSnXTJSdEvVXLPwOyBWihhLk8GZ5Txf5C6rndyz1ISAg0TIVhXC5lMdFwiZ5cXYPZ4bd8E RbqSKA2MOWODj1cZeAqpKU112OQySpcOKbeBaICDxNZM47MtEw0gGb56f3MWVNujJHAb2e9r5IT 7hUMGOk/BzRujkqOeMG3FI5xCak8XU8XcXAEneItvZLekQ5s7l784mflBfwH7wR79oScN5J+2zQ TAZfL8WwFHZ/kV6Ry6n2zy0+OS3YBlhENOBYTnFao8crsnWelS59gvmUfx/sfNut64qTS8eZrZf piJw/HDVSLkBGjVevs3PUdY4/Nq4YFd+8ZPg1WpAbPUBdB8WecDjkqhi+/bXrxAy36zMfXieDPl x4Baf9X49aO+d7lFy4ZjxcceUKtIJrxaZeGlFpLD+GOn4C77XqgEVNJt1LDpLeIBWqhtE2lLp+k Zn6wR9j3trM35fXCBIy0JdBLFJZ6G0= X-Received: by 2002:a05:600c:a55:b0:48f:e518:d110 with SMTP id 5b1f17b1804b1-490b0717e7dmr59041175e9.32.1780389991662; Tue, 02 Jun 2026 01:46:31 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:30 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Tom Tromey Subject: [COMMITTED 42/51] ada: Update gnat-llvm debugging documentation for nested functions Date: Tue, 2 Jun 2026 10:45:30 +0200 Message-ID: <20260602084541.3829876-42-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Tom Tromey We recently changed gdb so that it can directly handle gnat-style unnesting. This fixes an issue with debugging nested functions with gnat-llvm. gcc/ada/ChangeLog: * doc/gnat_ugn/building_executable_programs_with_gnat.rst (GNATLLVM): Remove note about nested functions. * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- .../gnat_ugn/building_executable_programs_with_gnat.rst | 7 ++----- gcc/ada/gnat_ugn.texi | 9 +++------ 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst index c69b958804c..a67047107b2 100644 --- a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst +++ b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst @@ -8005,11 +8005,8 @@ GNAT LLVM currently provides limited support for debugging data. It provides full line number information for declarations and statements, and complete debugging data for all types. -In some situations, a name in the source may not be available. -Renamings are not currently emitted into the debugging data. When -debugging a nested function, variables from enclosing scopes will not -be available. You will have to examine those variables in their -hosting frame. +In some situations, a name in the source may not be available. For +example, renamings are not currently emitted into the debugging data. In addition, debugging information may be confusing if you have ``out`` parameters to subprograms. If you have a procedure with only diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 6350a4a99ef..f1d887c3670 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -17571,11 +17571,8 @@ GNAT LLVM currently provides limited support for debugging data. It provides full line number information for declarations and statements, and complete debugging data for all types. -In some situations, a name in the source may not be available. -Renamings are not currently emitted into the debugging data. When -debugging a nested function, variables from enclosing scopes will not -be available. You will have to examine those variables in their -hosting frame. +In some situations, a name in the source may not be available. For +example, renamings are not currently emitted into the debugging data. In addition, debugging information may be confusing if you have @code{out} parameters to subprograms. If you have a procedure with only @@ -30270,8 +30267,8 @@ to permit their use in free software. @printindex ge -@anchor{gnat_ugn/gnat_utility_programs switches-related-to-project-files}@w{ } @anchor{d2}@w{ } +@anchor{gnat_ugn/gnat_utility_programs switches-related-to-project-files}@w{ } @c %**end of body @bye From patchwork Tue Jun 2 08:45:31 2026 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: 136282 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C01994BA2E0C for ; Tue, 2 Jun 2026 09:30:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C01994BA2E0C Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=Vxg7eod1 X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by sourceware.org (Postfix) with ESMTPS id 4CB3D4BA2E09 for ; Tue, 2 Jun 2026 08:46:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4CB3D4BA2E09 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 4CB3D4BA2E09 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::335 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389993; cv=none; b=b6uqeVh3jZyjk26ELI+aBUBrgP54M6qYynBAzJXd+VIyEGgoeCez6U/ZKtb0aehdjMqmsu890QjIQebh7io5qA8qTrx8Ur8ScMMfDZN7TfWoMpwmIR8oAoTmUUjvF4N5l2CQeVDqrED0hJrLVoxaUS8SZGwoT0lcYLi/hlv/83I= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389993; c=relaxed/simple; bh=xdNEnASxhOGTfneFOs/s1955206hMhybncyPiQjR9AM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=hmcpHnBGI9M5I3liJR+kycO8I61YKKT1R3q2QnsLFgMHnN1gU/GJtsEAT9oh2QHk63BG3dwL5F9lMO6VQL7MY+SsLq+gfned3uo48pyf64XqNUd4nnBjxDOcVJXFQwRKuOTp0Z8TwlH82GrwXbmqnevhiPQb0sZNMxZqxUhM2aU= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=Vxg7eod1 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4CB3D4BA2E09 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-490686877a1so66170715e9.0 for ; Tue, 02 Jun 2026 01:46:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389992; x=1780994792; 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=iMOV6sTk803hsOZqAv49st1Reb8Xxow57LLgqLbVwJ4=; b=Vxg7eod1CZCkh9TutcmaSHvIXtDag9pXxVnFWtIv8+ZXKnCVvT/WYo4v7gP7HNLgTe X1eq5n1JLYoK/gmyh7lF+yaEVl/bCmNBBLjkideP77GUG6HADtdZkcshz7TIgFQvZ5fV iLS9nWv+lqQQN3bkLF22W++BXw/pEwJm/icZsg1KzGsiBULHOjxuF/JwSKC43zCGVXUC HRoEfgeloOqQfgnyOD7KoMlOyZwgO0wlP9OFC83nptgPdLaxKsMJlC92j56CPRudMR6A WZ7q1Qr5XNN1o1sgEJFqCK8gwMLELSWnSdGDNe8xBB3v6mQ4FFqEbYePgFckCc1NHDfR SA4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389992; x=1780994792; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=iMOV6sTk803hsOZqAv49st1Reb8Xxow57LLgqLbVwJ4=; b=UDQGuwyD/NSSWZoIPWojGr3Irxicxf7JRgrtPG98m11jZVsJ6PNHo29AKHUWECFFh9 C9SMxJKgQd/meU42gy+GZkrIiCS2z3+MYkZ76p6fiJtoY/TEIrur541uVQmgfB0flmx/ oyMV50i4+ObzE4BxxRk1n1coi5kpxJqr4bnjtvqs/FGCtmlcSYNFDAsRorS0eO78bBr7 IO7/9UHvCxFMCdR5FRWZ1DUBa9FYZYE6JUBr51o0CJYTT4Jxm3rNZA3Mg56fotXyQVs5 SW5ffr/JCs4JaJkdNtBvHzVmLqvbZxP2J3Le/ioQCKENeXzdMBN7xBxbziehuUBg/QJ8 3wjg== X-Gm-Message-State: AOJu0YypOecmNde+Qg72rctcbRJ4utHdRDFdyhQOcJHDMcNHHYo4Ndo/ iYm5l3G8N9NitI+Ou4bzzvWjKCo8/6167tCoBV3rzRAtJzNF75/XxxCRGDB2eZGCWgutTeCaWE/ qMzk= X-Gm-Gg: Acq92OEpVkaJ8Hfmi1iSJOp/1Qkvwf2vZGEFLG3sR/0AV3w51LCRnNymWp2bAUwOgly vvBqm6899Wyc5SvDtG+YHygtIAfFauonFqOaC0gwjgVxyN1XOKq7FePSOqUSTz4qrBw+KSCJ8F5 SJHsO7NXzvyEGxrPD8BGE0NQRVoyHjYwXV4nb3nw2/hDaD+LTW5uN1c0RmaYaF+JSg2RP9Wyu+A /77ypSoYmqX9weqVnSpPOzGauDiVIbBc/1U1IyBfhj+ae64CrOxy9+SfOVJJCLiQmBuFQvKAqdW 0tBzzTk8AfrJNBMwOeCSuAVZ/79Ccgmh404Nc41jhRq19z/CqXdvYEpRfCQhMdGf1vfL6f6rRiO r0hiFwDHKlWTxY/u1wVlA1I/V6WZwN+LDYA/WvSwLepfCzEcSY8ohdg8Qky2UXIoIWWS1S+lWfU vKbgvuGF/FxQ/bfE1O4O4Sb6+PDc27+suH46T4R2lAu3fBIG6cXz7FQCrfZuUxdDhbhVdHugSBR 3PqmWLP7UnK0crQHzHcPtVVgw4GaR8= X-Received: by 2002:a05:600d:84ca:10b0:490:8b0b:d3b1 with SMTP id 5b1f17b1804b1-490b0e8f03bmr27257645e9.12.1780389992278; Tue, 02 Jun 2026 01:46:32 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:31 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 43/51] ada: Do not generate accessibility checks for specific synthesized return Date: Tue, 2 Jun 2026 10:45:31 +0200 Message-ID: <20260602084541.3829876-43-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Eric Botcazou This is the return synthesized in a function whose body has been wrapped in a nested _Wrapped_Statements function, since it only propagates the result. gcc/ada/ChangeLog: * accessibility.adb (Apply_Accessibility_Check_For_Return): Bail out for the return synthesized in a function with _Wrapped_Statements. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/accessibility.adb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gcc/ada/accessibility.adb b/gcc/ada/accessibility.adb index 9b5d0fba73a..52d4810987f 100644 --- a/gcc/ada/accessibility.adb +++ b/gcc/ada/accessibility.adb @@ -1671,6 +1671,13 @@ package body Accessibility is return; end if; + -- No checks are needed for the return synthesized in a function whose + -- body has been wrapped in a nested _Wrapped_Statements function. + + if Present (Wrapped_Statements (Func)) then + return; + end if; + -- Ada 2005 (AI95-344): If the result type is class-wide, then insert -- a check that the level of the return expression's underlying type -- is not deeper than the level of the master enclosing the function. From patchwork Tue Jun 2 08:45:32 2026 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: 136278 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4BB474BA2E30 for ; Tue, 2 Jun 2026 09:25:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4BB474BA2E30 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=J9p6akvY X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id 12D354BA23D3 for ; Tue, 2 Jun 2026 08:46:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 12D354BA23D3 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 12D354BA23D3 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::331 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389994; cv=none; b=nNMJevpuURtvwWfPx1yXk1wMbjcgCDp0w27QrFthNkbNsVeQFGUWN+OOqVjkqKs4oKDUG0hs5cM1fmaCv8oiizvsZ31zUsMW+2d/B0YlLyj2Wr0iVyBG1aqcMJ1DxiGr6P0FeqETFc+AljOc94M1VikwJIOLWlD4t89Rg1wKcxk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389994; c=relaxed/simple; bh=vLesSXxgmaivoJrpyv80yQIIvP1su7DxGnCYVl61oks=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=YtKP0JPg7hy/w3AS6TOvrUGKkjI1D7jez2C737jfOi/CFt0G0S0R6W7Aglf4wFScsu1H062PNUaFpFd0+ONhidf+FtJli+rYPoCnmNG+8KLSfFoNAgzE9vV5eadBk4ZbAQrHgPqHGbXmHFq/VMYAm05OJeG28z8uh9GFv4hj1UA= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=J9p6akvY DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 12D354BA23D3 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-490ac357c55so16738915e9.1 for ; Tue, 02 Jun 2026 01:46:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389993; x=1780994793; 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=FrrJQyP7f8Fkq0we3L6ycnE4RangSxbmRod6AKzCdao=; b=J9p6akvY6kbQa03OqOdO8Plu2E7jF3CdtWdPW6+vO7NsRZnSlfk4uQJTgyFL4w06na LXlLNMalv3Bz+OqTSZjSXtZ7P3FxuTOyCE+jjZJnraXWME1j8dxeAR7+LIqhyf8vQQJO xXi0wyvLq9zT+qYEvpjFVTB3LgnfYF24/3BVeE9WxHGD12JniPaYI9g/K7NGEZbL6E5F yoVD49772ZT5shUTky9aQXIFsadIH2klgawD+6WwoEkinMAS8EEFwxutH/SKb020yA6u inAwX9EP+RaAA54hm+sAw7yY8QCNQD4UNwJHLEr7gaoo4EHSjHyx/RGy1hqdKSeV7aMZ inkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389993; x=1780994793; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=FrrJQyP7f8Fkq0we3L6ycnE4RangSxbmRod6AKzCdao=; b=m8WR0M/GHyBt6Y7dvJw6fj7tzWGSMidP5pFAXrSzhwee3Jy+idRIMTQXdIOYzhnM73 FtYcq63nWpjiYWjN/pP73pI3O0wcroWBh88jyJRNY8wQBJdmlCfu9F3ZpN1k8lk3hAtk n9S36ZkGI6tTvvrHiXmZFSGEfHkyUp9Y4eF2pwVoWlKnTb432yuBgcgL1pBsnp+kPB0S utkf/RHKgvuxEUwZqU+db1l5dccFKYJJHh7IYW9lWxgP4v+hqoTTsoXSUeYFUkP9mBha 1zTnsr5LS1ov0jA91EFIq/p2IAOd9/odJolA57g4UonT/KBLe88xRLD4Hzwa3iN0/xDW XtPA== X-Gm-Message-State: AOJu0Yzo4mylOp1kTb+VZjYcJYN5FbWXafyJk/g+4r+3xHHimRX1Vg9f /Tlzs0rL+6ViHDdNeGnsENZPPXfTmubVERtObQxXYCRhC37uPXxUfut5dQ7TFvfaJNYqBHNfzhs sr2A= X-Gm-Gg: Acq92OGu6T47F1HQM7d4HmDbp3V6NfrwmwqD+2SA4RJuCvn9fTSUXTz2MCz6zny9F1S S3qdnZ4e5evSWzMzWdcbCyvXfgBp5U3P1bYeZRLcdSQi7n+GMDRPJjkGRRkw0ynOI2fNYNLxK4u tWD70ta5SOWt5hp/fJH0UQ6Jxi783a3bMt75kXX1F4sGn3P1Im4oKcbQUnfVULyaEeQEW6tszD+ 7wElTL2td+fuufKHTrkMpD+W8yh3tL/eAgaGdJr2TF2Xw0v/ql540x1zATlOzbhtMte5+oXT/I6 na3/+/ynWp5cVfK6ghXvhhabLj6Hnfhq4uhuDPXJCGy4tJhTwuOaiY27W+onma5BntU7pw3cE0n 6iyVlPjaJU1r8qpOeRXtg+dB3OK57R6LfXKv/3UXxN10yCDW89lvzTNOUPtwylHN6HknTsgu9sT yJGGyxvMLL9YeVXxqUobMKYS6TxcwP+Vl2psZyq7x/Bs1r1NBDpudK3Lr7b9Osnseza8wI7nr2Q cw3MgvDW32fBWKtMYlHrRK1nDb2F7g= X-Received: by 2002:a05:600c:8508:b0:489:c57:7836 with SMTP id 5b1f17b1804b1-490a2952644mr236925695e9.27.1780389992912; Tue, 02 Jun 2026 01:46:32 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:32 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 44/51] ada: Fix Scalar_Storage_Order not honored for misaligned wrapped scalar Date: Tue, 2 Jun 2026 10:45:32 +0200 Message-ID: <20260602084541.3829876-44-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Eric Botcazou This occurs when the construct is totally scalarized by the SRA pass. gcc/ada/ChangeLog: * gcc-interface/utils.cc (maybe_pad_type): Propagate the flag TYPE_REVERSE_STORAGE_ORDER from the inner type to the record type if the former is also an aggregate type. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/utils.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gcc/ada/gcc-interface/utils.cc b/gcc/ada/gcc-interface/utils.cc index f4fc0cec828..f74b6361b40 100644 --- a/gcc/ada/gcc-interface/utils.cc +++ b/gcc/ada/gcc-interface/utils.cc @@ -1763,6 +1763,16 @@ maybe_pad_type (tree type, tree size, unsigned int align, size_binop (EXACT_DIV_EXPR, TYPE_SIZE (record), bitsize_unit_node)); + /* Propagate the storage order from an aggregate type to the padded type. + Ideally this should not be necessary, because the flag on the padded + type has no semantic effects given that its only field is not scalar. + However, when the aggregate type contains a single scalar field, SRA + may totally scalarize the padded type without taking into account the + intermediate aggregate type and, therefore, may test the flag on the + former instead of the latter to generate a reverse memory access. */ + if (AGGREGATE_TYPE_P (type)) + TYPE_REVERSE_STORAGE_ORDER (record) = TYPE_REVERSE_STORAGE_ORDER (type); + /* If we are changing the alignment and the input type is a record with BLKmode and a small constant size, try to make a form that has an integral mode. This might allow the padding record to also have an From patchwork Tue Jun 2 08:45:33 2026 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: 136280 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 14A674BA2E39 for ; Tue, 2 Jun 2026 09:27:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 14A674BA2E39 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=X6KqZbbT X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by sourceware.org (Postfix) with ESMTPS id BDF854BA23E2 for ; Tue, 2 Jun 2026 08:46:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BDF854BA23E2 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 BDF854BA23E2 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389995; cv=none; b=l4pStV8MUgd//SXDxllqhpn5vGQOzG04P+3tQJdiY7FWZ/ctvgtTGfHPTB02jUDDeelUFhZD7KJ8QOMJPXaLERDa5A7LJyI6hWNKpnes8pkFhuc1jF3SCFYYp0S+jRYMdrAw4HEqvhLNCkFafuu9lqJUCPwfNOa4wHbQECusL9g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389995; c=relaxed/simple; bh=UHMpeNIHOuDMwzUzNzfLi/ZN3k6Uzy8SxJvBywrK8pU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Rmo2QE3+18xUeVq+PBfBdHcWePAVEKKdxF2NqBMxqoIUymEduROrJoxximODGPS4HT5oV9oL/UQkH+ErzIWK2Z7td4fV7TqCovnsWmLtJmbI+If4Wbrzg7c9zlbCUofAlkPts1JfxzK3rWBYxrI54fyk9tagRzaA5DZ4fxAbbmI= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=X6KqZbbT DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BDF854BA23E2 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-490686877a1so66170945e9.0 for ; Tue, 02 Jun 2026 01:46:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389994; x=1780994794; 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=9/b7tf5Nukm2eEQ+/MdOEGXlnFakgKCsPaHWCERMNfM=; b=X6KqZbbTlP1Oc1+A9umNj/MaGFFqwj9Pb25fQxQ6GdE/VUXEvcng1lhKMWJnvszBCT h0jlA85o8d2jwDUaOWJRBpWEe3Wy4avvi6Eo1EtZ9/TSQ/2wSE5uQy8UIRwlZp27pkLa WD9rd2KSQOmwln/5UT0/yfPkIJGT1PC1X/OmKXJgaN7XmyQ5D4LTN5uCOIMREPwN3gB2 UhjL4oX6Ul7eaW9Sed6SQH9Nq73ah30RBiFZ1OLhI/P2vJ5mgR7EGKrWUBhY5EYJGUmL CEiu34jmtXyIeaSUySQY0wXhPQ0b/OsjTEfl2//Mr2L20xdeapRdJ4dR1bZFTSnE/J0t uuIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389994; x=1780994794; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=9/b7tf5Nukm2eEQ+/MdOEGXlnFakgKCsPaHWCERMNfM=; b=WAnkwrBVIvf1zk20TIINrAnEjELh/WCSrpn3j0V0QapBHuj5S4mtncsMJyypwGq9u0 /Ne54aJat+S/doPZ7oFcfNiGzPR8T3+uP9GQevFFwwWwQ+oD+NKbYepYst79vBLPjss+ YEIQB3Plqmu+DJxdpxv8USXaOLx7GL8G8gRgeD2TcupVMl0DI6VPfdX23QEBJoluytoi IDMD+9mqnYm0kD4s/bvhsQ3Od56rZhSvG5F5ZVks8G1lyXch4tvR6AK9Gboil6KgH7s5 2C7gNhY8qVFq2wxF/vzhTkcObeF3GURkckHjSeqYZOF8YBnczT9k96caRW2CtrgdZ5+Q 1Yqw== X-Gm-Message-State: AOJu0Yw6meRQ8HC8H2lwZ8Popg0ZjsNqWD/mdtm8MJ/xiiJNvvzbmiw8 tfXGUJMf7MhXvlNlc/fFN/j/EhIR4GHwGncFNo7vCLdiaK2Lt6MD6amSTWcpgpoNAMzpX/TobOE kgm0= X-Gm-Gg: Acq92OGvajX6UtIcrRQznSSfjl+cngyE/RveFIZdWg1v9fvU0AxGechebjO4T0vU96K ywUUFi+ux4hx5Odjtihr9JpGegPO5Wl7btmIQWdrbrkCJT2PEImeeDtUpxAkI6A4wqvk/F8nvjq MbjxrDNVHXh04vHQjUhZ4dmqsaAE/Lnk7wUmTu3g8L8On5kDatmL8+i/iQSIHblE/qIbLJyA13D vkoozqBsYnCUk4E0JNhVegoKIsM6uQv+UVDlwzuVy19TK0KmTMUkXgmnZwCvvl79MEwam6FCGrH 3VkJX6p8Ry+nxyoksHwU8ao/iY2M62kec1XmlGiIFHj6xw+2lzYL1YOpb5eL5CgNRHrESs3zaCv oGIxrDKy7BF02iOAtWbOdff8Xbbi8CGw3VEpBmxVKVBKu+0J856Rf5n0pnOsRk2cs/giXc/Vj1K e/sUpo+B+4qxMyUvlZct4/seuZcClZ1K7N2kSeCRYsENflTw8UpnAjgQKWFAuMZkfd5Wur6009+ UCsKJS/eQ7XXR7tReICHks0MJVsD1w= X-Received: by 2002:a05:600c:c0d1:20b0:490:4b89:5372 with SMTP id 5b1f17b1804b1-490b0e80be1mr32966695e9.11.1780389993672; Tue, 02 Jun 2026 01:46:33 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:33 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 45/51] ada: Adjust RESULT_DECL of functions after updating their profile if needed Date: Tue, 2 Jun 2026 10:45:33 +0200 Message-ID: <20260602084541.3829876-45-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Eric Botcazou Adjusting the RESULT_DECL of functions is necessary before handing them over to the middle-end when they return by invisible reference and are defined in the current translation unit, so that's done in Subprogram_Body_to_gnu. That's also needed when the functions are generated by the middle-end, like GNU thunks. But, in this case, the transformation can only be applied when the full view of the type is available, which is not guaranteed by the time maybe_make_gnu_thunk is invoked, so the transformation needs to be delayed and applied by update_profile when the full view is eventually encountered. gcc/ada/ChangeLog: PR ada/89609 * gcc-interface/gigi.h (adjust_result_decl_for_invisible_reference): New inline function. * gcc-interface/decl.cc (update_profile): Adjust the RESULT_DECL of the function if it returns by invisible reference. * gcc-interface/trans.cc (Subprogram_Body_to_gnu): Replace manual adjustment by a call to adjust_result_decl_for_invisible_reference. (maybe_make_gnu_thunk): Likewise. * gcc-interface/targtyps.cc: Include stor-layout.h header file. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/decl.cc | 3 +++ gcc/ada/gcc-interface/gigi.h | 24 ++++++++++++++++++++++++ gcc/ada/gcc-interface/targtyps.cc | 1 + gcc/ada/gcc-interface/trans.cc | 25 ++++--------------------- 4 files changed, 32 insertions(+), 21 deletions(-) diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc index 7f39113186f..d9b70019c4a 100644 --- a/gcc/ada/gcc-interface/decl.cc +++ b/gcc/ada/gcc-interface/decl.cc @@ -6018,6 +6018,9 @@ update_profile (Entity_Id gnat_subprog) DECL_ARGUMENTS (gnu_subprog) = gnu_param_list; finish_subprog_decl (gnu_subprog, gnu_ext_name, gnu_type); + + /* If the function returns by invisible reference, make it explicit. */ + adjust_result_decl_for_invisible_reference (gnu_subprog); } } diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h index 793d7145b5e..f4d79119518 100644 --- a/gcc/ada/gcc-interface/gigi.h +++ b/gcc/ada/gcc-interface/gigi.h @@ -1208,6 +1208,30 @@ return_type_with_variable_size_p (tree type) return false; } +/* Adjust RESULT_DECL of a function that returns by invisible reference. + + Adjusting the RESULT_DECL of functions is needed before handing them over + to the middle-end when they return by invisible reference and are defined + in the current translation unit, which is done in Subprogram_Body_to_gnu. + + That's also needed when the functions are generated by the middle-end, like + GNU thunks. But, in this case, the transformation can only be applied when + the full view of the type is available, which is not guaranteed by the time + maybe_make_gnu_thunk is invoked, so the transformation needs to be delayed + and applied by update_profile when the full view is eventually seen. */ + +static inline void +adjust_result_decl_for_invisible_reference (tree subprog) +{ + if (TREE_ADDRESSABLE (TREE_TYPE (subprog)) + && TREE_CODE (TREE_TYPE (DECL_RESULT (subprog))) != REFERENCE_TYPE) + { + TREE_TYPE (DECL_RESULT (subprog)) + = build_reference_type (TREE_TYPE (DECL_RESULT (subprog))); + relayout_decl (DECL_RESULT (subprog)); + } +} + /* Return the unsigned version of TYPE_NODE, a scalar type. */ static inline tree diff --git a/gcc/ada/gcc-interface/targtyps.cc b/gcc/ada/gcc-interface/targtyps.cc index 4fc97cfb3fd..4768322e15a 100644 --- a/gcc/ada/gcc-interface/targtyps.cc +++ b/gcc/ada/gcc-interface/targtyps.cc @@ -31,6 +31,7 @@ #include "tm.h" #include "target.h" #include "tree.h" +#include "stor-layout.h" #include "ada.h" #include "types.h" diff --git a/gcc/ada/gcc-interface/trans.cc b/gcc/ada/gcc-interface/trans.cc index 6eca5a49cd5..f66d0b99ba3 100644 --- a/gcc/ada/gcc-interface/trans.cc +++ b/gcc/ada/gcc-interface/trans.cc @@ -3995,17 +3995,8 @@ Subprogram_Body_to_gnu (Node_Id gnat_node) else gnu_return_var_elmt = NULL_TREE; - /* If the function returns by invisible reference, make it explicit in the - function body, but beware that maybe_make_gnu_thunk may already have done - it if the function is inlined across units. See gnat_to_gnu_subprog_type - for more details. */ - if (TREE_ADDRESSABLE (gnu_subprog_type) - && TREE_CODE (TREE_TYPE (gnu_result_decl)) != REFERENCE_TYPE) - { - TREE_TYPE (gnu_result_decl) - = build_reference_type (TREE_TYPE (gnu_result_decl)); - relayout_decl (gnu_result_decl); - } + /* If the function returns by invisible reference, make it explicit. */ + adjust_result_decl_for_invisible_reference (gnu_subprog); /* Set the line number in the decl to correspond to that of the body. */ if (DECL_IGNORED_P (gnu_subprog)) @@ -11514,16 +11505,8 @@ maybe_make_gnu_thunk (Entity_Id gnat_thunk, tree gnu_thunk) indirect_offset = (HOST_WIDE_INT) (POINTER_SIZE / BITS_PER_UNIT); } - /* If the target returns by invisible reference and is external, apply the - same transformation as Subprogram_Body_to_gnu here. */ - if (TREE_ADDRESSABLE (TREE_TYPE (gnu_target)) - && DECL_EXTERNAL (gnu_target) - && TREE_CODE (TREE_TYPE (DECL_RESULT (gnu_target))) != REFERENCE_TYPE) - { - TREE_TYPE (DECL_RESULT (gnu_target)) - = build_reference_type (TREE_TYPE (DECL_RESULT (gnu_target))); - relayout_decl (DECL_RESULT (gnu_target)); - } + /* If the function returns by invisible reference, make it explicit. */ + adjust_result_decl_for_invisible_reference (gnu_target); /* The thunk expander requires the return types of thunk and target to be compatible, which is not fully the case with the CICO mechanism. */ From patchwork Tue Jun 2 08:45:34 2026 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: 136281 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C34724BA2E32 for ; Tue, 2 Jun 2026 09:29:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C34724BA2E32 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=eVHS5e7s X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id 9D0F74BA23C5 for ; Tue, 2 Jun 2026 08:46:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9D0F74BA23C5 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 9D0F74BA23C5 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::331 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389995; cv=none; b=EwmwqN2gwHJn/rOHsdK/iWfMYYfk0hx11AX78RuE63KUL1AwSYx2rJvNCHhktEZHTE9Yu9ZsVhW0/5sDcEYL6GsiZp95yiZTKhbUNn/F/9DAbQvqGGo4NVO9sR4OMMJAs76LwL/J+aTyS7cH62R/ThLnBlkcUCiTvx4a3yJdBpY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389995; c=relaxed/simple; bh=A9nwrxlL98YN71oVYlT8nU2W/HEBkNvqSLuGAyk8BKE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=rR7YIltHJFhwcWhcoY7RvlHry/4B01YM38tNnjz8eq+EoRjmuattWl3xsJqUFNZQ5KHTlOfhjMeDXUoSJwbbJCK4yQ4G74UI43lx0W03aSA4Hg4nLr65oZ+Gi5yrfUiNSn4sl2l1/M5cntmlH/05wdemuJlSfM6NtpocoOTH6/Y= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=eVHS5e7s DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9D0F74BA23C5 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-490686877a1so66171005e9.0 for ; Tue, 02 Jun 2026 01:46:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389994; x=1780994794; 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=oHiDd4PttWdnJRvKnnmhkUCeD03jZGX5qUY1ngIHm/A=; b=eVHS5e7sZatqfSHhW43LAXfjb/1vfJkKRyUFCJgPmVCZyqM3rJDNOy/u0+MIA9Sh5k UkseYHr4v9sh0N7UEFBRzQIDkeBKwjN5j+tVdaOMoXLu+zxKTY6jtNBZ5JenBw6b674X 0rzUigi88KoSPqehDZvTRUvJ1qXAytjF2+X5n+u1sUkAQPiYq4Gh7GEv4VEp9Wdd1WzN kzZRHTlzelWTITHYmomhwdMQwpZ61eb8hQ8hsmlsO5xku7uQ2SgX71yQrBwhRUfuq1F1 x2CGcrxl1amy2/J4ox4IMVZSxzAg2iC4w6+MsgfHvrs0wc3eTIoTlLz4p5A9oQp8sQoH 7wbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389994; x=1780994794; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=oHiDd4PttWdnJRvKnnmhkUCeD03jZGX5qUY1ngIHm/A=; b=mpYNVb8iUP71x7JXriRFYZ0huqB/FEaa7/uTcEXB6hAJ5H6UpMiv6ZxZeS+arNMmOh rBFYNZ9BtxsNiqZoBwmOE8GCHuPX1rTyloHNDvlkL1/KB4ke5ejIugPkz10NbHAXqnVf AvHTtrS2qMZEp86QWCv5gch4+UsD6CWvQJ9aJLymZrLyZWFWqVNutUmXSJPuMeby68tI ljOm+/HgrhovDH6E4eeDWgO4N4ZIyqVotcWAMiJPdDX/s8LX+/AM09eS3ChsJpjlZm6L dKDVDOl/4OSRPfhTtd2aJWQ1g8e9fU+45kkuJJrxuNcNysyMtVuOoYL3awj9MZS+7yEA gn6g== X-Gm-Message-State: AOJu0Yxs4VbqN6aDVW+P0DU32fkkoXJRgwd6JGC5exanVXmNSYANIgt9 IoDqLJ7eCOvrxcny/DSo9WbajYpg0Lk+7FxL/sICq4znLsB6sUjduSUo11bBAD6lESJMbkYhpwL K73Y= X-Gm-Gg: Acq92OGnYuGhZlbd1F8lEWr9etkhVCsM9SDlKzTpPXLnklzJwN0UdJ08JBn+BL1M8o7 sS6v1Iqrbq9G9jWaMfokHzjsrDDuChMlm0YrZFw+n0/IcxzfaJvQlvC8x96MWRPebioDgCTRTEA nwVQ1QTuHE3FFY5F8aURS8LjPQYfvQP+bKHfpzUd94ZmB69JpQ3dedM/7mNPI+jTNWba4aSNJ8F 7EC+hXI/Cf2Z4MwmoN/BlxBHjGVYk43m8xdXKBme1bJ148aJqoFYEE6BZITaGvlpEjg/Pas9tlz jdOPqbVEjaA1Y4Eqvjca6gzPBNnf6ThbSDMagjkyoy3ujbngFJU+dmdeiBzTLFWD2cgg4KsY/6+ /+ydNOzOcM9wYkJEy+N9qGynbxYhRxAlAPpB7ZD2k891TKa3HquhGxQ/h/Zk6DosMKDPQndf5Pn w1q0ggIa7DLlS+I9JTE21vxHGrsZ1Hswm+5ws6UVTkC2w4avA7UplrmG+hV5tfJElDf1mD3VIS1 8sR7UzD7N5m0uJblsIeOjEJCQuthHc= X-Received: by 2002:a05:600c:1546:b0:490:7df7:9190 with SMTP id 5b1f17b1804b1-490b0e70060mr46239885e9.8.1780389994320; Tue, 02 Jun 2026 01:46:34 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:33 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 46/51] ada: Adjust translation of non-stored discriminants of tagged subtypes Date: Tue, 2 Jun 2026 10:45:34 +0200 Message-ID: <20260602084541.3829876-46-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Eric Botcazou This changes the translation of non-stored discriminants of tagged subtypes from the (stored) discriminants of the ultimate ancestor to the (non-stored) discriminants of the tagged type, for the sake of tagged extensions. This also contains a code layout tweak to gnat_to_gnu_entity and a minor improvement to gnat_to_gnu. gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_entity) : Do not repeat conditions in chained tests. (copy_and_substitute_in_layout): For a tagged subtype, inherit the non-stored dicriminants from the old type explicitely. * gcc-interface/trans.cc (gnat_to_gnu): Exclude more contexts for the transformation of boolean rvalues. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/decl.cc | 35 +++++++++++++++++++++++++++------- gcc/ada/gcc-interface/trans.cc | 2 ++ 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc index d9b70019c4a..ff7d9bb80b4 100644 --- a/gcc/ada/gcc-interface/decl.cc +++ b/gcc/ada/gcc-interface/decl.cc @@ -3727,8 +3727,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) we are asked to output GNAT encodings, write a record that shows what we are a subtype of and also make a variable that indicates our size, if still variable. */ - if (debug_info_p - && gnat_encodings == DWARF_GNAT_ENCODINGS_ALL) + if (!debug_info_p) + ; + + else if (gnat_encodings == DWARF_GNAT_ENCODINGS_ALL) { tree gnu_subtype_marker = make_node (RECORD_TYPE); tree gnu_unpad_base_name @@ -3759,11 +3761,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) true, true, NULL, gnat_entity, false); } - /* Or else, if the subtype is artificial and GNAT encodings are - not used, use the base record type as the debug type. */ - else if (debug_info_p - && artificial_p - && gnat_encodings != DWARF_GNAT_ENCODINGS_ALL) + /* Or else, if the subtype is artificial, use the base record + type as the debug type. */ + else if (artificial_p) SET_TYPE_DEBUG_TYPE (gnu_type, gnu_unpad_base_type); } @@ -10975,6 +10975,27 @@ copy_and_substitute_in_layout (Entity_Id gnat_new_type, save_gnu_tree (gnat_field, gnu_field, false); } + /* For a tagged subtype, inherit the non-stored dicriminants from the old + type instead of inheriting them from an ancestor. That's specifically + helpful for the Parent_Subtype of tagged extensions when discriminants + must be rematerialized by the DWARF back-end, to describe the variant + part of extensions, because the discriminants of the old type are also + non-stored whereas those of the (ultimate) ancestor are stored. */ + if (is_subtype && Is_Tagged_Type (gnat_new_type)) + for (gnat_field = First_Discriminant (gnat_new_type); + Present (gnat_field); + gnat_field = Next_Discriminant (gnat_field)) + if (!is_stored_discriminant (gnat_field, gnat_new_type) + && (gnat_old_field = Original_Record_Component (gnat_field)) + && Underlying_Type (Scope (gnat_old_field)) == gnat_old_type + && present_gnu_tree (gnat_old_field)) + { + tree gnu_old_field = get_gnu_tree (gnat_old_field); + if (TREE_CODE (gnu_old_field) == COMPONENT_REF) + gnu_old_field = TREE_OPERAND (gnu_old_field, 1); + save_gnu_tree (gnat_field, gnu_old_field, false); + } + /* Put the fields with fixed position in order of increasing position. */ if (gnu_field_list) gnu_field_list = reverse_sort_field_list (gnu_field_list); diff --git a/gcc/ada/gcc-interface/trans.cc b/gcc/ada/gcc-interface/trans.cc index f66d0b99ba3..5140ed8bbfd 100644 --- a/gcc/ada/gcc-interface/trans.cc +++ b/gcc/ada/gcc-interface/trans.cc @@ -8780,6 +8780,8 @@ gnat_to_gnu (Node_Id gnat_node) || kind == N_Selected_Component) && TREE_CODE (get_base_type (gnu_result_type)) == BOOLEAN_TYPE && Nkind (Parent (gnat_node)) != N_Attribute_Reference + && Nkind (Parent (gnat_node)) != N_Discriminant_Association + && Nkind (Parent (gnat_node)) != N_Index_Or_Discriminant_Constraint && Nkind (Parent (gnat_node)) != N_Pragma_Argument_Association && Nkind (Parent (gnat_node)) != N_Variant_Part && !lvalue_required_p (gnat_node, gnu_result_type, false, false)) From patchwork Tue Jun 2 08:45:35 2026 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: 136274 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B76DF4BA2E36 for ; Tue, 2 Jun 2026 09:21:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B76DF4BA2E36 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=dTcak+1X X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by sourceware.org (Postfix) with ESMTPS id 0E02A4BA23D1 for ; Tue, 2 Jun 2026 08:46:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0E02A4BA23D1 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 0E02A4BA23D1 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::335 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389996; cv=none; b=iqnrda96XL9XHf4TvemCo7d81MF5gbu/7ZdbigmjQ/dN7HNL9wJUjdvbs40YtRGljj+tKGaoTOBMnNTgZsc5Kcchmm6jNhjb9uyNFFgifvkYr7JPYxdDqlFVuf53rKcry2gS10Z7zrlIuCIM7csNQSXMzzwFPpXjXOR2TGGcHBM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389996; c=relaxed/simple; bh=8MtIWC/o1RTX7mnjefj5N3wFlkRCszUr+aAz2Dn4DgI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ip1GXB5FZVPzm2cPc1XG1sDKrHi3+ho79aI7VqUWK3X4eswHf75QHq7PIGZKc+tj7qLlZwbhxeoGzIjLvy1oBejmT7gnCy6uieDgExZl6Vv2ayouuI4VVKxVd6pq3x8CFtsp5VN+0b2i/Lr3iLxhWADEAi5GuarD0Aii41UGH2M= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=dTcak+1X DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0E02A4BA23D1 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-490b12270b3so3767245e9.1 for ; Tue, 02 Jun 2026 01:46:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389995; x=1780994795; 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=5ftbWtQHrFcTvYP+KNr6OwV231r9t484bReAEAruEU8=; b=dTcak+1Xx8qDU5iy7xjPX1bqV8+goQ3dB0glz7zHhp8tqF/g13uSRdBc10R9U0JyEZ wjYdZyixDZaIsluZkN62OIZYh5EO3vfNTVFjmYDXleEARCLCMoR1mQU+a7Hi2nG/af2z kZzg7GbcSGk/hNqBnNQ0FhVhCT+addDQ2VH5D7UkaEuDlguChD7bAdfGuqSFDQi0InL4 A6sBRpbQPxtipAsTHSITzf/HsJxUU0NRyyq24pY8zvL9cOLjtZdJghuB1IXiyPprbWnz 8SDSvAcuOQoQosB1x0qpbI4c7WxdwaUI4JbWg2D4nqLEjRp6MFknpLaoI7STH++TTWwU vARw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389995; x=1780994795; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=5ftbWtQHrFcTvYP+KNr6OwV231r9t484bReAEAruEU8=; b=UuCv+1TH/NwdPM84dkXGmCPvZ9IIQnWXQM1HEk6rZOhKpqc6fqm8h6vm/zRfPfsh6T qvvfh+/tetXsydU/DDdNnR1YdIC2IHK7GaHKd0xsrWKDVEbCU1NiZ/mYI70bZsxz3s7D NZAkwKh7W7HRmep/9pGJ9nRI4iUDBxvt0x4hORGAEsEvokRNOPoyjFxQf7Y1iOQuqvDl yoJKwArOTsUbcllHDNmapdeE2aGRMi6vHoQ0Q2Cc5eM6tXaDZHVn5VIlDvAyF7AXzqpM rDiEZMsoueOy7T1Zc/+UQ4jbB2UhoocE+JdWoGQP5A5p3UpwOoRH9zy74shD5kNYlLJt 6ypQ== X-Gm-Message-State: AOJu0Yz0unOLKlxbwOcQ4hT3Ep6h5QEzoitWVHh7ZoAAHFFQGhVzc8bN 485XbK5ie89tO0OELs3Ye9IIr5tY96XOt2dtkvMn3hhFy32qDm1bRDP5AClUbf+qmWIQiCLJnzT mwkg= X-Gm-Gg: Acq92OGv/VstPtBslIpFmMwe7hTEAVXvicszbflh5i2LOlxqgf728+1SfM7KI8ccv0H BZbSgmvMh3MdHW8pang2XfbVr6O/w1r8goLIx1u1ZAUy+r6tWVicbqfreMIq8LrmkcKEeFidG2U Jv/5T92kgz0h8ppJy2p2J2zteV1ph8DLfSUr9w6FC7p8yiEoDLi4m0zMKXIz179lZ6o24yb1Ee1 Eaybt7mjSTXaOIrFv27rTx5ReyEq4qjYdz3OGBUHqI1kwE5cagOdZVHZ3DWg3M10FYbyxMWgD4F Wyk5cSVCwdmEkNWQ/ZQmtk4cTILOy3RhxsDgeT2qE64Z7hqsayOycFSgblQ4AQtyFcYndGcEv6F rw2s0vjhFPEu3eCP8E62cLBODhpkv2j78T46LjZ5pLgdkStXSya2jn191xm0hmOTPQ670EStUMV 3WOllksASNuLHolE6I9TyvScTrwnF0wSw3sZULHAZ0h4656MbItDspZzXxHEBcu54jVv055L1yA qRA41CdKokNWOvxA+haSLZwcd725Y0= X-Received: by 2002:a05:600c:46cc:b0:490:b0dc:6999 with SMTP id 5b1f17b1804b1-490b0dc6a2dmr57428625e9.29.1780389994976; Tue, 02 Jun 2026 01:46:34 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:34 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 47/51] ada: Plug loophole in layout derivation machinery Date: Tue, 2 Jun 2026 10:45:35 +0200 Message-ID: <20260602084541.3829876-47-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Eric Botcazou The machinery that computes the layout of derived types does not deal with the variant part of unchecked union types that also contain a fixed part, because this variant part is represented by a (mere) union type instead of a qualified union type. gcc/ada/ChangeLog: * gcc-interface/decl.cc (components_to_record): Tweak comment. (build_position_list): Deal with unchecked union types. (build_variant_list): Likewise. (get_variant_part): Likewise. (create_variant_part_from): Likewise. (copy_and_substitute_in_layout): Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/decl.cc | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc index ff7d9bb80b4..9b64544a2f2 100644 --- a/gcc/ada/gcc-interface/decl.cc +++ b/gcc/ada/gcc-interface/decl.cc @@ -8617,9 +8617,9 @@ components_to_record (Node_Id gnat_component_list, Entity_Id gnat_record_type, mutually exclusive and should go in the same memory. To do this we need to treat each variant as a record whose elements are created from the component list for the variant. So here we create the records from the - lists for the variants and put them all into the QUAL_UNION_TYPE. - If this is an Unchecked_Union, we make a UNION_TYPE instead or - use GNU_RECORD_TYPE if there are no fields so far. */ + lists for the variants and put them all into the QUAL_UNION_TYPE. But + if this is an Unchecked_Union, we make a UNION_TYPE instead, or reuse + GNU_RECORD_TYPE (which is a UNION_TYPE) if there are no fixed fields. */ if (Present (gnat_variant_part)) { Node_Id gnat_discr = Name (gnat_variant_part), variant; @@ -9724,7 +9724,8 @@ build_position_list (tree gnu_type, bool do_not_flatten_variant, tree gnu_pos, { tree gnu_field_type = TREE_TYPE (gnu_field); if (do_not_flatten_variant - && TREE_CODE (gnu_field_type) == QUAL_UNION_TYPE) + && (TREE_CODE (gnu_field_type) == QUAL_UNION_TYPE + || TREE_CODE (gnu_field_type) == UNION_TYPE)) gnu_list = build_position_list (gnu_field_type, do_not_flatten_variant, size_zero_node, bitsize_zero_node, @@ -9811,7 +9812,7 @@ build_variant_list (tree gnu_qual_union_type, Node_Id gnat_variant_part, /* If the new qualifier is not unconditionally false, its variant may still be accessed. */ - if (!integer_zerop (qual)) + if (!qual || !integer_zerop (qual)) { tree variant_type = TREE_TYPE (gnu_field), variant_subpart; variant_desc v @@ -9820,7 +9821,7 @@ build_variant_list (tree gnu_qual_union_type, Node_Id gnat_variant_part, gnu_list.safe_push (v); /* Annotate the GNAT node if present. */ - if (Present (gnat_variant)) + if (qual && Present (gnat_variant)) Set_Present_Expr (gnat_variant, annotate_value (qual)); /* Recurse on the variant subpart of the variant, if any. */ @@ -9837,7 +9838,7 @@ build_variant_list (tree gnu_qual_union_type, Node_Id gnat_variant_part, /* If the new qualifier is unconditionally true, the subsequent variants cannot be accessed. */ - if (integer_onep (qual)) + if (qual && integer_onep (qual)) break; } } @@ -10552,10 +10553,11 @@ get_variant_part (tree record_type) { tree field; - /* The variant part is the only internal field that is a qualified union. */ + /* The variant part is the only internal field that is a union. */ for (field = TYPE_FIELDS (record_type); field; field = DECL_CHAIN (field)) if (DECL_INTERNAL_P (field) - && TREE_CODE (TREE_TYPE (field)) == QUAL_UNION_TYPE) + && (TREE_CODE (TREE_TYPE (field)) == QUAL_UNION_TYPE + || TREE_CODE (TREE_TYPE (field)) == UNION_TYPE)) return field; return NULL_TREE; @@ -10582,7 +10584,7 @@ create_variant_part_from (tree old_variant_part, unsigned int i; /* First create the type of the variant part from that of the old one. */ - new_union_type = make_node (QUAL_UNION_TYPE); + new_union_type = make_node (TREE_CODE (TREE_TYPE (old_variant_part))); TYPE_NAME (new_union_type) = concat_name (TYPE_NAME (record_type), IDENTIFIER_POINTER (DECL_NAME (old_variant_part))); @@ -10785,7 +10787,7 @@ copy_and_substitute_in_layout (Entity_Id gnat_new_type, is statically selected. */ selected_variant = true; FOR_EACH_VEC_ELT (gnu_variant_list, i, v) - if (!integer_onep (v->qual)) + if (!v->qual || !integer_onep (v->qual)) { selected_variant = false; break; From patchwork Tue Jun 2 08:45:36 2026 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: 136259 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 02D9E4BA23D3 for ; Tue, 2 Jun 2026 09:06:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 02D9E4BA23D3 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=Tgm18YUV X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id AAB874BA2E11 for ; Tue, 2 Jun 2026 08:46:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AAB874BA2E11 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 AAB874BA2E11 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389996; cv=none; b=mKliAtPhb7qp/8Wsfnqx85Iv8MAlwT1OsidBMoWGc0UIS8N5kGa8SzfRXaCllztB4kxgQivPIcQeeOhhSBtYxhYcOKJ4ioTsbn+oUiwBCdoyxmrfhXLaOdbd/d+lNYETr0D9y0RP1l7KMKWA/Am2JFnr+Nm2nDCL01DF1K3JuLA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389996; c=relaxed/simple; bh=F/lR2MkR5S5rWWGyFRYto7z2N5OxXwcTED9D7I36+AE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=kCnXbO8i/9w5sbWyM/2sYqg/fvNfQ8kfZBPxesrSHNMGCCgVBywjIozFsnRaxDTqxdLobJainyq1ee8I/Obzbat9IcbKtl4uAgbJ0xS2cbolWPaMIRRDev5iwTc/RsaoUbCJQaPKhC55IT0EIW7vUv8pp4i+j1FBqwfLwbzwUoA= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=Tgm18YUV DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AAB874BA2E11 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-45ef29c5561so2122692f8f.0 for ; Tue, 02 Jun 2026 01:46:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389995; x=1780994795; 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=4xpNjr8lbFfC+FdicYLAaBTKz6Gq8jRsulx/t/qbD7U=; b=Tgm18YUVYaZHGAZ0LHOh4AE+qtzNBwWHULhmhb8QqCFIv5rzb24tEab/FATpbMS2cV 5RZq4TVHhMmKk57YbHD4tnPRNPxcNYWCNxEKZGc1AVH4NeMlntvd6J6ZUsDvznfRQPIu 5/wzXAz2juNPVVzmwLMWD2K7UqiMcmLKBTmgVgTl1fMJDAjh+pSoCrEDr6kPXhTm8xi8 ywtTl3JefId1o/Tm9cg2RlPg74fWoxssTbd4BW6ZpJ9+WJFD+rRwZk0DmoDt+eB524I7 UVWkUH9vwlHynkwOvqf6qKPFkHkjGhmJzhzQnZbAPkgaCqhKa+5SY3l2JNniOAlc8Ae+ AhnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389995; x=1780994795; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=4xpNjr8lbFfC+FdicYLAaBTKz6Gq8jRsulx/t/qbD7U=; b=DVlqv0za7oTrRshIakQEwVwp/h67rWVz0RVp7FqUOS1vpMzaeetUZYDLH/yIxR283g 0iIh5ry5PyhB2nhXUVzwEt0Ljx5El6vJW4pUAb0bPG6Zn7i8T8oXzs3AByi+9RvTPUUd Wh7CVxvba5ibqXzr5RWYWUW4VzdK3I/z0g+aoGCt3SoidNhXFrGDaIwplMYzPHTCd7tw phcPTO5rLkmZ80eWCHtk4xoCOMigVUB8tyHbD9JvbuQJlv2eJrD2MuDR6mTmUywAA5LB vZvaQseaZWp9D06qQ9Quq0KpF8Xz8t6K62Mo5pFVUBmvZceklBDmrHtwFk5ixnNSCLSh Bu1A== X-Gm-Message-State: AOJu0YxqalqSU+N8NuSCzkhuNqSYluFXqdlDTUF7I90EyrScs6mixro8 CcqYxq4mnAjum8IMZrrQzcpJrNPFR/PWb82NGa8si/vVZIgTtBoIIUO1HCdeybBMDiyxf5BhfSZ r854= X-Gm-Gg: Acq92OG4OUw1lPcDkuft8m4CaPgkg349Kx3AOudO69j6Q93Ojy0O+RTQ8LUrqt2xpOF EA5lRgOJRReiJIxSBg7PRtXsaH5hFGhFA2kQyz04W077jwSJWTEnJf1BB7PutJDn7odf166INPr btccguRyE717+w3m4JI11iutoyyA1v0/df759WEC9L3xKfpGv5u5okvxI1ntuPC1SMy/xr/BF+3 lWXuXBDalNLlA2DaZrBHXpbi9SBstO4Nh9YeQGoV0/KDVOIQdusNc0onnfu84mzuQ9WPqpwV7hU nvJuKH1F6zZ5uTNItcPtQKQpnDahL0sPsJrnT/zpDIBQe8UCuQKKpSQxtrQurEHveaL0h05HMNe CuxelqfY/wzGoq9/MoCj5few8tTXWBO2VxapbfrYI8wczbOsD6i8Nml7PdsE8d4Hwl+DoEJeCtn 92RaTfsZ//hE/yl3olBHR7S9dSOG7BAvxpPdFxWyLkmPBPxkI1GQKbHPUgDRNEPb+MwOEMx0Dvb Vg9DGdf+2EOrX7lCbwr6SqH34EcjuEhpZwE1Sluhw== X-Received: by 2002:a05:600c:8a0a:20b0:48f:da34:ec4e with SMTP id 5b1f17b1804b1-490a29303aemr193328615e9.19.1780389995617; Tue, 02 Jun 2026 01:46:35 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:35 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 48/51] ada: Skip layout derivation for C-compatible unchecked union types Date: Tue, 2 Jun 2026 10:45:36 +0200 Message-ID: <20260602084541.3829876-48-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Eric Botcazou The machinery that computes the layout of derived types does not support C-compatible unchecked union types, but their layout is fixed in any case. gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_entity) : Do not derive the layout of C-compatible unchecked union types. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/decl.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc index 9b64544a2f2..cf6c37f1ca2 100644 --- a/gcc/ada/gcc-interface/decl.cc +++ b/gcc/ada/gcc-interface/decl.cc @@ -3551,8 +3551,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) } /* If this is a derived type with discriminants and these discriminants - affect the initial shape it has inherited, factor them in. */ - if (has_discr + affect the initial shape it has inherited, factor them in, but this + is not needed for a C-compatible Unchecked_Union since the variants + are at offset 0 in there. */ + if (TREE_CODE (gnu_type) == RECORD_TYPE + && has_discr && !is_extension && !Has_Record_Rep_Clause (gnat_entity) && Stored_Constraint (gnat_entity) != No_Elist From patchwork Tue Jun 2 08:45:37 2026 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: 136284 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 52A704BA2E1C for ; Tue, 2 Jun 2026 09:33:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 52A704BA2E1C Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=GZntjv4W X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by sourceware.org (Postfix) with ESMTPS id 477144BA2E0D for ; Tue, 2 Jun 2026 08:46:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 477144BA2E0D 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 477144BA2E0D Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::334 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389997; cv=none; b=nr5SQGDiiwDFuKsgp4zKNr0G9vXoeGoovE+3Gryd/H/w172gvAydPHZ715T7FR+MNdajPdkUo/9u6PN99NgQBlGwRwta52bNElFSK4SS9W7GlS2GL0LZ4Dwdyb+5JvVJobBiQNdTOzMJv2lXs8LOtTS/1ZooHUK7NST3GkThUp4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389997; c=relaxed/simple; bh=ENnNd40jNK+OrkrEO6y49l8ou2Tbr/8MlKAz3h016i0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Bh5RHmadPm80yGyPgr+C+UWCjH8/IgMXGY4DU5ZmvSBz2dHRXgVXNCjkOvj+w3/SLFgJGo97lFR92KCn89ti4Z/adTZE5c+yH7UsvzlWwA1sENeRMYBIPRo4IIZt76gEVRFoyTfxXxPANbVW3vKDFcu3Z6EegYRAQ6m8bd3b5VM= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=GZntjv4W DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 477144BA2E0D Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4904fd4f6aeso93076205e9.2 for ; Tue, 02 Jun 2026 01:46:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389996; x=1780994796; 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=hUzKMFJVKensTVarnhJlO+zsY+pK8iS+F6IrC/UnBzI=; b=GZntjv4WOkW9jSk2UkFeOsvjyUEvDjmUYE3//y+rAZlsvNUKb7+X68MfOENYI9MKNo +LgCRUeJ/JCXG1mpkRgDZ62dj0tW5G4VqXKFhr0UouLslImw/nVC7p6RLuiKMywDOss6 WrVvo+VauUd/BvEMnGIDTur91g8LUUnMXS9V44cEcUVOuUYW/BKhRpxLfT1SeUhOauUk MgfvQNXG3Gl8d0lWeg0u47d6goQu7sMQEloOO7KKWnU9qV/NaAemCZgQQ+KshNADw0F+ cQMhVbsJA724GcKmFdwiJjucW7e5ErE2UbZN5h4SZrMbHHvJng1gnZD+hZb3S7dKAxbq T80A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389996; x=1780994796; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=hUzKMFJVKensTVarnhJlO+zsY+pK8iS+F6IrC/UnBzI=; b=iISXSOsHsiUh70uihvhllG2wR/GjtjikVdh+7WhM9t6AG7eI/SNCzdu3iVyYXwq9U3 LxpCtuKWLyN1RBKBVOHcaPDcwJBokH/YuwQiiDdiTT+gYj3EXyhV/oezjo0A4/gV4KGH 2xUygmQEn36rJ2ZX5G1vL6EIGBt4AvKQayKroPRO62EUEV+mUKszXXOr50LEJ76FcKkE 8JIgvb9xGC2Pecuf/px3Sk7SLDLzpIgpSlqvIckfXjF6kSLA7t/tpsoVI3Ru9OCej6KT +XbTVumcYTK2cQhvkiWmRMDDBLvR6LT0rrEGpy6kBWsvz57Jtt4676/8PMDU0cU0W1pO N3AQ== X-Gm-Message-State: AOJu0Yw8/VTOvdRlkb72fY9qowcH4X1h+wGeDkTUk2QizIkwWN7OaDhk G3Wl8qpZkbcLFqUYEmopILTZsFKWtJcugAMShNzeTyDh9N88ujQYU7Uvc3HCcqCGRsbrl5Ai0Ws PYWk= X-Gm-Gg: Acq92OGeAhSiax42rPbqN85g5HkIbT3vZ4w0CeTcrj3jgQWc139r/3TRi8O4vzUl+KP o8ew/wA0Yr3/mI6eb5uj91chZTEYYnpB9OJRQ0rH7jgnAFFrOuFBWO3ZhzvoC7vhS9G7Qj+bQtI kUFpQyI34iBieS/Ol8YFCQVcbQwbsBmrAuL+44Jw3FlRXY0OSMACLeZrUcamuNrltCy8bOpwKko vIlUlPHSYD1xktkM9wv7C1o8/AcNlOLO9zjDVqLhbXUUffp4zWMOV980ScWwXD8ZFbbDQUU3rWv BhgIm4NKoPDZkGC51TleJ58OKn6qIo1PeocVQ+MnVaQ2+/qapH3Dlyn+oZkqqi15cCn90N+RJbA n+c6vBxxj7d2uwlPW8gHkAshTpfK+v2qBJfuvZ+Bt5ZiYV0C4EwQaqaxnmtQnriCN4nb+0NCkum 4+AvHfpEHTg9HhHJK9km8SEGmhNA/kaCHWhlVRmqnc9FxJUJ6bBE3usGsFPsUksDJWwFTJv5W9x Xr2rZYhnzYByaEt2cLO6fPLhOLz3Ro= X-Received: by 2002:a05:600c:4714:b0:489:1c1f:35f1 with SMTP id 5b1f17b1804b1-490a290ebf2mr277659105e9.4.1780389996246; Tue, 02 Jun 2026 01:46:36 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:35 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 49/51] ada: Add warning for too large return object in extended return statement Date: Tue, 2 Jun 2026 10:45:37 +0200 Message-ID: <20260602084541.3829876-49-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Eric Botcazou The return object may be allocated directly on the return or secondary stack by the front-end, in other words be the renaming of an allocator. gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_entity) : Do not give the warning about too large a size here but... * gcc-interface/utils2.cc (build_allocator): ...here instead. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/decl.cc | 6 ------ gcc/ada/gcc-interface/utils2.cc | 5 ++++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc index cf6c37f1ca2..50a065d2dea 100644 --- a/gcc/ada/gcc-interface/decl.cc +++ b/gcc/ada/gcc-interface/decl.cc @@ -1489,12 +1489,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) false); } - /* Give a warning if the size is constant but too large. */ - if (TREE_CODE (TYPE_SIZE_UNIT (gnu_alloc_type)) == INTEGER_CST - && !valid_constant_size_p (TYPE_SIZE_UNIT (gnu_alloc_type))) - post_error ("??Storage_Error will be raised at run time!", - gnat_entity); - gnu_expr = build_allocator (gnu_alloc_type, gnu_expr, gnu_type, Empty, Empty, gnat_entity, mutable_p); diff --git a/gcc/ada/gcc-interface/utils2.cc b/gcc/ada/gcc-interface/utils2.cc index 3604d4df761..9de47a70240 100644 --- a/gcc/ada/gcc-interface/utils2.cc +++ b/gcc/ada/gcc-interface/utils2.cc @@ -2731,7 +2731,10 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc, /* If the size overflows, pass -1 so Storage_Error will be raised. */ if (TREE_CODE (size) == INTEGER_CST && !valid_constant_size_p (size)) - size = size_int (-1); + { + post_error ("??Storage_Error will be raised at run time!", gnat_node); + size = size_int (-1); + } storage = convert (result_type, build_call_alloc_dealloc (NULL_TREE, size, type, From patchwork Tue Jun 2 08:45:38 2026 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: 136285 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 850414BA23CE for ; Tue, 2 Jun 2026 09:35:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 850414BA23CE Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=Vkpm/kIk X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id 0241D4BA2E32 for ; Tue, 2 Jun 2026 08:46:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0241D4BA2E32 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 0241D4BA2E32 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389998; cv=none; b=igJPAc5TCRLiYqKFHQFePNYJIezkq5Qe84Mvc7ygRGP26ehFAaYjfP2wtLJVeb2GjiDtnQKmwlPcz8qzdmZE+2a3PR1cyX8rkdj6vRTNwNdFv+DLxFeNhtdWT126gm9VnrQ16y//BS85LOU1GXgbG/Sk1wgEwHamhrHUBbSEpro= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389998; c=relaxed/simple; bh=XcXPVTI2KDYM4ad+GX9tZntfkjdQgMfuMFkLvhmVIW4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=t5ls0RjxaqHh1+Kl2j43UN9UQUkrJAqqWDRmXyqWJKk1dXWVKgBrKPYyGvDXsNO6cPIZzWMGWK1One8ZWBXNZqCoyTDd8ObJBbHGr11YJXtV2hot4IHDt/Xc+jeT/bm/YF7eO911HwbYsAxww70H3wqQXln//Ykf2htE0InLFBw= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=Vkpm/kIk DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0241D4BA2E32 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4906238c62eso90274205e9.3 for ; Tue, 02 Jun 2026 01:46:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389997; x=1780994797; 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=REgRCVfP5i/WcSI9G6vdOrkF5e9rMrhPlathKbxoPeQ=; b=Vkpm/kIkxS8WWp1t8CEorvcsbj6AtFS0wxQafqMdmFUYB8y4eJHLVntPGH9SRilhvE vwlf5+ns5yqG0+sc3aYPbhAoe+NyM3MroFb1En+lzDvIbRLX3aplWaKsuTKpsazWRKDy vOPccauBwcR1xZQEDW93IaDFiBjjmCrvNaBOEGeoXgmYEWwBBrFAyvu3W8rKzu23yts8 0Wl41md2toIVA5Erm1O9jDEToEOVqkN5uV3VnM6wSuhgO/8CFYqFkiUiEVMRC5y3YWgY kz0nk0ulyBiSOpvpicL3qRSk8HnBI/TJFmR0lWv7Deup71bCg7tjhEf23PPSwPBzD3XU 1OXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389997; x=1780994797; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=REgRCVfP5i/WcSI9G6vdOrkF5e9rMrhPlathKbxoPeQ=; b=LFX5PoV8coi1UGTzXMqhQH9f4nfdmGzOwtY2gwv437VyAaverEOxgaohBUE8qoONAO hSmr9IX5zSJqUiaGzqie8t+LuMvH0qT70NIS+J6+2wbgJws6uWna4ggHmSONWOw/i6oE EvuCptMUSIbUBr+rhx7cd/PCrpTEVUv2i8TdSBJPl7mAt2/r+eZFt8E+JS3GdcCDlnwJ i2ttQaHvL0a7QpP0sO8TXJumP0IuazPJ/Ve3xclu5jrIb391JBlOXJBZLi5zjiXqdMEL itCy8LV8kCbkc1nq1Zz9Wev0mSrZGTmBwpyoNdx3eT3JQOxcPb+KvMEPsq6z6g+GTynD SuNQ== X-Gm-Message-State: AOJu0YwCbFQm96ty7ezmt74ou84EKd6cBUqstLPzm52LkNX0VDFcLuDV tx5QgcFrZ/vSkglCJIs1SLewr+BQF0n5PEDcfPfJJ+sfU1T3QkkzLIYl1NIhrKjIgeoeCM4KJKl kHKg= X-Gm-Gg: Acq92OGfFAz38SAi4f20rMEGOlDGnhTZPte5FWmpFinMlVdyEBPsIOlTZx7EKd1f/+j tnNbw2EJeMAsCrRZExUPXimTXlWN3gHlweEMnl5Lj2yxn1xRDTiWNjCn8QK3j8ynT0Tb2Qq3yx8 yNe2bQAB/V/vx1o7IzBLLTqPnrPs6sT1SWsgrsEEXdEX5vrcDC2nU0KioghUqZDCU+DV0C+bVr+ gbAoGn3ssLm/czNOnZuUIoL2MbrGJ8yAZm41JZQfwVUCKIZV7b8JLt1IbnvsABG4198n8oPWpih x8gF4PR/FAZH0BiMjlXcSW45yuL0mVWFJSxH4C1tzds64FuNFgQnCy/ssvAVd1htqxdsRpHImbt ha+/SiI76lcWDUST2Wt0NEMonwjq+iOJ3fwv8ZwsDr4notIXt0v7juv1O2ofP1dRISg2WGO0JWJ 2KspaiME2IOb7w8ED7j3sL8JF6HXLcn+1T8H5r7mXpc5I70gvzWPUh4Vicl8TiKIoANfHzjyEFo 8PM/iPC7IAYhh6D X-Received: by 2002:a05:600c:1988:b0:490:44eb:c1dd with SMTP id 5b1f17b1804b1-490a294fe9cmr251626765e9.29.1780389996863; Tue, 02 Jun 2026 01:46:36 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:36 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: =?utf-8?q?Marc_Poulhi=C3=A8s?= Subject: [COMMITTED 50/51] ada: Avoid definition of unused label for LOOP_STMT Date: Tue, 2 Jun 2026 10:45:38 +0200 Message-ID: <20260602084541.3829876-50-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org The gimplification of LOOP_STMT has a systematic end label definition, that may be unused. For example, an endless loop maybe gimplified to: : # USE = anything # CLB = anything totoD.5747 (); goto ; : Later, the gimple_seq_may_fallthru() will decide that this block can fallthru as the last statement is a single label that may be jumped to from somewhere else. Only defining this label if we also emit jumps to it helps the compiler correctly decide if the block can fallthru or not. In particular, if a function, with a local object needing finalization and the No_Return aspect, is an endless loop then the spurious warning that the function is still returning is not emitted anymore. gcc/ada/ChangeLog: * gcc-interface/trans.cc (gnat_to_gnu) : Mark the label tree as used. (gnat_gimplify_stmt) : Do not emit end label definition in unused. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/trans.cc | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/gcc/ada/gcc-interface/trans.cc b/gcc/ada/gcc-interface/trans.cc index 5140ed8bbfd..7df32d67ea9 100644 --- a/gcc/ada/gcc-interface/trans.cc +++ b/gcc/ada/gcc-interface/trans.cc @@ -7993,13 +7993,17 @@ gnat_to_gnu (Node_Id gnat_node) break; case N_Exit_Statement: - gnu_result - = build2 (EXIT_STMT, void_type_node, - (Present (Condition (gnat_node)) - ? gnat_to_gnu (Condition (gnat_node)) : NULL_TREE), - (Present (Name (gnat_node)) - ? get_gnu_tree (Entity (Name (gnat_node))) - : LOOP_STMT_LABEL (gnu_loop_stack->last ()->stmt))); + { + tree end_loop_label = Present (Name (gnat_node)) + ? get_gnu_tree (Entity (Name (gnat_node))) + : LOOP_STMT_LABEL (gnu_loop_stack->last ()->stmt); + gnu_result + = build2 (EXIT_STMT, void_type_node, + (Present (Condition (gnat_node)) + ? gnat_to_gnu (Condition (gnat_node)) : NULL_TREE), + end_loop_label); + TREE_USED (end_loop_label) = 1; + } break; case N_Simple_Return_Statement: @@ -9532,6 +9536,8 @@ gnat_gimplify_stmt (tree *stmt_p) gnu_cond = build3 (COND_EXPR, void_type_node, gnu_cond, NULL_TREE, build1 (GOTO_EXPR, void_type_node, gnu_end_label)); + + TREE_USED (gnu_end_label) = 1; } /* Set to emit the statements of the loop. */ @@ -9541,8 +9547,9 @@ gnat_gimplify_stmt (tree *stmt_p) end label if there's a top condition, then the update if it's at the top, then the body of the loop, then a conditional jump to the end label if there's a bottom condition, then the update if - it's at the bottom, and finally a jump to the start label and the - definition of the end label. */ + it's at the bottom, and finally a jump to the start label and if + there's a top or bottom condition, the definition of the end + label. */ append_to_statement_list (build1 (LABEL_EXPR, void_type_node, gnu_start_label), stmt_p); @@ -9565,9 +9572,10 @@ gnat_gimplify_stmt (tree *stmt_p) SET_EXPR_LOCATION (t, DECL_SOURCE_LOCATION (gnu_end_label)); append_to_statement_list (t, stmt_p); - append_to_statement_list (build1 (LABEL_EXPR, void_type_node, - gnu_end_label), - stmt_p); + if (TREE_USED (gnu_end_label)) + append_to_statement_list (build1 (LABEL_EXPR, void_type_node, + gnu_end_label), + stmt_p); return GS_OK; } From patchwork Tue Jun 2 08:45:39 2026 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: 136286 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E18CD4BA2E0A for ; Tue, 2 Jun 2026 09:37:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E18CD4BA2E0A Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=QwRUlGSO X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by sourceware.org (Postfix) with ESMTPS id 7F2944BA2E26 for ; Tue, 2 Jun 2026 08:46:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7F2944BA2E26 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 7F2944BA2E26 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389998; cv=none; b=UZnb0OZEfhoY/xc5CmgbhNbiudY+PXcPCahEO2FQFZeK3Y+e1z5bfHc5iAR3kETx22FmMrbr12lc1QbwHE9zFePzkuUm4tszmRbCaW1BG//fDLYryy/ZkNmmVory8anFxwgiOfUoXzWIZxD+M4Qr4qerPlRuARzxPjIBYGqmMic= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389998; c=relaxed/simple; bh=OmfaVvN03cQuZ0j0pg1Mi8E7bOAeeTaEoj7E/3zUpsQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Il6n4MJa6Ms0ACwVHxvjR1Hmz1oZMmiFzxV6wY6z6wwCljSRXkrdY9CucH2anqJXnLN0AdztV8yfHtE6crGsFitMcpRqyOOmqiRpiFYQHykW+t/SfrXREoULEQPcE4SS3rc1e3BJ0ft6+C+6x7ffACBjKg7J5A3H2I0LhJFQCTM= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=QwRUlGSO DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7F2944BA2E26 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-49041e84237so90266065e9.1 for ; Tue, 02 Jun 2026 01:46:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389997; x=1780994797; 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=F9baYSiL2587/zQ/3QJYtYJLejWE/3MOOnAhU/A3+b8=; b=QwRUlGSOZxse4UPVo54aj24npkiOw3+IRPG0zp6+rfiNSw8T83YqAs2oIsUBVTKMXO sTvjEsBj61BpO6v01xX50WHLL8upP4SgRMAlvFZ7Y2QM8NU+NKt5OZtsNdRr/1HyzhFL 3rmZHpJ8D+iWZj7q88ltLXnI/RXyqNy9PLAMRJEZ9Al+LDghtstt5Csv+59BxSqUzga1 brXItzu2cLOz2l+YqIUPueDtNxy8mCYWcXFek2E1ZDsgm/p9tcswXh+ZVA1A5U+6ElCL LSUAT3LlndK4gGN8FpzKZrIaL7Eh49tYORUnCKWvJ5haeMdbBjPgqkwRSqXNt3z0a9jZ vvng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389997; x=1780994797; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=F9baYSiL2587/zQ/3QJYtYJLejWE/3MOOnAhU/A3+b8=; b=ds+fQkOPV5ILnQMmnOvAE24GENnwz+HwnyhLToSPK1DI4dApNnAw/20bjAanJG6pep 9zNlHhljohdwFAhmEVc1kTykezWtqo0qSAuPz4ilr6jRww7ntsdDl1MXAZbfRsUaVRjX 6vgOkQlV4Oh/PV8xnRIOyiP7HbMMIFOaypT2POGvhY91y3PHGIGrcREmtm9jh3L3yyUo HxbE0loMwC4YmyMb5Hr9baqXyB5UyC65Y50M5+80BPxS57Tpf7zfEdnVoAlhii/0H/M1 3DttRHNF3H8WBNdqk6MhtDB9PDoF4dBuNf1EjPo4Fm5hsZVnwsrgmaiW8E475TVKFg/+ Q/Vw== X-Gm-Message-State: AOJu0YyiBu4jpLY8QsqLmIyToj9KfvbGvicpVFBq4XoyQDawdI9H6kzI GAn6Gkhitt0sd5AQj9mba8RWmoJWpERSQ0TiLBpAGlIqO3yXrQ9IgLbN4j8aBXlI52OfeD7JKRC 6/Y4= X-Gm-Gg: Acq92OG7ceWO8ZKRhc8y7RzOGs94n1EjzNJom3a7xHeNq9lcO9aS8wGWu0XznpUUDeR 1xgLZ/lvZSiMsskjF7AfEeO+TqW28fHdE/tHOmKlTiY91iUcYi1obgAnYe5G/VIK9LyP9YeRzFm 8T9AJlQ1vBoBNSmwadlYt/r0Pu4DZjR2lbntV5GdjTPczGA8GY0ofcIprpydjoPU/D1iiU/t0a+ BDaFQSFets3831l9ZelNKL85RSdXbWZh3ZYj3MX/GtKNR/ojEnikf/cxZTASjBzBFxlhOOte1lB 97AkIU2iv0YIcNKEdZ6YLbq2FTI4UWf3ANJCr7/hoGAuNhcfGYx0cMhxixjXR7SgjMmcrGj2BP+ BR7XEgvjKrEYGoXaPbfZ9+K2oB7tFGgwVFDmdlKogStegERNcDKfKuA5U3wEBR49dV8b/2sp8nc mZoMn5Au5UVeHcW7Cus0jTJ82614bbi7YL12G74wDYzUufLwzlrPF6MwseHPktdaKJIpwh0bXxS ZmLc5egCfkaVHK5wvjTUd9CYN+F5M5io8umpYO1og== X-Received: by 2002:a05:600c:5254:b0:48f:e044:927d with SMTP id 5b1f17b1804b1-490b0e7caafmr44024055e9.10.1780389997485; Tue, 02 Jun 2026 01:46:37 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:37 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 51/51] ada: Reject misalignment of objects with address clause Date: Tue, 2 Jun 2026 10:45:39 +0200 Message-ID: <20260602084541.3829876-51-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Eric Botcazou Misaligned objects are meant to be rejected universally by the compiler. gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_entity) : Validate a known alignment on the object even if there is an address clause. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/decl.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc index 50a065d2dea..3a14f226f0e 100644 --- a/gcc/ada/gcc-interface/decl.cc +++ b/gcc/ada/gcc-interface/decl.cc @@ -814,12 +814,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) } /* If an alignment is specified, use it if valid. Note that exceptions - are objects but don't have an alignment and there is also no point in - setting it for an address clause, since the final type of the object - will be a reference type. */ - if (Known_Alignment (gnat_entity) - && kind != E_Exception - && No (Address_Clause (gnat_entity))) + are objects but don't have an alignment. */ + if (Known_Alignment (gnat_entity) && kind != E_Exception) align = validate_alignment (Alignment (gnat_entity), gnat_entity, TYPE_ALIGN (gnu_type));