re PR objc/31281 (ICE on ObjC try-catch blocks with next runtime)
authorStuart Hastings <stuart@apple.com>
Wed, 4 Apr 2007 18:37:14 +0000 (18:37 +0000)
committerStuart Hastings <stuart@gcc.gnu.org>
Wed, 4 Apr 2007 18:37:14 +0000 (18:37 +0000)
PR 31281
* objc/objc-act.c (next_sjlj_build_catch_list): Delete volatile from rethrow decl.
* testsuite/objc/execute/exceptions/pr31281.m: New.

From-SVN: r123501

gcc/objc/ChangeLog
gcc/objc/objc-act.c
gcc/testsuite/ChangeLog
gcc/testsuite/objc/execute/exceptions/pr31281.m [new file with mode: 0644]

index 76c342854ad4a071168dabc4dc6f24e1f6a85549..eb2061a69753471d674cc0157a99250577c60360 100644 (file)
@@ -1,3 +1,8 @@
+2007-04-04  Stuart Hastings  <stuart@apple.com>
+
+       PR 31281
+       * objc/objc-act.c (next_sjlj_build_catch_list): Delete volatile from rethrow decl.
+
 2007-03-01  Brooks Moses  <brooks.moses@codesourcery.com>
 
        * Make-lang.in: Add dummy lang.install-pdf target.
index 0cbd759e9d4dc05b9ae8423407bfe298f6b54227..19475e2f8d8dc74748c0eca823a22001792bdedd 100644 (file)
@@ -3642,7 +3642,7 @@ next_sjlj_build_catch_list (void)
 
        {
          struct _objc_exception_data _stack;
-         id volatile _rethrow = 0;
+         id _rethrow = 0;
          try
            {
              objc_exception_try_enter (&_stack);
@@ -3686,7 +3686,6 @@ next_sjlj_build_try_catch_finally (void)
 
   rethrow_decl = objc_create_temporary_var (objc_object_type);
   cur_try_context->rethrow_decl = rethrow_decl;
-  TREE_THIS_VOLATILE (rethrow_decl) = 1;
   TREE_CHAIN (rethrow_decl) = stack_decl;
 
   /* Build the outermost variable binding level.  */
index 4a5ce3b4ce84f0557c8d98e7181b52bf1132c817..7ab79cbad97aedb4069ac353fdf1cde8fa9f337d 100644 (file)
@@ -1,3 +1,8 @@
+2007-04-04  Stuart Hastings  <stuart@apple.com>
+
+       PR 31281
+       * testsuite/objc/execute/exceptions/pr31281.m: New.
+
 2007-04-04  Danny Smith  <dannysmith.users.sourceforge.net>
 
        * g++.dg/ext/dllimport12.C: Update comments.
diff --git a/gcc/testsuite/objc/execute/exceptions/pr31281.m b/gcc/testsuite/objc/execute/exceptions/pr31281.m
new file mode 100644 (file)
index 0000000..41e7a8e
--- /dev/null
@@ -0,0 +1,27 @@
+/* From PR31281.  */
+extern void abort (void);
+int __attribute__((noinline))
+f(unsigned int i)
+{
+  int j, k;
+  @try { } @catch(id) { return 13; }
+  for (j=0; j<i; j++)
+    for (k=0; k<i; k++)
+      {
+        @try {
+          if (i)
+            break;
+        } @catch(id) { }
+        return 9;
+      }
+  return 0;
+}
+
+
+int
+main()
+{
+  if (f(1))
+    abort ();
+  return 0 ;
+}