From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24573 invoked by alias); 26 Oct 2011 23:07:27 -0000 Received: (qmail 24562 invoked by uid 22791); 26 Oct 2011 23:07:26 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 26 Oct 2011 23:07:12 +0000 From: "oleg.endo@t-online.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/50751] SH Target: Displacement addressing does not work for QImode and HImode Date: Wed, 26 Oct 2011 23:07: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-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: oleg.endo@t-online.de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2011-10/txt/msg02742.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50751 --- Comment #7 from Oleg Endo 2011-10-26 23:07:08 UTC --- Created attachment 25622 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25622 asmcons and ira pass log for the reload failure of "z" insn constraint (In reply to comment #5) > It seems that clobbering R0 in that expander is simply papering > over the real problem. Yes, it is very much. > Although the reload issue beyonds me, > .ira dump file about that impossible insn which doesn't satisfy > the "z" constraint would be a starting point. I've been trying to make some sense out of it since, but I'm a bit clueless at the moment here. The following function is a reduced failure example: int fail (char* buf0, char* buf1) { char a,b,c; a = buf0[0] + buf1[1]; b = buf0[5] + buf1[4]; c = buf0[15] + buf1[14]; return a+b-c; } In the attached log the problematic pseudo reg is reg:QI 191, where it is reloaded into r1... Reloads for insn # 13 Reload 0: reload_in (QI) = (reg:QI 191 [ MEM[(char *)buf1_4(D) + 4B] ]) reload_out (SI) = (reg:SI 1 r1 [193]) GENERAL_REGS, RELOAD_OTHER (opnum = 0) Strange thing is that the following variant does not cause the error: int fail (char* buf0, char* buf1, char* out) { char a,b,c; a = buf0[0] + buf1[1]; b = buf0[5] + buf1[4]; c = buf0[15] + buf1[14]; *out = a+b-c; return *out; }