This is the mail archive of the gcc-patches@gcc.gnu.org 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 SH] Fix sh64-elf build failure


Hi,

I've committed the patch below to fix sh64-elf build failure.
SHmedia and SHcompact using call cookie require special return insns
and will require an extra work to enable simple_return.  I simply
disable it for these targets ATM.

Regards,
	kaz
--
2012-10-04  Kaz Kojima  <kkojima@gcc.gnu.org>

	* config/sh/sh.c (sh_can_use_simple_return_p): Return false for
	SHmedia	and SHcompact using call cookie.
	* config/sh/sh.md (epilogue): Emit non-inlined return insns for
	SHmedia	and SHcompact using call cookie.

Index: gcc/config/sh/sh.md
===================================================================
--- gcc/config/sh/sh.md	(revision 192060)
+++ gcc/config/sh/sh.md	(working copy)
@@ -10460,6 +10460,13 @@
   ""
 {
   sh_expand_epilogue (false);
+  if (TARGET_SHMEDIA
+      || (TARGET_SHCOMPACT
+	  && (crtl->args.info.call_cookie & CALL_COOKIE_RET_TRAMP (1))))
+    {
+      emit_jump_insn (gen_return ());
+      DONE;
+    }
 })
 
 (define_expand "eh_return"
Index: gcc/config/sh/sh.c
===================================================================
--- gcc/config/sh/sh.c	(revision 192060)
+++ gcc/config/sh/sh.c	(working copy)
@@ -13134,6 +13134,12 @@
   HARD_REG_SET live_regs_mask;
   int d;
 
+  /* Some targets require special return insns.  */
+  if (TARGET_SHMEDIA
+      || (TARGET_SHCOMPACT
+	  && (crtl->args.info.call_cookie & CALL_COOKIE_RET_TRAMP (1))))
+    return false;
+
   if (! reload_completed || frame_pointer_needed)
     return false;
 


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