]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Mon, 29 Aug 2011 11:04:03 +0000 (13:04 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 29 Aug 2011 11:04:03 +0000 (13:04 +0200)
2011-08-29  Thomas Quinot  <quinot@adacore.com>

* a-synbar-posix.adb: Minor reformatting.

2011-08-29  Jose Ruiz  <ruiz@adacore.com>

* a-exetim-posix.adb, a-exetim-mingw.adb, a-exetim-mingw.ads,
a-exetim-default.ads (Interrupt_Clocks_Supported,
Separate_Interrupt_Clocks_Supported, Clock_For_Interrupts): Add these
definitions to be compliant with AI-0171. The target systems do not
support separate account for the execution time of interrupt handlers.

2011-08-29  Jose Ruiz  <ruiz@adacore.com>

* a-synbar.adb (Wait): Change the order of evaluation of the conditions
in the barrier to put first the easiest to evaluate (and the one which
will be True more often). More efficient.

2011-08-29  Eric Botcazou  <ebotcazou@adacore.com>

* s-atocou-x86.adb: Fix constraint in machine code insertion.

2011-08-29  Bob Duff  <duff@adacore.com>

* aspects.ads, aspects.adb: Add new aspects for various pragmas and
attributes that are now aspects, as specified by AI05-0229-1.
* sem_ch13.adb (Analyze_Aspect_Specifications,
Check_Aspect_At_Freeze_Point): Analyze the new aspects. Turn them into
pragmas or attribute references, as appropriate.

From-SVN: r178203

gcc/ada/ChangeLog
gcc/ada/a-exetim-default.ads
gcc/ada/a-exetim-mingw.adb
gcc/ada/a-exetim-mingw.ads
gcc/ada/a-exetim-posix.adb
gcc/ada/a-synbar-posix.adb
gcc/ada/a-synbar.adb
gcc/ada/aspects.adb
gcc/ada/aspects.ads
gcc/ada/s-atocou-x86.adb
gcc/ada/sem_ch13.adb

index 4dfff556c2ba16dab6210e52a707f15552262b31..17a2e5d2a341550447a1bc2f6f0e3ecc9d233f77 100644 (file)
@@ -1,3 +1,33 @@
+2011-08-29  Thomas Quinot  <quinot@adacore.com>
+
+       * a-synbar-posix.adb: Minor reformatting.
+
+2011-08-29  Jose Ruiz  <ruiz@adacore.com>
+
+       * a-exetim-posix.adb, a-exetim-mingw.adb, a-exetim-mingw.ads,
+       a-exetim-default.ads (Interrupt_Clocks_Supported,
+       Separate_Interrupt_Clocks_Supported, Clock_For_Interrupts): Add these
+       definitions to be compliant with AI-0171. The target systems do not
+       support separate account for the execution time of interrupt handlers.
+
+2011-08-29  Jose Ruiz  <ruiz@adacore.com>
+
+       * a-synbar.adb (Wait): Change the order of evaluation of the conditions
+       in the barrier to put first the easiest to evaluate (and the one which
+       will be True more often). More efficient.
+
+2011-08-29  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * s-atocou-x86.adb: Fix constraint in machine code insertion.
+
+2011-08-29  Bob Duff  <duff@adacore.com>
+
+       * aspects.ads, aspects.adb: Add new aspects for various pragmas and
+       attributes that are now aspects, as specified by AI05-0229-1.
+       * sem_ch13.adb (Analyze_Aspect_Specifications,
+       Check_Aspect_At_Freeze_Point): Analyze the new aspects. Turn them into
+       pragmas or attribute references, as appropriate.
+
 2011-08-29  Robert Dewar  <dewar@adacore.com>
 
        * a-synbar.ads, a-synbar.adb, a-synbar-posix.adb,
index edc6f19a205170f57e1ee9f2e2acad8c54f70c84..3267baad606b4b07dd978dbd1a2c0c44368595be 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 2007-2010, Free Software Foundation, Inc.         --
+--          Copyright (C) 2007-2011, Free Software Foundation, Inc.         --
 --                                                                          --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -81,6 +81,11 @@ package Ada.Execution_Time is
       TS : Ada.Real_Time.Time_Span := Ada.Real_Time.Time_Span_Zero)
       return CPU_Time;
 
+   Interrupt_Clocks_Supported          : constant Boolean := False;
+   Separate_Interrupt_Clocks_Supported : constant Boolean := False;
+
+   function Clock_For_Interrupts return CPU_Time;
+
 private
 
    type CPU_Time is new Ada.Real_Time.Time;
