lkml.org 
[lkml]   [2002]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] rw-semaphore asm constraints patch fix


On Mon, 8 Apr 2002, David Howells wrote:
>
> The attached patch should fix the compile error that asm-i386/rwsem.h causes
> with old gcc's whilst maintaining the asm constraints correctly.

Doesn't work.

> + : "=m"(sem->count), "=d"(tmp)
> + : "0"(sem->count), "1"(tmp), "a"(sem)

A "m" constraint cannot be used together with a subsequent number (ie the
"=m" -> "0" thing is illegal - the numbering traditionally only works on
hard registers). It may work with some compilers and with the right
register pressure, but it absolutely _will_ cause problems on other
setups.

I should know, I tried to work around gcc stupidities in this area enough
times, and cursed how various things didn't work with various compilers.

The best thing to do is probably to mark "sem->count" a memory input only,
which together with the memory clobber should be ok.

Linus

-
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: 2005-03-22 13:25    [W:0.037 / U:1.968 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site