[Ada] Fix bogus error on array with overaligned scalar component
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 3 Jul 2019 08:14:15 +0000 (08:14 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 3 Jul 2019 08:14:15 +0000 (08:14 +0000)
commit09c9ed5bb8b8e3b65dd2f631bf18f6b796499fbd
treea0f13786145129994116d8620769483ced1276dc
parent6cbd53c2277e5013d83fe73d5e73844066b651a7
[Ada] Fix bogus error on array with overaligned scalar component

The compiler would wrongly reject an alignment clause larger than 8 on
the component type of an array of scalars, which is valid albeit
pathological.

2019-07-03  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* layout.adb (Layout_Type): Do not set the component size of an
array with a scalar component if the component type is
overaligned.

gcc/testsuite/

* gnat.dg/alignment14.adb: New testcase.

From-SVN: r272968
gcc/ada/ChangeLog
gcc/ada/layout.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/alignment14.adb [new file with mode: 0644]