This is the mail archive of the gcc@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]

help with different treatment of asms in 3.2 and 3.3?


3.2 compiles the following code without complaint (beyond the warnings)
and 3.3 rejects it.  The code is from the MLton ML compiler runtime; I
know nothing about inline asms; could someone offer some advice?

int Int_quot(int numerator, int denominator) {
        register int eax asm("eax");

        eax = numerator ;

        __asm__ __volatile__ ("cdq\n        idivl %1"
                :
                : "r" (eax), "m" (denominator)
                : "eax", "edx");

        return eax;
}

messages with 3.2:

[lucier@dsl-207-066 runtime]$ /usr/bin/gcc -Wall -I. -mcpu=pentiumpro -malign-loops=2 -malign-jumps=2 -malign-functions=5 -fomit-frame-pointer -O1 -DNODEBUG -c
-o basis/Int/quot.o basis/Int/quot.c -save-temps
cc1: warning: -malign-loops is obsolete, use -falign-loops
cc1: warning: -malign-jumps is obsolete, use -falign-jumps
cc1: warning: -malign-functions is obsolete, use -falign-functions
[lucier@dsl-207-066 runtime]$ /usr/bin/gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --host=i386-redhat-linux --with-system-zlib --enable-__cxa_atexit
Thread model: posix
gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)

with 3.3:

[lucier@dsl-207-066 runtime]$ gcc -Wall -I. -mcpu=pentiumpro -malign-loops=2 -malign-jumps=2 -malign-functions=5 -fomit-frame-pointer  -O1 -DNODEBUG -c -o basis/Int/quot.o basis/Int/quot.c
cc1: warning: -malign-loops is obsolete, use -falign-loops
cc1: warning: -malign-jumps is obsolete, use -falign-jumps
cc1: warning: -malign-functions is obsolete, use -falign-functions
basis/Int/quot.c: In function `Int_quot':
basis/Int/quot.c:10: error: asm-specifier for variable `eax' conflicts with asm
clobber list
[lucier@dsl-207-066 runtime]$ gcc -v
Reading specs from /usr/local/gcc-3.3/lib/gcc-lib/i686-pc-linux-gnu/3.3/specs
Configured with: ../configure --prefix=/usr/local/gcc-3.3 --disable-checking --enable-languages=c,c++
Thread model: posix
gcc version 3.3 20021016 (experimental)


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