Re: Possible GCC contamination of Linux

Richard B. Johnson (root@chaos.analogic.com)
Wed, 22 Sep 1999 11:20:10 -0400 (EDT)


On Wed, 22 Sep 1999, Artur Skawina wrote:

> Richard B. Johnson wrote:
> >
> > The machine does 'Uncompressing Linux', 'Booting...' Screen-flash crash
> > reboot. There is no way in hell I can find the instruction(s) causing
> > the problem(s).
>
> Could you run 'objdump -d --no-show-raw-insn vmlinux | grep -3 cmov'
> on the nonbooting kernel? If the problem is indeed abs() you will
> probably see a few od these (a 486 can't handle conditional moves so
> if gcc generates them then that is a problem).
>

Nope. The instruction is not being used. However, there are a lot
of coprocessor instructions and if any of these are encountered
before the emulator handler is in place, I'm in trouble. The '486
doesn't have a coprocessor.

c0100181: fninit
c010019b: fnsetpm(287 only)
c01075dd: fnsave 0x2fc(%edx)
c0107630: fnsave 0x2fc(%eax)
c010778c: fnsave 0x2fc(%ecx)
c0107fa0: fnsave 0x2fc(%edx)
c0109513: fnsave 0x2fc(%edx)
c010957c: fninit
c01e80be: fninit
c01e80c0: fnstcw 0xa(%esp,1)
c01e8118: fninit

[SNIPPED]

> > The code generated would boot if the code was compiled with the same
> > compiler (gcc-2.8.1) compiled on a '486. It would not boot if the
> > complier was built on my '686.
>
> same gcc2.8 in the latter case too?

Same source-code.


> I did a few tests and gcc2.95.1 (std config, on a 686) seems to
> produce correct results (cmoves only when -march=i686 is specified),
> so that may have been a compiler bug that has since been fixed...
> If you can reproduce the problem, could you check if simply adding
> '-march=i386' (if your gcc supports that) helps?

I tried with both 'C' compilers.

>
> there's only one input, but it's not necessarily a variable...
> [no, this does not currently happen anywhere in the kernel. Still
> any abs() should do the right thing (ie evaluate the arg only once)]
>

Right.

Cheers,
Dick Johnson
**** FILE SYSTEM WAS MODIFIED ****
Penguin : Linux version 2.3.13 on an i686 machine (400.59 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.

-
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/