- To: submit at bugs dot debian dot org
- Subject: Bug#73065: gcc: Code produced with -fPIC reserves EBX, but compiles bad __asm__ anyway
- From: <camm at enhanced dot com>
- Date: Tue, 03 Oct 2000 14:44:33 -0400
- Reply-To: <camm at enhanced dot com>, 73065 at bugs dot debian dot org
- Resent-CC: Debian GCC maintainers <gcc at packages dot debian dot org>
Package: gcc
Version: 1:2.95.2-13
Severity: normal
Greetings! Both files should fail to compile with the same warning.
I've produced verifiably incorrect asm code using the latter syntax.
intech20:/tmp$ cat foo.c
int
main(int argc,char * argv[]) {
int i=0;
__asm__ __volatile__ ("addl $1,%%ebx\n\t" : : "b" (i));
}
intech20:/tmp$ cc -fPIC foo.c -o foo
foo.c: In function `main':
foo.c:6: Invalid `asm' statement:
foo.c:6: fixed or forbidden register 3 (bx) was spilled for class BREG.
intech20:/tmp$ cat foo1.c
int
main(int argc,char * argv[]) {
int i=0;
__asm__ __volatile__ ("addl $1,%%ebx\n\t" : : "a" (i) : "ebx");
}
intech20:/tmp$ cc -fPIC foo1.c -o foo
intech20:/tmp$
-- System Information
Debian Release: 2.2
Kernel Version: Linux intech20 2.2.16 #1 SMP Tue Aug 8 17:17:46 EDT 2000 i686 unknown
Versions of the packages gcc depends on:
ii binutils 2.9.5.0.37-1 The GNU assembler, linker and binary utiliti
ii cpp 2.95.2-13 The GNU C preprocessor.
ii libc6 2.1.3-10 GNU C Library: Shared libraries and Timezone