Commit 1541ede1 by Ed Schonberg Committed by Pierre-Marie de Rodat

[Ada] Copy index expression trees rather than relocating them

2018-05-28  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* exp_aggr.adb (Flatten): Copy tree of expression in a component
	association with a range or a set of discrete choices, rather than
	relocating the node. This avoids inconsistencies in the tree when
	handling nested subprograms with uplevel references for LLVM.

From-SVN: r260829
parent f167c735
2018-05-28 Ed Schonberg <schonberg@adacore.com>
* exp_aggr.adb (Flatten): Copy tree of expression in a component
association with a range or a set of discrete choices, rather than
relocating the node. This avoids inconsistencies in the tree when
handling nested subprograms with uplevel references for LLVM.
2018-05-28 Arnaud Charlet <charlet@adacore.com> 2018-05-28 Arnaud Charlet <charlet@adacore.com>
* exp_util.adb (Possible_Bit_Aligned_Component): Always return False in * exp_util.adb (Possible_Bit_Aligned_Component): Always return False in
......
...@@ -4490,7 +4490,9 @@ package body Exp_Aggr is ...@@ -4490,7 +4490,9 @@ package body Exp_Aggr is
return False; return False;
end if; end if;
Vals (Num) := Relocate_Node (Elmt); -- Duplicate expression for each index it covers.
Vals (Num) := New_Copy_Tree (Elmt);
Num := Num + 1; Num := Num + 1;
Next (Elmt); Next (Elmt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment