This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/53436] Volatile behaves strange with OpenMP
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 22 May 2012 10:01:11 +0000
- Subject: [Bug tree-optimization/53436] Volatile behaves strange with OpenMP
- Auto-submitted: auto-generated
- References: <bug-53436-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53436
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-05-22 10:01:11 UTC ---
What GCC did was wrong. But your testcase is clearly invalid as per
OpenMP 3.1, 1.4.1:
"Similarly, if at least one thread reads from a memory unit and at least one
thread writes without synchronization to that same memory unit, including cases
due to atomicity considerations as described above, then a data race occurs. If
a data race occurs then the result of the program is unspecified."