https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55212
--- Comment #108 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Oleg Endo from comment #107)
The problem is the define_split at sh.md line 893 (the part at 945). Or
actually, it's sh_find_set_of_reg. Adding this
diff --git a/gcc/config/sh/sh-protos.h b/gcc/config/sh/sh-protos.h
index 3e4211b..b4866c1 100644
--- a/gcc/config/sh/sh-protos.h
+++ b/gcc/config/sh/sh-protos.h
@@ -199,8 +199,13 @@ sh_find_set_of_reg (rtx reg, rtx_insn* insn, F stepfunc,
{
if (BARRIER_P (result.insn))
break;
+
+ if (CALL_P (result.insn))
+ break;
+
if (!NONJUMP_INSN_P (result.insn))
continue;
+
if (reg_set_p (reg, result.insn))
{
result.set_rtx = set_of (reg, result.insn);
Fixes the test case for me. It seems I should really fix PR 67061, which looks
like the same issue (and the other issue with sh_find_set_of_reg which was
fixed with a modified_between_p).