File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -32,12 +32,20 @@ typedef struct opal_memory_linux_component_t {
3232#endif
3333
3434#if MEMORY_LINUX_PTMALLOC2
35- /* Ptmalloc2-specific data */
36- bool free_invoked ;
37- bool malloc_invoked ;
38- bool realloc_invoked ;
39- bool memalign_invoked ;
40- bool munmap_invoked ;
35+ /* Ptmalloc2-specific data. Note that these variables are all marked as volatile.
36+ * This is needed because of what may be a buggy optimization in the GCC 4.9.2
37+ * compilers and later. These variables are used in different code paths which the
38+ * compiler is not aware of.
39+ * Extra details located at these URLs:
40+ * Open MPI User List: http://www.open-mpi.org/community/lists/users/2015/06/27039.php
41+ * Bug Discussion: https://github.com/open-mpi/ompi/pull/625
42+ * GCC Discussion: https://gcc.gnu.org/ml/gcc-bugs/2015-06/msg00757.html
43+ */
44+ volatile bool free_invoked ;
45+ volatile bool malloc_invoked ;
46+ volatile bool realloc_invoked ;
47+ volatile bool memalign_invoked ;
48+ volatile bool munmap_invoked ;
4149#endif
4250} opal_memory_linux_component_t ;
4351
You can’t perform that action at this time.
0 commit comments