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

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