ada: Avoid extra conversion in expansion of packed array assignments
commitaeca5b9554d816a8ef8afd0f6cd99250a0a67979
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 3 Oct 2023 19:33:32 +0000 (3 21:33 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 7 Nov 2023 09:15:02 +0000 (7 10:15 +0100)
treedf41e49296cda29b27472ff11b18132ab3e14e87
parent9eb5deb42b1dffe030d447913191a615bba90284
ada: Avoid extra conversion in expansion of packed array assignments

Expansion of assignments to packed array objects with string literals on
the right-hand side, created an unnecessary conversion, i.e.:

  ... :=
    component_type
      (declare
         temp : component_type := "string_literal";
       begin
         temp)

Now the expansion omits the outer type conversion.

Cleanup; behavior is unaffected.

gcc/ada/

* exp_pakd.adb (Expand_Bit_Packed_Element_Set): Simplify handling of
assignments with string literals.
gcc/ada/exp_pakd.adb