lkml.org 
[lkml]   [1998]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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

\
 
 \ /
  Last update: 2005-03-22 13:41    [W:1.933 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site