]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Fri, 17 Apr 2009 12:12:07 +0000 (14:12 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 17 Apr 2009 12:12:07 +0000 (14:12 +0200)
2009-04-17  Thomas Quinot  <quinot@adacore.com>

* exp_ch7.adb (Expand_Ctrl_Function_Call): Remove incorrect special
case for the case of an aggregate component, the attach call for the
result is actually needed.

* exp_aggr.adb (Backend_Processing_Possible): Backend processing for
an array aggregate must be disabled if the component type requires
controlled actions.

* exp_ch3.adb: Minor reformatting

2009-04-17  Arnaud Charlet  <charlet@adacore.com>

* s-taprop-tru64.adb, s-taprop-vms.adb, s-taprop-linux.adb,
s-taprop-solaris.adb, s-taprop-irix.adb, s-taprop-hpux-dce.adb,
s-taprop-posix.adb (Suspend_Until_True): Protect against early wakeup.

From-SVN: r146254

gcc/ada/ChangeLog
gcc/ada/exp_aggr.adb
gcc/ada/exp_ch3.adb
gcc/ada/exp_ch7.adb
gcc/ada/s-taprop-hpux-dce.adb
gcc/ada/s-taprop-irix.adb
gcc/ada/s-taprop-linux.adb
gcc/ada/s-taprop-posix.adb
gcc/ada/s-taprop-solaris.adb
gcc/ada/s-taprop-tru64.adb
gcc/ada/s-taprop-vms.adb

index 67f4c53fb422d566c1ee829403f13605ca5038cf..45c6cadece6962def2651ebe02736fd94cf24440 100644 (file)
@@ -1,3 +1,42 @@
+2009-04-17  Thomas Quinot  <quinot@adacore.com>
+
+       * exp_ch7.adb (Expand_Ctrl_Function_Call): Remove incorrect special
+       case for the case of an aggregate component, the attach call for the
+       result is actually needed.
+
+       * exp_aggr.adb (Backend_Processing_Possible): Backend processing for
+       an array aggregate must be disabled if the component type requires
+       controlled actions.
+
+       * exp_ch3.adb: Minor reformatting
+
+2009-04-17  Bob Duff  <duff@adacore.com>
+
+       * output.ads (Indent,Outdent): New procedures for indenting the output.
+       (Write_Char): Correct comment -- LF _is_ allowed.
+
+       * output.adb (Indent,Outdent): New procedures for indenting the output.
+       Keep track of the indentation level, and make sure it doesn't get too
+       high.
+       (Flush_Buffer): Insert spaces at the beginning of each line, if
+       indentation level is nonzero.
+       (Save_Output_Buffer,Restore_Output_Buffer): Save and restore the current
+       indentation level.
+       (Set_Standard_Error,Set_Standard_Output): Remove superfluous
+       "Next_Col := 1;".  Flush_Buffer does that.
+
+       * sem_ch6.adb, sem_ch7.adb (Debug_Flag_C): Reorganize the output
+       controlled by the -gnatdc switch. It now occurs on entry/exit to the
+       relevant analysis routines, and calls Indent/Outdent to make the
+       indentation reflect the nesting level.  Add "helper" routines, since
+       otherwise lots of "return;" statements would skip the debugging output.
+
+2009-04-17  Arnaud Charlet  <charlet@adacore.com>
+
+       * s-taprop-tru64.adb, s-taprop-vms.adb, s-taprop-linux.adb,
+       s-taprop-solaris.adb, s-taprop-irix.adb, s-taprop-hpux-dce.adb,
+       s-taprop-posix.adb (Suspend_Until_True): Protect against early wakeup.
+
 2009-04-17  Thomas Quinot  <quinot@adacore.com>
 
        * exp_aggr.adb: Minor code reorganization, no behaviour change.
index 61fa79021ca552a919d3907745852466bbd81082..0ed20d0bd68b5343f882824f87460aefd20d7ba5 100644 (file)
@@ -506,6 +506,8 @@ package body Exp_Aggr is
    --    9. There cannot be any discriminated record components, since the
    --       back end cannot handle this complex case.
 
+   --   10. No controlled actions need to be generated for components.
+
    function Backend_Processing_Possible (N : Node_Id) return Boolean is
       Typ : constant Entity_Id := Etype (N);
       --  Typ is the correct constrained array subtype of the aggregate
@@ -580,9 +582,9 @@ package body Exp_Aggr is
    --  Start of processing for Backend_Processing_Possible
 
    begin
-      --  Checks 2 (array must not be bit packed)
+      --  Checks 2 (array not bit packed) and 10 (no controlled actions)
 
-      if Is_Bit_Packed_Array (Typ) then
+      if Is_Bit_Packed_Array (Typ) or else Needs_Finalization (Typ) then
          return False;
       end if;
 
index 570b1f8aa5dc166eaf0a44d436c48b048e003521..242e5c45ffd2ea94258c5315bf4aa20b914bc851 100644 (file)
@@ -2061,9 +2061,9 @@ package body Exp_Ch3 is
          --       return O.Iface_Comp'Position;
          --    end Fxx;
 
-         ------------------------------
-         -- Build_Offset_To_Top_Body --
-         ------------------------------
+         ----------------------------------
+         -- Build_Offset_To_Top_Function --
+         ----------------------------------
 
          procedure Build_Offset_To_Top_Function (Iface_Comp : Entity_Id) is
             Body_Node : Node_Id;
@@ -6858,8 +6858,7 @@ package body Exp_Ch3 is
            and then Is_Variable_Size_Record (Etype (Comp_Typ))
            and then Chars (Tag_Comp) /= Name_uTag
          then
-            pragma Assert
-              (Present (DT_Offset_To_Top_Func (Tag_Comp)));
+            pragma Assert (Present (DT_Offset_To_Top_Func (Tag_Comp)));
 
             --  Issue error if Set_Dynamic_Offset_To_Top is not available in a
             --  configurable run-time environment.
index dc606480453bd1d4fe8e3b8e04268eab497c30bf..ea05b24b26428c6fec152d660dda1b2e24cc25e6 100644 (file)
@@ -1401,20 +1401,6 @@ package body Exp_Ch7 is
 
       --    Attach_To_Final_List (_Lx, Resx (Resx'last)._controller, 3);
 
-      --  If the context is an array aggregate, the call will be expanded into
-      --  an assignment, and the attachment will be done when the aggregate
-      --  expansion is complete. See body of Exp_Aggr for the treatment of
-      --  other controlled components.
-
-      if (Nkind (Parent (N)) = N_Aggregate
-            and then Is_Array_Type (Etype (Parent (N))))
-        or else
-         (Nkind (Parent (N)) = N_Component_Association
-            and then Is_Array_Type (Etype (Parent (Parent (N)))))
-      then
-         return;
-      end if;
-
       --  Case where type has controlled components
 
       if Has_Controlled_Component (Rtype) then
index 6288af5a776bb03ba5f2cb50c72784ddacef514d..07fcc9cb20df59fcbf9e26414d8f89fa564e0d56 100644 (file)
@@ -1068,7 +1068,16 @@ package body System.Task_Primitives.Operations is
             S.State := False;
          else
             S.Waiting := True;
-            Result := pthread_cond_wait (S.CV'Access, S.L'Access);
+
+            loop
+               --  loop in case pthread_cond_wait returns earlier than
+               --  expected (e.g. in case of EINTR caused by a signal).
+
+               Result := pthread_cond_wait (S.CV'Access, S.L'Access);
+               pragma Assert (Result = 0 or else Result = EINTR);
+
+               exit when not S.Waiting;
+            end loop;
          end if;
 
          Result := pthread_mutex_unlock (S.L'Access);
index 2d38f6e4a5cdc79b94c737fdcb07960489cd86c3..59297e941ff148ac2315d8f5fc9a525e16cf48e2 100644 (file)
@@ -1153,7 +1153,16 @@ package body System.Task_Primitives.Operations is
             S.State := False;
          else
             S.Waiting := True;
-            Result := pthread_cond_wait (S.CV'Access, S.L'Access);
+
+            loop
+               --  loop in case pthread_cond_wait returns earlier than
+               --  expected (e.g. in case of EINTR caused by a signal).
+
+               Result := pthread_cond_wait (S.CV'Access, S.L'Access);
+               pragma Assert (Result = 0 or else Result = EINTR);
+
+               exit when not S.Waiting;
+            end loop;
          end if;
 
          Result := pthread_mutex_unlock (S.L'Access);
index aebfcb65383040b88bd5c5a38200579cd46bf355..b9c3c5e6ae9e7b6adad08a4a4820b5a17cbcbd9d 100644 (file)
@@ -1083,7 +1083,19 @@ package body System.Task_Primitives.Operations is
             S.State := False;
          else
             S.Waiting := True;
-            Result := pthread_cond_wait (S.CV'Access, S.L'Access);
+
+            loop
+               --  loop in case pthread_cond_wait returns earlier than
+               --  expected (e.g. in case of EINTR caused by a signal).
+               --  This should not happen on current implementation of pthread
+               --  under Linux, but POSIX does not guarantee it, so this may
+               --  change in the future.
+
+               Result := pthread_cond_wait (S.CV'Access, S.L'Access);
+               pragma Assert (Result = 0 or else Result = EINTR);
+
+               exit when not S.Waiting;
+            end loop;
          end if;
 
          Result := pthread_mutex_unlock (S.L'Access);
index d87b1e670c26e80a679b701faf68f1b618d5c0a1..c8894d64929b82cb29d2cb11bfd5cf3d6a964fe1 100644 (file)
@@ -1257,7 +1257,16 @@ package body System.Task_Primitives.Operations is
             S.State := False;
          else
             S.Waiting := True;
-            Result := pthread_cond_wait (S.CV'Access, S.L'Access);
+
+            loop
+               --  loop in case pthread_cond_wait returns earlier than
+               --  expected (e.g. in case of EINTR caused by a signal).
+
+               Result := pthread_cond_wait (S.CV'Access, S.L'Access);
+               pragma Assert (Result = 0 or else Result = EINTR);
+
+               exit when not S.Waiting;
+            end loop;
          end if;
 
          Result := pthread_mutex_unlock (S.L'Access);
index 795750bed85bf1a2824b5005df0a0fd3353cd4f8..bd2470057e3663373d8ed39cea47253ce074323a 100644 (file)
@@ -1818,7 +1818,16 @@ package body System.Task_Primitives.Operations is
             S.State := False;
          else
             S.Waiting := True;
-            Result := cond_wait (S.CV'Access, S.L'Access);
+
+            loop
+               --  loop in case pthread_cond_wait returns earlier than
+               --  expected (e.g. in case of EINTR caused by a signal).
+
+               Result := cond_wait (S.CV'Access, S.L'Access);
+               pragma Assert (Result = 0 or else Result = EINTR);
+
+               exit when not S.Waiting;
+            end loop;
          end if;
 
          Result := mutex_unlock (S.L'Access);
index 4c55c58a0a488e57542611084ebf33911c0654de..20b0bbc04adfde9019a70458c6cc0855d32a4a70 100644 (file)
@@ -1170,7 +1170,16 @@ package body System.Task_Primitives.Operations is
             S.State := False;
          else
             S.Waiting := True;
-            Result := pthread_cond_wait (S.CV'Access, S.L'Access);
+
+            loop
+               --  loop in case pthread_cond_wait returns earlier than
+               --  expected (e.g. in case of EINTR caused by a signal).
+
+               Result := pthread_cond_wait (S.CV'Access, S.L'Access);
+               pragma Assert (Result = 0 or else Result = EINTR);
+
+               exit when not S.Waiting;
+            end loop;
          end if;
 
          Result := pthread_mutex_unlock (S.L'Access);
index 01a77d6ff3a57ab0e7b9dafadebce494e1e8649c..0d0dd08699e7b808b6ce9afaf7e4cad716622f30 100644 (file)
@@ -1104,7 +1104,16 @@ package body System.Task_Primitives.Operations is
             S.State := False;
          else
             S.Waiting := True;
-            Result := pthread_cond_wait (S.CV'Access, S.L'Access);
+
+            loop
+               --  loop in case pthread_cond_wait returns earlier than
+               --  expected (e.g. in case of EINTR caused by a signal).
+
+               Result := pthread_cond_wait (S.CV'Access, S.L'Access);
+               pragma Assert (Result = 0 or else Result = EINTR);
+
+               exit when not S.Waiting;
+            end loop;
          end if;
 
          Result := pthread_mutex_unlock (S.L'Access);