FW: [Patch] Bugfix for pointer address space in atomic builtins

Matt Arsenault Matthew.Arsenault at amd.com
Mon Feb 23 11:19:19 PST 2015


On 02/17/2015 02:41 AM, Anastasia Stulova wrote:
>
> Ping!
>
I think this needs a test that includes checking the emitted IR.

Would it be reasonable to fix this more generally for all builtins? I 
know this is a problem for many others that accept pointers


> *From:*cfe-commits-bounces at cs.uiuc.edu 
> [mailto:cfe-commits-bounces at cs.uiuc.edu] *On Behalf Of *Anastasia Stulova
> *Sent:* 12 February 2015 18:01
> *To:* cfe-commits at cs.uiuc.edu
> *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
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150223/c540eadb/attachment.html>


More information about the cfe-commits mailing list