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

Alan Cox (alan@lxorguk.ukuu.org.uk)
Sun, 18 Jan 1998 17:41:04 +0000 (GMT)


> The output of objdump -d -S seems to indicate that the line..
> *(&eflags) = (eflags & 0xffffcfff) | (level << 12);
> .. was simply optimized away by 2.8.0.
>
> Since the manipulation in question is to a local variable, and there
> are no references past this line, it's OK for gcc to throw it away as
> it is not valid after the function returns.

Interesting but ultimately the compiler does win the argument. Changing the
kernel so it generates

*((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.

Alan