http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51244
--- Comment #33 from Kazumoto Kojima <kkojima at gcc dot gnu.org> 2012-03-15 07:52:21 UTC --- (In reply to comment #31) > Created attachment 26859 [details] > testresult on sh4-unknown-linux-gnu [trunk revision 185088]. FYI, looking into the libstdc++ failures for sh4-unknown-linux-gnu, it seems that the call insn was swapped before prologue frame insns and then it makes unwinder confused. -fno-delayed-branch also stops that swapping for these failing cases. The patch below works for me. * config/sh/sh.c (sh_expand_prologue): Emit blockage at the end of prologue for unwinder and profiler. --- ORIG/trunk/gcc/config/sh/sh.c 2012-03-06 10:28:32.000000000 +0900 +++ trunk/gcc/config/sh/sh.c 2012-03-14 20:22:15.000000000 +0900 @@ -7234,6 +7234,13 @@ sh_expand_prologue (void) 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 make unwinder confused 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; }