From 8e2d104ba2f4f89d6479d03f75cc374484875fc7 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Wed, 25 Nov 2015 16:30:09 +0100 Subject: [PATCH] [multiple changes] 2015-11-25 Eric Botcazou * gnatlink.adb (Gnatlink): Do not reinstate -fsjlj for the linker from the switches saved in the ALI file but from the exception settings. 2015-11-25 Arnaud Charlet * lib-xref-spark_specific.adb (Add_SPARK_Scope): Take entry families into account. * a-exetim.ads, a-exetim-default.ads, a-exetim-mingw.ads (Clock, Clock_For_Interrupts): preconditions added. * a-extiin.ads (Clock): preconditions added. * par-ch3.adb (P_Declarative_Items): In case of misplaced aspect specifications, ensure that flag Done is properly set to continue parsing. From-SVN: r230879 --- gcc/ada/ChangeLog | 17 +++++++++++++++++ gcc/ada/a-exetim-default.ads | 10 ++++++++-- gcc/ada/a-exetim-mingw.ads | 10 ++++++++-- gcc/ada/a-exetim.ads | 10 ++++++++-- gcc/ada/a-extiin.ads | 3 ++- gcc/ada/gnatlink.adb | 10 ++++++++++ gcc/ada/lib-xref-spark_specific.adb | 3 ++- gcc/ada/par-ch3.adb | 10 +++++----- 8 files changed, 60 insertions(+), 13 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index db50698b443..d7df276aa1a 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,20 @@ +2015-11-25 Eric Botcazou + + * gnatlink.adb (Gnatlink): Do not reinstate -fsjlj for the linker + from the switches saved in the ALI file but from the exception + settings. + +2015-11-25 Arnaud Charlet + + * lib-xref-spark_specific.adb + (Add_SPARK_Scope): Take entry families into account. + * a-exetim.ads, a-exetim-default.ads, a-exetim-mingw.ads (Clock, + Clock_For_Interrupts): preconditions added. + * a-extiin.ads (Clock): preconditions added. + * par-ch3.adb (P_Declarative_Items): In case of misplaced + aspect specifications, ensure that flag Done is properly set to + continue parsing. + 2015-11-25 Arnaud Charlet * exp_util.adb (Remove_Side_Effects): Minimize extra temporaries diff --git a/gcc/ada/a-exetim-default.ads b/gcc/ada/a-exetim-default.ads index 5877fc535fe..50b9bc50fab 100644 --- a/gcc/ada/a-exetim-default.ads +++ b/gcc/ada/a-exetim-default.ads @@ -47,13 +47,16 @@ is CPU_Time_Unit : constant := Ada.Real_Time.Time_Unit; CPU_Tick : constant Ada.Real_Time.Time_Span; + use type Ada.Task_Identification.Task_Id; + function Clock (T : Ada.Task_Identification.Task_Id := Ada.Task_Identification.Current_Task) return CPU_Time with Volatile_Function, - Global => Ada.Real_Time.Clock_Time; + Global => Ada.Real_Time.Clock_Time, + Pre => T /= Ada.Task_Identification.Null_Task_Id; function "+" (Left : CPU_Time; @@ -105,9 +108,12 @@ is Interrupt_Clocks_Supported : constant Boolean := False; Separate_Interrupt_Clocks_Supported : constant Boolean := False; + pragma Warnings (Off, "check will fail at run time"); function Clock_For_Interrupts return CPU_Time with Volatile_Function, - Global => Ada.Real_Time.Clock_Time; + Global => Ada.Real_Time.Clock_Time, + Pre => Interrupt_Clocks_Supported; + pragma Warnings (On, "check will fail at run time"); private pragma SPARK_Mode (Off); diff --git a/gcc/ada/a-exetim-mingw.ads b/gcc/ada/a-exetim-mingw.ads index 8e1e764e50b..5ba3e08c386 100644 --- a/gcc/ada/a-exetim-mingw.ads +++ b/gcc/ada/a-exetim-mingw.ads @@ -49,13 +49,16 @@ is CPU_Time_Unit : constant := 0.000001; CPU_Tick : constant Ada.Real_Time.Time_Span; + use type Ada.Task_Identification.Task_Id; + function Clock (T : Ada.Task_Identification.Task_Id := Ada.Task_Identification.Current_Task) return CPU_Time with Volatile_Function, - Global => Ada.Real_Time.Clock_Time; + Global => Ada.Real_Time.Clock_Time, + Pre => T /= Ada.Task_Identification.Null_Task_Id; function "+" (Left : CPU_Time; @@ -105,9 +108,12 @@ is Interrupt_Clocks_Supported : constant Boolean := False; Separate_Interrupt_Clocks_Supported : constant Boolean := False; + pragma Warnings (Off, "check will fail at run time"); function Clock_For_Interrupts return CPU_Time with Volatile_Function, - Global => Ada.Real_Time.Clock_Time; + Global => Ada.Real_Time.Clock_Time, + Pre => Interrupt_Clocks_Supported; + pragma Warnings (On, "check will fail at run time"); private pragma SPARK_Mode (Off); diff --git a/gcc/ada/a-exetim.ads b/gcc/ada/a-exetim.ads index 951c3ed09e9..d75b6befb6f 100644 --- a/gcc/ada/a-exetim.ads +++ b/gcc/ada/a-exetim.ads @@ -38,13 +38,16 @@ is CPU_Time_Unit : constant := 0.000001; CPU_Tick : constant Ada.Real_Time.Time_Span; + use type Ada.Task_Identification.Task_Id; + function Clock (T : Ada.Task_Identification.Task_Id := Ada.Task_Identification.Current_Task) return CPU_Time with Volatile_Function, - Global => Ada.Real_Time.Clock_Time; + Global => Ada.Real_Time.Clock_Time, + Pre => T /= Ada.Task_Identification.Null_Task_Id; function "+" (Left : CPU_Time; @@ -96,9 +99,12 @@ is Interrupt_Clocks_Supported : constant Boolean := False; Separate_Interrupt_Clocks_Supported : constant Boolean := False; + pragma Warnings (Off, "check will fail at run time"); function Clock_For_Interrupts return CPU_Time with Volatile_Function, - Global => Ada.Real_Time.Clock_Time; + Global => Ada.Real_Time.Clock_Time, + Pre => Interrupt_Clocks_Supported; + pragma Warnings (On, "check will fail at run time"); private pragma SPARK_Mode (Off); diff --git a/gcc/ada/a-extiin.ads b/gcc/ada/a-extiin.ads index e35c32df37d..a4edb8f28e7 100644 --- a/gcc/ada/a-extiin.ads +++ b/gcc/ada/a-extiin.ads @@ -25,7 +25,8 @@ is function Clock (Interrupt : Ada.Interrupts.Interrupt_ID) return CPU_Time with Volatile_Function, - Global => Ada.Real_Time.Clock_Time; + Global => Ada.Real_Time.Clock_Time, + Pre => Separate_Interrupt_Clocks_Supported; function Supported (Interrupt : Ada.Interrupts.Interrupt_ID) return Boolean with diff --git a/gcc/ada/gnatlink.adb b/gcc/ada/gnatlink.adb index 67b07b23e3c..0d190eb1a31 100644 --- a/gcc/ada/gnatlink.adb +++ b/gcc/ada/gnatlink.adb @@ -1588,6 +1588,16 @@ begin end if; end; end loop; + + -- Pass -fsjlj to the linker with back-end SJLJ exceptions + + if not ALIs.Table (A).Frontend_Exceptions + and then not ALIs.Table (A).Zero_Cost_Exceptions + then + Linker_Options.Increment_Last; + Linker_Options.Table + (Linker_Options.Last) := new String'("-fsjlj"); + end if; end if; end; end if; diff --git a/gcc/ada/lib-xref-spark_specific.adb b/gcc/ada/lib-xref-spark_specific.adb index b570725369c..c857b0f6944 100644 --- a/gcc/ada/lib-xref-spark_specific.adb +++ b/gcc/ada/lib-xref-spark_specific.adb @@ -260,6 +260,7 @@ package body SPARK_Specific is case Ekind (E) is when E_Entry + | E_Entry_Family | E_Function | E_Generic_Function | E_Generic_Package @@ -330,7 +331,7 @@ package body SPARK_Specific is function Is_SPARK_Scope (E : Entity_Id) return Boolean; -- Return whether the entity or reference scope meets requirements for - -- being an SPARK scope. + -- being a SPARK scope. function Lt (Op1 : Natural; Op2 : Natural) return Boolean; -- Comparison function for Sort call diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb index 5859bcea05b..3863c5a56f3 100644 --- a/gcc/ada/par-ch3.adb +++ b/gcc/ada/par-ch3.adb @@ -4441,13 +4441,13 @@ package body Ch3 is else Error_Msg_SC ("aspect specifications not allowed here"); + end if; - -- Assume that this is a misplaced aspect specification - -- within a declarative list. After discarding the - -- misplaced aspects we can continue the scan. + -- Assume that this is a misplaced aspect specification within + -- a declarative list. After discarding the misplaced aspects + -- we can continue the scan. - Done := False; - end if; + Done := False; declare Dummy_Node : constant Node_Id := -- 2.30.2