Re: user-mode port 0.44-2.4.7

Andrea Arcangeli (andrea@suse.de)
Tue, 24 Jul 2001 02:04:13 +0200


On Mon, Jul 23, 2001 at 05:47:04PM -0600, Richard Gooch wrote:
> I don't think it should be allowed to do that. That's a whipping

it is allowed to do that, period. This is not your choice or my choice.
You may ask gcc folks not to do that and I think they just do.

> So grab a local snapshot of the variable, as Linus suggested. In fact,
> the switch example is interesting, because one could argue the
> opposite way, that declaring the switch variable as "volatile" means
> that if GCC needs to internally re-"get" the variable, it should grab
> it from memory, and thus definately fail. Without "volatile", GCC is
> implicitely allowed to cache the variable (which is of course safe).

If gcc caches there's no problem indeed, the problem is when it doesn't
cache it which can happen, with volatile it will understand it must not
make assumption for the variable to not change under it. Anyways as just
said in another email in this thread I'm been told it wasn't just for
'case'. I think tomorrow Honza will comment this since he's the gcc
developer who asked those kernel bugs to be fixed for gcc.

Andrea
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/