]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/ada/exp_util.adb
2012-10-04 Vincent Celier <celier@adacore.com>
[thirdparty/gcc.git] / gcc / ada / exp_util.adb
index cb397a24d7144e975df03587674242346c1f7f53..82b054adfcea3a9f36c305a542694d86ac747891 100644 (file)
@@ -710,8 +710,11 @@ package body Exp_Util is
                Subpool := Subpool_Handle_Name (Expr);
             end if;
 
+            --  If a subpool is present it can be an arbitrary name, so make
+            --  the actual by copying the tree.
+
             if Present (Subpool) then
-               Append_To (Actuals, New_Reference_To (Entity (Subpool), Loc));
+               Append_To (Actuals, New_Copy_Tree (Subpool, New_Sloc => Loc));
             else
                Append_To (Actuals, Make_Null (Loc));
             end if;