Messages in this thread | | | Subject | Re: Linux 2.0.3x & gcc 2.8 | From | Andi Kleen <> | Date | 05 Feb 1998 21:10:46 +0100 |
| |
alan@lxorguk.ukuu.org.uk (Alan Cox) writes:
> > problem with the source code, as the optimizer is quite right in assuming > > that the variable we're modifying is a parameter on the stack and thus a > > change will not affect anything and thus it can be optimized away. > > > > I do hope that'll end up in 2.0.34, and it's already in 2.1.* anyways. > > Its not. Until someone can explain why the original cast pointer as pointer > to volatile fix I tried didnt work I have to assume that gcc 2.8 has > broken volatile handling. I will never support a kernel built with a compiler > with any known volatile handling bug. Its _far_ too critical to the net code > that volatile and the __asm__ behaviour work as documented.
Kenner admited that it was a bug in the new addressof optimization (which finally supports *(&x) = y) and promised a fix for 2.8.1.
The problem seems to only occur with casts, not with volatile declarations.
/* Useless test case */ f1(int X) { *((volatile int *) &X) = 1; /* gets optimized away by 2.8.0 -O2 */ }
f2(int X) { volatile int *P = &X;
*P = 1; /* 2.8.0 keeps it */ }
-Andi - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu
| |