Hello,
Can I assume from the gcc sources that the __sync_fetch_ builtins take
only unsigned value as inputs, and thus also return unsigned values.
so the testsuite test as in sync-2.c :
if (__sync_fetch_and_and(AL+8, 7) != -1)
abort ();
can be optimized out so the test is XFAIL
Or: Those routines can take any signess as input, and thus the builtin
types needs fixing, as with the attached patch.
It looks to me that the former is the correct way of doing it, is it a
bug or a spec ?
many thanks
Christian
Index: ChangeLog
===================================================================
--- ChangeLog (revision 151937)
+++ ChangeLog (working copy)
@@ -1,3 +1,7 @@
+2009-10-08 Christian Bruel <christian.bruel@xxxxxx>
+
+ * builtin-types.def (BT_I1, BT_I2, BT_I4, BT_I8, BT_I16): Set signed.
+
2009-09-21 Giuseppe Scrivano <gscrivano@xxxxxxx>
* tree-tailcall.c (process_assignment): Don't check if a multiplication
Index: builtin-types.def
===================================================================
--- builtin-types.def (revision 151937)
+++ builtin-types.def (working copy)
@@ -115,11 +115,11 @@
DEF_PRIMITIVE_TYPE (BT_VALIST_REF, va_list_ref_type_node)
DEF_PRIMITIVE_TYPE (BT_VALIST_ARG, va_list_arg_type_node)
-DEF_PRIMITIVE_TYPE (BT_I1, builtin_type_for_size (BITS_PER_UNIT*1, 1))
-DEF_PRIMITIVE_TYPE (BT_I2, builtin_type_for_size (BITS_PER_UNIT*2, 1))
-DEF_PRIMITIVE_TYPE (BT_I4, builtin_type_for_size (BITS_PER_UNIT*4, 1))
-DEF_PRIMITIVE_TYPE (BT_I8, builtin_type_for_size (BITS_PER_UNIT*8, 1))
-DEF_PRIMITIVE_TYPE (BT_I16, builtin_type_for_size (BITS_PER_UNIT*16, 1))
+DEF_PRIMITIVE_TYPE (BT_I1, builtin_type_for_size (BITS_PER_UNIT*1, 0))
+DEF_PRIMITIVE_TYPE (BT_I2, builtin_type_for_size (BITS_PER_UNIT*2, 0))
+DEF_PRIMITIVE_TYPE (BT_I4, builtin_type_for_size (BITS_PER_UNIT*4, 0))
+DEF_PRIMITIVE_TYPE (BT_I8, builtin_type_for_size (BITS_PER_UNIT*8, 0))
+DEF_PRIMITIVE_TYPE (BT_I16, builtin_type_for_size (BITS_PER_UNIT*16, 0))
DEF_POINTER_TYPE (BT_PTR_CONST_STRING, BT_CONST_STRING)
DEF_POINTER_TYPE (BT_PTR_LONG, BT_LONG)