From: Arnaud Charlet Date: Tue, 25 May 2021 08:18:21 +0000 (-0400) Subject: [Ada] Make runtime code compatible with No_Dynamic_Accessibility_Checks X-Git-Tag: basepoints/gcc-13~6169 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5b1e8e9a5808d612ad20fdf2f77c52cfa5907d3;p=thirdparty%2Fgcc.git [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 --git a/gcc/ada/libgnat/a-cbdlli.adb b/gcc/ada/libgnat/a-cbdlli.adb index bb92bda9ebbf..143805ef2b66 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 78a590f7586a..26c01f57e651 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 f8ca4d2720bc..d6ab353b15d7 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 714dea1a3ee9..e80eb5cdc0f2 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 67e610847b2c..f26a1e38f6ef 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 0b9e0cc6b9a8..5c9a86e2e72f 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 f32afa1a54bf..e56cb94610e1 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 dc6709197102..717f529a7bb5 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 dbd3fc8ed191..7dbd3b3ebc5f 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 0dfabd59c734..71d733ed538a 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);