index 973817c0bec0443aee091f50bb85392b51712f71..c80d11286095124aafdc972cd3bdca3e0f5fbf6b 100755 (executable)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---         Copyright (C) 2007-2009, Free Software Foundation, Inc.          --
+--         Copyright (C) 2007-2011, Free Software Foundation, Inc.          --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -129,6 +129,19 @@ package body Ada.Execution_Time is
                  + (Long_Long_Float (U_Time) / Hundreds_Nano_In_Sec))));
    end Clock;
 
+   --------------------------
+   -- Clock_For_Interrupts --
+   --------------------------
+
+   function Clock_For_Interrupts return CPU_Time is
+   begin
+      --  According to AI 0170-1, D.14(18.1/3), if Interrupt_Clocks_Supported
+      --  is set to False the function raises Program_Error.
+
+      raise Program_Error;
+      return CPU_Time_First;
+   end Clock_For_Interrupts;
+
    -----------
    -- Split --
    -----------
index 374e066abe1f6cc92d865f4e75a7e96a42441ae0..a2b68061838841ccc7669826123d2bebd4d70023 100755 (executable)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---             Copyright (C) 2009  Free Software Foundation, Inc.           --
+--          Copyright (C) 2009-2011, Free Software Foundation, Inc.         --
 --                                                                          --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -81,6 +81,11 @@ package Ada.Execution_Time is
        TS : Ada.Real_Time.Time_Span := Ada.Real_Time.Time_Span_Zero)
        return CPU_Time;
 
+   Interrupt_Clocks_Supported          : constant Boolean := False;
+   Separate_Interrupt_Clocks_Supported : constant Boolean := False;
+
+   function Clock_For_Interrupts return CPU_Time;
+
 private
 
    type CPU_Time is new Ada.Real_Time.Time;
index fe00abe55956789fb330774d725ee15a814b0ac1..65b21d61d7a700f240b03ef0842485a9624c7c8d 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---         Copyright (C) 2007-2010, Free Software Foundation, Inc.          --
+--         Copyright (C) 2007-2011, Free Software Foundation, Inc.          --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -127,6 +127,19 @@ package body Ada.Execution_Time is
       return To_CPU_Time (To_Duration (TS));
    end Clock;
 
+   --------------------------
+   -- Clock_For_Interrupts --
+   --------------------------
+
+   function Clock_For_Interrupts return CPU_Time is
+   begin
+      --  According to AI 0170-1, D.14(18.1/3), if Interrupt_Clocks_Supported
+      --  is set to False the function raises Program_Error.
+
+      raise Program_Error;
+      return CPU_Time_First;
+   end Clock_For_Interrupts;
+
    -----------
    -- Split --
    -----------
index c98a460dcdf5d6d302cfccc7963d7a215d34864c..73dc9fa2008510d2eb4c36465f77f5079dca5fe2 100644 (file)
@@ -52,7 +52,6 @@ package body Ada.Synchronous_Barriers is
    --  when count waiters arrived. If attr is null the default barrier
    --  attributes shall be used.
 
-   --  Destroy a previously dynamically initialized barrier
    function pthread_barrier_destroy
      (barrier : not null access pthread_barrier_t) return int;
    pragma Import (C, pthread_barrier_destroy, "pthread_barrier_destroy");
@@ -106,4 +105,5 @@ package body Ada.Synchronous_Barriers is
 
       Notified := (Result = PTHREAD_BARRIER_SERIAL_THREAD);
    end Wait_For_Release;
+
 end Ada.Synchronous_Barriers;
index 8142dcd395f544bae9952179bde822f39e7ae19b..7966b23b7271d80daa795fa4f5885e6b2cda4895 100644 (file)
@@ -44,7 +44,7 @@ package body Ada.Synchronous_Barriers is
       --  barrier will remain open only for those tasks already inside.
 
       entry Wait (Notified : out Boolean)
-        when Wait'Count = Release_Threshold or else Keep_Open
+        when Keep_Open or else Wait'Count = Release_Threshold
       is
       begin
          --  If we are executing the entry it means that the required number of
index 74d17c7cea772c55f233a362ff08dd377c373639..43d0df600c268bfcbbc9c6a893f6ef829e94cd5e 100755 (executable)
@@ -185,8 +185,10 @@ package body Aspects is
     Aspect_Ada_2012                     => Aspect_Ada_2005,
     Aspect_Address                      => Aspect_Address,
     Aspect_Alignment                    => Aspect_Alignment,
+    Aspect_Asynchronous                 => Aspect_Asynchronous,
     Aspect_Atomic                       => Aspect_Atomic,
     Aspect_Atomic_Components            => Aspect_Atomic_Components,
