This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/81485] [SH] ICE: in sh_find_set_of_reg, at config/sh/sh-protos.h:232
- From: "olegendo at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 10 Aug 2017 15:18:29 +0000
- Subject: [Bug target/81485] [SH] ICE: in sh_find_set_of_reg, at config/sh/sh-protos.h:232
- Auto-submitted: auto-generated
- References: <bug-81485-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81485
--- Comment #6 from Oleg Endo <olegendo at gcc dot gnu.org> ---
And in fact, there has been a change to the function sh_find_set_of_reg. I'd
have to dig through the archives etc to find out what was going on there.
Meanwhile, it seems that the small backport patch below fixes the issue,
although I have not done any proper tests.
Index: gcc/config/sh/sh-protos.h
===================================================================
--- gcc/config/sh/sh-protos.h (revision 240471)
+++ gcc/config/sh/sh-protos.h (working copy)
@@ -228,8 +228,12 @@
}
}
- if (result.set_src != NULL)
- gcc_assert (result.insn != NULL && result.set_rtx != NULL);
+ /* If the searched reg is found inside a (mem (post_inc:SI (reg))), set_of
+ will return NULL and set_rtx will be NULL.
+ In this case report a 'not found'. result.insn will always be non-null
+ at this point, so no need to check it. */
+ if (result.set_src != NULL && result.set_rtx == NULL)
+ result.set_src = NULL;
return result;
}