[Ada] Unnesting: handle 'Address references that are calls
authorEd Schonberg <schonberg@adacore.com>
Mon, 16 Jul 2018 14:12:09 +0000 (14:12 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 16 Jul 2018 14:12:09 +0000 (14:12 +0000)
2018-07-16  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* exp_unst.adb (Visit_Node): Handle 'Address references that are
calls.

From-SVN: r262726

gcc/ada/ChangeLog
gcc/ada/exp_unst.adb

index 13428e986ba2851bd9fc6cea380344cc17b1f727..8b79b00a0e83755ada7ee4b364ff3bf02ce012d7 100644 (file)
@@ -1,3 +1,8 @@
+2018-07-16  Ed Schonberg  <schonberg@adacore.com>
+
+       * exp_unst.adb (Visit_Node): Handle 'Address references that are
+       calls.
+
 2018-07-16  Ed Schonberg  <schonberg@adacore.com>
 
        * exp_unst.adb (Visit_Node): Handle the semantic of Storage_Pool field
index 464eaa036f8f5ade9d3e425eed4f8f9ddbf3796d..ef5ab4a366d2cb479386025a18ab35b349fd0ce9 100644 (file)
@@ -859,7 +859,8 @@ package body Exp_Unst is
                      end;
                   end if;
 
-               --  A 'Access reference is a (potential) call. Other attributes
+               --  A 'Access reference is a (potential) call. So is 'Address,
+               --  in particular on imported subprograms. Other attributes
                --  require special handling.
 
                when N_Attribute_Reference =>
@@ -871,6 +872,7 @@ package body Exp_Unst is
                         when Attribute_Access
                            | Attribute_Unchecked_Access
                            | Attribute_Unrestricted_Access
+                           | Attribute_Address
                         =>
                            if Nkind (Prefix (N)) in N_Has_Entity then
                               Ent := Entity (Prefix (N));