GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
ada

Ada: Partially dynamic accessibility checks for modern standards

Implements a partially dynamic model for Ada accessibility checks, addressing shortcomings of the static model in Ada 2012 and later.

This change introduces a partially dynamic small-integer model for Ada accessibility checks in GCC, moving beyond the previous static model. The static model, based on master construct nesting depth, struggled with Ada 2012 requirements like strict caller/called level ordering. The new model augments static nesting depth with dynamic levels passed to subprograms, offering better compliance while keeping runtime overhead minimal. Compile-time changes are localized to the Accessibility unit.

In Details

The GCC Ada front-end's Accessibility unit is significantly refactored to support a partially dynamic accessibility checking model, addressing limitations of the previous static model (based on Minimum_Accessibility) for Ada 2012 and later. This involves introducing new concepts like Dynamic_Accessibility_Level and Dynamic_Subprogram_Access_Level, and modifying Static_Accessibility_Level to accommodate runtime information. The changes aim to correctly enforce stricter ordering and flattening of access levels, with minimal impact on runtime parameter passing conventions.

For Context
Accessibility checks
In Ada, a compile-time and runtime mechanism to ensure that access types (pointers) do not outlive the objects they point to.
Static nesting depth
The depth of nested blocks or subprograms at compile time, used in the previous Ada accessibility model.
Dynamic levels
Accessibility levels that are determined at runtime, rather than being fixed at compile time.
Ada 2012
A revision of the Ada programming language standard, introducing new features and enhancements, including stricter rules for accessibility.
Filed Under: adacompilersemanticsaccessibilityada2012