diff mbox

[SH,4.7] Backport PR 52642 - libstdc++ failures

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

Commit Message

Oleg Endo May 31, 2012, 9:06 p.m. UTC
Original patch:
http://gcc.gnu.org/ml/gcc-patches/2012-03/msg01393.html

'Tested' with..

../gcc-4_7-branch/configure --target=sh-elf --prefix=/usr/local
--enable-languages=c,c++ --enable-multilib --disable-libssp
--disable-nls --disable-werror --enable-lto --with-newlib --with-gnu-as
--with-gnu-ld --with-system-zlib

make all

OK for 4.7 branch?

ChangeLog:

	Backport from mainline
	2012-03-21  Kaz Kojima  <kkojima@gcc.gnu.org>
	PR target/52642
	* config/sh/sh.c (sh_expand_prologue): Emit blockage at the end
	of prologue for unwinder and profiler.

Comments

Kaz Kojima May 31, 2012, 10:05 p.m. UTC | #1
Oleg Endo <oleg.endo@t-online.de> wrote:
> Original patch:
> http://gcc.gnu.org/ml/gcc-patches/2012-03/msg01393.html
> 
> 'Tested' with..
> 
> ../gcc-4_7-branch/configure --target=sh-elf --prefix=/usr/local
> --enable-languages=c,c++ --enable-multilib --disable-libssp
> --disable-nls --disable-werror --enable-lto --with-newlib --with-gnu-as
> --with-gnu-ld --with-system-zlib
> 
> make all
> 
> OK for 4.7 branch?
> 
> ChangeLog:
> 
> 	Backport from mainline
> 	2012-03-21  Kaz Kojima  <kkojima@gcc.gnu.org>
> 	PR target/52642
> 	* config/sh/sh.c (sh_expand_prologue): Emit blockage at the end
> 	of prologue for unwinder and profiler.

OK as the fix for a regression from 4.6.

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;
 }