diff options
author | Steve Baird <baird@adacore.com> | 2024-03-18 14:35:33 -0700 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2024-05-20 09:47:03 +0200 |
commit | caaf20e2678117861a7a4d1da712be91a94596b1 (patch) | |
tree | 0494f6647de1f4d340511fcc75c2aa0a480d9de3 /gcc/ada/fe.h | |
parent | eef3025547ce55cbf6a9018b495ef5c9a562047a (diff) | |
download | gcc-caaf20e2678117861a7a4d1da712be91a94596b1.zip gcc-caaf20e2678117861a7a4d1da712be91a94596b1.tar.gz gcc-caaf20e2678117861a7a4d1da712be91a94596b1.tar.bz2 |
ada: Reject too-strict alignment specifications.
For a discrete (or fixed-point) type T, GNAT requires that T'Object_Size
shall be a multiple of T'Alignment * 8 .
GNAT also requires that T'Object_Size shall be no larger than
Standard'Max_Integer_Size.
For a sufficiently-large alignment specification, these requirements can
conflict.
The conflict is resolved by rejecting such alignment specifications (which
were previously accepted in some cases).
gcc/ada/
* freeze.adb (Adjust_Esize_For_Alignment): Assert that a valid
Alignment specification cannot result in adjusting the given
type's Esize to be larger than System_Max_Integer_Size.
* sem_ch13.adb (Analyze_Attribute_Definition_Clause): In analyzing
an Alignment specification, enforce the rule that a specified
Alignment value for a discrete or fixed-point type shall not be
larger than System_Max_Integer_Size / 8 .
gcc/testsuite/ChangeLog:
* gnat.dg/specs/alignment2.ads: Adjust.
* gnat.dg/specs/alignment2_bis.ads: New test.
Diffstat (limited to 'gcc/ada/fe.h')
0 files changed, 0 insertions, 0 deletions