Patchwork [Ada] : Fix PR/55445 also for Ada's SEH-exception-mechanism

login
register
mail settings
Submitter Kai Tietz
Date April 23, 2013, 9:13 a.m.
Message ID <CAEwic4YmMJ=hUvtnZ8RQe1NV_cvxc=mgHc5e0o8hRkBTwqW5Rw@mail.gmail.com>
Download mbox | patch
Permalink /patch/238825/
State New
Headers show

Comments

Kai Tietz - April 23, 2013, 9:13 a.m.
Hi,

this patch adds the missing part of PR/55445 for Ada.  Issue is that
__SEH__ gets defined
if SEH-annotations are generated.  That doesn't mean necessarily that
SEH-exception-mechanism
is used.  The SEH-annotations are also used for
SjLj-exception-mechanism.  So patch adds to
clauses the additional check that SjLj is deactive.

ChangeLog

2013-04-23  Kai Tietz  <ktietz@redhat.com>

    PR target/55445
    * raise-gcc.c (__SEH__): Additional check that
    SjLj isn't active.

Tested for x86_64-pc-cygwin, and x86_64-w64-mingw32.  Ok for apply?

Regards,
Kai
Arnaud Charlet - April 23, 2013, 9:18 a.m.
> --- raise-gcc.c    (Revision 198124)
> +++ raise-gcc.c    (Arbeitskopie)
> @@ -1019,7 +1019,7 @@ extern void __gnat_notify_unhandled_exception
> (str
> 
>  #ifdef __USING_SJLJ_EXCEPTIONS__
>  #define PERSONALITY_FUNCTION    __gnat_personality_sj0
> -#elif defined(__SEH__)
> +#elif defined (__SEH__)  && !defined (__USING_SJLJ_EXCEPTIONS__)

This test shouldn't be needed, since we already test
__USING_SJLJ_EXCEPTIONS__ above.

>  #define PERSONALITY_FUNCTION    __gnat_personality_imp
>  #else
>  #define PERSONALITY_FUNCTION    __gnat_personality_v0
> @@ -1056,7 +1056,7 @@ typedef int version_arg_t;
>  typedef _Unwind_Action phases_arg_t;
>  #endif
> 
> -#ifdef __SEH__
> +#if defined (__SEH__) && !defined (__USING_SJLJ_EXCEPTIONS__)
>  static
>  #endif
>  _Unwind_Reason_Code
> @@ -1222,7 +1222,7 @@ __gnat_Unwind_ForcedUnwind (_Unwind_Exception
> *e,
>  #endif
>  }
> 
> -#ifdef __SEH__
> +#if defined (__SEH__) && !defined (__USING_SJLJ_EXCEPTIONS__)
> 
>  #define STATUS_USER_DEFINED        (1U << 29)

Rest looks OK.
Kai Tietz - April 23, 2013, 7:20 p.m.
Ok, applied to trunk and 4.8 branch with your suggested change.

Kai

Patch

Index: raise-gcc.c
===================================================================
--- raise-gcc.c    (Revision 198124)
+++ raise-gcc.c    (Arbeitskopie)
@@ -1019,7 +1019,7 @@  extern void __gnat_notify_unhandled_exception (str

 #ifdef __USING_SJLJ_EXCEPTIONS__
 #define PERSONALITY_FUNCTION    __gnat_personality_sj0
-#elif defined(__SEH__)
+#elif defined (__SEH__)  && !defined (__USING_SJLJ_EXCEPTIONS__)
 #define PERSONALITY_FUNCTION    __gnat_personality_imp
 #else
 #define PERSONALITY_FUNCTION    __gnat_personality_v0
@@ -1056,7 +1056,7 @@  typedef int version_arg_t;
 typedef _Unwind_Action phases_arg_t;
 #endif

-#ifdef __SEH__
+#if defined (__SEH__) && !defined (__USING_SJLJ_EXCEPTIONS__)
 static
 #endif
 _Unwind_Reason_Code
@@ -1222,7 +1222,7 @@  __gnat_Unwind_ForcedUnwind (_Unwind_Exception *e,
 #endif
 }

-#ifdef __SEH__
+#if defined (__SEH__) && !defined (__USING_SJLJ_EXCEPTIONS__)

 #define STATUS_USER_DEFINED        (1U << 29)