public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/62218] New: gcc produces invalid SH instruction (stc r2,sr) when building libgcc
@ 2014-08-21 14:52 dhowells at redhat dot com
2014-08-21 15:09 ` [Bug target/62218] " dhowells at redhat dot com
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: dhowells at redhat dot com @ 2014-08-21 14:52 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 3512 bytes --]
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62218
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=33374&action=edit
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: â__sync_fetch_and_nandâ changed 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: <gcc-bugs-return-458973-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
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: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
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" <gcc-bugzilla@gcc.gnu.org>
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: <bug-62218-4-XSu8wAweak@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-62218-4@http.gcc.gnu.org/bugzilla/>
References: <bug-62218-4@http.gcc.gnu.org/bugzilla/>
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?idb218
--- Comment #1 from dhowells at redhat dot com <dhowells at redhat dot com> ---
Created attachment 33375
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id3375&actioníit
Assembly output from test case
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/62218] gcc produces invalid SH instruction (stc r2,sr) when building libgcc
2014-08-21 14:52 [Bug target/62218] New: gcc produces invalid SH instruction (stc r2,sr) when building libgcc dhowells at redhat dot com
@ 2014-08-21 15:09 ` dhowells at redhat dot com
2014-08-21 15:11 ` dhowells at redhat dot com
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dhowells at redhat dot com @ 2014-08-21 15:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62218
--- Comment #2 from dhowells at redhat dot com <dhowells at redhat dot com> ---
The build is configured thus:
AR_FOR_TARGET=/usr/bin/sh-linux-gnu-ar \
AS_FOR_TARGET=/usr/bin/sh-linux-gnu-as \
DLLTOOL_FOR_TARGET=/usr/bin/sh-linux-gnu-dlltool \
LD_FOR_TARGET=/usr/bin/sh-linux-gnu-ld \
NM_FOR_TARGET=/usr/bin/sh-linux-gnu-nm \
OBJDUMP_FOR_TARGET=/usr/bin/sh-linux-gnu-objdump \
RANLIB_FOR_TARGET=/usr/bin/sh-linux-gnu-ranlib \
STRIP_FOR_TARGET=/usr/bin/sh-linux-gnu-strip \
WINDRES_FOR_TARGET=/usr/bin/sh-linux-gnu-windres \
WINDMC_FOR_TARGET=/usr/bin/sh-linux-gnu-windmc \
LDFLAGS='-Wl,-z,relro ' \
../gcc-4.9.1-20140717/configure \
--bindir=/usr/bin \
--build=x86_64-redhat-linux-gnu \
--datadir=/usr/share \
--disable-decimal-float \
--disable-dependency-tracking \
--disable-gold \
--disable-libgomp \
--disable-libmudflap \
--disable-libquadmath \
--disable-libssp \
--disable-nls \
--disable-plugin \
--disable-shared \
--disable-silent-rules \
--disable-sjlj-exceptions \
--disable-threads \
--enable-checking= \
--enable-gnu-unique-object \
--enable-initfini-array \
--enable-languages=c,c++ \
--enable-linker-build-id \
--enable-nls \
--enable-obsolete \
--enable-targets=all \
--exec-prefix=/usr \
--host=x86_64-redhat-linux-gnu \
--includedir=/usr/include \
--infodir=/usr/share/info \
--libexecdir=/usr/libexec \
--localstatedir=/var \
--mandir=/usr/share/man \
--prefix=/usr \
--program-prefix=sh-linux-gnu- \
--sbindir=/usr/sbin \
--sharedstatedir=/var/lib \
--sysconfdir=/etc \
--target=sh-linux-gnu \
--with-bugurl=http://bugzilla.redhat.com/bugzilla/ \
--with-linker-hash-style=gnu \
--with-newlib \
--with-sysroot=/usr/sh-linux-gnu/sys-root \
--with-system-libunwind \
--with-system-zlib \
--without-headers \
--without-isl \
--without-cloog \
'--with-multilib-list=m1,m2,m2e,m4,m4-single,m4-single-only,m2a,m2a-single,!m2a,!m2a-single'
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/62218] gcc produces invalid SH instruction (stc r2,sr) when building libgcc
2014-08-21 14:52 [Bug target/62218] New: gcc produces invalid SH instruction (stc r2,sr) when building libgcc dhowells at redhat dot com
2014-08-21 15:09 ` [Bug target/62218] " dhowells at redhat dot com
@ 2014-08-21 15:11 ` dhowells at redhat dot com
2014-08-21 15:23 ` dhowells at redhat dot com
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dhowells at redhat dot com @ 2014-08-21 15:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62218
--- Comment #3 from dhowells at redhat dot com <dhowells at redhat dot com> ---
The gcc sources are:
%global DATE 20140717
%global SVNREV 212747
%global gcc_version 4.9.1
only one patch is applied, attachment 33366 from bug 61996.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/62218] gcc produces invalid SH instruction (stc r2,sr) when building libgcc
2014-08-21 14:52 [Bug target/62218] New: gcc produces invalid SH instruction (stc r2,sr) when building libgcc dhowells at redhat dot com
2014-08-21 15:09 ` [Bug target/62218] " dhowells at redhat dot com
2014-08-21 15:11 ` dhowells at redhat dot com
@ 2014-08-21 15:23 ` dhowells at redhat dot com
2014-08-21 15:25 ` dhowells at redhat dot com
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dhowells at redhat dot com @ 2014-08-21 15:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62218
--- Comment #4 from dhowells at redhat dot com <dhowells at redhat dot com> ---
The following multilib subdirs are configured: mb m2 m2e m4 m4-single
m4-single-only mb/m2 mb/m2e mb/m4 mb/m4-single mb/m4-single-only mb/m2a
mb/m2a-single
The problem occurs on the first (mb).
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/62218] gcc produces invalid SH instruction (stc r2,sr) when building libgcc
2014-08-21 14:52 [Bug target/62218] New: gcc produces invalid SH instruction (stc r2,sr) when building libgcc dhowells at redhat dot com
` (2 preceding siblings ...)
2014-08-21 15:23 ` dhowells at redhat dot com
@ 2014-08-21 15:25 ` dhowells at redhat dot com
2014-09-25 14:46 ` nickc at redhat dot com
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dhowells at redhat dot com @ 2014-08-21 15:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62218
--- Comment #5 from dhowells at redhat dot com <dhowells at redhat dot com> ---
(In reply to dhowells@redhat.com from comment #0)
> A gcc build for SH produces an invalid opcode when building libgcc. It
> produces "stc sr,rN" when it should produce "ldc sr,rN".
Sorry, that should be it produces "stc rN,sr" when it should produce "ldc
rN,sr".
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/62218] gcc produces invalid SH instruction (stc r2,sr) when building libgcc
2014-08-21 14:52 [Bug target/62218] New: gcc produces invalid SH instruction (stc r2,sr) when building libgcc dhowells at redhat dot com
` (3 preceding siblings ...)
2014-08-21 15:25 ` dhowells at redhat dot com
@ 2014-09-25 14:46 ` nickc at redhat dot com
2014-09-25 15:02 ` nickc at gcc dot gnu.org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: nickc at redhat dot com @ 2014-09-25 14:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62218
Nick Clifton <nickc at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |nickc at redhat dot com
--- Comment #6 from Nick Clifton <nickc at redhat dot com> ---
Created attachment 33562
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33562&action=edit
Patch to fix typo in sync.md
This bug is due to a typo in the sync.md file. I will be applying the uploaded
patch to fix it shortly.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/62218] gcc produces invalid SH instruction (stc r2,sr) when building libgcc
2014-08-21 14:52 [Bug target/62218] New: gcc produces invalid SH instruction (stc r2,sr) when building libgcc dhowells at redhat dot com
` (4 preceding siblings ...)
2014-09-25 14:46 ` nickc at redhat dot com
@ 2014-09-25 15:02 ` nickc at gcc dot gnu.org
2014-09-25 15:24 ` olegendo at gcc dot gnu.org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: nickc at gcc dot gnu.org @ 2014-09-25 15:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62218
--- Comment #7 from Nick Clifton <nickc at gcc dot gnu.org> ---
Author: nickc
Date: Thu Sep 25 15:01:46 2014
New Revision: 215602
URL: https://gcc.gnu.org/viewcvs?rev=215602&root=gcc&view=rev
Log:
PR target/62218
* config/sh/sync.md (atomic_fetch_nand<mode>_soft_imask): Fix typo
in instruction sequence.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/sh/sync.md
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/62218] gcc produces invalid SH instruction (stc r2,sr) when building libgcc
2014-08-21 14:52 [Bug target/62218] New: gcc produces invalid SH instruction (stc r2,sr) when building libgcc dhowells at redhat dot com
` (5 preceding siblings ...)
2014-09-25 15:02 ` nickc at gcc dot gnu.org
@ 2014-09-25 15:24 ` olegendo at gcc dot gnu.org
2014-09-25 15:51 ` olegendo at gcc dot gnu.org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: olegendo at gcc dot gnu.org @ 2014-09-25 15:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62218
Oleg Endo <olegendo at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target| |sh*-*-*
Status|UNCONFIRMED |NEW
Last reconfirmed| |2014-09-25
CC| |olegendo at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #8 from Oleg Endo <olegendo at gcc dot gnu.org> ---
Please do not close this PR yet -- backports to 4.9 and 4.8 will follow.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/62218] gcc produces invalid SH instruction (stc r2,sr) when building libgcc
2014-08-21 14:52 [Bug target/62218] New: gcc produces invalid SH instruction (stc r2,sr) when building libgcc dhowells at redhat dot com
` (6 preceding siblings ...)
2014-09-25 15:24 ` olegendo at gcc dot gnu.org
@ 2014-09-25 15:51 ` olegendo at gcc dot gnu.org
2014-09-25 15:54 ` olegendo at gcc dot gnu.org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: olegendo at gcc dot gnu.org @ 2014-09-25 15:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62218
--- Comment #9 from Oleg Endo <olegendo at gcc dot gnu.org> ---
Author: olegendo
Date: Thu Sep 25 15:50:38 2014
New Revision: 215607
URL: https://gcc.gnu.org/viewcvs?rev=215607&root=gcc&view=rev
Log:
gcc/
PR target/62218
* config/sh/sync.md (atomic_test_and_set_soft_imask): Fix typo
in instruction sequence.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/sh/sync.md
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/62218] gcc produces invalid SH instruction (stc r2,sr) when building libgcc
2014-08-21 14:52 [Bug target/62218] New: gcc produces invalid SH instruction (stc r2,sr) when building libgcc dhowells at redhat dot com
` (7 preceding siblings ...)
2014-09-25 15:51 ` olegendo at gcc dot gnu.org
@ 2014-09-25 15:54 ` olegendo at gcc dot gnu.org
2014-09-25 16:01 ` olegendo at gcc dot gnu.org
2014-09-25 16:13 ` olegendo at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: olegendo at gcc dot gnu.org @ 2014-09-25 15:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62218
--- Comment #10 from Oleg Endo <olegendo at gcc dot gnu.org> ---
Author: olegendo
Date: Thu Sep 25 15:53:31 2014
New Revision: 215608
URL: https://gcc.gnu.org/viewcvs?rev=215608&root=gcc&view=rev
Log:
gcc/
Backport from mainline
2014-09-25 Nick Clifton <nickc@redhat.com>
2014-09-25 Oleg Endo <olegendo@gcc.gnu.org>
PR target/62218
* config/sh/sync.md (atomic_fetch_nand<mode>_soft_imask,
atomic_test_and_set_soft_imask): Fix typo in instruction sequence.
Modified:
branches/gcc-4_9-branch/gcc/ChangeLog
branches/gcc-4_9-branch/gcc/config/sh/sync.md
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/62218] gcc produces invalid SH instruction (stc r2,sr) when building libgcc
2014-08-21 14:52 [Bug target/62218] New: gcc produces invalid SH instruction (stc r2,sr) when building libgcc dhowells at redhat dot com
` (8 preceding siblings ...)
2014-09-25 15:54 ` olegendo at gcc dot gnu.org
@ 2014-09-25 16:01 ` olegendo at gcc dot gnu.org
2014-09-25 16:13 ` olegendo at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: olegendo at gcc dot gnu.org @ 2014-09-25 16:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62218
--- Comment #11 from Oleg Endo <olegendo at gcc dot gnu.org> ---
Author: olegendo
Date: Thu Sep 25 16:00:58 2014
New Revision: 215609
URL: https://gcc.gnu.org/viewcvs?rev=215609&root=gcc&view=rev
Log:
gcc/
2014-09-25 Oleg Endo <olegendo@gcc.gnu.org>
Backport from mainline
2014-09-25 Nick Clifton <nickc@redhat.com>
2014-09-25 Oleg Endo <olegendo@gcc.gnu.org>
PR target/62218
* config/sh/sync.md (atomic_fetch_nand<mode>_soft_imask,
atomic_test_and_set_soft_imask): Fix typo in instruction sequence.
Modified:
branches/gcc-4_8-branch/gcc/ChangeLog
branches/gcc-4_8-branch/gcc/config/sh/sync.md
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/62218] gcc produces invalid SH instruction (stc r2,sr) when building libgcc
2014-08-21 14:52 [Bug target/62218] New: gcc produces invalid SH instruction (stc r2,sr) when building libgcc dhowells at redhat dot com
` (9 preceding siblings ...)
2014-09-25 16:01 ` olegendo at gcc dot gnu.org
@ 2014-09-25 16:13 ` olegendo at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: olegendo at gcc dot gnu.org @ 2014-09-25 16:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62218
Oleg Endo <olegendo at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #12 from Oleg Endo <olegendo at gcc dot gnu.org> ---
Fixed on trunk, 4.9 and 4.8. Thanks for reporting.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2014-09-25 16:13 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-21 14:52 [Bug target/62218] New: gcc produces invalid SH instruction (stc r2,sr) when building libgcc dhowells at redhat dot com
2014-08-21 15:09 ` [Bug target/62218] " dhowells at redhat dot com
2014-08-21 15:11 ` dhowells at redhat dot com
2014-08-21 15:23 ` dhowells at redhat dot com
2014-08-21 15:25 ` dhowells at redhat dot com
2014-09-25 14:46 ` nickc at redhat dot com
2014-09-25 15:02 ` nickc at gcc dot gnu.org
2014-09-25 15:24 ` olegendo at gcc dot gnu.org
2014-09-25 15:51 ` olegendo at gcc dot gnu.org
2014-09-25 15:54 ` olegendo at gcc dot gnu.org
2014-09-25 16:01 ` olegendo at gcc dot gnu.org
2014-09-25 16:13 ` olegendo at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).