[PATCH/RFA] PR target/18032: SH: wrong code for EH

Kaz Kojima kkojima@rr.iij4u.or.jp
Wed Oct 20 12:51:00 GMT 2004


Hi,

The appended patch suggested by Joern is to fix PR target/18032:

  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18032

It bootstraps and there are no new regressions on mainline for
sh4-unknown-linux-gnu.  OK for mainline?  Can I backport it for
3.4-branch?

Regards,
	kaz
--
2004-10-20  Kaz Kojima  <kkojima@gcc.gnu.org>

	PR target/18032
	* config/sh/sh.c (sh_expand_epilogue): Emit a blockage insn before
	the frame pointer adjustment when exception handling is enabled.

--- ORIG/gcc/gcc/config/sh/sh.c	2004-10-08 07:46:30.000000000 +0900
+++ LOCAL/gcc/gcc/config/sh/sh.c	2004-10-19 07:20:50.000000000 +0900
@@ -5828,6 +5828,10 @@ sh_expand_epilogue (bool sibcall_p)
 
   if (frame_pointer_needed)
     {
+      /* We must avoid scheduling the epilogue with previous basic blocks
+	 when exception handling is enabled.  See PR/18032.  */
+      if (flag_exceptions)
+	emit_insn (gen_blockage ());
       output_stack_adjust (frame_size, frame_pointer_rtx, e, &live_regs_mask);
 
       /* We must avoid moving the stack pointer adjustment past code



More information about the Gcc-patches mailing list