Re: gcc-2.8.0 miscompiles kernel (Was: gcc-2.8 out...)

Alan Cox (
Mon, 19 Jan 1998 20:43:20 +0000 (GMT)

> > *((volatile u32 *)&eflags)
> >
> > should persuade gcc to behave. Right now the compiler knows the result of
> > a local variable stack assigment is thrown and the kernel knows it isnt.
> Unfortunately, gcc doesn't generate code for this line either. (Is
> this a bug?) You have to specify the `volatile' keyword in the
> parameter list:

If *((volatile u32 *)&eflags=val doesnt generate code then gcc is buggy.
Volatile tells the compiler the value may change behinds its back, and the
compiler is not allowed to assume otherwise.

That one is a bug, perhaps the egcs folks would care to squidge it. The
non volatile case is a kernel error