]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Objective-C: Default flag_objc_sjlj_exceptions off for NeXT ABI >= 2.
authorMatt Jacobson <mhjacobson@me.com>
Thu, 29 Jul 2021 08:57:23 +0000 (09:57 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Tue, 23 Apr 2024 14:11:35 +0000 (15:11 +0100)
Signed-off-by: Matt Jacobson <mhjacobson@me.com>
gcc/c-family/ChangeLog:

* c-opts.c (c_common_post_options): Default to
flag_objc_sjlj_exceptions = 1 only when flag_objc_abi < 2.

gcc/objc/ChangeLog:

* objc-next-runtime-abi-02.c
(objc_next_runtime_abi_02_init): Warn about and reset
flag_objc_sjlj_exceptions regardless of flag_objc_exceptions.
(next_runtime_02_initialize): Use a checking assert that
flag_objc_sjlj_exceptions is off.

(cherry picked from commit 798666392b512a585f0de2983a5d3423e960959e)

gcc/c-family/c-opts.c
gcc/objc/objc-next-runtime-abi-02.c

index 6f001e0bb6c20aecf39c5552849f646ddb598382..5bfa239ec0b8165883d61a622fb8e9b904daf129 100644 (file)
@@ -852,9 +852,9 @@ c_common_post_options (const char **pfilename)
   else if (!flag_gnu89_inline && !flag_isoc99)
     error ("%<-fno-gnu89-inline%> is only supported in GNU99 or C99 mode");
 
-  /* Default to ObjC sjlj exception handling if NeXT runtime.  */
+  /* Default to ObjC sjlj exception handling if NeXT runtime < v2.  */
   if (flag_objc_sjlj_exceptions < 0)
-    flag_objc_sjlj_exceptions = flag_next_runtime;
+    flag_objc_sjlj_exceptions = (flag_next_runtime && flag_objc_abi < 2);
   if (flag_objc_exceptions && !flag_objc_sjlj_exceptions)
     flag_exceptions = 1;
 
index 2f18b04e34a847187b5075c9cb73d7d637886227..2a4f87cc726f9ccb0c8d7f7b2197019c19a84150 100644 (file)
@@ -245,7 +245,7 @@ objc_next_runtime_abi_02_init (objc_runtime_hooks *rthooks)
 {
   extern_names = ggc_cleared_vec_alloc<hash> (SIZEHASHTABLE);
 
-  if (flag_objc_exceptions && flag_objc_sjlj_exceptions)
+  if (flag_objc_sjlj_exceptions)
     {
       inform (UNKNOWN_LOCATION,
              "%<-fobjc-sjlj-exceptions%> is ignored for "
@@ -511,7 +511,7 @@ static void next_runtime_02_initialize (void)
   objc_getPropertyStruct_decl = NULL_TREE;
   objc_setPropertyStruct_decl = NULL_TREE;
 
-  gcc_assert (!flag_objc_sjlj_exceptions);
+  gcc_checking_assert (!flag_objc_sjlj_exceptions);
 
   /* Although we warn that fobjc-exceptions is required for exceptions
      code, we carry on and create it anyway.  */