]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix incorrect handling of packed array with aliased composite components
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 30 May 2024 22:13:44 +0000 (00:13 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Fri, 21 Jun 2024 08:34:19 +0000 (10:34 +0200)
commit8c7ce88c00f9bea9fb6f7e466c8706439fb5b131
tree7105c8adf991a03825b88d73e29d720a058b52ba
parent9ce1b11e154a930de3ba20b9e26af5631a73c7f3
ada: Fix incorrect handling of packed array with aliased composite components

The problem is that the handling of the interaction between packing and
aliased/atomic/independent components of an array type is tied to that of
the interaction between a component clause and aliased/atomic/independent
components, although the semantics are different: packing is a best effort
thing, whereas a component clause must be honored or else an error be given.

This decouples the two handlings, but retrofits the separate processing of
independent components done in both cases into the common code and changes
the error message from "minimum allowed is" to "minimum allowed value is"
for the sake of consistency with the aliased/atomic processing.

gcc/ada/

* freeze.adb (Freeze_Array_Type): Decouple the handling of the
interaction between packing and aliased/atomic components from
that of the interaction between a component clause and aliased/
atomic components, and retrofit the processing of the interaction
between the two characteristics and independent components into
the common processing.

gcc/testsuite/ChangeLog:

* gnat.dg/atomic10.adb: Adjust.
gcc/ada/freeze.adb
gcc/testsuite/gnat.dg/atomic10.adb