Summary: | [3.3/3.4 regression] asm-specifier conflicts with asm clobber list | ||
---|---|---|---|
Product: | gcc | Reporter: | mdb |
Component: | inline-asm | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED INVALID | ||
Severity: | normal | CC: | bje, dank, gcc-bugs, marcel, rearnsha |
Priority: | P2 | ||
Version: | 3.3 | ||
Target Milestone: | 3.4.0 | ||
Host: | i686-pc-linux-gnu | Target: | xscale-elf |
Build: | i686-pc-linux-gnu | Known to work: | |
Known to fail: | Last reconfirmed: | 2003-06-08 05:51:47 |
Description
mdb
2003-06-05 18:58:17 UTC
Confirmed with gcc 3.3 and mainline (20030608). I think this belongs in the inline-asm category though. Richard, would you mind commenting on whether the code in question is legal? Thanks, Dara I get a similar error, error: asm-specifier for variable `_a1' conflicts with asm clobber list compiling glibc-2.3.2 with gcc-3.3 for arm-linux. In the real world, you should be able to reproduce this like so: wget http://www.kegel.com/crossgcc/crosstool-0.6.tar.gz tar -xzvf crosstool-0.6.tar.gz cd crosstool-0.6 eval `cat arm.dat` `cat gcc3.3-glibc2.3.2.dat` sh all.sh Here's the problem boiled down as small as I can easily get it (this is the output of $ cd build/arm-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/glibc-2.3.2/signal $ arm-unknown-linux-gnu-gcc -E ../linuxthreads/sysdeps/pthread/sigaction.c cut down by hand and reformatted with indent): -- snip -- cat > bug.c <<_EOF_ extern int *__errno_location (void) __attribute__ ((__const__)); struct kernel_sigaction { //__sighandler_t k_sa_handler; unsigned long sa_flags; void (*sa_restorer) (void); //sigset_t sa_mask; }; int __libc_sigaction(sig, act, oact) int sig; const struct sigaction *act; struct sigaction *oact; { int result; struct kernel_sigaction kact, koact; result = ( { unsigned int _sys_result = ( { unsigned int _sys_result; { register int _a1 asm("a1"); register int _a4 asm("a4") = (int)(64 / 8); register int _a3 asm("a3") = (int)(oact ? (&koact) : ((void *)0)); register int _a2 asm("a2") = (int)(act ? (&kact) : ((void *)0)); _a1 = (int) (sig); asm volatile ("swi %1 @ syscall " "rt_sigaction": "=r" (_a1): "i"(((0x900000 + 174))), "r"(_a1), "r"(_a2), "r"(_a3), "r"(_a4):"a1", "memory"); _sys_result = _a1; } (int) _sys_result; }); if (__builtin_expect(((unsigned int) (_sys_result) >= 0xfffff001u), 0)) { ((*__errno_location()) = ((-(_sys_result)))); _sys_result = (unsigned int) -1;} (int) _sys_result;}); return result; } _EOF_ arm-unknown-linux-gnu-gcc bug.c -- snip -- As Richard noted (http://gcc.gnu.org/ml/gcc-bugs/2003-06/msg01134.html), the behavior of the compiler seems to be correct, and so the bug appears to be in the code here. I am marking this bug as invalid, but if for some reason this turns out to be incorrect, we can reopen this. Ah, so I should open this as a glibc bug, then? OK, I'll try that. Supposedly fixed in glibc cvs; see http://bugs.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=glibc&pr=5051 |