ada: Fix wrong optimization of extended return for discriminated record type
commitb96446e0d0afd0d817f6206efabb1deed4e1ed8e
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 7 Sep 2023 14:44:36 +0000 (7 16:44 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Fri, 15 Sep 2023 13:01:30 +0000 (15 15:01 +0200)
tree2c53d5b90f46d27c89f28f235713f5e6a67f23b0
parent2578936b341585230d8554bb9c822c3d6f46f6ad
ada: Fix wrong optimization of extended return for discriminated record type

This happens when the discriminants of the record type have default values.

gcc/ada/ChangeLog:

* inline.adb (Expand_Inlined_Call): In the case of a function call
that returns an unconstrained type and initializes an object, set
the No_Initialization flag on the new declaration of the object.
gcc/ada/inline.adb