On Wed, 25 Jul 2007, Linus Torvalds wrote: > > Hmm. I really think you should take this up with the gcc people. That > looks like a gcc bug - because there really is nothing that guarantees > that the asm doesn't change the array that "x" points to, and the asm > clearly talks about clobbering memory.
Actually, I take that back. I think gcc does the right thing, and yes, it's explained by the memory clobber being just a blind "write to memory" rather than read memory. My bad. It does leave us with very few ways of saying that an asm can *read* memory, and so it might be good to have it clarified that "volatile" implies that (at least with the memory clobber). Your examples are good, I think. Linus - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/