]> granicus.if.org Git - clang/commitdiff
Make the pointer arguments to the __sync_* builtins pointers to
authorDouglas Gregor <dgregor@apple.com>
Wed, 28 Jul 2010 18:42:27 +0000 (18:42 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 28 Jul 2010 18:42:27 +0000 (18:42 +0000)
volatile-qualified types. Fixes <rdar://problem/8228293>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109618 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/Builtins.def
test/Sema/builtins.c

index 658295657b7936be1d2566a76157fd179d6eac33..e9b8fc037bedf91296d9767f075f08733326294a 100644 (file)
@@ -368,75 +368,75 @@ BUILTIN(__builtin_alloca, "v*z"   , "n")
 // long long -> i64.
 
 BUILTIN(__sync_fetch_and_add, "v.", "")
-BUILTIN(__sync_fetch_and_add_1, "cc*c.", "n")
-BUILTIN(__sync_fetch_and_add_2, "ss*s.", "n")
-BUILTIN(__sync_fetch_and_add_4, "ii*i.", "n")
-BUILTIN(__sync_fetch_and_add_8, "LLiLLi*LLi.", "n")
-BUILTIN(__sync_fetch_and_add_16, "LLLiLLLi*LLLi.", "n")
+BUILTIN(__sync_fetch_and_add_1, "ccD*c.", "n")
+BUILTIN(__sync_fetch_and_add_2, "ssD*s.", "n")
+BUILTIN(__sync_fetch_and_add_4, "iiD*i.", "n")
+BUILTIN(__sync_fetch_and_add_8, "LLiLLiD*LLi.", "n")
+BUILTIN(__sync_fetch_and_add_16, "LLLiLLLiD*LLLi.", "n")
 
 BUILTIN(__sync_fetch_and_sub, "v.", "")
-BUILTIN(__sync_fetch_and_sub_1, "cc*c.", "n")
-BUILTIN(__sync_fetch_and_sub_2, "ss*s.", "n")
-BUILTIN(__sync_fetch_and_sub_4, "ii*i.", "n")
-BUILTIN(__sync_fetch_and_sub_8, "LLiLLi*LLi.", "n")
-BUILTIN(__sync_fetch_and_sub_16, "LLLiLLLi*LLLi.", "n")
+BUILTIN(__sync_fetch_and_sub_1, "ccD*c.", "n")
+BUILTIN(__sync_fetch_and_sub_2, "ssD*s.", "n")
+BUILTIN(__sync_fetch_and_sub_4, "iiD*i.", "n")
+BUILTIN(__sync_fetch_and_sub_8, "LLiLLiD*LLi.", "n")
+BUILTIN(__sync_fetch_and_sub_16, "LLLiLLLiD*LLLi.", "n")
 
 BUILTIN(__sync_fetch_and_or, "v.", "")
-BUILTIN(__sync_fetch_and_or_1, "cc*c.", "n")
-BUILTIN(__sync_fetch_and_or_2, "ss*s.", "n")
-BUILTIN(__sync_fetch_and_or_4, "ii*i.", "n")
-BUILTIN(__sync_fetch_and_or_8, "LLiLLi*LLi.", "n")
-BUILTIN(__sync_fetch_and_or_16, "LLLiLLLi*LLLi.", "n")
+BUILTIN(__sync_fetch_and_or_1, "ccD*c.", "n")
+BUILTIN(__sync_fetch_and_or_2, "ssD*s.", "n")
+BUILTIN(__sync_fetch_and_or_4, "iiD*i.", "n")
+BUILTIN(__sync_fetch_and_or_8, "LLiLLiD*LLi.", "n")
+BUILTIN(__sync_fetch_and_or_16, "LLLiLLLiD*LLLi.", "n")
 
 BUILTIN(__sync_fetch_and_and, "v.", "")
-BUILTIN(__sync_fetch_and_and_1, "cc*c.", "n")
-BUILTIN(__sync_fetch_and_and_2, "ss*s.", "n")
-BUILTIN(__sync_fetch_and_and_4, "ii*i.", "n")
-BUILTIN(__sync_fetch_and_and_8, "LLiLLi*LLi.", "n")
-BUILTIN(__sync_fetch_and_and_16, "LLLiLLLi*LLLi.", "n")
+BUILTIN(__sync_fetch_and_and_1, "ccD*c.", "n")
+BUILTIN(__sync_fetch_and_and_2, "ssD*s.", "n")
+BUILTIN(__sync_fetch_and_and_4, "iiD*i.", "n")
+BUILTIN(__sync_fetch_and_and_8, "LLiLLiD*LLi.", "n")
+BUILTIN(__sync_fetch_and_and_16, "LLLiLLLiD*LLLi.", "n")
 
 BUILTIN(__sync_fetch_and_xor, "v.", "")
-BUILTIN(__sync_fetch_and_xor_1, "cc*c.", "n")
-BUILTIN(__sync_fetch_and_xor_2, "ss*s.", "n")
-BUILTIN(__sync_fetch_and_xor_4, "ii*i.", "n")
-BUILTIN(__sync_fetch_and_xor_8, "LLiLLi*LLi.", "n")
-BUILTIN(__sync_fetch_and_xor_16, "LLLiLLLi*LLLi.", "n")
+BUILTIN(__sync_fetch_and_xor_1, "ccD*c.", "n")
+BUILTIN(__sync_fetch_and_xor_2, "ssD*s.", "n")
+BUILTIN(__sync_fetch_and_xor_4, "iiD*i.", "n")
+BUILTIN(__sync_fetch_and_xor_8, "LLiLLiD*LLi.", "n")
+BUILTIN(__sync_fetch_and_xor_16, "LLLiLLLiD*LLLi.", "n")
 
 
 BUILTIN(__sync_add_and_fetch, "v.", "")
-BUILTIN(__sync_add_and_fetch_1, "cc*c.", "n")
-BUILTIN(__sync_add_and_fetch_2, "ss*s.", "n")
-BUILTIN(__sync_add_and_fetch_4, "ii*i.", "n")
-BUILTIN(__sync_add_and_fetch_8, "LLiLLi*LLi.", "n")
-BUILTIN(__sync_add_and_fetch_16, "LLLiLLLi*LLLi.", "n")
+BUILTIN(__sync_add_and_fetch_1, "ccD*c.", "n")
+BUILTIN(__sync_add_and_fetch_2, "ssD*s.", "n")
+BUILTIN(__sync_add_and_fetch_4, "iiD*i.", "n")
+BUILTIN(__sync_add_and_fetch_8, "LLiLLiD*LLi.", "n")
+BUILTIN(__sync_add_and_fetch_16, "LLLiLLLiD*LLLi.", "n")
 
 BUILTIN(__sync_sub_and_fetch, "v.", "")
-BUILTIN(__sync_sub_and_fetch_1, "cc*c.", "n")
-BUILTIN(__sync_sub_and_fetch_2, "ss*s.", "n")
-BUILTIN(__sync_sub_and_fetch_4, "ii*i.", "n")
-BUILTIN(__sync_sub_and_fetch_8, "LLiLLi*LLi.", "n")
-BUILTIN(__sync_sub_and_fetch_16, "LLLiLLLi*LLLi.", "n")
+BUILTIN(__sync_sub_and_fetch_1, "ccD*c.", "n")
+BUILTIN(__sync_sub_and_fetch_2, "ssD*s.", "n")
+BUILTIN(__sync_sub_and_fetch_4, "iiD*i.", "n")
+BUILTIN(__sync_sub_and_fetch_8, "LLiLLiD*LLi.", "n")
+BUILTIN(__sync_sub_and_fetch_16, "LLLiLLLiD*LLLi.", "n")
 
 BUILTIN(__sync_or_and_fetch, "v.", "")
-BUILTIN(__sync_or_and_fetch_1, "cc*c.", "n")
-BUILTIN(__sync_or_and_fetch_2, "ss*s.", "n")
-BUILTIN(__sync_or_and_fetch_4, "ii*i.", "n")
-BUILTIN(__sync_or_and_fetch_8, "LLiLLi*LLi.", "n")
-BUILTIN(__sync_or_and_fetch_16, "LLLiLLLi*LLLi.", "n")
+BUILTIN(__sync_or_and_fetch_1, "ccD*c.", "n")
+BUILTIN(__sync_or_and_fetch_2, "ssD*s.", "n")
+BUILTIN(__sync_or_and_fetch_4, "iiD*i.", "n")
+BUILTIN(__sync_or_and_fetch_8, "LLiLLiD*LLi.", "n")
+BUILTIN(__sync_or_and_fetch_16, "LLLiLLLiD*LLLi.", "n")
 
 BUILTIN(__sync_and_and_fetch, "v.", "")
-BUILTIN(__sync_and_and_fetch_1, "cc*c.", "n")
-BUILTIN(__sync_and_and_fetch_2, "ss*s.", "n")
-BUILTIN(__sync_and_and_fetch_4, "ii*i.", "n")
-BUILTIN(__sync_and_and_fetch_8, "LLiLLi*LLi.", "n")
-BUILTIN(__sync_and_and_fetch_16, "LLLiLLLi*LLLi.", "n")
+BUILTIN(__sync_and_and_fetch_1, "ccD*c.", "n")
+BUILTIN(__sync_and_and_fetch_2, "ssD*s.", "n")
+BUILTIN(__sync_and_and_fetch_4, "iiD*i.", "n")
+BUILTIN(__sync_and_and_fetch_8, "LLiLLiD*LLi.", "n")
+BUILTIN(__sync_and_and_fetch_16, "LLLiLLLiD*LLLi.", "n")
 
 BUILTIN(__sync_xor_and_fetch, "v.", "")
-BUILTIN(__sync_xor_and_fetch_1, "cc*c.", "n")
-BUILTIN(__sync_xor_and_fetch_2, "ss*s.", "n")
-BUILTIN(__sync_xor_and_fetch_4, "ii*i.", "n")
-BUILTIN(__sync_xor_and_fetch_8, "LLiLLi*LLi.", "n")
-BUILTIN(__sync_xor_and_fetch_16, "LLLiLLLi*LLLi.", "n")
+BUILTIN(__sync_xor_and_fetch_1, "ccD*c.", "n")
+BUILTIN(__sync_xor_and_fetch_2, "ssD*s.", "n")
+BUILTIN(__sync_xor_and_fetch_4, "iiD*i.", "n")
+BUILTIN(__sync_xor_and_fetch_8, "LLiLLiD*LLi.", "n")
+BUILTIN(__sync_xor_and_fetch_16, "LLLiLLLiD*LLLi.", "n")
 
 BUILTIN(__sync_bool_compare_and_swap, "v.", "")
 BUILTIN(__sync_bool_compare_and_swap_1, "bcD*cc.", "n")
@@ -453,18 +453,18 @@ BUILTIN(__sync_val_compare_and_swap_8, "LLiLLiD*LLiLLi.", "n")
 BUILTIN(__sync_val_compare_and_swap_16, "LLLiLLLiD*LLLiLLLi.", "n")
 
 BUILTIN(__sync_lock_test_and_set, "v.", "")
-BUILTIN(__sync_lock_test_and_set_1, "cc*c.", "n")
-BUILTIN(__sync_lock_test_and_set_2, "ss*s.", "n")
-BUILTIN(__sync_lock_test_and_set_4, "ii*i.", "n")
-BUILTIN(__sync_lock_test_and_set_8, "LLiLLi*LLi.", "n")
-BUILTIN(__sync_lock_test_and_set_16, "LLLiLLLi*LLLi.", "n")
+BUILTIN(__sync_lock_test_and_set_1, "ccD*c.", "n")
+BUILTIN(__sync_lock_test_and_set_2, "ssD*s.", "n")
+BUILTIN(__sync_lock_test_and_set_4, "iiD*i.", "n")
+BUILTIN(__sync_lock_test_and_set_8, "LLiLLiD*LLi.", "n")
+BUILTIN(__sync_lock_test_and_set_16, "LLLiLLLiD*LLLi.", "n")
 
 BUILTIN(__sync_lock_release, "v.", "")
-BUILTIN(__sync_lock_release_1, "vc*.", "n")
-BUILTIN(__sync_lock_release_2, "vs*.", "n")
-BUILTIN(__sync_lock_release_4, "vi*.", "n")
-BUILTIN(__sync_lock_release_8, "vLLi*.", "n")
-BUILTIN(__sync_lock_release_16, "vLLLi*.", "n")
+BUILTIN(__sync_lock_release_1, "vcD*.", "n")
+BUILTIN(__sync_lock_release_2, "vsD*.", "n")
+BUILTIN(__sync_lock_release_4, "viD*.", "n")
+BUILTIN(__sync_lock_release_8, "vLLiD*.", "n")
+BUILTIN(__sync_lock_release_16, "vLLLiD*.", "n")
 
 
 
@@ -473,10 +473,10 @@ BUILTIN(__sync_synchronize, "v.", "n")
 // LLVM instruction builtin [Clang extension].
 BUILTIN(__builtin_llvm_memory_barrier,"vbbbbb", "n")
 // GCC does not support these, they are a Clang extension.
-BUILTIN(__sync_fetch_and_min, "ii*i", "n")
-BUILTIN(__sync_fetch_and_max, "ii*i", "n")
-BUILTIN(__sync_fetch_and_umin, "UiUi*Ui", "n")
-BUILTIN(__sync_fetch_and_umax, "UiUi*Ui", "n")
+BUILTIN(__sync_fetch_and_min, "iiD*i", "n")
+BUILTIN(__sync_fetch_and_max, "iiD*i", "n")
+BUILTIN(__sync_fetch_and_umin, "UiUiD*Ui", "n")
+BUILTIN(__sync_fetch_and_umax, "UiUiD*Ui", "n")
 
 // Random libc builtins.
 BUILTIN(__builtin_abort, "v", "Fnr")
index f2cd3ea360e68bb669c69833779bbe42ac085724..7d6d54dbce8cc8a33cd085504a1f96fe69a22d24 100644 (file)
@@ -84,3 +84,9 @@ void test_unknown_builtin(int a, int b) {
 int test13() {
   __builtin_eh_return(0, 0); // no warning, eh_return never returns.
 }
+
+// <rdar://problem/8228293>
+void test14() {
+  int old;
+  old = __sync_fetch_and_min((volatile int *)&old, 1);
+}