+    Aspect_Attach_Handler               => Aspect_Attach_Handler,
     Aspect_Bit_Order                    => Aspect_Bit_Order,
     Aspect_Component_Size               => Aspect_Component_Size,
     Aspect_Constant_Indexing            => Aspect_Constant_Indexing,
@@ -198,8 +200,12 @@ package body Aspects is
     Aspect_External_Tag                 => Aspect_External_Tag,
     Aspect_Favor_Top_Level              => Aspect_Favor_Top_Level,
     Aspect_Implicit_Dereference         => Aspect_Implicit_Dereference,
+    Aspect_Independent                  => Aspect_Independent,
+    Aspect_Independent_Components       => Aspect_Independent_Components,
     Aspect_Inline                       => Aspect_Inline,
     Aspect_Inline_Always                => Aspect_Inline,
+    Aspect_Interrupt_Handler            => Aspect_Interrupt_Handler,
+    Aspect_Interrupt_Priority           => Aspect_Interrupt_Priority,
     Aspect_Iterator_Element             => Aspect_Iterator_Element,
     Aspect_All_Calls_Remote             => Aspect_All_Calls_Remote,
     Aspect_Compiler_Unit                => Aspect_Compiler_Unit,
@@ -226,10 +232,12 @@ package body Aspects is
     Aspect_Precondition                 => Aspect_Pre,
     Aspect_Predicate                    => Aspect_Predicate,
     Aspect_Preelaborable_Initialization => Aspect_Preelaborable_Initialization,
+    Aspect_Priority                     => Aspect_Priority,
     Aspect_Pure_Function                => Aspect_Pure_Function,
     Aspect_Read                         => Aspect_Read,
     Aspect_Shared                       => Aspect_Atomic,
     Aspect_Size                         => Aspect_Size,
+    Aspect_Small                        => Aspect_Small,
     Aspect_Static_Predicate             => Aspect_Predicate,
     Aspect_Storage_Pool                 => Aspect_Storage_Pool,
     Aspect_Storage_Size                 => Aspect_Storage_Size,
