From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15911 invoked by alias); 21 Aug 2014 14:52:57 -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 15889 invoked by uid 48); 21 Aug 2014 14:52:53 -0000 From: "dhowells at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/62218] New: gcc produces invalid SH instruction (stc r2,sr) when building libgcc Date: Thu, 21 Aug 2014 14:52: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.9.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dhowells at redhat dot com 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 attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-08/txt/msg01469.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D62218 Bug ID: 62218 Summary: gcc produces invalid SH instruction (stc r2,sr) when building libgcc Product: gcc Version: 4.9.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: dhowells at redhat dot com Created attachment 33374 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D33374&action=3Dedit Reduced test case A gcc build for SH produces an invalid opcode when building libgcc. It produces "stc sr,rN" when it should produce "ldc sr,rN". /data/fedora/cross-gcc/gcc-4.9.1-20140717/sh-linux-gnu/./gcc/xgcc -B/data/fedora/cross-gcc/gcc-4.9.1-20140717/sh-linux-gnu/./gcc/ -B/usr/sh-linux-gnu/bin/ -O2 -mb -fpic -w -Wno-sync-nand -fbuilding-libgcc = -o /tmp/linux-atomic.o -c /tmp/linux-atomic.i /tmp/ccHwXin4.s: Assembler messages: /tmp/ccHwXin4.s:19: Error: invalid operands for opcode /tmp/ccHwXin4.s:38: Error: invalid operands for opcode /tmp/ccHwXin4.s:56: Error: invalid operands for opcode Interestingly, if -Wno-sync-nand is removed, I see this: /tmp/linux-atomic.i:7:2: note: =E2=80=98__sync_fetch_and_nand=E2=80=99 chan= ged semantics in GCC 4.4 return __sync_fetch_and_nand (x, y, z); in addition. I've attached /tmp/linux-atomic.i as a reduced test case. >>From gcc-bugs-return-458973-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Aug 21 14:53:59 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 16806 invoked by alias); 21 Aug 2014 14:53:59 -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 Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 16788 invoked by uid 48); 21 Aug 2014 14:53:55 -0000 From: "dhowells at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/62218] gcc produces invalid SH instruction (stc r2,sr) when building libgcc Date: Thu, 21 Aug 2014 14:53: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: 4.9.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dhowells at redhat dot com 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: attachments.created 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: 2014-08/txt/msg01470.txt.bz2 Content-length: 260 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62218 --- Comment #1 from dhowells at redhat dot com --- Created attachment 33375 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33375&action=edit Assembly output from test case