From 3e69995410d3462cca8846369620b2e438996138 Mon Sep 17 00:00:00 2001 From: Ed Schonberg Date: Wed, 6 Sep 2017 10:04:20 +0000 Subject: [PATCH] freeze.adb (Freeze_Entity): Do not generate a freeze node for a generic unit... 2017-09-06 Ed Schonberg * freeze.adb (Freeze_Entity): Do not generate a freeze node for a generic unit, even if it includes delayed aspect specifications. Freeze nodes for generic entities must never appear in the tree that reaches the back-end of the compiler. From-SVN: r251766 --- gcc/ada/ChangeLog | 7 +++++++ gcc/ada/freeze.adb | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 5c0b3d7a25a..196edaec3e4 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,10 @@ +2017-09-06 Ed Schonberg + + * freeze.adb (Freeze_Entity): Do not generate a freeze + node for a generic unit, even if it includes delayed aspect + specifications. Freeze nodes for generic entities must never + appear in the tree that reaches the back-end of the compiler. + 2017-09-06 Yannick Moy * treepr.adb (Print_Entity_Info): Do not print empty Elist. diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index 4d8aa656a57..5540c78fecf 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -5489,6 +5489,13 @@ package body Freeze is then Explode_Initialization_Compound_Statement (E); end if; + + -- Do not generate a freeze node for a generic unit. + + if Is_Generic_Unit (E) then + Result := No_List; + goto Leave; + end if; end if; -- Case of a type or subtype being frozen -- 2.30.2