Fix bogus alignment warning on address clause
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 28 Sep 2020 07:00:46 +0000 (09:00 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Mon, 28 Sep 2020 07:32:27 +0000 (09:32 +0200)
commit88795e14ae7143bd8039af68d2d876ae34568799
treef4d3f7ff26499adab0ec12d3f1330f864ac2d704
parentdabef758bfe23d847cb1e2de2d0c0a67a53dc56a
Fix bogus alignment warning on address clause

The compiler gives a bogus alignment warning on an address clause and
a discriminated record type with variable size.

gcc/ada/ChangeLog:
* gcc-interface/decl.c (maybe_saturate_size): Add ALIGN parameter
and round down the result to ALIGN.
(gnat_to_gnu_entity): Adjust calls to maybe_saturate_size.

gcc/testsuite/ChangeLog:
* gnat.dg/addr16.adb: New test.
* gnat.dg/addr16_pkg.ads: New helper.
gcc/ada/gcc-interface/decl.c
gcc/testsuite/gnat.dg/addr16.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/addr16_pkg.ads [new file with mode: 0644]