diff mbox

[SH] PR 52642 - libstdc++ failures

Message ID 1332276020.1876.199.camel@yam-132-YW-E178-FTW
State New
Headers show

Commit Message

Oleg Endo March 20, 2012, 8:40 p.m. UTC
Hi,

Attached is Kaz's patch from the PR.

Tested against rev 185555 with 
make -k check RUNTESTFLAGS="--target_board=sh-sim
\{-m2/-ml,-m2/-mb,-m2a-single/-mb,
-m4-single/-ml,-m4-single/-mb,
-m4a-single/-ml,-m4a-single/-mb}"

It fixes a few "sometimes failing" libstdc++ failures.
No new failures otherwise.

OK to apply?

Maybe this one should be backported to 4.7.x, too?

Cheers,
Oleg


ChangeLog:

	PR/target 52642
	* config/sh/sh.c (sh_expand_prologue): Emit blockage at the end
	of prologue for unwinder and profiler.

Comments

Kaz Kojima March 21, 2012, 3:15 a.m. UTC | #1
Oleg Endo <oleg.endo@t-online.de> wrote:
> It fixes a few "sometimes failing" libstdc++ failures.
> No new failures otherwise.
> 
> OK to apply?

OK.

> Maybe this one should be backported to 4.7.x, too?

Sure.

Regards,
	kaz
diff mbox

Patch

Index: gcc/config/sh/sh.c
===================================================================
--- gcc/config/sh/sh.c	(revision 185554)
+++ gcc/config/sh/sh.c	(working copy)
@@ -7239,6 +7239,13 @@ 
       emit_insn (gen_shcompact_incoming_args ());
     }
 
+  /* If we are profiling, make sure no instructions are scheduled before
+     the call to mcount.  Similarly if some call instructions are swapped
+     before frame related insns, it'll confuse the unwinder because
+     currently SH has no unwind info for function epilogues.  */
+  if (crtl->profile || flag_exceptions || flag_unwind_tables)
+    emit_insn (gen_blockage ());
+
   if (flag_stack_usage_info)
     current_function_static_stack_size = stack_usage;
 }