This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]