GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
ada

Ada now validates intrinsic subprograms declared with aspects

GCC's Ada front end now correctly validates intrinsic subprograms whether they are declared via pragmas or language aspects, preventing potential miscompilatio…

The Ada front end in GCC has been updated to consistently check intrinsic subprograms. Previously, checks were only applied to subprograms specified by source-based pragmas, overlooking those specified by Ada aspects. This change ensures that all intrinsic subprograms, regardless of their declaration method, undergo proper validation, leading to more robust code generation.

In Details

This commit addresses a type-checking gap in GCC's Ada front-end, specifically within sem_intr.adb where Check_Intrinsic_Subprogram resides. The issue was that internally-generated pragmas originating from aspect specifications were not recognized as requiring validation, unlike source-level pragmas. The fix involves enhancing the pragma recognition logic to treat internally-generated pragmas derived from aspects with the same scrutiny as explicitly declared source pragmas, ensuring complete type safety for intrinsic subprogram declarations.

For Context

Compilers like GCC translate human-readable code into machine instructions. For languages like Ada, developers can declare 'intrinsic subprograms,' which are special functions built directly into the compiler for performance or low-level access. These can be declared using 'pragmas' (compiler directives) or more modern 'aspects' (metadata attached to language constructs). This change fixes a bug where the compiler would only check the validity of these subprograms if they were declared with pragmas directly written in the source code. If they were declared using aspects, which internally generate equivalent pragmas, the compiler would miss some validation steps. This could lead to incorrect program behavior. The update ensures that all intrinsic subprograms are properly checked, making the compiled code more reliable.

Filed Under: adacompiler-frontendvalidation