Re: gcc bug tickled by non-SMP linux-2.1.37-pre2

Jarno Paananen (jpaana@a31b.mtalo.ton.tut.fi)
Fri, 02 May 1997 08:03:40 +0300


Horst von Brand <vonbrand@sleipnir.valparaiso.cl> wrote:

> I recently reported that .../arch/i386/kernel/init_task.c crashes
> gcc-2.7.2.2.f.2. Further investigation uncovered a subtle bug tickled by
> the union init_task_union initialization, due to the fact that spinlock_t is
> defined as an empty struct in .../include/asm-i386/spinlock.h, and is
> initialized as such here. I just reported the bug to the gcc folks, see
> below and enjoy (or weep, as the case may be). I hate to put something into
> spinlock_t just to get away with this (gcc does optimize empty structs
> away). Any other thoughts?

I also experienced this with gcc 2.7.2.2 and narrowed it down to that union
too. For some time I used Pentium Compiler Group's pgcc to compile my kernels,
and experienced strange, consistent, signal 11's and such occasionally (what
would you expect from beta snapshot). Using gcc 2.7.2.2 to compile those
offending files always helped. Nowadays I use mostly gcc 2.7.2.2 with libc6
and also compile kernels with it. Anyway, this time I thought, maybe pgcc
would help this time and took the latest snapshot (970425 or something) and
voila... the whole pre-2.1.37-2 plus some fixes for uniprocessor machines
compiled perfectly (although with more warnings as pgcc warns about
comparisons between signed and unsigned variables). Running it happily for
third day or so with nothing alarming yet.

Jarno