This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/11103] New: asm-specifier conflicts with asm clobber list


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11103

           Summary: asm-specifier conflicts with asm clobber list
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mdb@gnu.org
                CC: gcc-bugs@gcc.gnu.org
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: xscal-elf

Using the gcc 3.2.2 xscale-elf-gcc compiler had no problems with the test case.

Using the gcc 3.3 xscale-elf-gcc compiler will produce the following
messages:

blkpg-test.c: In function `blk_ioctl':
blkpg-test.c:13: error: asm-specifier for variable `myr1' conflicts with asm
clobber list

The basic problem is that the gcc code generator does NOT like the user
forcing the use of registers r0 and r1 for the inline assembler.

The workaround would appear to be to elide the asm("r1") and the two
asm("r0") extensions and let gcc choose the register for the code...
which really only works correctly if that is what the __put_user_1
function will accept.

In the real world, this problem is found by building the file
linux-2.4.19/drivers/block/blkpg.c which results in the error

blkpg.c: In function `blk_ioctl':
blkpg.c:285: warning: comparison between signed and unsigned
blkpg.c:252: error: asm-specifier for variable `__r1' conflicts with asm clobber
list


Release:
gcc 3.3

Target:
xscale-elf

Environment:
Redhat 7.3 GNU/Linux: uname -a says:
Linux mdb-lnx 2.4.20-13.7 #1 Mon May 12 13:13:52 EDT 2003 i686 unknown

How-To-Repeat:
cat <<EOF > blkpg-test.c
/*
 * -------------- blkpg-test.c ---------------
 * xscale-elf-gcc -c blkpg-test.c
 */

int __put_user_1 (void *, unsigned int);
int
blk_ioctl (unsigned long long *arg)
{
    const register unsigned long long myr1 asm("r1") = 0;
    const register unsigned long long *ptr asm("r0") = arg;
    register int res asm("r0");
    __asm__ __volatile__ ("bl   __put_user_1"
                          : "=&r" (res)
                          : "0" (ptr), "r" (myr1)
                          : "r2", "lr");
    return(res);
}
EOF
xscale-elf-gcc -c blkpg-test.c



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]