From c427220a8caf5221617d92fd9e70a92d1f8ffe55 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Sun, 8 Jun 2008 19:06:49 +0000 Subject: [PATCH] * except.h: Correct checks for when SJLJ exceptions must be used. From-SVN: r136568 --- gcc/ChangeLog | 4 ++++ gcc/except.h | 23 +++++++++++++++-------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 92496e56ee3..1892d25562a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2008-06-08 Nathan Sidwell + + * except.h: Correct checks for when SJLJ exceptions must be used. + 2008-06-08 Manuel Lopez-Ibanez * doc/invoke.texi (Wenum-compare): Mention that it is enabled by diff --git a/gcc/except.h b/gcc/except.h index ba6f5929dd2..ae3264e6f3e 100644 --- a/gcc/except.h +++ b/gcc/except.h @@ -135,14 +135,14 @@ extern tree (*lang_eh_runtime_type) (tree); has appropriate support. */ #ifndef MUST_USE_SJLJ_EXCEPTIONS -# if !(defined (EH_RETURN_DATA_REGNO) \ +# if defined (EH_RETURN_DATA_REGNO) \ && (defined (TARGET_UNWIND_INFO) \ || (DWARF2_UNWIND_INFO \ && (defined (EH_RETURN_HANDLER_RTX) \ - || defined (HAVE_eh_return))))) -# define MUST_USE_SJLJ_EXCEPTIONS 1 -# else + || defined (HAVE_eh_return)))) # define MUST_USE_SJLJ_EXCEPTIONS 0 +# else +# define MUST_USE_SJLJ_EXCEPTIONS 1 # endif #endif @@ -152,14 +152,21 @@ extern tree (*lang_eh_runtime_type) (tree); # endif # if CONFIG_SJLJ_EXCEPTIONS == 0 # define USING_SJLJ_EXCEPTIONS 0 -# ifndef EH_RETURN_DATA_REGNO +# if !defined(EH_RETURN_DATA_REGNO) #error "EH_RETURN_DATA_REGNO required" # endif -# if !defined(EH_RETURN_HANDLER_RTX) && !defined(HAVE_eh_return) +# if ! (defined(TARGET_UNWIND_INFO) || DWARF2_UNWIND_INFO) + #error "{DWARF2,TARGET}_UNWIND_INFO required" +# endif +# if !defined(TARGET_UNWIND_INFO) \ + && !(defined(EH_RETURN_HANDLER_RTX) || defined(HAVE_eh_return)) #error "EH_RETURN_HANDLER_RTX or eh_return required" # endif -# if !defined(DWARF2_UNWIND_INFO) && !defined(TARGET_UNWIND_INFO) - #error "{DWARF2,TARGET}_UNWIND_INFO required" +/* Usually the above error checks will have already triggered an + error, but backends may set MUST_USE_SJLJ_EXCEPTIONS for their own + reasons. */ +# if MUST_USE_SJLJ_EXCEPTIONS + #error "Must use SJLJ exceptions but configured not to" # endif # endif #else -- 2.30.2