Re: egcs v1.1.1 compiler bug? @ Linux v2.2.0-pre6 / depca.c

Jeffrey A Law (law@hurl.cygnus.com)
Wed, 13 Jan 1999 23:54:58 -0700


In message <m2pv8ma5ye.fsf@sauna.ton.tut.fi>you write:
>
> Tried to compile with egcs v1.1.1 and seems compiler barfs at depca.c.
>
> Linux kernel version is 2.2.0-pre6
>
> Any verifications? And I'm sorry I'm not able to debug this further.
>
> ------------------------------------------------------------------------
> /usr/local/bin/egcs -D__KERNEL__ -I/usr/src/linux-2.2.0-pre6-egcs/include -
> Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -fno-strength-reduc
> e -mpentium -DCPU=586 -DMODULE -DMODVERSIONS -include /usr/src/linux-2.2.0-
> pre6-egcs/include/linux/modversions.h -c -o depca.o depca.c
> depca.c: In function `EISA_signature':
> depca.c:1802: fixed or forbidden register 7 (sp) was spilled for class GENE
> RAL_REGS.
> This may be due to a compiler bug or to impossible asm
> statements or clauses.
It is possible that the strstr asm is using too many registers for the old
compiler to handle.

At the minimum it will need eax, ecx, edx, edi, esi. The stack pointer (esp)
is reserved.

The asm uses a "g" operand, which may need 2 registers since it could be
an indexed memory address.

Register operands may also originally be in memory, which could cause them to
need an additional register.

In fact, I can all but guarantee that some of those register operands were
initially in memory because if esp spilled, then the asm needed at least
8 registers. You should feel lucky the compiler aborted instead of silently
generating incorrect code. Normally gcc2, egcs-1.0 and egcs-1.1 will silently
generate incorrect code when as asm runs out of register.

Never snapshots of egcs are much better at handling these kinds of situations.
jeff

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/