Hi Matt,
Thanks for your comments. > I think this needs a test that includes checking the emitted IR. No problem. I will add that! > Would it be reasonable to fix this more generally for all builtins? I know this is a problem for many others that accept pointers This fix is not specific to c11 compare exchange atomic, but to atomics with a pointer as second parameter. Do you mean generalization for other parameters here? Could you tell me what atomic functions should I be looking at? Anastasia From: [email protected] [mailto:[email protected]] On Behalf Of Anastasia Stulova Sent: 12 February 2015 18:01 To: [email protected] Subject: [Patch] Bugfix for pointer address space in atomic builtins Address spaces are not handled in atomic buildins sematic checks. If there are two pointers passed to the builtin, it requires them to be in the same address space. That is unnecessary restriction. This patch removed this restriction by copying the address space from the passed pointers into checked type. Currently, the following code: _Atomic int __attribute__((address_space(256))) *A; int *B; ... ... = __c11_atomic_compare_exchange_strong(A, B, 1, memory_order_seq_cst, memory_order_seq_cst); fails to compile with an assertion, because A and B are expected to be in the same address space. This is not really necessary, as they are just two pointers pointed to separate objects used in the atomic operation. Looking forward to your feedback, Anastasia _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
