http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51752
Bug #: 51752 Summary: trans-mem: publication safety violated Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end AssignedTo: unassig...@gcc.gnu.org ReportedBy: torv...@gcc.gnu.org Created attachment 26238 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26238 publication safety test Publication safety refers to transactions being able to safely publish data by setting something like a shared flag (e.g., "data=23; __transaction_atomic { flag = 1; }"). For that to work, programmers must access the data only if the flag is true. Second, the compiler must preserve program order in this case and is not allowed to reorder the two loads (i.e., load data before loading the flag). Otherwise, there will be a race condition and the data load can return an inconsistent value. The attached test shows that this isn't working currently (e.g., look at 149t.optimized, the load of data is moved to out of the loop and before the "flag" loads).