From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8491 invoked by alias); 10 May 2014 21:27:03 -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 8440 invoked by uid 48); 10 May 2014 21:26:59 -0000 From: "olegendo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/61142] New: [SH] QImode/HImode @(R0,Rm),Rn does not load to Rn = R0 Date: Sat, 10 May 2014 21:27:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: olegendo at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cf_gcctarget Message-ID: 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: 2014-05/txt/msg00919.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61142 Bug ID: 61142 Summary: [SH] QImode/HImode @(R0,Rm),Rn does not load to Rn = R0 Product: gcc Version: 4.10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: olegendo at gcc dot gnu.org Target: sh*-*-* I've noticed that @(R0,Rm),Rn loads won't load into Rn = R0. Example: int test0 (const char* x, int a, int b, int c) { if (x[a] == 92) return b; return c; } With -O2 -m4 -ml compiles to: mov r5,r0 mov.b @(r0,r4),r1 <<<< mov r1,r0 <<<< cmp/eq #92,r0 bt .L3 mov r7,r0 rts nop .align 1 .L3: rts mov r6,r0 This happens for QImode and HImode loads. SImode is fine. I'm not sure whether it's a side effect of the changes done for PR 50751, or something else. It could be worked around with a peephole, but then we'd waste one register.