From: charlet Date: Mon, 4 Jul 2016 10:29:02 +0000 (+0000) Subject: 2016-07-04 Ed Schonberg X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b426a73b4c50e58b2796973096ff253a4e0b342f;p=thirdparty%2Fgcc.git 2016-07-04 Ed Schonberg * ghost.adb (Prune_Node): A freeze node for an ignored ghost entity must be pruned as well. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237967 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 708b629a54b2..8672bdc301fa 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2016-07-04 Ed Schonberg + + * ghost.adb (Prune_Node): A freeze node for an ignored ghost + entity must be pruned as well. + 2016-07-04 Gary Dismukes * 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 2eca5eda4748..8add17ae1eeb 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.