From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1914) id BAA3C398B879; Thu, 8 Jul 2021 13:36:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BAA3C398B879 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Pierre-Marie de Rodat To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-2144] [Ada] Make runtime code compatible with No_Dynamic_Accessibility_Checks X-Act-Checkin: gcc X-Git-Author: Arnaud Charlet X-Git-Refname: refs/heads/master X-Git-Oldrev: a2f91a52b4b989b52f0ccdabc2d9aead05c8056b X-Git-Newrev: c5b1e8e9a5808d612ad20fdf2f77c52cfa5907d3 Message-Id: <20210708133613.BAA3C398B879@sourceware.org> Date: Thu, 8 Jul 2021 13:36:13 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2021 13:36:13 -0000 https://gcc.gnu.org/g:c5b1e8e9a5808d612ad20fdf2f77c52cfa5907d3 commit r12-2144-gc5b1e8e9a5808d612ad20fdf2f77c52cfa5907d3 Author: Arnaud Charlet Date: Tue May 25 04:18:21 2021 -0400 [Ada] Make runtime code compatible with No_Dynamic_Accessibility_Checks gcc/ada/ * libgnat/a-cbdlli.adb, libgnat/a-cbhama.adb, libgnat/a-cbhase.adb, libgnat/a-cbmutr.adb, libgnat/a-cborma.adb, libgnat/a-cborse.adb, libgnat/a-cobove.adb, libgnat/a-textio.adb, libgnat/a-witeio.adb, libgnat/a-ztexio.adb: Make code compatible with No_Dynamic_Accessibility_Checks restriction. Diff: --- gcc/ada/libgnat/a-cbdlli.adb | 4 ++-- gcc/ada/libgnat/a-cbhama.adb | 8 ++++---- gcc/ada/libgnat/a-cbhase.adb | 4 ++-- gcc/ada/libgnat/a-cbmutr.adb | 4 ++-- gcc/ada/libgnat/a-cborma.adb | 8 ++++---- gcc/ada/libgnat/a-cborse.adb | 8 ++++---- gcc/ada/libgnat/a-cobove.adb | 8 ++++---- gcc/ada/libgnat/a-textio.adb | 13 ++++++------- gcc/ada/libgnat/a-witeio.adb | 13 ++++++------- gcc/ada/libgnat/a-ztexio.adb | 13 ++++++------- 10 files changed, 40 insertions(+), 43 deletions(-) diff --git a/gcc/ada/libgnat/a-cbdlli.adb b/gcc/ada/libgnat/a-cbdlli.adb index bb92bda9ebb..143805ef2b6 100644 --- a/gcc/ada/libgnat/a-cbdlli.adb +++ b/gcc/ada/libgnat/a-cbdlli.adb @@ -312,7 +312,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Constant_Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -1608,7 +1608,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); diff --git a/gcc/ada/libgnat/a-cbhama.adb b/gcc/ada/libgnat/a-cbhama.adb index 78a590f7586..26c01f57e65 100644 --- a/gcc/ada/libgnat/a-cbhama.adb +++ b/gcc/ada/libgnat/a-cbhama.adb @@ -213,7 +213,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Constant_Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -239,7 +239,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Constant_Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -1028,7 +1028,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -1053,7 +1053,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); diff --git a/gcc/ada/libgnat/a-cbhase.adb b/gcc/ada/libgnat/a-cbhase.adb index f8ca4d2720b..d6ab353b15d 100644 --- a/gcc/ada/libgnat/a-cbhase.adb +++ b/gcc/ada/libgnat/a-cbhase.adb @@ -232,7 +232,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Constant_Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -1643,7 +1643,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Constant_Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); diff --git a/gcc/ada/libgnat/a-cbmutr.adb b/gcc/ada/libgnat/a-cbmutr.adb index 714dea1a3ee..e80eb5cdc0f 100644 --- a/gcc/ada/libgnat/a-cbmutr.adb +++ b/gcc/ada/libgnat/a-cbmutr.adb @@ -600,7 +600,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Constant_Reference_Type := - (Element => Container.Elements (Position.Node)'Access, + (Element => Container.Elements (Position.Node)'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -2533,7 +2533,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Reference_Type := - (Element => Container.Elements (Position.Node)'Access, + (Element => Container.Elements (Position.Node)'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); diff --git a/gcc/ada/libgnat/a-cborma.adb b/gcc/ada/libgnat/a-cborma.adb index 67e610847b2..f26a1e38f6e 100644 --- a/gcc/ada/libgnat/a-cborma.adb +++ b/gcc/ada/libgnat/a-cborma.adb @@ -420,7 +420,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Constant_Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -445,7 +445,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Constant_Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -1417,7 +1417,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -1442,7 +1442,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); diff --git a/gcc/ada/libgnat/a-cborse.adb b/gcc/ada/libgnat/a-cborse.adb index 0b9e0cc6b9a..5c9a86e2e72 100644 --- a/gcc/ada/libgnat/a-cborse.adb +++ b/gcc/ada/libgnat/a-cborse.adb @@ -420,7 +420,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Constant_Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -752,7 +752,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Constant_Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -943,7 +943,7 @@ is N : Node_Type renames Container.Nodes (Position.Node); begin return R : constant Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with Container.TC'Unrestricted_Access, @@ -971,7 +971,7 @@ is N : Node_Type renames Container.Nodes (Node); begin return R : constant Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with Container.TC'Unrestricted_Access, diff --git a/gcc/ada/libgnat/a-cobove.adb b/gcc/ada/libgnat/a-cobove.adb index f32afa1a54b..e56cb94610e 100644 --- a/gcc/ada/libgnat/a-cobove.adb +++ b/gcc/ada/libgnat/a-cobove.adb @@ -415,7 +415,7 @@ package body Ada.Containers.Bounded_Vectors is Container.TC'Unrestricted_Access; begin return R : constant Constant_Reference_Type := - (Element => A (J)'Access, + (Element => A (J)'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -439,7 +439,7 @@ package body Ada.Containers.Bounded_Vectors is Container.TC'Unrestricted_Access; begin return R : constant Constant_Reference_Type := - (Element => A (J)'Access, + (Element => A (J)'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -2238,7 +2238,7 @@ package body Ada.Containers.Bounded_Vectors is Container.TC'Unrestricted_Access; begin return R : constant Reference_Type := - (Element => A (J)'Access, + (Element => A (J)'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -2262,7 +2262,7 @@ package body Ada.Containers.Bounded_Vectors is Container.TC'Unrestricted_Access; begin return R : constant Reference_Type := - (Element => A (J)'Access, + (Element => A (J)'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); diff --git a/gcc/ada/libgnat/a-textio.adb b/gcc/ada/libgnat/a-textio.adb index dc670919710..717f529a7bb 100644 --- a/gcc/ada/libgnat/a-textio.adb +++ b/gcc/ada/libgnat/a-textio.adb @@ -171,15 +171,15 @@ is -- is required (RM A.10.3(23)) but it seems reasonable, and besides -- ACVC test CE3208A expects this behavior. - if File_Type (File) = Current_In then + if File = Current_In then Current_In := null; - elsif File_Type (File) = Current_Out then + elsif File = Current_Out then Current_Out := null; - elsif File_Type (File) = Current_Err then + elsif File = Current_Err then Current_Err := null; end if; - Terminate_Line (File_Type (File)); + Terminate_Line (File.all'Access); end AFCB_Close; --------------- @@ -187,10 +187,9 @@ is --------------- procedure AFCB_Free (File : not null access Text_AFCB) is - type FCB_Ptr is access all Text_AFCB; - FT : FCB_Ptr := FCB_Ptr (File); + FT : File_Type := File.all'Access; - procedure Free is new Ada.Unchecked_Deallocation (Text_AFCB, FCB_Ptr); + procedure Free is new Ada.Unchecked_Deallocation (Text_AFCB, File_Type); begin Free (FT); diff --git a/gcc/ada/libgnat/a-witeio.adb b/gcc/ada/libgnat/a-witeio.adb index dbd3fc8ed19..7dbd3b3ebc5 100644 --- a/gcc/ada/libgnat/a-witeio.adb +++ b/gcc/ada/libgnat/a-witeio.adb @@ -136,15 +136,15 @@ package body Ada.Wide_Text_IO is -- is required (RM A.10.3(23)) but it seems reasonable, and besides -- ACVC test CE3208A expects this behavior. - if File_Type (File) = Current_In then + if File = Current_In then Current_In := null; - elsif File_Type (File) = Current_Out then + elsif File = Current_Out then Current_Out := null; - elsif File_Type (File) = Current_Err then + elsif File = Current_Err then Current_Err := null; end if; - Terminate_Line (File_Type (File)); + Terminate_Line (File.all'Access); end AFCB_Close; --------------- @@ -152,11 +152,10 @@ package body Ada.Wide_Text_IO is --------------- procedure AFCB_Free (File : not null access Wide_Text_AFCB) is - type FCB_Ptr is access all Wide_Text_AFCB; - FT : FCB_Ptr := FCB_Ptr (File); + FT : File_Type := File.all'Access; procedure Free is - new Ada.Unchecked_Deallocation (Wide_Text_AFCB, FCB_Ptr); + new Ada.Unchecked_Deallocation (Wide_Text_AFCB, File_Type); begin Free (FT); diff --git a/gcc/ada/libgnat/a-ztexio.adb b/gcc/ada/libgnat/a-ztexio.adb index 0dfabd59c73..71d733ed538 100644 --- a/gcc/ada/libgnat/a-ztexio.adb +++ b/gcc/ada/libgnat/a-ztexio.adb @@ -136,15 +136,15 @@ package body Ada.Wide_Wide_Text_IO is -- is required (RM A.10.3(23)) but it seems reasonable, and besides -- ACVC test CE3208A expects this behavior. - if File_Type (File) = Current_In then + if File = Current_In then Current_In := null; - elsif File_Type (File) = Current_Out then + elsif File = Current_Out then Current_Out := null; - elsif File_Type (File) = Current_Err then + elsif File = Current_Err then Current_Err := null; end if; - Terminate_Line (File_Type (File)); + Terminate_Line (File.all'Access); end AFCB_Close; --------------- @@ -152,11 +152,10 @@ package body Ada.Wide_Wide_Text_IO is --------------- procedure AFCB_Free (File : not null access Wide_Wide_Text_AFCB) is - type FCB_Ptr is access all Wide_Wide_Text_AFCB; - FT : FCB_Ptr := FCB_Ptr (File); + FT : File_Type := File.all'Access; procedure Free is new - Ada.Unchecked_Deallocation (Wide_Wide_Text_AFCB, FCB_Ptr); + Ada.Unchecked_Deallocation (Wide_Wide_Text_AFCB, File_Type); begin Free (FT);