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

Anastasia Stulova anastasia.stulova at arm.com
Tue Feb 17 02:41:32 PST 2015


Ping!

 

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150217/af18914b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: c11_atomics_as_bugfix.patch
Type: application/octet-stream
Size: 3296 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150217/af18914b/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ATT00001.txt
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150217/af18914b/attachment.txt>


More information about the cfe-commits mailing list