[Ada] Improve code generated for dynamic discriminated aggregate
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 6 Mar 2020 20:58:39 +0000 (21:58 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 10 Jun 2020 13:34:59 +0000 (09:34 -0400)
commite67df677b4d7672f0e3d1055ec0443fafb3e9aee
tree9b66c029cbcbe88d7476b1cad31669dd831e01e4
parent3aeb5ebe953a78223ef7ac9abee9b7adb709b29f
[Ada] Improve code generated for dynamic discriminated aggregate

2020-06-10  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* exp_aggr.adb (In_Place_Assign_OK): Do not necessarily return
false for a type with discriminants.
(Convert_To_Assignments): Use Parent_Node and Parent_Kind more
consistently.  In the in-place assignment case, first apply a
discriminant check if need be, and be prepared for a rewritten
aggregate as a result.
gcc/ada/exp_aggr.adb