ada: Simplify expansion of packed array assignments
commitdedaaa81cc7c518404080505e9b74aa0919c7587
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 3 Oct 2023 17:04:16 +0000 (3 19:04 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 7 Nov 2023 09:15:02 +0000 (7 10:15 +0100)
tree90b34869f69ce1c4e5a789fc1427a2f36c33456d
parent7385cd358d3b054c1babb3f9af3c6995716d9e4b
ada: Simplify expansion of packed array assignments

When expanding assignment to a packed array object, e.g. a formal
parameter with mode OUT that might have unconstrained type, we took the
component type and component size from the constrained actual subtype.
It is simpler to take these properties from the nominal type of the
assigned object.

Semantics is unaffected, because constraining the array doesn't change
the type or size of the array components.

gcc/ada/

* exp_pakd.adb (Expand_Bit_Packed_Element_Set): Change Ctyp and Csiz
from variables to constants and compute them using the nominal type
of the assigned array object.
gcc/ada/exp_pakd.adb