index af4448f3ce95e85b9986e50ccb60f2a04611c4f2..ee992a6383f599dba2105deca3ed5b7de4ab62bb 100755 (executable)
@@ -46,6 +46,7 @@ package Aspects is
      (No_Aspect,                            -- Dummy entry for no aspect
       Aspect_Address,
       Aspect_Alignment,
+      Aspect_Attach_Handler,
       Aspect_Bit_Order,
       Aspect_Component_Size,
       Aspect_Constant_Indexing,
@@ -56,6 +57,7 @@ package Aspects is
       Aspect_External_Tag,
       Aspect_Implicit_Dereference,
       Aspect_Input,
+      Aspect_Interrupt_Priority,
       Aspect_Invariant,
       Aspect_Iterator_Element,
       Aspect_Machine_Radix,
@@ -66,8 +68,10 @@ package Aspects is
       Aspect_Pre,
       Aspect_Precondition,
       Aspect_Predicate,                     -- GNAT
+      Aspect_Priority,
       Aspect_Read,
       Aspect_Size,
+      Aspect_Small,
       Aspect_Static_Predicate,
       Aspect_Storage_Pool,
       Aspect_Storage_Size,
@@ -104,12 +108,16 @@ package Aspects is
 
       Aspect_Ada_2005,                      -- GNAT
       Aspect_Ada_2012,                      -- GNAT
+      Aspect_Asynchronous,
       Aspect_Atomic,
       Aspect_Atomic_Components,
       Aspect_Discard_Names,
       Aspect_Favor_Top_Level,               -- GNAT
+      Aspect_Independent,
+      Aspect_Independent_Components,
       Aspect_Inline,
       Aspect_Inline_Always,                 -- GNAT
+      Aspect_Interrupt_Handler,
       Aspect_No_Return,
       Aspect_Pack,
       Aspect_Persistent_BSS,                -- GNAT
@@ -166,7 +174,7 @@ package Aspects is
 
    type Aspect_Expression is
      (Optional,               -- Optional boolean expression
-      Expression,             -- Required non-boolean expression
+      Expression,             -- Required expression
       Name);                  -- Required name
 
    --  The following array indicates what argument type is required
@@ -175,6 +183,7 @@ package Aspects is
                        (No_Aspect                      => Optional,
                         Aspect_Address                 => Expression,
                         Aspect_Alignment               => Expression,
+                        Aspect_Attach_Handler          => Expression,
                         Aspect_Bit_Order               => Expression,
                         Aspect_Component_Size          => Expression,
                         Aspect_Constant_Indexing       => Name,
@@ -185,6 +194,7 @@ package Aspects is
                         Aspect_External_Tag            => Expression,
                         Aspect_Implicit_Dereference    => Name,
                         Aspect_Input                   => Name,
+                        Aspect_Interrupt_Priority      => Expression,
                         Aspect_Invariant               => Expression,
                         Aspect_Iterator_Element        => Name,
                         Aspect_Machine_Radix           => Expression,
@@ -195,8 +205,10 @@ package Aspects is
                         Aspect_Pre                     => Expression,
                         Aspect_Precondition            => Expression,
                         Aspect_Predicate               => Expression,
+                        Aspect_Priority                => Expression,
                         Aspect_Read                    => Name,
                         Aspect_Size                    => Expression,
+                        Aspect_Small                   => Expression,
                         Aspect_Static_Predicate        => Expression,
                         Aspect_Storage_Pool            => Name,
                         Aspect_Storage_Size            => Expression,
@@ -226,8 +238,10 @@ package Aspects is
      Aspect_Address                      => Name_Address,
      Aspect_Alignment                    => Name_Alignment,
      Aspect_All_Calls_Remote             => Name_All_Calls_Remote,
+     Aspect_Asynchronous                 => Name_Asynchronous,
      Aspect_Atomic                       => Name_Atomic,
      Aspect_Atomic_Components            => Name_Atomic_Components,
+     Aspect_Attach_Handler               => Name_Attach_Handler,
      Aspect_Bit_Order                    => Name_Bit_Order,
      Aspect_Compiler_Unit                => Name_Compiler_Unit,
      Aspect_Component_Size               => Name_Component_Size,
@@ -241,9 +255,13 @@ package Aspects is
      Aspect_External_Tag                 => Name_External_Tag,
      Aspect_Favor_Top_Level              => Name_Favor_Top_Level,
      Aspect_Implicit_Dereference         => Name_Implicit_Dereference,
+     Aspect_Independent                  => Name_Independent,
+     Aspect_Independent_Components       => Name_Independent_Components,
      Aspect_Inline                       => Name_Inline,
      Aspect_Inline_Always                => Name_Inline_Always,
      Aspect_Input                        => Name_Input,
+     Aspect_Interrupt_Handler            => Name_Interrupt_Handler,
+     Aspect_Interrupt_Priority           => Name_Interrupt_Priority,
      Aspect_Invariant                    => Name_Invariant,
      Aspect_Iterator_Element             => Name_Iterator_Element,
      Aspect_Machine_Radix                => Name_Machine_Radix,
@@ -260,6 +278,7 @@ package Aspects is
      Aspect_Preelaborable_Initialization => Name_Preelaborable_Initialization,
      Aspect_Preelaborate                 => Name_Preelaborate,
      Aspect_Preelaborate_05              => Name_Preelaborate_05,
+     Aspect_Priority                     => Name_Priority,
      Aspect_Pure                         => Name_Pure,
      Aspect_Pure_05                      => Name_Pure_05,
      Aspect_Pure_Function                => Name_Pure_Function,
@@ -269,6 +288,7 @@ package Aspects is
      Aspect_Shared                       => Name_Shared,
      Aspect_Shared_Passive               => Name_Shared_Passive,
      Aspect_Size                         => Name_Size,
+     Aspect_Small                        => Name_Small,
      Aspect_Static_Predicate             => Name_Static_Predicate,
      Aspect_Storage_Pool                 => Name_Storage_Pool,
      Aspect_Storage_Size                 => Name_Storage_Size,
index 1625ebaecbe316955479807df8cf34c5962f42f1..f7c0bcb3147033dacb68cc59ceec4bb1d85bd9ac 100644 (file)
@@ -54,7 +54,7 @@ package body System.Atomic_Counters is
              & "sete %1",
          Outputs  =>
            (Unsigned_32'Asm_Output ("=m", Item.Value),
-            Boolean'Asm_Output ("=rm", Aux)),
+            Boolean'Asm_Output ("=qm", Aux)),
          Inputs   => Unsigned_32'Asm_Input ("m", Item.Value),
          Volatile => True);
 
index b0ea4da08ec82c938b7883a871a287221972bc7a..b6d00db94506c4bf8df5747167a1249c71e07ea0 100644 (file)
@@ -1026,6 +1026,7 @@ package body Sem_Ch13 is
                     Aspect_Output         |
                     Aspect_Read           |
                     Aspect_Size           |
+                    Aspect_Small          |
                     Aspect_Storage_Pool   |
                     Aspect_Storage_Size   |
                     Aspect_Stream_Size    |
@@ -1135,6 +1136,36 @@ package body Sem_Ch13 is
                   Set_Is_Delayed_Aspect (Aspect);
                   Set_Has_Default_Aspect (Base_Type (Entity (Ent)));
 
+               when Aspect_Attach_Handler =>
+                  Aitem :=
+                    Make_Pragma (Loc,
+                      Pragma_Identifier            =>
+                        Make_Identifier (Sloc (Id), Name_Attach_Handler),
+                      Pragma_Argument_Associations =>
+                        New_List (Ent, Relocate_Node (Expr)));
+
+                  Set_From_Aspect_Specification (Aitem, True);
+
+               when Aspect_Priority | Aspect_Interrupt_Priority => declare
+                  Pname : Name_Id;
+
+               begin
+                  if A_Id = Aspect_Priority then
+                     Pname := Name_Priority;
+                  else
+                     Pname := Name_Interrupt_Priority;
+                  end if;
+
+                  Aitem :=
+                    Make_Pragma (Loc,
+                      Pragma_Identifier            =>
+                        Make_Identifier (Sloc (Id), Pname),
+                      Pragma_Argument_Associations =>
+                        New_List (Relocate_Node (Expr)));
+
+                  Set_From_Aspect_Specification (Aitem, True);
+               end;
+
                --  Aspects Pre/Post generate Precondition/Postcondition pragmas
                --  with a first argument that is the expression, and a second
                --  argument that is an informative message if the test fails.
@@ -1433,18 +1464,64 @@ package body Sem_Ch13 is
                --  Here if not compilation unit case
 
                else
-                  --  For Pre/Post cases, insert immediately after the entity
-                  --  declaration, since that is the required pragma placement.
+                  case A_Id is
+                     --  For Pre/Post cases, insert immediately after the
+                     --  entity declaration, since that is the required pragma
+                     --  placement.
 
-                  if A_Id in Pre_Post_Aspects then
-                     Insert_After (N, Aitem);
+                     when Pre_Post_Aspects =>
+                        Insert_After (N, Aitem);
+
+                     --  For Priority aspects, insert into the task or
+                     --  protected definition, which we need to create if it's
+                     --  not there.
+
+                     when Aspect_Priority | Aspect_Interrupt_Priority =>
+                        declare
+                           T : Node_Id; -- the type declaration
+                           L : List_Id; -- list of decls of task/protected
+
+                        begin
+                           if Nkind (N) = N_Object_Declaration then
+                              T := Parent (Etype (Defining_Identifier (N)));
+
+                           else
+                              T := N;
+                           end if;
+
+                           if Nkind (T) = N_Protected_Type_Declaration then
+                              pragma Assert
+                                (Present (Protected_Definition (T)));
+
+                              L := Visible_Declarations
+                                     (Protected_Definition (T));
+
+                           elsif Nkind (T) = N_Task_Type_Declaration then
+                              if No (Task_Definition (T)) then
+                                 Set_Task_Definition
+                                   (T,
+                                    Make_Task_Definition
+                                      (Sloc (T),
+                                       Visible_Declarations => New_List,
+                                       End_Label => Empty));
+                              end if;
+
+                              L := Visible_Declarations
+                                     (Task_Definition (T));
+
+                           else
+                              raise Program_Error;
+                           end if;
+
+                           Prepend (Aitem, To => L);
+                        end;
 
                   --  For all other cases, insert in sequence
 
-                  else
-                     Insert_After (Ins_Node, Aitem);
-                     Ins_Node := Aitem;
-                  end if;
+                     when others =>
+                        Insert_After (Ins_Node, Aitem);
+                        Ins_Node := Aitem;
+                  end case;
                end if;
             end if;
          end;
@@ -5758,6 +5835,9 @@ package body Sem_Ch13 is
          when Aspect_Test_Case =>
             raise Program_Error;
 
+         when Aspect_Attach_Handler =>
+            T := RTE (RE_Interrupt_ID);
+
          --  Default_Value is resolved with the type entity in question
 
          when Aspect_Default_Value =>
@@ -5779,6 +5859,12 @@ package body Sem_Ch13 is
          when Aspect_External_Tag =>
             T := Standard_String;
 
+         when Aspect_Priority | Aspect_Interrupt_Priority =>
+            T := Standard_Integer;
+
+         when Aspect_Small =>
+            T := Universal_Real;
+
          when Aspect_Storage_Pool =>
             T := Class_Wide_Type (RTE (RE_Root_Storage_Pool));