[PowerPC] Fix PR25176: Array_3 bytecode->native test fail

Alan Modra amodra@bigpond.net.au
Thu Dec 1 23:41:00 GMT 2005


On Fri, Dec 02, 2005 at 09:44:49AM +1030, Alan Modra wrote:
> delete_unreachable_blocks is removing it.  OK, so I was tired last
> night..  The asm *isn't* in the right place.  I think it needs to be
> moved to just after the return label.

Like this.  Cures the Array_3 failure and of course I now don't need
the powerpc backend blockages .  Bootstrap in progress.

	PR middle-end/25176
	* function.c (expand_function_end): Emit blockage for unwinder
	after return label.

Index: gcc/function.c
===================================================================
--- gcc/function.c	(revision 107758)
+++ gcc/function.c	(working copy)
@@ -4334,14 +4334,6 @@ 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.  */
@@ -4373,10 +4365,23 @@ expand_function_end (void)
   /* Output the label for the actual return from the function.  */
   emit_label (return_label);
 
-  /* Let except.c know where it should emit the call to unregister
-     the function context for sjlj exceptions.  */
-  if (flag_exceptions && USING_SJLJ_EXCEPTIONS)
-    sjlj_emit_function_exit_after (get_last_insn ());
+  if (USING_SJLJ_EXCEPTIONS)
+    {
+      /* Let except.c know where it should emit the call to unregister
+	 the function context for sjlj exceptions.  */
+      if (flag_exceptions)
+	sjlj_emit_function_exit_after (get_last_insn ());
+    }
+  else
+    {
+      /* @@@ 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, ""));
+    }
 
   /* If this is an implementation of throw, do what's necessary to
      communicate between __builtin_eh_return and the epilogue.  */

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Gcc-patches mailing list