xtensa: libgcc: fix PR target/95571
[gcc.git] / libgcc / unwind-c.c
index eb50ad82a17db6c38acab943ded81167b691983c..af8e390bdbdd2470cbc7a65e5b42aa46c4d7fc75 100644 (file)
@@ -1,5 +1,5 @@
 /* Supporting functions for C exception handling.
-   Copyright (C) 2002, 2003, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2002-2020 Free Software Foundation, Inc.
    Contributed by Aldy Hernandez <aldy@quesejoda.com>.
    Shamelessly stolen from the Java front end.
 
@@ -26,6 +26,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 #include "tconfig.h"
 #include "tsystem.h"
+#include "auto-target.h"
 #include "unwind.h"
 #define NO_SIZE_OF_ENCODED_VALUE
 #include "unwind-pe.h"
@@ -105,11 +106,12 @@ PERSONALITY_FUNCTION (_Unwind_State, struct _Unwind_Exception *,
                      struct _Unwind_Context *);
 
 _Unwind_Reason_Code
+__attribute__((target ("general-regs-only")))
 PERSONALITY_FUNCTION (_Unwind_State state,
                      struct _Unwind_Exception * ue_header,
                      struct _Unwind_Context * context)
 #else
-#ifdef __SEH__
+#if defined (__SEH__) && !defined (__USING_SJLJ_EXCEPTIONS__)
 static
 #endif
 _Unwind_Reason_Code
@@ -233,7 +235,7 @@ PERSONALITY_FUNCTION (int version,
   return _URC_INSTALL_CONTEXT;
 }
 
-#ifdef __SEH__
+#if defined (__SEH__) && !defined (__USING_SJLJ_EXCEPTIONS__)
 EXCEPTION_DISPOSITION
 __gcc_personality_seh0 (PEXCEPTION_RECORD ms_exc, void *this_frame,
                        PCONTEXT ms_orig_context, PDISPATCHER_CONTEXT ms_disp)