lkml.org 
[lkml]   [2007]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 11/23] make atomic_read() and atomic_set() behavior consistent on m32r
Date
Segher Boessenkool <segher@kernel.crashing.org> 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 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/

\
 
 \ /
  Last update: 2007-08-23 22:09    [W:0.047 / U:0.896 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site