Messages in this thread | | | Date | Mon, 27 Feb 2006 16:54:36 -0800 | From | Richard Henderson <> | Subject | Re: [patch] i386: make bitops safe |
| |
On Tue, Feb 28, 2006 at 12:47:22AM +0100, Andi Kleen wrote: > I remember asking rth about this at some point and IIRC > he expressed doubts if it would actually do what expected. Richard?
It's a bit dicey to be sure. GCC may or may not be able to look through the size of the array and not kill things beyond it. If one could be *sure* of some actual maximum index, this would be fine, but I don't think you can.
One could reasonably argue that if you used a structure with a flexible array member, that GCC could not look through that. But again I'm not 100% positive this is handled properly.
I think the best argument for simply leaving things with a memory clobber is that these are atomic operations, and are on occasion used as locks, or parts of locks.
r~ - 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/
| |