aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/decl.cc
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2023-10-18 09:54:06 -0400
committerMarc Poulhiès <poulhies@adacore.com>2023-11-07 10:15:05 +0100
commit756e05d1565482e7b24f9cf51ffcfeced5a9d91c (patch)
tree59bfc98e0a372bd11abe8c7656451f92a507cf84 /gcc/ada/gcc-interface/decl.cc
parent09e5e68c07c8cf6e30af0f7553c2565bbbed49b4 (diff)
downloadgcc-756e05d1565482e7b24f9cf51ffcfeced5a9d91c.zip
gcc-756e05d1565482e7b24f9cf51ffcfeced5a9d91c.tar.gz
gcc-756e05d1565482e7b24f9cf51ffcfeced5a9d91c.tar.bz2
ada: Compiler crash on early alignment clause
This patch fixes a bug: if "for T'Alignment use..." is followed by "for T use (<enum rep>);" the compiler crashes. A workaround is to move the alignment clause after the enumeration rep clause. gcc/ada/ * sem_ch13.ads (Set_Enum_Esize): Do not set alignment. * sem_ch13.adb (Set_Enum_Esize): Do not set alignment. Archaeology seems to show that this line of code dates from when "Alignment = 0" meant "the Alignment is not known at compile time" and "the Alignment is not yet known at compile time" as well as "the Alignment is zero". In any case, it seems to be unnecessary, and in this case harmful, because gigi would crash. Alignment_Clause is set (because there is one), so gigi would query the Alignment, but Alignment was destroyed.
Diffstat (limited to 'gcc/ada/gcc-interface/decl.cc')
0 files changed, 0 insertions, 0 deletions