]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Plug small loophole with pathological packed array type
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 Dec 2018 11:11:37 +0000 (11:11 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 Dec 2018 11:11:37 +0000 (11:11 +0000)
commit196aa9dd488e11c4b6076fed9e7820f88990eef6
tree6713d9d5083a4a32e5cd5b92ac41ba9f35f4019c
parent12202386a4e107817b3006fe29583087d6f9010a
[Ada] Plug small loophole with pathological packed array type

This fixes a crash in gigi on a pathological packed array type, whose
component type is a record type without representation clause or packing
but with a clause that bumps its size to a non-multiple value of the
storage unit.  In this case, the front-end fails to detect that calls
to the packing manpulation routines of the run time are necessary.

The fix doesn't change anything for non-pathological cases, i.e. when
the component type has a representation clause or is packed.

2018-12-11  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* exp_aggr.adb (Packed_Array_Aggregate_Handled): Bail out for
any non-scalar type as component type of the array.

gcc/testsuite/

* gnat.dg/packed_array.adb, gnat.dg/packed_array.ads,
gnat.dg/packed_array_pkg.ads: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@267006 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ada/ChangeLog
gcc/ada/exp_aggr.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/packed_array.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/packed_array.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/packed_array_pkg.ads [new file with mode: 0644]