This patch implements an experimental restriction No_Dynamic_Accessibility_Checks which presents the two alternative accessibility models.
Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * checks.adb (Accessibility_Checks_Suppressed): Add check against restriction No_Dynamic_Accessibility_Checks. (Apply_Accessibility_Check): Add assertion to check restriction No_Dynamic_Accessibility_Checks is not active. * debug.adb: Add documentation for new debugging switch to control which accessibility model gets employed under restriction No_Dynamic_Accessibility_Checks. * exp_attr.adb (Expand_N_Attribute_Reference): Disable dynamic accessibility check generation when No_Dynamic_Accessibility_Checks is active. * exp_ch4.adb (Apply_Accessibility_Check): Skip check generation when restriction No_Dynamic_Accessibility_Checks is active. (Expand_N_Allocator): Disable dynamic accessibility checks when No_Dynamic_Accessibility_Checks is active. (Expand_N_In): Disable dynamic accessibility checks when No_Dynamic_Accessibility_Checks is active. (Expand_N_Type_Conversion): Disable dynamic accessibility checks when No_Dynamic_Accessibility_Checks is active. * exp_ch5.adb (Expand_N_Assignment_Statement): Disable alternative accessibility model calculations when computing a dynamic level for a SAOAAT. * exp_ch6.adb (Add_Call_By_Copy_Code): Disable dynamic accessibility check generation when No_Dynamic_Accessibility_Checks is active. (Expand_Branch): Disable alternative accessibility model calculations. (Expand_Call_Helper): Disable alternative accessibility model calculations. * restrict.adb, restrict.ads: Add new restriction No_Dynamic_Accessibility_Checks. (No_Dynamic_Accessibility_Checks_Enabled): Created to test when experimental features (which are generally incompatible with standard Ada) can be enabled. * sem_attr.adb (Safe_Value_Conversions): Add handling of new accessibility model under the restriction No_Dynamic_Accessibility_Checks. * sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings): Disallow new restriction No_Dynamic_Accessibility_Checks from being exclusively specified within a body or subunit without being present in a specification. * sem_res.adb (Check_Fully_Declared_Prefix): Minor comment fixup. (Valid_Conversion): Omit implicit conversion checks on anonymous access types and perform static checking instead when No_Dynamic_Accessibility_Checks is active. * sem_util.adb, sem_util.ads (Accessibility_Level): Add special handling of anonymous access objects, formal parameters, anonymous access components, and function return objects. (Deepest_Type_Access_Level): When No_Dynamic_Accessibility_Checks is active employ an alternative model. Add paramter Allow_Alt_Model to override the new behavior in certain cases. (Type_Access_Level): When No_Dynamic_Accessibility_Checks is active employ an alternative model. Add parameter Allow_Alt_Model to override the new behavior in certain cases. (Typ_Access_Level): Created within Accessibility_Level for convenience. * libgnat/s-rident.ads, snames.ads-tmpl: Add handing for No_Dynamic_Accessibility_Checks.
patch.diff.gz
Description: application/gzip