Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH][2.6.7-rc2] gcc-3.4.0 warning in i386 __down_read_trylock()

2 views
Skip to first unread message

Mikael Pettersson

unread,
May 30, 2004, 6:50:09 AM5/30/04
to
The i386 __down_read_trylock() code contains a "+m" asm
constraint, which triggers warnings from gcc-3.4.0:

gcc -Wp,-MD,fs/xfs/.xfs_iget.o.d -nostdinc -iwithprefix include -D__KERNEL__ -Iinclude -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -msoft-float -mpreferred-stack-boundary=2 -fno-unit-at-a-time -march=k8 -Iinclude/asm-i386/mach-default -O2 -fomit-frame-pointer -Wdeclaration-after-statement -Ifs/xfs -Ifs/xfs/linux-2.6 -funsigned-char -DKBUILD_BASENAME=xfs_iget -DKBUILD_MODNAME=xfs -c -o fs/xfs/xfs_iget.o fs/xfs/xfs_iget.c
include/asm/rwsem.h: In function `xfs_ilock_nowait':
include/asm/rwsem.h:126: warning: read-write constraint does not allow a register
include/asm/rwsem.h:126: warning: read-write constraint does not allow a register
include/asm/rwsem.h:126: warning: read-write constraint does not allow a register
include/asm/rwsem.h:126: warning: read-write constraint does not allow a register

Fixed by the patch below.

/Mikael

diff -ruN linux-2.6.7-rc2/include/asm-i386/rwsem.h linux-2.6.7-rc2.gcc340-fixes/include/asm-i386/rwsem.h
--- linux-2.6.7-rc2/include/asm-i386/rwsem.h 2003-03-08 17:22:32.000000000 +0100
+++ linux-2.6.7-rc2.gcc340-fixes/include/asm-i386/rwsem.h 2004-05-30 11:39:07.000000000 +0200
@@ -134,8 +134,8 @@
" jnz 1b\n\t"
"2:\n\t"
"# ending __down_read_trylock\n\t"
- : "+m"(sem->count), "=&a"(result), "=&r"(tmp)
- : "i"(RWSEM_ACTIVE_READ_BIAS)
+ : "=m"(sem->count), "=&a"(result), "=&r"(tmp)
+ : "i"(RWSEM_ACTIVE_READ_BIAS), "m"(sem->count)
: "memory", "cc");
return result>=0 ? 1 : 0;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Linus Torvalds

unread,
May 30, 2004, 1:30:13 PM5/30/04
to

On Sun, 30 May 2004, Mikael Pettersson wrote:
>
> The i386 __down_read_trylock() code contains a "+m" asm
> constraint, which triggers warnings from gcc-3.4.0:

This comes up every once in a while.

It's going to be fixed in 3.4.1, and the 3.4.0 warning is just bogus.

Linus

Mikael Pettersson

unread,
Jun 1, 2004, 10:40:05 AM6/1/04
to
Linus Torvalds writes:
>
>
> On Sun, 30 May 2004, Mikael Pettersson wrote:
> >
> > The i386 __down_read_trylock() code contains a "+m" asm
> > constraint, which triggers warnings from gcc-3.4.0:
>
> This comes up every once in a while.
>
> It's going to be fixed in 3.4.1, and the 3.4.0 warning is just bogus.

Ok, I see. But most "+m" constraints in the i386 arch files
have already been "fixed"; the one I sent is I think the
last one. Should those "fixes" be undone?

/Mikael

0 new messages