[Ada] Fix bogus alignment warning on address clause

Eric Botcazou botcazou@adacore.com
Mon Sep 28 07:34:59 GMT 2020


This is a regression present on the mainline and 10 branch: the compiler gives 
a bogus alignment warning on an address clause and a discriminated record type 
with variable size.

Tested on x86_64-suse-linux, applied on the mainline and 10 branch.


2020-09-28  Eric Botcazou  <ebotcazou@adacore.com>

	* 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.


2020-09-28  Eric Botcazou  <ebotcazou@adacore.com>

	* gnat.dg/addr16.adb: New test.
	* gnat.dg/addr16_pkg.ads: New helper.

-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-patch
Size: 2768 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200928/d36a182d/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aggr16.adb
Type: text/x-adasrc
Size: 431 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200928/d36a182d/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aggr16_pkg.ads
Type: text/x-adasrc
Size: 433 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200928/d36a182d/attachment-0002.bin>


More information about the Gcc-patches mailing list