public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch committed SH] Fix PR target/65987
@ 2015-05-04 23:28 Kaz Kojima
  0 siblings, 0 replies; only message in thread
From: Kaz Kojima @ 2015-05-04 23:28 UTC (permalink / raw)
  To: gcc-patches

I've committed the attached patch to fix PR target/65987
which is a 6 regression.  The recent stdarg change reveals
the target problem for section crossing jumps.
Some SH specific jump optimizations don't take into account
such jumps.  The attached patch is a minimal fix to solve
the above PR.  Tested on sh4-unknown-linux-gnu.

Regards,
	kaz
--
2015-05-04  Kaz Kojima  <kkojima@gcc.gnu.org>

	PR target/65987
	* config/sh/sh.c (output_far_jump): Take into account crossing jumps.
	(split_branches): Likewise.

diff --git a/config/sh/sh.c b/config/sh/sh.c
index 1cf6ed0..a4c9c4c 100644
--- a/config/sh/sh.c
+++ b/config/sh/sh.c
@@ -2747,7 +2747,8 @@ output_far_jump (rtx_insn *insn, rtx op)
 
   if (TARGET_SH2
       && offset >= -32764
-      && offset - get_attr_length (insn) <= 32766)
+      && offset - get_attr_length (insn) <= 32766
+      && ! CROSSING_JUMP_P (insn))
     {
       far = 0;
       jump =   "mov.w	%O0,%1" "\n"
@@ -6753,6 +6754,13 @@ split_branches (rtx_insn *first)
 
 	    if (type == TYPE_JUMP)
 	      {
+		if (CROSSING_JUMP_P (insn))
+		  {
+		    emit_insn_before (gen_block_branch_redirect (const0_rtx),
+				      insn);
+		    continue;
+		  }
+
 		far_label = as_a <rtx_insn *> (
 			      XEXP (SET_SRC (PATTERN (insn)), 0));
 		dest_uid = get_dest_uid (far_label, max_uid);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-05-04 23:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-04 23:28 [patch committed SH] Fix PR target/65987 Kaz Kojima

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).