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]

Incorrect xmm assembler code using -march=pentium4


The example code is from the xine distribution. The source has
embedded assembler code (__asm__) referring to a function argument,
and the generated code misuses register xmm0 under any level of
optimisation. The problem does not occur using -mcpu=pentium4

gcc -v:

Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/specs
Configured with: ../gcc-3.3.1/configure
Thread model: posix
gcc version 3.3.1

gcc invocation & errors:

gcc -save-temps -O1 -DARCH_X86 -march=pentium4 -c zoom_filter_xmmx.c
zoom_filter_xmmx.s: Assembler messages:
zoom_filter_xmmx.s:90: Error: suffix or operands invalid for `add'

the embedded assembler causing this is

"addl %0 %%eax\n" where %0 refers to an array argument of the function

and the compiler renders this as

addl %xmm0,%eax

The function argument (int array pointer) is (incorrectly) loaded
into %xmm0 earlier in the code.

regards,

John Sager
jcs@zoo.bt.co.uk

Attachment: zoom_filter_xmmx.i.bz2
Description: BZip2 compressed data


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