]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Fix incompatibility Default_Scalar_Storage_Order/tagged types
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 Jul 2018 08:11:43 +0000 (08:11 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 Jul 2018 08:11:43 +0000 (08:11 +0000)
commit1d97d249a9d2aae9f9990fe355d72dfec08200f9
tree6ca455c4333eead9f5aeb9e814a8747cb8e4ae24
parent499812b50faeae0b71173c2b4a0104f8cf1b5b1d
[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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@262797 138bc75d-0d04-0410-961f-82ee72b054a4
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]