[forwarded from http://bugs.debian.org/285695] works with 3.3 CVS 20041215, HEAD 200401212, fails with 3.4 CVS 20041215, binutils-2.15. $ gcc -O foo.c /tmp/cc68I7Tr.s: Assembler messages: /tmp/cc68I7Tr.s:26: Error: bad register name `%sil' #include <stdio.h> int main( int nb, char *argv[] ) { unsigned char a = nb, b = nb + 1; printf("a = %d - b = %d\n", a, b); a ^= b; b ^= a; a ^= b; printf("a = %d - b = %d\n", a, b); return 0; }
Created attachment 7746 [details] preprocessed source
I can't reproduce this. Can you post the exact output of gcc -v? Thanks Wolfgang
*** Bug 19026 has been marked as a duplicate of this bug. ***
I could reproduce this bug with : Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.2/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=i386-redhat-linux Thread model: posix gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3) Other people reported (https://linuxfr.org/forums/31/5533.html) they could reproduce with : gcc (GCC) 3.4.3 (Mandrakelinux 10.2 3.4.3-1mdk) gcc (GCC) 3.4.1 (Mandrakelinux 10.1 3.4.1-4mdk)
Confirmed.
Subject: Bug 19005 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: rth@gcc.gnu.org 2004-12-16 01:51:32 Modified files: gcc : ChangeLog gcc/config/i386: i386.md Log message: PR target/19005 * config/i386/i386.md (swaphi_1): Swap with swaphi_2, allow with optimize_size. (swapqi_1): Rename from swapqi. Enable only for no partial reg stall and optimize_size. (swapqi_2): New. (swaphi_1, swaphi_2, swapqi_1): Add athlon_decode. (swapsi, swaphi_1, swaphi_2, swapqi_1, swapdi): Remove modrm override. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.740&r2=2.2326.2.741 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.md.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.502.2.12&r2=1.502.2.13
Subject: Bug 19005 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: rth@gcc.gnu.org 2004-12-16 09:31:18 Modified files: gcc : ChangeLog gcc/config/i386: i386.md Log message: PR target/19005 * config/i386/i386.md (swaphi_1): Swap with swaphi_2, allow with optimize_size. (swapqi_1): Rename from swapqi. Enable only for no partial reg stall and optimize_size. (swapqi_2): New. (swaphi_1, swaphi_2, swapqi_1): Add athlon_decode. (swapsi, swaphi_1, swaphi_2, swapqi_1, swapdi): Remove modrm override. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.1039&r2=1.16114.2.1040 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.md.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.404.2.27&r2=1.404.2.28
Fixed.
Subject: Bug 19005 CVSROOT: /cvs/gcc Module name: gcc Changes by: rth@gcc.gnu.org 2004-12-16 09:40:35 Modified files: gcc : ChangeLog gcc/config/i386: i386.md Log message: PR target/19005 * config/i386/i386.md (swaphi_1): Swap with swaphi_2, allow with optimize_size. (swapqi_1): Rename from swapqi. Enable only for no partial reg stall and optimize_size. (swapqi_2): New. (swaphi_1, swaphi_2, swapqi_1): Add athlon_decode. (swapsi, swaphi_1, swaphi_2, swapqi_1, swapdi): Remove modrm override. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.6851&r2=2.6852 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.md.diff?cvsroot=gcc&r1=1.579&r2=1.580
Subject: Bug 19005 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-rhl-branch Changes by: jakub@gcc.gnu.org 2005-07-08 14:20:28 Modified files: gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.c-torture/execute: pr19005.c Log message: PR target/19005 * gcc.c-torture/execute/pr19005.c: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-rhl-branch&r1=1.5084.2.9.2.38&r2=1.5084.2.9.2.39 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/pr19005.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-rhl-branch&r1=NONE&r2=1.1.2.1
Subject: Bug 19005 Author: jakub Date: Thu Dec 8 21:49:17 2005 New Revision: 108246 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108246 Log: PR target/19005 * gcc.c-torture/execute/pr19005.c: New test. Added: trunk/gcc/testsuite/gcc.c-torture/execute/pr19005.c Modified: trunk/gcc/testsuite/ChangeLog
Subject: Bug 19005 Author: jakub Date: Thu Dec 8 21:54:34 2005 New Revision: 108252 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108252 Log: PR target/19005 * gcc.c-torture/execute/pr19005.c: New test. Added: branches/gcc-4_1-branch/gcc/testsuite/gcc.c-torture/execute/pr19005.c Modified: branches/gcc-4_1-branch/gcc/testsuite/ChangeLog