David,
This was discussed last week and dismissed since the problem was seen
using an old version of the compiler. However, the problem has been
reported on several recent compilers:
gcc 3.0.4
gcc 2.95.4 (debian)
gcc 2.96 20000732 (Redhat 2.96-81)
gcc 2.95.3 20010315 (Suse)
I don't know why it seems to be exclusive to jfs_imap.c and the 2.5
kernel tree. The is no obvious difference in the code between the 2.4
and 2.5 source.
David Howells wrote:
>>include/asm/rwsem.h: In function `diFree':
>>include/asm/rwsem.h:169: inconsistent operand constraints in an `asm'
>>
>>seems that sem->count is not referenced in the asm.
>>
>
> It _is_ referenced in the asm. In the "xadd", the "(%%eax)" is sem->count, and
> also the slow-path function (rwsem_wake) may modify it, so you must not remove
> this constraint.
>
> What version of the compiler are you using? It may be having a problem because
> there are two "+" constraints in the output list. Having consulted one of our
> gcc guys, I require both the "+m" constraint _and_ the "memory"
> constraint. You might try splitting the contraint into a "=" version in the
> o/p list and a reference to it in the i/p list, but beware, this may modify
> the behaviour of the compiler unexpectedly (I know it shouldn't).
As "tmp" is not referenced after the assembly, I removed it from the
output list and added it to the input list. This appears to fix it. Do
you see anything wrong with removing tmp from the output list?
--- include/asm-i386/rwsem.h.orig Mon Feb 25 14:59:07 2002
+++ include/asm-i386/rwsem.h Wed Mar 20 12:17:30 2002
@@ -164,8 +164,8 @@
" jmp 1b\n"
LOCK_SECTION_END
"# ending __up_read\n"
-
: "+m"(sem->count), "+d"(tmp)
-
: "a"(sem)
+
: "+m"(sem->count)
+
: "a"(sem), "d"(tmp)
: "memory", "cc");
}
--
David Kleikamp
IBM Linux Technology Center
_______________________________________________
Jfs-discussion mailing list
[EMAIL PROTECTED]
http://www-124.ibm.com/developerworks/oss/mailman/listinfo/jfs-discussion