aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2016-07-04 10:29:02 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2016-07-04 12:29:02 +0200
commit7c14db4032fe0e34140dacf08c4ffadde404f414 (patch)
treed62e8f4d28c53958138a7bbff4ad9ec6da10422e /gcc
parent607114db6a0ae4c23ca0937cb1744f7110c6cd36 (diff)
downloadgcc-7c14db4032fe0e34140dacf08c4ffadde404f414.zip
gcc-7c14db4032fe0e34140dacf08c4ffadde404f414.tar.gz
gcc-7c14db4032fe0e34140dacf08c4ffadde404f414.tar.bz2
ghost.adb (Prune_Node): A freeze node for an ignored ghost entity must be pruned as well.
2016-07-04 Ed Schonberg <schonberg@adacore.com> * ghost.adb (Prune_Node): A freeze node for an ignored ghost entity must be pruned as well. From-SVN: r237967
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/ghost.adb9
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 708b629..8672bdc 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2016-07-04 Ed Schonberg <schonberg@adacore.com>
+
+ * ghost.adb (Prune_Node): A freeze node for an ignored ghost
+ entity must be pruned as well.
+
2016-07-04 Gary Dismukes <dismukes@adacore.com>
* sem_type.adb, einfo.ads, freeze.adb, exp_ch6.adb: Minor reformatting
diff --git a/gcc/ada/ghost.adb b/gcc/ada/ghost.adb
index 2eca5ed..8add17a 100644
--- a/gcc/ada/ghost.adb
+++ b/gcc/ada/ghost.adb
@@ -1174,6 +1174,15 @@ package body Ghost is
Prune (N);
return Skip;
+ -- A freeze node for an ignored ghost entity must be pruned as
+ -- well, to prevent meaningless references in the back end.
+
+ elsif Nkind (N) = N_Freeze_Entity
+ and then Is_Ignored_Ghost_Entity (Entity (N))
+ then
+ Prune (N);
+ return Skip;
+
-- Scoping constructs such as blocks, packages, subprograms and
-- bodies offer some flexibility with respect to pruning.