sem_elab.adb (In_Preelaborated_Context): A generic package subject to Remote_Call_Int...
authorHristian Kirtchev <kirtchev@adacore.com>
Sat, 14 Oct 2017 17:17:41 +0000 (17:17 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Sat, 14 Oct 2017 17:17:41 +0000 (17:17 +0000)
gcc/ada/

2017-10-14  Hristian Kirtchev  <kirtchev@adacore.com>

* sem_elab.adb (In_Preelaborated_Context): A generic package subject to
Remote_Call_Interface is not a suitable preelaboratd context when the
call appears in the package body.

gcc/testsuite/

2017-10-14  Hristian Kirtchev  <kirtchev@adacore.com>

* gnat.dg/remote_call_iface.ads, gnat.dg/remote_call_iface.adb: New
testcase.

From-SVN: r253758

gcc/ada/ChangeLog
gcc/ada/sem_elab.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/remote_call_iface.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/remote_call_iface.ads [new file with mode: 0644]

index d0d17bacdb9f62f1865806c5eb8da16eee5bdf95..7708c5865e7eb6d60f7911aa8769e953e5b6b303 100644 (file)
@@ -1,3 +1,9 @@
+2017-10-14  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * sem_elab.adb (In_Preelaborated_Context): A generic package subject to
+       Remote_Call_Interface is not a suitable preelaboratd context when the
+       call appears in the package body.
+
 2017-10-14  Eric Botcazou  <ebotcazou@adacore.com>
 
        * layout.ads (Set_Elem_Alignment): Add Align parameter defaulted to 0.
index 7f5a3d6718ca9fc99a334c31aedb647f29237e3f..7f9ce089d4a1fa2258e345f9b2ba2c07bac96c71 100644 (file)
@@ -1808,7 +1808,7 @@ package body Sem_Elab is
          --  be on another machine.
 
          if Ekind (Body_Id) = E_Package_Body
-           and then Ekind (Spec_Id) = E_Package
+           and then Ekind_In (Spec_Id, E_Generic_Package, E_Package)
            and then (Is_Remote_Call_Interface (Spec_Id)
                       or else Is_Remote_Types (Spec_Id))
          then
index c48f8a6f676478be713d4a6f051f7d27c1c069fd..909ca73cc5970b8cf4982d6c3127c40d57ac3e72 100644 (file)
@@ -1,3 +1,8 @@
+2017-10-14  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * gnat.dg/remote_call_iface.ads, gnat.dg/remote_call_iface.adb: New
+       testcase.
+
 2017-10-14  Jakub Jelinek  <jakub@redhat.com>
 
        PR rtl-optimization/81423
diff --git a/gcc/testsuite/gnat.dg/remote_call_iface.adb b/gcc/testsuite/gnat.dg/remote_call_iface.adb
new file mode 100644 (file)
index 0000000..6816ad9
--- /dev/null
@@ -0,0 +1,7 @@
+--  { dg-do compile }
+
+package body Remote_Call_Iface is
+   procedure Proc is begin null; end;
+begin
+   Proc;
+end Remote_Call_Iface;
diff --git a/gcc/testsuite/gnat.dg/remote_call_iface.ads b/gcc/testsuite/gnat.dg/remote_call_iface.ads
new file mode 100644 (file)
index 0000000..ce12fef
--- /dev/null
@@ -0,0 +1,5 @@
+generic
+package Remote_Call_Iface is
+   pragma Remote_Call_Interface;
+   procedure Proc;
+end Remote_Call_Iface;