2009-04-20 Nicolas Roche <roche@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 20 Apr 2009 12:54:27 +0000 (12:54 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 20 Apr 2009 12:54:27 +0000 (12:54 +0000)
* sysdep.c (__gnat_localtime_tzoff): on Windows, manipulated times are
unsigned long long. So compare local_time and utc_time before computing
the difference.

2009-04-20  Eric Botcazou  <ebotcazou@adacore.com>

* sem_ch3.adb (Build_Derived_Private_Type): Insert the declaration
of the Underlying_Record_View before that of the derived type.

* exp_ch3.adb (Expand_Record_Extension): Do not special-case types
with unknown discriminants with regard to the parent subtype.

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

gcc/ada/ChangeLog
gcc/ada/exp_ch3.adb
gcc/ada/sem_ch3.adb
gcc/ada/sysdep.c

index 21b28bb..e49b992 100644 (file)
@@ -1,3 +1,22 @@
+2009-04-20  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch8.adb (Analyze_Object_Renaming): Proper checks on incorrect
+       null exclusion qualifiers for object renaming declarations.
+
+2009-04-20  Nicolas Roche  <roche@adacore.com>
+
+       * sysdep.c (__gnat_localtime_tzoff): on Windows, manipulated times are
+       unsigned long long. So compare local_time and utc_time before computing
+       the difference.
+
+2009-04-20  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * sem_ch3.adb (Build_Derived_Private_Type): Insert the declaration
+       of the Underlying_Record_View before that of the derived type.
+
+       * exp_ch3.adb (Expand_Record_Extension): Do not special-case types
+       with unknown discriminants with regard to the parent subtype.
+
 2009-04-20  Bob Duff  <duff@adacore.com>
 
        * sem.adb (Semantics, Walk_Library_Items): Include dependents of bodies
index 8b70aeb..ae7d7a9 100644 (file)
@@ -3892,16 +3892,6 @@ package body Exp_Ch3 is
          Par_Subtype := Process_Subtype (New_Copy_Tree (Indic), Def);
       end if;
 
-      --  If this is an extension of a type with unknown discriminants, use
-      --  full view to provide proper discriminants to gigi.
-
-      if Has_Unknown_Discriminants (Par_Subtype)
-        and then Is_Private_Type (Par_Subtype)
-        and then Present (Full_View (Par_Subtype))
-      then
-         Par_Subtype := Full_View (Par_Subtype);
-      end if;
-
       Set_Parent_Subtype (T, Par_Subtype);
 
       Comp_Decl :=
index 45c483a..db0d12c 100644 (file)
@@ -5557,10 +5557,7 @@ package body Sem_Ch3 is
                  (N, Parent_Type, Derived_Type, Derive_Subps);
 
                --  Build anonymous completion, as a derivation from the full
-               --  view of the parent. Because it is used as a placeholder
-               --  to convey information to the back-end, it must be declared
-               --  after the original type so the back-end knows that it needs
-               --  to disregard the declaration.
+               --  view of the parent.
 
                Decl :=
                  Make_Full_Type_Declaration (Loc,
@@ -5588,7 +5585,7 @@ package body Sem_Ch3 is
 
                Install_Private_Declarations (Par_Scope);
                Install_Visible_Declarations (Par_Scope);
-               Insert_After (N, Decl);
+               Insert_Before (N, Decl);
 
                --  Mark entity as an underlying record view before analysis,
                --  to avoid generating the list of its primitive operations
index 8a227b4..fd4dfad 100644 (file)
@@ -787,7 +787,10 @@ __gnat_localtime_tzoff (const time_t *timer, long *off)
      /* An error occurs so return invalid_tzoff.  */
      *off = __gnat_invalid_tzoff;
   else
-     *off = (long) ((local_time.ull_time - utc_time.ull_time) / 10000000ULL);
+     if (local_time.ull_time > utc_time.ull_time)
+        *off = (long) ((local_time.ull_time - utc_time.ull_time) / 10000000ULL);
+     else
+        *off = - (long) ((utc_time.ull_time - local_time.ull_time) / 10000000ULL);
 
   (*Unlock_Task) ();
 }