I looked a bit more into this: I think the problem was that gcc got into
register pressure while processing an return value and thrashed the
register variable sk in %ebx during this. Here is the code:
pushl %eax
pushl %edi
pushl %esi
call tcp_check_req ;; call other function
movl %eax,%ebx ;; gcc thrashes the register variable here.
addl $12,%esp
When I wanted to reproduce it I enabled the lock_sock()/release_sock()
code in the current version of tcp_v4_hnd_req() again (with some code
movements compared to the original buggy version). Now it compiles
correctly, I can't reproduce it anymore. I'll reenable the socket locking
soon in the CVS tree.
-Andi