aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2022-06-11 13:05:39 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2022-07-06 13:29:48 +0000
commitbaa3015d8efebd731701d6985bb7a7083db244a8 (patch)
tree2b0106fa74f3849d43088aacaefda7fdc5ce1699 /gcc/ada/gcc-interface
parent56311a3c9f207c83a08f964e65687b2ba302799e (diff)
downloadgcc-baa3015d8efebd731701d6985bb7a7083db244a8.zip
gcc-baa3015d8efebd731701d6985bb7a7083db244a8.tar.gz
gcc-baa3015d8efebd731701d6985bb7a7083db244a8.tar.bz2
[Ada] Fix incorrect itype sharing for case expression in limited type return
The compiler aborts with an internal error in gigi, but the problem is an itype incorrectly shared between several branches of an if_statement that has been created for a Build-In-Place return. Three branches of this if_statement contain an allocator statement and the latter two have been obtained as the result of calling New_Copy_Tree on the first; now the initialization expression of the first had also been obtained as the result of calling New_Copy_Tree on the original tree, and these chained calls to New_Copy_Tree run afoul of an issue with the copy of itypes after the rewrite of an aggregate as an expression with actions. Fixing this issue looks quite delicate, so this fixes the incorrect sharing by replacing the chained calls to New_Copy_Tree with repeated calls on the original expression, which is more elegant in any case. gcc/ada/ * exp_ch3.adb (Make_Allocator_For_BIP_Return): New local function. (Expand_N_Object_Declaration): Use it to build the three allocators for a Build-In-Place return with an unconstrained type. Update the head comment after other recent changes.
Diffstat (limited to 'gcc/ada/gcc-interface')
0 files changed, 0 insertions, 0 deletions