From bddd6058a2b9c29980962301b65a911985a3e00d Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Mon, 20 Apr 2009 14:54:27 +0200 Subject: [PATCH] [multiple changes] 2009-04-20 Nicolas Roche * 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 * 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. From-SVN: r146410 --- gcc/ada/ChangeLog | 19 +++++++++++++++++++ gcc/ada/exp_ch3.adb | 10 ---------- gcc/ada/sem_ch3.adb | 7 ++----- gcc/ada/sysdep.c | 5 ++++- 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 21b28bb98971..e49b99269667 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,22 @@ +2009-04-20 Ed Schonberg + + * sem_ch8.adb (Analyze_Object_Renaming): Proper checks on incorrect + null exclusion qualifiers for object renaming declarations. + +2009-04-20 Nicolas Roche + + * 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 + + * 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 * sem.adb (Semantics, Walk_Library_Items): Include dependents of bodies diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 8b70aeb446b3..ae7d7a9c7e13 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -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 := diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 45c483a7c18f..db0d12c11662 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -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 diff --git a/gcc/ada/sysdep.c b/gcc/ada/sysdep.c index 8a227b42037d..fd4dfad97dbd 100644 --- a/gcc/ada/sysdep.c +++ b/gcc/ada/sysdep.c @@ -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) (); } -- 2.47.2