function.c (expand_function_end): Emit a blockage insn before the epilogue when ...
authorAndrew Haley <aph@redhat.com>
Wed, 10 Mar 2004 17:47:45 +0000 (17:47 +0000)
committerAndrew Haley <aph@gcc.gnu.org>
Wed, 10 Mar 2004 17:47:45 +0000 (17:47 +0000)
2004-03-10  Andrew Haley  <aph@redhat.com>

* function.c (expand_function_end): Emit a blockage insn before
the epilogue when -fnon-call-exceptions is used.

* except.c (expand_start_all_catch): Make comment more accurate.

From-SVN: r79265

gcc/ChangeLog
gcc/except.c
gcc/function.c

index eb0a82567c532d2cf4014ed33e314e6dfc6572e2..3bfc3ede49c51271381ce8bff94328e38af8d7d0 100644 (file)
@@ -1,3 +1,10 @@
+2004-03-10  Andrew Haley  <aph@redhat.com>
+
+       * function.c (expand_function_end): Emit a blockage insn before
+       the epilogue when -fnon-call-exceptions is used.
+
+       * except.c (expand_start_all_catch): Make comment more accurate.
+
 2004-03-08  Joel Sherrill  <joel@oarcorp.com>
 
        PR target/14480
index 0084af145b8ba13e678cc9e75575ee98cd3ecb7c..60edf8227b94d9260d06323ebf3145c9539d6981 100644 (file)
@@ -602,10 +602,12 @@ expand_start_all_catch (void)
   emit_jump (region->u.try.continue_label);
 }
 
-/* Begin a catch clause.  TYPE is the type caught, a list of such types, or
-   null if this is a catch-all clause. Providing a type list enables to
-   associate the catch region with potentially several exception types, which
-   is useful e.g. for Ada.  */
+/* Begin a catch clause.  TYPE is the type caught, a list of such
+   types, (in the case of Java) an ADDR_EXPR which points to the
+   runtime type to match, or null if this is a catch-all
+   clause. Providing a type list enables to associate the catch region
+   with potentially several exception types, which is useful e.g. for
+   Ada.  */
 
 void
 expand_start_catch (tree type_or_list)
index 4fffcd81b00adca8d2fb64179c3db8734554754b..2f68eaa007292eee4a562e8d14d5593b7d6db474 100644 (file)
@@ -7016,6 +7016,14 @@ expand_function_end (void)
   clear_pending_stack_adjust ();
   do_pending_stack_adjust ();
 
+  /* @@@ This is a kludge.  We want to ensure that instructions that
+     may trap are not moved into the epilogue by scheduling, because
+     we don't always emit unwind information for the epilogue.
+     However, not all machine descriptions define a blockage insn, so
+     emit an ASM_INPUT to act as one.  */
+  if (flag_non_call_exceptions)
+    emit_insn (gen_rtx_ASM_INPUT (VOIDmode, ""));
+
   /* Mark the end of the function body.
      If control reaches this insn, the function can drop through
      without returning a value.  */