[Ada] Fix uniqueness of address for aliased objects
Eric Botcazou
botcazou@adacore.com
Fri May 8 15:20:07 GMT 2020
Two aliased objects must have distinct addresses, even if they have size zero,
so we make sure to allocate at least one byte for them.
Tested on x86-64/Linux, applied on the mainline.
2020-05-08 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Force at
least the unit size for an aliased object of a constrained nominal
subtype whose size is variable.
2020-05-08 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/addr15.adb: New test.
--
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-patch
Size: 1225 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200508/516b1e1d/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: addr15.adb
Type: text/x-adasrc
Size: 387 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200508/516b1e1d/attachment-0001.bin>
More information about the Gcc-patches
mailing list