public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [SH][committed] Fix PR 67061
@ 2015-09-14 14:13 Oleg Endo
  2015-09-20 14:18 ` Oleg Endo
  0 siblings, 1 reply; 2+ messages in thread
From: Oleg Endo @ 2015-09-14 14:13 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 393 bytes --]

Hi,

The attached patch fixes PR 67061.
Tested on sh-elf trunk r227682 with
make -k check RUNTESTFLAGS="--target_board=sh-sim
\{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}"

Committed to trunk as r227750.
Will backport to GCC 5 branch later.

Cheers,
Oleg

gcc/ChangeLog:
	PR target/67061
	* config/sh/sh-protos.h (sh_find_set_of_reg): Simplfiy for-loop.
	Handle call insns.



[-- Attachment #2: sh_pr67061.patch --]
[-- Type: text/x-patch, Size: 1366 bytes --]

Index: gcc/config/sh/sh-protos.h
===================================================================
--- gcc/config/sh/sh-protos.h	(revision 227749)
+++ gcc/config/sh/sh-protos.h	(working copy)
@@ -192,19 +192,20 @@
   if (!REG_P (reg) || insn == NULL_RTX)
     return result;
 
-  rtx_insn* previnsn = insn;
-
-  for (result.insn = stepfunc (insn); result.insn != NULL_RTX;
-       previnsn = result.insn, result.insn = stepfunc (result.insn))
+  for (rtx_insn* i = stepfunc (insn); i != NULL_RTX; i = stepfunc (i))
     {
-      if (BARRIER_P (result.insn))
+      if (BARRIER_P (i))
 	break;
-      if (!NONJUMP_INSN_P (result.insn))
-	continue;
-      if (reg_set_p (reg, result.insn))
+      if (!INSN_P (i) || DEBUG_INSN_P (i))
+	  continue;
+      if (reg_set_p (reg, i))
 	{
-	  result.set_rtx = set_of (reg, result.insn);
+	  if (CALL_P (i))
+	    break;
 
+	  result.insn = i;
+	  result.set_rtx = set_of (reg, i);
+
 	  if (result.set_rtx == NULL_RTX || GET_CODE (result.set_rtx) != SET)
 	    break;
 
@@ -226,12 +227,6 @@
 	}
     }
 
-  /* If the loop above stopped at the first insn in the list,
-     result.insn will be null.  Use the insn from the previous iteration
-     in this case.  */
-  if (result.insn == NULL)
-    result.insn = previnsn;
-
   if (result.set_src != NULL)
     gcc_assert (result.insn != NULL && result.set_rtx != NULL);
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [SH][committed] Fix PR 67061
  2015-09-14 14:13 [SH][committed] Fix PR 67061 Oleg Endo
@ 2015-09-20 14:18 ` Oleg Endo
  0 siblings, 0 replies; 2+ messages in thread
From: Oleg Endo @ 2015-09-20 14:18 UTC (permalink / raw)
  To: gcc-patches

On Mon, 2015-09-14 at 22:50 +0900, Oleg Endo wrote:
> Hi,
> 
> The attached patch fixes PR 67061.
> Tested on sh-elf trunk r227682 with
> make -k check RUNTESTFLAGS="--target_board=sh-sim
> \{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}"
> 
> Committed to trunk as r227750.
> Will backport to GCC 5 branch later.

I've committed the patch to the GCC 5 branch as r227943.
Tested on sh-elf with
make -k check RUNTESTFLAGS="--target_board=sh-sim
\{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}"

Cheers,
Oleg

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-20 10:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-14 14:13 [SH][committed] Fix PR 67061 Oleg Endo
2015-09-20 14:18 ` Oleg Endo

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).