Messages in this thread | | | Date | 6 Feb 1998 13:23:14 -0000 | From | Wolfram Gloger <> | Subject | Re: Linux 2.0.3x & gcc 2.8 [better use egcs for now] |
| |
I just checked this code:
int f(long e) { *(&e) = e & 0x1234; return 0; }
and found that egcs-1.0.1 _never_ optimizes the assignment away (no volatile is needed). So, people should maybe use that rather than gcc-2.8.0 for compiling 2.0.x.
> 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.
IMHO, a single assignment to *(&x) can _never_ be optimized away (multiple such assignments could be folded into one possibly). I can't see why a volatile specification or cast should make a difference either, since the variable isn't written to by another context of execution.
If such an optimization was allowed, programming threaded code with shared stack variables would become a nightmare...
Regards, Wolfram. -- `Surf the sea, not double-u three...' wmglo@dent.med.uni-muenchen.de - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu
| |