From e1458cf8d179035643d1fe0d45e3c763967b157c Mon Sep 17 00:00:00 2001 From: charlet Date: Fri, 23 Oct 2015 12:21:21 +0000 Subject: [PATCH] 2015-10-23 Ed Schonberg * sem_util.adb (Is_Iterator, Is_Reversible_iterator): Use root type to determine whether the type is a descendant of the corresponding interface type, so take into account multiple levels of subtypes and derivations. 2015-10-23 Olivier Hainque * tracebak.c: Refine selection of GCC/GENERIC_UNWINDER for tracebacks on x86 & x86_64. (x86 & x86_64): If !SJLJ, always pick the GCC_UNWINDER for x86_64 (not only on linux). * sem_util.ads: Minor fix in comment. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229239 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/ChangeLog | 15 +++++++++++++++ gcc/ada/sem_util.adb | 12 ++++++++---- gcc/ada/sem_util.ads | 2 +- gcc/ada/tracebak.c | 2 +- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 17fa34a..f1ef4ab 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,18 @@ +2015-10-23 Ed Schonberg + + * sem_util.adb (Is_Iterator, Is_Reversible_iterator): Use + root type to determine whether the type is a descendant of the + corresponding interface type, so take into account multiple + levels of subtypes and derivations. + +2015-10-23 Olivier Hainque + + * tracebak.c: Refine selection of GCC/GENERIC_UNWINDER for + tracebacks on x86 & x86_64. + (x86 & x86_64): If !SJLJ, always pick the + GCC_UNWINDER for x86_64 (not only on linux). + * sem_util.ads: Minor fix in comment. + 2015-10-23 Hristian Kirtchev * sem_prag.adb (Analyze_Pragma): Pragma Volatile_Function should diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 90cd1ca..325e3c5 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -12119,12 +12119,16 @@ package body Sem_Util is Iface : Entity_Id; begin + -- The type may be a subtype of a descendant of the proper instance of + -- the predefined interface type, so we must use the root type of the + -- given type. The same us done for Is_Reversible_Iterator. + if Is_Class_Wide_Type (Typ) - and then Nam_In (Chars (Etype (Typ)), Name_Forward_Iterator, + and then Nam_In (Chars (Root_Type (Typ)), Name_Forward_Iterator, Name_Reversible_Iterator) and then Is_Predefined_File_Name - (Unit_File_Name (Get_Source_Unit (Etype (Typ)))) + (Unit_File_Name (Get_Source_Unit (Root_Type (Typ)))) then return True; @@ -13009,9 +13013,9 @@ package body Sem_Util is begin if Is_Class_Wide_Type (Typ) - and then Chars (Etype (Typ)) = Name_Reversible_Iterator + and then Chars (Root_Type (Typ)) = Name_Reversible_Iterator and then Is_Predefined_File_Name - (Unit_File_Name (Get_Source_Unit (Etype (Typ)))) + (Unit_File_Name (Get_Source_Unit (Root_Type (Typ)))) then return True; diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index 6fba622..1ed93de 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -2156,7 +2156,7 @@ package Sem_Util is -- Determines if Current_Scope is within an init proc function Within_Scope (E : Entity_Id; S : Entity_Id) return Boolean; - -- Returns True if entity Id is declared within scope S + -- Returns True if entity E is declared within scope S procedure Wrong_Type (Expr : Node_Id; Expected_Type : Entity_Id); -- Output error message for incorrectly typed expression. Expr is the node diff --git a/gcc/ada/tracebak.c b/gcc/ada/tracebak.c index c91f147..ff85ca5 100644 --- a/gcc/ada/tracebak.c +++ b/gcc/ada/tracebak.c @@ -433,7 +433,7 @@ struct layout but our only alternative is the generic unwinder which requires compilation forcing a frame pointer to be reliable. */ -#if defined (__linux__) && !defined (__USING_SJLJ_EXCEPTIONS__) +#if (defined (__x86_64__) || defined (__linux__)) && !defined (__USING_SJLJ_EXCEPTIONS__) #define USE_GCC_UNWINDER #else #define USE_GENERIC_UNWINDER -- 2.7.4