[SPARC64]: __atomic_{add,sub}() must sign-extend return value.
Even though we declare these functions as returning
a 32-bit signed integer, the sparc64 ABI states that
such functions must properly sign-extend the return
value to the full 64-bits.
Due to this bug, parts of mm/rmap.c were misbehaving
when compiled with gcc-3.4 on sparc64. gcc-3.4 was
legally using a 64-bit comparison against zero with
the return value of __atomic_add().
I would like to thank Hugh Daniels and others for helping
to track down this peculiar bug.
Signed-off-by: David S. Miller <davem@davemloft.net>
Showing
Please register or sign in to comment