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

login
register
mail settings
Submitter Oleg Endo
Date May 31, 2012, 9:06 p.m.
Message ID <1338498386.2146.16.camel@yam-132-YW-E178-FTW>
Download mbox | patch
Permalink /patch/162237/
State New
Headers show

Comments

Oleg Endo - May 31, 2012, 9:06 p.m.
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.
Kaz Kojima - May 31, 2012, 10:05 p.m.
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

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