From 0fcd7270b6fb2fbb5ec72671374b17d3db531151 Mon Sep 17 00:00:00 2001 From: Hristian Kirtchev Date: Sat, 14 Oct 2017 17:17:41 +0000 Subject: [PATCH] sem_elab.adb (In_Preelaborated_Context): A generic package subject to Remote_Call_Interface is not a suitable... gcc/ada/ 2017-10-14 Hristian Kirtchev * 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 * gnat.dg/remote_call_iface.ads, gnat.dg/remote_call_iface.adb: New testcase. From-SVN: r253758 --- gcc/ada/ChangeLog | 6 ++++++ gcc/ada/sem_elab.adb | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gnat.dg/remote_call_iface.adb | 7 +++++++ gcc/testsuite/gnat.dg/remote_call_iface.ads | 5 +++++ 5 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gnat.dg/remote_call_iface.adb create mode 100644 gcc/testsuite/gnat.dg/remote_call_iface.ads diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index d0d17bacdb9..7708c5865e7 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2017-10-14 Hristian Kirtchev + + * 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 * layout.ads (Set_Elem_Alignment): Add Align parameter defaulted to 0. diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb index 7f5a3d6718c..7f9ce089d4a 100644 --- a/gcc/ada/sem_elab.adb +++ b/gcc/ada/sem_elab.adb @@ -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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c48f8a6f676..909ca73cc59 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-10-14 Hristian Kirtchev + + * gnat.dg/remote_call_iface.ads, gnat.dg/remote_call_iface.adb: New + testcase. + 2017-10-14 Jakub Jelinek 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 index 00000000000..6816ad95a65 --- /dev/null +++ b/gcc/testsuite/gnat.dg/remote_call_iface.adb @@ -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 index 00000000000..ce12fef88ca --- /dev/null +++ b/gcc/testsuite/gnat.dg/remote_call_iface.ads @@ -0,0 +1,5 @@ +generic +package Remote_Call_Iface is + pragma Remote_Call_Interface; + procedure Proc; +end Remote_Call_Iface; -- 2.30.2