GNAT Pro 25 Release Notes

We present here a few highlights of the new features in GNAT Pro 25. You can access the complete list in the GNAT Pro 25 feature file.

GCC back-end update

The GNAT Pro Ada, C and C++ has now been updated to GCC 13. See the GCC 13 changes for the corresponding capabilities as well as updates to C and C++.

Platforms

Platform status changes

Hosts

  • GNAT Pro now supports Linux ARM 64-bit native platforms

  • GNAT Pro for Ada for Windows native platforms now supports the LLVM back-end

Targets

  • GNAT Pro now supports bare-metal Morello platforms

  • GNAT Pro for Ada for ARM 64-bit cross linux platforms now supports the LLVM back-end

  • GNAT Pro for Ada for ARM 64-bit bare-metal platforms now supports the LLVM back-end

  • GNAT Pro for VxWorks 6 and 7 for PowerPC e500v2 are baselined

  • GNAT Pro for PowerPC 55xx and e500v2 bare-metal is baselined

Ada support

String interpolation

A new syntax allows variables or expressions to be used directly within string literals, such that the value of the variable or the expression is “interpolated” directly into the value of the enclosing string upon use at run-time.

Local declarations

Local variables or constants can now be declared at the place of any statement, not necessarily within a declarative part.

Support for target names in dimensionality analysis

Target names, introduced in Ada 2022 using the ‘@’ symbol, can now be used in conjunction with dimensionality analysis.

New External_Initialization extension

A new GNAT-specific extension has been added to the compiler to make it possible to embed binary resources stored in arbitrary files into executables.

New object attribute ‘Super

The compiler now recognizes a new attribute Super under the -gnatX0 switch (for experimental features), which can be applied to objects of tagged types in order to obtain a view conversion to the most immediate specific parent type. This can be useful for making nondispatching calls to a parent type’s primitive subprogram.

First_Controlling_Parameter aspect

A new pragma/aspect, First_Controlling_Parameter, has been added to the curated subset of language extensions for tagged types. This aspect modifies the semantics of controlling parameters. When a tagged type is marked with this aspect, only subprograms where the first parameter is of that type are treated as being dispatching primitives.

Symbolic backtraces

Support for symbolic backtraces with DLLs on Windows

Symbolic backtraces generated by means of the -Es binder switch now work in the presence of DLLs on Windows.

LLVM new capabilities

The llvm-gcc binary can now compile LLVM IR

LLVM IR in text or binary form (i.e., .ll or .bc files) can now be compiled with “llvm-gcc -c”.

Windows enhancements

Improved support for task priorities on Win32

The compiler now provides a more distributed mapping (covering a wider range) of task priorities on Win32 when pragma Task_Dispatching_Policy (FIFO_Within_Priorities) is not present. Additionally, documentation on the subject has been supplemented.

Libraries for VxWorks

Ada bindings to ARINC 653 P1-5 for Helix

GNAT for VxWorks7r2 Cert provides bindings to version 5 of ARINC 653 part 1, to be used with Helix Virtualization Platform.

GNATcoll-minimal for vx7r2 kernel modules

GNATcoll-minimal is now provided pre-compiled for vxWorks kernel modules. This allows use of the packages provided with GNATcoll-minimal without having to manually build GNATcoll-minimal for this target.

Optimizations

Elided temporary for aliased unconstrained array

The compiler no longer creates a temporary for the declaration of an aliased array with unconstrained nominal subtype that is initialized by a call to a function whose result subtype is also unconstrained.

Faster return for indefinite record with size clause

Functions whose result type is an indefinite record type, that is to say a discriminated record type with nondefaulted discriminants, no longer return on the secondary stack if the record type is declared with a size or object size clause that is accepted by the compiler.

Better Length attribute overflow-check elimination

The non-Strict overflow-checking code now does a better job of eliminating overflow checks when given an expression consisting only of predefined operators (including relationals), literals, identifiers, and conditional expressions. If it is both feasible and useful, the compiler rewrites a Length attribute reference as such an expression. “Feasible” means “the index type is the same type as the attribute reference type, so we can rewrite without using type conversions”. “Useful” means “Overflow_Mode is something other than Strict, so there is value in making overflow-check elimination easier”.

More compact debug information for packed fields

When fields of packed records were explicitly sized so as to use a biased representation, every such field would get a type of its own in debug information, in addition to the unpacked type. The redundancy has been eliminated, so that the fields share a single type.

Less duplication of Put_Image and Streaming routines

For untagged types, the implicitly declared subprograms needed to implement streaming attributes and the Ada-2022 Put_Image attribute were generated “on demand” prior to this enhancement, instead of when a given type is declared. This could result in code duplication when multiple functionally equivalent routines are generated. With this enhancement, we see more sharing (and consequently less duplication) of routines within the context of a single compilation unit.

Elimination of redundant validity checks

In some cases with validity checking enabled via the -gnatVa option, the compiler generated validity checks that can obviously never fail. These included validity checks for (some) static expressions, and consecutive identical checks generated for a single read of an object. Such redundant checks are no longer generated.

Improved size allocation for container aggregates

The initial capacity of containers that are initialized with container aggregates that iterate over a one-dimensional array object is now set to the size of the array instead of the default container capacity.

More efficient elaboration of local tagged types

The object code generated for the elaloration of tagged types that are not declared at library level is now more efficient.

Removal of global lock for controlled allocation

The implementation no longer uses a global lock during the dynamic allocation of controlled objects.

More efficient aggregates in conditional expressions

The object code generated for nonstatic aggregates that are dependent expressions of conditional expressions is now more efficient.

Stack usage for small dynamic string concatenations

The code generated by the compiler for small dynamic string concatenations now uses static stack allocation in more cases.

More efficient ordering operators for arrays of byte

The predefined ordering operators specified for discrete array types by RM 4.5.2(26/3) are now implemented more efficiently when their component type is a byte (unsigned), which is the case for type String.

Enhanced modulo reduction for nonbinary modular type

Modulo reduction for modular types whose modulus is not a power of two, both implicit or explicit by means of the ‘Mod attribute, is now implemented by an improved division-free algorithm at every optimization level except for -Os, and also without branches if the restriction No_Implicit_Conditionals is in effect.

Better support for packed types in Address Sanitizer

The support for Ada packed array types and packed record types has been improved in the Address Sanitizer, resulting in fewer false positives when it is enabled.

Improvement of memcpy generation

Calls to memcpy are no longer generated in the case where the target and destination addresses match.