This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/67061] sh64-elf: internal compiler error: in sh_find_set_of_reg, at config/sh/sh-protos.h:235
- 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: Sat, 01 Aug 2015 00:12:20 +0000
- Subject: [Bug target/67061] sh64-elf: internal compiler error: in sh_find_set_of_reg, at config/sh/sh-protos.h:235
- Auto-submitted: auto-generated
- References: <bug-67061-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67061
--- Comment #4 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Kazumoto Kojima from comment #2)
>
> where reg is r2 and curr_insn is the insn 31. sh_find_set_of_reg is
> stepping backward from the insn 31 but the call_insn 29 is missed.
>
> Does the patch below work?
>
> Oleg, it's the same one we've discussed, I think. Thought?
Same function, different problem, and all are true :)
The previous issue was that sh_find_set_of_reg does not check if an insn
clobbers the searched reg. Usually set_of will find a regular clobber in the
insn. For calls that clobber some hardregs it doesn't work. This requires
additional calls to 'modified_in_p'.
This issue here is that it doesn't understand that the call_insn sets the
searched reg. Your patch works for this particular case, but I think the
better fix for this would be to just use INSN_P instead of NONJUMP_INSN_P.
Then we don't need the REGNO check.
I've planted the assert (which got us here) to catch inconsistencies of the
return value. Even if sh_find_set_of_reg skips over the the call_insn because
of the !NONJUMP_INSN_P, the return value should be consistent. So there is
another problem. I'll work on a patch for that.