This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
sync_lock_test_and_set testcases
- From: Adrian Straetling <straetling at de dot ibm dot com>
- To: rth at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 18 Aug 2005 19:53:41 +0200
- Subject: sync_lock_test_and_set testcases
Hi,
developing a patch to implement sync_lock_test_and_set for S/390 I found
2 testcases failing:
testsuite/gcc.dg/ia64-sync-1.c
testsuite/gcc.dg/ia64-sync-2.c
They both call __sync_lock_test_and_set(AL+2, 1)
and later compare the changed memory with the expected result (in this
case 1).
This works for all architectures which do a compare_exchange or set only
1 bit, but S/390 sets all bits of the lowest byte. Therefore the actual
memory content is 0xff and the memcmp fails.
However, in md.texi it states: "The true contents of the memory operand
are implementation defined." Does this testcase intentionally check for
compare_exchange behaviour or is it overly stringent?
A fix could be to mask the result with 1 before comparing? At least that
would work for me.
regards,
Adrian