Wrong i386 assembler code emitted by egcs--2.91.24 19980418 (gcc2 ss-980401 experimental) with -O[1-9]
ernst.molitor@uni-bonn.de
ernst.molitor@uni-bonn.de
Sun Apr 19 12:18:00 GMT 1998
Dear EGCS gurus,
first of all, many thanks for all the work you spend on this fine
tool!
With the latest EGCS (and in fact, with some of the previous
versions), I came across some problems during the compilation of the
current Linux-2.1.97 kernel (sorry, I haven't been able to produce an
example that does not rely on other parts of the Linux sources... -
the offending file was linux/arch/i386/kernel/process.c). As far as I
can tell, the problem boils down to the emission of assembler code
like this if (and only if) optimization is used:
movw 16(%esp),0(%edx)
GAS will invariably bark at this code:
GNU assembler version 980418 (i586-pc-linux-gnu), using BFD version 980418
test.s: Assembler messages:
test.s:72: Error: operands given don't match any known 386 instruction
To the best of my (very rusty) knowledge of i386 assembly, the code
listed above is an equivalent of a "memory to memory" move - could this
be the source of the problem?
At any rate, adding the -fforce-addr option to the CFLAGS allowed a
flawless compilation of the offending sources.
Best regards,
Ernst
More information about the Gcc-bugs
mailing list