Fix uniqueness of address for aliased objects
authorEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 8 May 2020 15:18:20 +0000 (17:18 +0200)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 8 May 2020 15:25:12 +0000 (17:25 +0200)
commite34495985e49545c468e664ee10bd0e66c7395bf
treeee654f813c85e07812e4b4564d5078fef176cc32
parentbb1ec4773a01e5bbb7cb6e2f53ea338a74a6797f
Fix uniqueness of address for aliased objects

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.

* 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.
gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/addr15.adb [new file with mode: 0644]