* exp_util.adb (Make_CW_Equivalent_Type): Do not mark the type as
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 24 Nov 2009 20:02:40 +0000 (20:02 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 24 Nov 2009 20:02:40 +0000 (20:02 +0000)
frozen for targets that do not require front-end layout.
(New_Class_Wide_Subtype): Always reset the freezing status to False.
* exp_ch8.adb: Do not 'with' Targparm.
(Expand_N_Object_Renaming_Declaration): Always freeze a class-wide
subtype that has been built from the expression.
* exp_intr.adb (Expand_Unc_Deallocation): If the designated type is
class wide, freeze the implicit type that has been built from the
expression at the dereference point.
* freeze.adb (Freeze_Entity): Adjust comment.
* gcc-interface/decl.c (Gigi_Equivalent_Type) <E_Class_Wide_Type>:
Remove useless test.
* gcc-interface/trans.c (process_freeze_entity): Do not special-case
class-wide subtypes.

* s-osinte-aix.adb (clock_gettime): Fix comment.
* s-osinte-darwin.adb (clock_gettime): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154514 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/exp_ch8.adb
gcc/ada/exp_intr.adb
gcc/ada/exp_util.adb
gcc/ada/freeze.adb
gcc/ada/gcc-interface/decl.c
gcc/ada/gcc-interface/trans.c
gcc/ada/s-osinte-aix.adb
gcc/ada/s-osinte-darwin.adb

index a0ed110..b8702d5 100644 (file)
@@ -1,3 +1,23 @@
+2009-11-24  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * exp_util.adb (Make_CW_Equivalent_Type): Do not mark the type as
+       frozen for targets that do not require front-end layout.
+       (New_Class_Wide_Subtype): Always reset the freezing status to False.
+       * exp_ch8.adb: Do not 'with' Targparm.
+       (Expand_N_Object_Renaming_Declaration): Always freeze a class-wide
+       subtype that has been built from the expression.
+       * exp_intr.adb (Expand_Unc_Deallocation): If the designated type is
+       class wide, freeze the implicit type that has been built from the
+       expression at the dereference point.
+       * freeze.adb (Freeze_Entity): Adjust comment.
+       * gcc-interface/decl.c (Gigi_Equivalent_Type) <E_Class_Wide_Type>:
+       Remove useless test.
+       * gcc-interface/trans.c (process_freeze_entity): Do not special-case
+       class-wide subtypes.
+
+       * s-osinte-aix.adb (clock_gettime): Fix comment.
+       * s-osinte-darwin.adb (clock_gettime): Likewise.
+
 2009-11-23  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Pass the list
index 68fa50e..fc28371 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2007, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2009, 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- --
@@ -35,7 +35,6 @@ with Sem;      use Sem;
 with Sem_Ch8;  use Sem_Ch8;
 with Sinfo;    use Sinfo;
 with Stand;    use Stand;
-with Targparm; use Targparm;
 
 package body Exp_Ch8 is
 
@@ -254,15 +253,9 @@ package body Exp_Ch8 is
          Set_Etype (Defining_Identifier (N), Entity (Subtype_Mark (N)));
 
          --  Freeze the class-wide subtype here to ensure that the subtype
-         --  and equivalent type are frozen before the renaming. This is
-         --  required for targets where Frontend_Layout_On_Target is true.
-         --  For targets where Gigi is used, class-wide subtype should not
-         --  be frozen (in that case the subtype is marked as already frozen
-         --  when it's created).
-
-         if Frontend_Layout_On_Target then
-            Freeze_Before (N, Entity (Subtype_Mark (N)));
-         end if;
+         --  and equivalent type are frozen before the renaming.
+
+         Freeze_Before (N, Entity (Subtype_Mark (N)));
       end if;
 
       --  Ada 2005 (AI-318-02): If the renamed object is a call to a build-in-
index da1314c..8f41a63 100644 (file)
@@ -1018,14 +1018,19 @@ package body Exp_Intr is
                else
                   D_Type := Make_Defining_Identifier (Loc,
                               New_Internal_Name ('A'));
-                  Insert_Action (N,
+                  Insert_Action (Deref,
                     Make_Subtype_Declaration (Loc,
                       Defining_Identifier => D_Type,
                       Subtype_Indication  => D_Subtyp));
-                  Freeze_Itype (D_Type, N);
 
                end if;
 
+               --  Force freezing at the point of the dereference. For the
+               --  class wide case, this avoids having the subtype frozen
+               --  before the equivalent type.
+
+               Freeze_Itype (D_Type, Deref);
+
                Set_Actual_Designated_Subtype (Free_Node, D_Type);
             end;
 
index fcf3878..535ec4c 100644 (file)
@@ -3775,19 +3775,6 @@ package body Exp_Util is
       --  end Equiv_T;
 
       Equiv_Type := Make_Defining_Identifier (Loc, New_Internal_Name ('T'));
-
-      --  When the target requires front-end layout, it's necessary to allow
-      --  the equivalent type to be frozen so that layout can occur (when the
-      --  associated class-wide subtype is frozen, the equivalent type will
-      --  be frozen, see freeze.adb). For other targets, Gigi wants to have
-      --  the equivalent type marked as frozen and deals with this type itself.
-      --  In the Gigi case this will also avoid the generation of an init
-      --  procedure for the type.
-
-      if not Frontend_Layout_On_Target then
-         Set_Is_Frozen (Equiv_Type);
-      end if;
-
       Set_Ekind (Equiv_Type, E_Record_Type);
       Set_Parent_Subtype (Equiv_Type, Constr_Root);
 
@@ -4090,18 +4077,7 @@ package body Exp_Util is
       Set_Ekind (Res, E_Class_Wide_Subtype);
       Set_Next_Entity (Res, Empty);
       Set_Etype (Res, Base_Type (CW_Typ));
-
-      --  For targets where front-end layout is required, reset the Is_Frozen
-      --  status of the subtype to False (it can be implicitly set to true
-      --  from the copy of the class-wide type). For other targets, Gigi
-      --  doesn't want the class-wide subtype to go through the freezing
-      --  process (though it's unclear why that causes problems and it would
-      --  be nice to allow freezing to occur normally for all targets ???).
-
-      if Frontend_Layout_On_Target then
-         Set_Is_Frozen (Res, False);
-      end if;
-
+      Set_Is_Frozen (Res, False);
       Set_Freeze_Node (Res, Empty);
       return (Res);
    end New_Class_Wide_Subtype;
index 56389bb..85206f7 100644 (file)
@@ -3459,10 +3459,7 @@ package body Freeze is
             end if;
 
             --  The equivalent type associated with a class-wide subtype needs
-            --  to be frozen to ensure that its layout is done. Class-wide
-            --  subtypes are currently only frozen on targets requiring
-            --  front-end layout (see New_Class_Wide_Subtype and
-            --  Make_CW_Equivalent_Type in exp_util.adb).
+            --  to be frozen to ensure that its layout is done.
 
             if Ekind (E) = E_Class_Wide_Subtype
               and then Present (Equivalent_Type (E))
index ceb1f34..925610c 100644 (file)
@@ -4965,9 +4965,7 @@ Gigi_Equivalent_Type (Entity_Id gnat_entity)
       break;
 
     case E_Class_Wide_Type:
-      gnat_equiv = ((Present (Equivalent_Type (gnat_entity)))
-                   ? Equivalent_Type (gnat_entity)
-                   : Root_Type (gnat_entity));
+      gnat_equiv = Root_Type (gnat_entity);
       break;
 
     case E_Task_Type:
index 41be8bb..51c846f 100644 (file)
@@ -6087,11 +6087,9 @@ process_freeze_entity (Node_Id gnat_node)
   if (Present (Address_Clause (gnat_entity)))
     gnu_old = 0;
 
-  /* Don't do anything for class-wide types they are always
-     transformed into their root type.  */
-  if (Ekind (gnat_entity) == E_Class_Wide_Type
-      || (Ekind (gnat_entity) == E_Class_Wide_Subtype
-         && Present (Equivalent_Type (gnat_entity))))
+  /* Don't do anything for class-wide types as they are always transformed
+     into their root type.  */
+  if (Ekind (gnat_entity) == E_Class_Wide_Type)
     return;
 
   /* Don't do anything for subprograms that may have been elaborated before
index 15b4d63..bfe03a6 100644 (file)
@@ -110,8 +110,7 @@ package body System.OS_Interface is
    is
       pragma Unreferenced (clock_id);
 
-      --  Darwin threads don't have clock_gettime, so use
-      --  gettimeofday() instead.
+      --  Older AIX don't have clock_gettime, so use gettimeofday
 
       use Interfaces;
 
index 1f47dde..3bf0bb9 100644 (file)
@@ -93,8 +93,7 @@ package body System.OS_Interface is
    is
       pragma Unreferenced (clock_id);
 
-      --  AIX threads don't have clock_gettime, so use
-      --  gettimeofday() instead.
+      --  Darwin Threads don't have clock_gettime, so use gettimeofday
 
       use Interfaces;