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/
- References:
- [PATCH 0/8] i386: bitops: Cleanup, sanitize, optimize
- From: Satyam Sharma <[email protected]>
- [PATCH 6/8] i386: bitops: Don't mark memory as clobbered unnecessarily
- From: Satyam Sharma <[email protected]>
- Re: [PATCH 6/8] i386: bitops: Don't mark memory as clobbered unnecessarily
- From: Nick Piggin <[email protected]>
- Re: [PATCH 6/8] i386: bitops: Don't mark memory as clobbered unnecessarily
- From: Satyam Sharma <[email protected]>
- Re: [PATCH 6/8] i386: bitops: Don't mark memory as clobbered unnecessarily
- From: Nick Piggin <[email protected]>
- Re: [PATCH 6/8] i386: bitops: Don't mark memory as clobbered unnecessarily
- From: Trent Piepho <[email protected]>
- Re: [PATCH 6/8] i386: bitops: Don't mark memory as clobbered unnecessarily
- From: Linus Torvalds <[email protected]>
- Re: [PATCH 6/8] i386: bitops: Don't mark memory as clobbered unnecessarily
- From: Trent Piepho <[email protected]>
- Re: [PATCH 6/8] i386: bitops: Don't mark memory as clobbered unnecessarily
- From: Linus Torvalds <[email protected]>
- [PATCH 0/8] i386: bitops: Cleanup, sanitize, optimize
- Prev by Date: Re: [PATCH 6/8] i386: bitops: Don't mark memory as clobbered unnecessarily
- Next by Date: Re: [ck] Re: -mm merge plans for 2.6.23
- Previous by thread: Re: [PATCH 6/8] i386: bitops: Don't mark memory as clobbered unnecessarily
- Next by thread: Re: [PATCH 6/8] i386: bitops: Don't mark memory as clobbered unnecessarily
- Index(es):