aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2018-05-28 08:54:18 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2018-05-28 08:54:18 +0000
commit1541ede1e18b72f77b84fdef0478e97684d14cf1 (patch)
treee81527f078a261020212905d2a046b4ee07168ac /gcc
parentf167c73516dcce0e9b0f659a8ca9bdbaf10f8097 (diff)
downloadgcc-1541ede1e18b72f77b84fdef0478e97684d14cf1.zip
gcc-1541ede1e18b72f77b84fdef0478e97684d14cf1.tar.gz
gcc-1541ede1e18b72f77b84fdef0478e97684d14cf1.tar.bz2
[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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog7
-rw-r--r--gcc/ada/exp_aggr.adb4
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index a9f89f57..95e482241 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,10 @@
+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>
* exp_util.adb (Possible_Bit_Aligned_Component): Always return False in
diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb
index c7158a3..cedc722 100644
--- a/gcc/ada/exp_aggr.adb
+++ b/gcc/ada/exp_aggr.adb
@@ -4490,7 +4490,9 @@ package body Exp_Aggr is
return False;
end if;
- Vals (Num) := Relocate_Node (Elmt);
+ -- Duplicate expression for each index it covers.
+
+ Vals (Num) := New_Copy_Tree (Elmt);
Num := Num + 1;
Next (Elmt);