This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch committed] Fix target/40313


I've applied the attached patch to fix PR target/40313.
In failing case, insn scheduling after reload pass moves a frame
related insn in the prologue after NOTE_INSN_EPILOGUE_BEG note
and this confuses dwarf2out_begin_epilogue.  The patch emits
a blockage insn before such insn in that situation.  This may
make a difference of the codes with/without -g which isn't good
in general, but I guess it wouldn't be a real problem in this
specific situation because if such movement of the frame related
insn happened, then no one can expect -g works well in the first

The patch is tested with bootstrap and the top level "make -k
check" on sh4-unknown-linux-gnu with no new failures.

2009-05-31  Kaz Kojima  <>

	PR target/40313
	* config/sh/sh.c: Include debug.h.
	(sh_expand_epilogue): Emit a blockage insn before the frame
	pointer adjustment also when dwarf2out_do_frame returns true.

--- ORIG/trunk/gcc/config/sh/sh.c	2009-05-30 18:35:42.000000000 +0900
+++ trunk/gcc/config/sh/sh.c	2009-05-31 08:46:05.000000000 +0900
@@ -43,6 +43,7 @@ along with GCC; see the file COPYING3.  
 #include "target.h"
 #include "target-def.h"
 #include "real.h"
+#include "debug.h"
 #include "langhooks.h"
 #include "basic-block.h"
 #include "df.h"
@@ -6747,8 +6748,9 @@ 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)
+	 when exception handling or frame information is needed.
+	 See PR/18032 and PR/40313.  */
+      if (flag_exceptions || dwarf2out_do_frame ())
 	emit_insn (gen_blockage ());
       output_stack_adjust (frame_size, hard_frame_pointer_rtx, e,

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]