[Ada] Fix incompatibility Default_Scalar_Storage_Order/tagged types
commit02fd37f505a164d921432503748a6f772a8f08c5
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 17 Jul 2018 08:11:43 +0000 (17 08:11 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Tue, 17 Jul 2018 08:11:43 +0000 (17 08:11 +0000)
tree6ca455c4333eead9f5aeb9e814a8747cb8e4ae24
parentc343f1dc19cd16e0fb995c2d3c27c13ab27e0a26
[Ada] Fix incompatibility Default_Scalar_Storage_Order/tagged types

The pragma Default_Scalar_Storage_Order cannot reliably be used to set the
non-default scalar storage order for a program that declares tagged types, if
it also declares user-defined primitives.

This is fixed by making Make_Tags use the same base array type as Make_DT and
Make_Secondary_DT when accessing the array of user-defined primitives.

2018-07-17  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* exp_disp.adb (Make_Tags): When the type has user-defined primitives,
build the access type that is later used by Build_Get_Prim_Op_Address
as pointing to a subtype of Ada.Tags.Address_Array.

gcc/testsuite/

* gnat.dg/sso10.adb, gnat.dg/sso10_pkg.ads: New testcase.

From-SVN: r262797
gcc/ada/ChangeLog
gcc/ada/exp_disp.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/sso10.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/sso10_pkg.ads [new file with mode: 0644]