# GCC 13.1 Released

**URL:** https://forum.ada-lang.io/t/gcc-13-1-released/374
**Category:** Releases
**Created:** [April 26, 2023, 11:20pm UTC](https://forum.ada-lang.io/t/gcc-13-1-released/374 "2023-04-26T23:20:38Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![JeremyGrosser](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/jeremygrosser/32/3_2.png) [@JeremyGrosser](https://forum.ada-lang.io/u/JeremyGrosser)
#### Post date: [April 26, 2023, 11:20pm UTC](https://forum.ada-lang.io/t/gcc-13-1-released/374/1 "2023-04-26T23:20:38Z")

</div>

[https://gcc.gnu.org/pipermail/gcc-announce/2023/000175.html](https://gcc.gnu.org/pipermail/gcc-announce/2023/000175.html)  
[https://gcc.gnu.org/gcc-13/changes.html](https://gcc.gnu.org/gcc-13/changes.html)

Ada specific changes:

- Traceback support added in RTEMS for the PPC ELF and ARM architectures.
- Support for versions older than VxWorks 7 has been removed.
- General improvements to the contracts in the standard libraries.
- Addition of GNAT.Binary\_Search.
- Further additions and fixes for the Ada 2022 specification.
- The Pragma SPARK\_Mode=\>Auto is now accepted. Contract analysis has been further improved.
- Documentation improvements

---

<div class="post-metadata">

### Author: ![simonjwright](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/simonjwright/32/11_2.png) [@simonjwright](https://forum.ada-lang.io/u/simonjwright)
#### Post date: [April 27, 2023, 3:17pm UTC](https://forum.ada-lang.io/t/gcc-13-1-released/374/2 "2023-04-27T15:17:03Z")

</div>

macOS release for [gcc-13.1.0-x86\_84-apple-darwin](https://github.com/simonjwright/distributing-gcc/releases/tag/gcc-13.1.0-x86_64): NB, this is for Monterey or later, will also run on Apple silicon.

---

<div class="post-metadata">

### Author: ![Max](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/max/32/21_2.png) [@Max](https://forum.ada-lang.io/u/Max)
#### Post date: [April 29, 2023, 7:20pm UTC](https://forum.ada-lang.io/t/gcc-13-1-released/374/3 "2023-04-29T19:20:35Z")

</div>

The official ChangeLog is quite brief. I’d like to share my findings on what’s new in this version. Comparing the documentation with the previous version, I have found the following new features.

In the [GNAT User’s Guide](https://gcc.gnu.org/onlinedocs/gnat_ugn/index.html) chapter **Building Executable Programs with GNAT** , new compiler options have been added:

- `-gnatX0` [Enable all GNAT implementation extensions and latest Ada version](https://gcc.gnu.org/onlinedocs/gnat_ugn/Compiling-Different-Versions-of-Ada.html).
- `-gnatw_q` [Activate warnings for ignored equality operators](https://gcc.gnu.org/onlinedocs/gnat_ugn/Warning-Message-Control.html).

In the chapter **GNAT and Program Execution** , it is mentioned that Position-Independent Executables (PIE) are now enabled by default, which means that `addr2line` no longer works out of the box. Instead, it is recommended to use `gnatsymbolize --load` and it is shown how to determine the current code load address.

The Reference Manual specifies a new restriction, [No\_Local\_Tagged\_Types](https://gcc.gnu.org/onlinedocs/gnat_rm/No_005fLocal_005fTagged_005fTypes.html). In the chapter **The GNAT Library** , new packages [GNAT.Binary\_Search](https://gcc.gnu.org/onlinedocs/gnat_rm/GNAT-Binary_005fSearch-g-binsea-ads.html) and [GNAT.Generic\_Fast\_Math\_Functions](https://gcc.gnu.org/onlinedocs/gnat_rm/GNAT-Generic_005fFast_005fMath_005fFunctions-g-gfmafu-ads.html) (this should use SIMD when possible) have been added. The chapter **Security Hardening Features** has been clarified and supplemented with two sections, [Hardened Booleans](https://gcc.gnu.org/onlinedocs/gnat_rm/Hardened-Booleans.html) and [Control Flow Redundancy](https://gcc.gnu.org/onlinedocs/gnat_rm/Control-Flow-Redundancy.html).

Unfortunately, the new experimental language extensions have not been included in the documentation. [String interpolation](https://docs.adacore.com/live/wave/gnat_rm/html/gnat_rm/gnat_rm/gnat_language_extensions.html#string-interpolation) has been implemented and described on the AdaCore website. This probably also applies to [Pragma Storage\_Model](https://docs.adacore.com/live/wave/gnat_rm/html/gnat_rm/gnat_rm/gnat_language_extensions.html#pragma-storage-model) and [Simpler accessibility model](https://docs.adacore.com/live/wave/gnat_rm/html/gnat_rm/gnat_rm/gnat_language_extensions.html#simpler-accessibility-model), but I have not checked. The attribute `'Reduce` no longer applies to implementation-defined extensions. Although the use of square brackets is allowed in Ada 2022 for array and container aggregates, it is listed in the documentation as a language extension (requires practical testing, probably just documentation bug).

Looking at the ChangeLog, a lot of changes have been made to support CUDA. For example, [`gnat_cuda.ads`](https://github.com/gcc-mirror/gcc/blob/83c78cb0d78fffa8791f64ba36146d17c00c1b23/gcc/ada/gnat_cuda.ads) has been added.

Regarding the improvement of Ada 2022 support, I only found two cases. The [`'Index` attribute](http://www.ada-auth.org/standards/22rm/html/RM-6-1-1.html) has been implemented for use in the preconditions and postconditions of input families. Containers have received [versions of cursor operations](http://www.ada-auth.org/standards/22rm/html/RM-A-18-8.html) where the first argument is the container object. These include `Has_Element`, `Element`, `Next`, and so on, i.e. we can write `My_Set.Has_Element (Cursor)`.

If you find something interesting, please share!

---

<div class="post-metadata">

### Author: ![leo-brewin](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/leo-brewin/32/175_2.png) [@leo-brewin](https://forum.ada-lang.io/u/leo-brewin)
#### Post date: [April 30, 2023, 12:42am UTC](https://forum.ada-lang.io/t/gcc-13-1-released/374/4 "2023-04-30T00:42:50Z")

</div>

The new [String interpolation](https://docs.adacore.com/live/wave/gnat_rm/html/gnat_rm/gnat_rm/gnat_language_extensions.html#string-interpolation) documentation from AdaCore has this simple code snippet.

```ada
procedure Test_Interpolation is
   X : Integer := 12;
   Y : Integer := 15;
   Name : String := "Leo";
begin
   Put_Line (f"The name is {Name} and the sum is {X + Y}.");
end Test_Interpolation;

```

I’m intrigued by the `f"..."` string inside the call to `Put_Line`. Can anybody please point me the documentation for these formatted strings?

Many thanks,  
Leo

---

<div class="post-metadata">

### Author: ![Max](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/max/32/21_2.png) [@Max](https://forum.ada-lang.io/u/Max)
#### Post date: [April 30, 2023, 8:26am UTC](https://forum.ada-lang.io/t/gcc-13-1-released/374/5 "2023-04-30T08:26:19Z")

</div>

If you scroll to the end of section you will find the link to RFC:

> Here is a link to the original RFC : [ada-spark-rfcs/prototyped/rfc-string-interpolation.rst at d652f0fad28fdbc68bb9281f7fa9e996aa2658be · AdaCore/ada-spark-rfcs · GitHub](https://github.com/AdaCore/ada-spark-rfcs/blob/d652f0fad28fdbc68bb9281f7fa9e996aa2658be/prototyped/rfc-string-interpolation.rst)

---

<div class="post-metadata">

### Author: ![leo-brewin](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/leo-brewin/32/175_2.png) [@leo-brewin](https://forum.ada-lang.io/u/leo-brewin)
#### Post date: [April 30, 2023, 8:40am UTC](https://forum.ada-lang.io/t/gcc-13-1-released/374/6 "2023-04-30T08:40:46Z")

</div>

Hi Max,  
Many thanks for the quick reply. That answers my question.  
Cheers,  
Leo

---

<div class="post-metadata">

### Author: ![Irvise](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/i/7ba0ec/32.png) [@Irvise](https://forum.ada-lang.io/u/Irvise)
#### Post date: [May 7, 2023, 7:14pm UTC](https://forum.ada-lang.io/t/gcc-13-1-released/374/7 "2023-05-07T19:14:03Z")

</div>

Hi Max, thank you for your comments.

I wrote the changelog by reading the Changelog files within the src tree of GCC, which lists all the changes that took place by the developers.

I did read the CUDA changes (actually, they have been taken place for a long while, including GCC 12). However, I was told that it was not in a working state (in GCC 12), so I did not want to mention it back then. There was no indication that it was working in GCC 13, that is why I also did not mention it.

What method did you use to detect the changes in GCC 13? Did you `git log` the documentation? I also read the mention of those changes, but I did not take a look at the actual text. My current method of reading for hours the Changelog messages is rather painful and innefficient. If you have a better way, I would like to know!

Once again, thank you for the extra bits!

---

<div class="post-metadata">

### Author: ![Max](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/max/32/21_2.png) [@Max](https://forum.ada-lang.io/u/Max)
#### Post date: [May 8, 2023, 9:53am UTC](https://forum.ada-lang.io/t/gcc-13-1-released/374/8 "2023-05-08T09:53:29Z")

</div>

@Irvise thank you for this work. I started with reading ChangeLog also and I agree that this is tedious and innefficient ☹ So I decided, that if I find difference in the documentation then it could help. I cloned GCC git repository, copied ada/doc folder from GCC 12 and compare it with GCC 13. But the documentation doesn’t look precise. For instance PIE isn’t activated by default in my GCC 13 build.

I tried to run `git log -S "Ada 2022"` to look for Ada 2022 improvements, then make examples with found features to verify that GCC 12 doesn’t understand them.

Another direction is the custom GNAT extensions list. I looked through [RFC repository](https://github.com/AdaCore/ada-spark-rfcs/) and latest [GNAT documentation snapshot](https://docs.adacore.com/live/wave/gnat_rm/html/gnat_rm/gnat_rm/gnat_language_extensions.html) to see what could be implemented. It appears that [local-vars-without-block](https://github.com/AdaCore/ada-spark-rfcs/blob/d652f0fad28fdbc68bb9281f7fa9e996aa2658be/considered/rfc-local-vars-without-block.md) works in GCC 13 (and not in GCC 12). On the other side, Storage\_Model worked in GCC 12 already.

Probably, we could compare standard Ada library unit specifications between GCC 12 and GCC 13. I got tired and left.

I’ve made a video of my findings on [YouTube](https://youtu.be/7lnITudAfX8).

---

<div class="post-metadata">

### Author: ![Max](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/max/32/21_2.png) [@Max](https://forum.ada-lang.io/u/Max)
#### Post date: [May 9, 2023, 10:01am UTC](https://forum.ada-lang.io/t/gcc-13-1-released/374/9 "2023-05-09T10:01:50Z")

</div>

If you want to use GCC 13.1 in the Linux Alire environment then you can try my [custom Alire index](https://github.com/reznikmm/als-alire-index/). Just run:

```ada
git clone https://github.com/reznikmm/als-alire-index.git
alr index --reset-community
alr index --add file://$PWD/als-alire-index --name als
alr toolchain --select gnat_native=13.1.1

```

And you are done!

If you need it for Aarch64 (Linux) use [this repository](https://github.com/reznikmm/aarch64-alire-index) instead.

---

<div class="post-metadata">

### Author: ![mosteo](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/mosteo/32/8_2.png) [@mosteo](https://forum.ada-lang.io/u/mosteo)
#### Post date: [May 9, 2023, 12:16pm UTC](https://forum.ada-lang.io/t/gcc-13-1-released/374/10 "2023-05-09T12:16:27Z")

</div>

Or just

```ada
alr index --add git+https://github.com/reznikmm/als-alire-index --name als

```

without the need to clone by hand.
