http://llvm.org/bugs/show_bug.cgi?id=14694
Bug #: 14694
Summary: clang violates C++11 memory model for bitfields at end
of structs
Product: clang
Version: trunk
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: C++11
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
Consider this:
union U {
struct { int c : 23; };
struct { int c2 : 23; char k; };
} s;
void f() { s.c = 5; }
Per the C++11 memory model and common initial sequence rules, 'f' is only
permitted to write to the first three bytes of s. Clang emits an i32 load and
an i32 store, which can introduce a data race on 's.k'.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs