From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 83867 invoked by alias); 1 Aug 2015 00:12:26 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 83821 invoked by uid 48); 1 Aug 2015 00:12:21 -0000 From: "olegendo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/67061] sh64-elf: internal compiler error: in sh_find_set_of_reg, at config/sh/sh-protos.h:235 Date: Sat, 01 Aug 2015 00:12:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 5.2.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: olegendo at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-08/txt/msg00000.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67061 --- Comment #4 from Oleg Endo --- (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.