]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Incorrect expansion of VADS Size attribute applied to an array type
authorGary Dismukes <dismukes@adacore.com>
Fri, 5 Sep 2025 20:58:54 +0000 (20:58 +0000)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 19 Sep 2025 09:26:09 +0000 (11:26 +0200)
commitb0f15d09da63effeb92d3d59f39bfab3c664bcaf
treec5b3074db8497e431b63e1fd10117b899fa9c51d
parentacfd5ab079f34caeda595e30ed1a1356ca2e2bd8
ada: Incorrect expansion of VADS Size attribute applied to an array type

The compiler fails, either with an Assert_Failure (for a compiler with
assertions enabled) or by producing a bad value, when processing a VADS_Size
attribute (or a Size attribute when pragma Use_VADS_Size is in force),
in the case where the prefix denotes a composite type or subtype whose
object size (Esise) is not known by the front end. The bug is due to
Eval_Attribute attempting to fold a VADS-related size attribute even
when Esize is not yet known for the type.

gcc/ada/ChangeLog:

* sem_attr.adb (Eval_Attribute): In the case of a VADS-specific
size attribute, only fold to the object size when the Esize field
is known.
gcc/ada/sem_attr.adb