From a9bbfbd052c4a6572ec8c46149549e046f7e0ed1 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Mon, 20 Oct 2014 16:11:43 +0200 Subject: [PATCH] [multiple changes] 2014-10-20 Arnaud Charlet * set_targ.adb (Write_Target_Dependent_Values, Write_Line): Fix calling C APIs with no trailing NUL char by calling better wrappers instead. 2014-10-20 Tristan Gingold * gnat_ugn.texi: Document that gdb users must be in group _developer on mac os. 2014-10-20 Arnaud Charlet * a-tgdico.ads: Fix typo. 2014-10-20 Ed Schonberg * exp_aggr.adb (Convert_To_Assignments): Do not create a transient scope for a component whose type requires it, if the context is an initialization procedure, because the target of the assignment must be visible outside of the block. 2014-10-20 Tristan Gingold * tracebak.c: Define PC_ADJUST for arm-darwin. * env.c: Remove darwin specific code. * raise-gcc.c (__gnat_Unwind_ForcedUnwind): Error on arm-darwin. 2014-10-20 Ed Schonberg * sem_ch3.adb (Analyze_Full_Type_Declaration): If previous view is incomplete rather than private, and full type declaration has aspects, analyze aspects on the full view rather than the incomplete view, to prevent freezing anomalies with the class-wide type. From-SVN: r216470 --- gcc/ada/ChangeLog | 36 ++++++++++++++++++++++++++++++++++++ gcc/ada/a-tgdico.ads | 2 +- gcc/ada/env.c | 7 ------- gcc/ada/exp_aggr.adb | 11 +++++++++-- gcc/ada/gnat_ugn.texi | 3 ++- gcc/ada/raise-gcc.c | 7 +++++++ gcc/ada/sem_ch3.adb | 11 ++++++++++- gcc/ada/set_targ.adb | 4 ++-- gcc/ada/tracebak.c | 2 ++ 9 files changed, 69 insertions(+), 14 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 70bad2fd58a..a304daaeb5b 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,39 @@ +2014-10-20 Arnaud Charlet + + * set_targ.adb (Write_Target_Dependent_Values, Write_Line): + Fix calling C APIs with no trailing NUL char by calling better + wrappers instead. + +2014-10-20 Tristan Gingold + + * gnat_ugn.texi: Document that gdb users must be in group + _developer on mac os. + +2014-10-20 Arnaud Charlet + + * a-tgdico.ads: Fix typo. + +2014-10-20 Ed Schonberg + + * exp_aggr.adb (Convert_To_Assignments): Do not create a + transient scope for a component whose type requires it, if the + context is an initialization procedure, because the target of + the assignment must be visible outside of the block. + +2014-10-20 Tristan Gingold + + * tracebak.c: Define PC_ADJUST for arm-darwin. + * env.c: Remove darwin specific code. + * raise-gcc.c (__gnat_Unwind_ForcedUnwind): Error on arm-darwin. + +2014-10-20 Ed Schonberg + + * sem_ch3.adb (Analyze_Full_Type_Declaration): If previous view + is incomplete rather than private, and full type declaration + has aspects, analyze aspects on the full view rather than + the incomplete view, to prevent freezing anomalies with the + class-wide type. + 2014-10-17 Robert Dewar * exp_ch9.adb (Expand_N_Task_Body): Add defense against diff --git a/gcc/ada/a-tgdico.ads b/gcc/ada/a-tgdico.ads index 6da900183dc..3aae768805c 100644 --- a/gcc/ada/a-tgdico.ads +++ b/gcc/ada/a-tgdico.ads @@ -14,7 +14,7 @@ ------------------------------------------------------------------------------ pragma Warnings (Off); --- Turn of categorization warnings +-- Turn off categorization warnings generic type T (<>) is abstract tagged limited private; diff --git a/gcc/ada/env.c b/gcc/ada/env.c index de5e08a65c3..95308130cbc 100644 --- a/gcc/ada/env.c +++ b/gcc/ada/env.c @@ -76,10 +76,6 @@ extern "C" { #endif -#if defined (__APPLE__) -#include -#endif - #ifdef VMS #include #endif @@ -208,9 +204,6 @@ __gnat_environ (void) #if defined (VMS) || defined (RTX) /* Not implemented */ return NULL; -#elif defined (__APPLE__) - char ***result = _NSGetEnviron (); - return *result; #elif defined (__MINGW32__) return _environ; #elif defined (sun) diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index a3049ddffed..ac67a5724e2 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -3396,7 +3396,7 @@ package body Exp_Aggr is -- that any finalization chain will be associated with that scope. -- For extended returns, we delay expansion to avoid the creation -- of an unwanted transient scope that could result in premature - -- finalization of the return object (which is built in in place + -- finalization of the return object (which is built in place -- within the caller's scope). or else @@ -3409,7 +3409,14 @@ package body Exp_Aggr is return; end if; - if Requires_Transient_Scope (Typ) then + -- Otherwise, if a transient scope is required, create it now. If we + -- are within an initialization procedure do not create such, because + -- the target of the assignment must not be declared within a local + -- block, and because cleanup will take place on return from the + -- initialization procedure. + -- Should the condition be more restrictive ??? + + if Requires_Transient_Scope (Typ) and then not Inside_Init_Proc then Establish_Transient_Scope (N, Sec_Stack => Needs_Finalization (Typ)); end if; diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 846fa03a622..f586f87b17b 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -29282,7 +29282,8 @@ codesign -f -s "gdb-cert" /bin/gdb ... where "gdb-cert" should be replaced by the actual certificate name chosen above, and should be replaced by -the location where you installed GNAT. +the location where you installed GNAT. Also, be sure that users are +in the Unix group @samp{_developer}. @c ********************************** @c * GNU Free Documentation License * diff --git a/gcc/ada/raise-gcc.c b/gcc/ada/raise-gcc.c index 747a9de167f..507412b0c36 100644 --- a/gcc/ada/raise-gcc.c +++ b/gcc/ada/raise-gcc.c @@ -1384,7 +1384,14 @@ __gnat_Unwind_ForcedUnwind (_Unwind_Exception *e, void *argument) { #ifdef __USING_SJLJ_EXCEPTIONS__ + +# if defined (__APPLE__) && defined (__arm__) + /* There is not ForcedUnwind routine in ios system library. */ + return _URC_FATAL_PHASE1_ERROR; +# else return _Unwind_SjLj_ForcedUnwind (e, handler, argument); +# endif + #else return _Unwind_ForcedUnwind (e, handler, argument); #endif diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 473bff83716..608307e4470 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -2777,9 +2777,18 @@ package body Sem_Ch3 is -- them to the entity for the type which is currently the partial -- view, but which is the one that will be frozen. + -- In most cases the partial view is a private type, and both views + -- appear in different declarative parts. In the unusual case where the + -- partial view is incomplete, perform the analysis on the full view, + -- to prevent freezing anomalies with the corresponding class-wide type, + -- which otherwise might be frozen before the dispatch table is built. + if Has_Aspects (N) then - if Prev /= Def_Id then + if Prev /= Def_Id + and then Ekind (Prev) /= E_Incomplete_Type + then Analyze_Aspect_Specifications (N, Prev); + else Analyze_Aspect_Specifications (N, Def_Id); end if; diff --git a/gcc/ada/set_targ.adb b/gcc/ada/set_targ.adb index 46f40cc047d..8c201ea3992 100755 --- a/gcc/ada/set_targ.adb +++ b/gcc/ada/set_targ.adb @@ -370,7 +370,7 @@ package body Set_Targ is AddC (ASCII.LF); if Buflen /= Write (Fdesc, Buffer'Address, Buflen) then - Delete_File (Target_Dependent_Info_Write_Name'Address, OK); + Delete_File (Target_Dependent_Info_Write_Name.all, OK); Fail ("disk full writing file " & Target_Dependent_Info_Write_Name.all); end if; @@ -382,7 +382,7 @@ package body Set_Targ is begin Fdesc := - Create_File (Target_Dependent_Info_Write_Name.all'Address, Text); + Create_File (Target_Dependent_Info_Write_Name.all, Text); if Fdesc = Invalid_FD then Fail ("cannot create file " & Target_Dependent_Info_Write_Name.all); diff --git a/gcc/ada/tracebak.c b/gcc/ada/tracebak.c index 54ec90f674b..d5f9b9c6ba8 100644 --- a/gcc/ada/tracebak.c +++ b/gcc/ada/tracebak.c @@ -272,6 +272,8 @@ __gnat_backtrace (void **array, #define PC_ADJUST -2 #elif defined (__ppc__) || defined (__ppc64__) #define PC_ADJUST -4 +#elif defined (__arm__) +#define PC_ADJUST -2 #else #error Unhandled darwin architecture. #endif -- 2.30.2