Segher Boessenkool <[email protected]> wrote: > This simply isn't true. The compiler *can* combine asm stuff: > > > typedef struct { int counter; } atomic_t; > > static inline __attribute__((pure)) int atomic_read(const atomic_t *v) > { > int x; > asm("ld %0,@%1" : "=r"(x) : "r"(&v->counter), "m"(v->counter)); > return x; > } That's not precisely combining asm stuff. The compiler is ditching a whole function because you've told it it can cache the result. David - 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:
- Re: [PATCH 11/23] make atomic_read() and atomic_set() behavior consistent on m32r
- From: Segher Boessenkool <[email protected]>
- [PATCH 0/23] make atomic_read() and atomic_set() behavior consistent across all architectures
- From: Chris Snook <[email protected]>
- [PATCH 11/23] make atomic_read() and atomic_set() behavior consistent on m32r
- From: Chris Snook <[email protected]>
- Re: [PATCH 11/23] make atomic_read() and atomic_set() behavior consistent on m32r
- From: Hirokazu Takata <[email protected]>
- Re: [PATCH 11/23] make atomic_read() and atomic_set() behavior consistent on m32r
- From: Hirokazu Takata <[email protected]>
- Re: [PATCH 11/23] make atomic_read() and atomic_set() behavior consistent on m32r
- From: Chris Snook <[email protected]>
- Re: [PATCH 11/23] make atomic_read() and atomic_set() behavior consistent on m32r
- From: Segher Boessenkool <[email protected]>
- Re: [PATCH 11/23] make atomic_read() and atomic_set() behavior consistent on m32r
- From: Linus Torvalds <[email protected]>
- Re: [PATCH 11/23] make atomic_read() and atomic_set() behavior consistent on m32r
- Prev by Date: Re: [patch 0/2] s390 related scheduler patches and questions
- Next by Date: Re: gettimeofday() jumping into the future
- Previous by thread: Re: [PATCH 11/23] make atomic_read() and atomic_set() behavior consistent on m32r
- Next by thread: [PATCH 12/23] make atomic_read() and atomic_set() behavior consistent on m68knommu
- Index(es):