[Openmp-commits] [openmp] r370943 - [OpenMP] Change initialization of __kmp_global
Jonas Hahnfeld via Openmp-commits
openmp-commits at lists.llvm.org
Wed Sep 4 10:47:37 PDT 2019
Author: hahnfeld
Date: Wed Sep 4 10:47:37 2019
New Revision: 370943
URL: http://llvm.org/viewvc/llvm-project?rev=370943&view=rev
Log:
[OpenMP] Change initialization of __kmp_global
There's no need to initialize variables with static storage duration
because they're implicitly initialized to zero. See
https://en.cppreference.com/w/c/language/initialization#Implicit_initialization
I think that's already relied upon because the supplied 0 only sets
'kmp_time_global_t g_time;' in 'struct kmp_base_global'. The other fields
are not set in the code, but implicitly initialized by the compiler.
Differential Revision: https://reviews.llvm.org/D66292
Modified:
openmp/trunk/runtime/cmake/LibompHandleFlags.cmake
openmp/trunk/runtime/cmake/config-ix.cmake
openmp/trunk/runtime/src/kmp_global.cpp
Modified: openmp/trunk/runtime/cmake/LibompHandleFlags.cmake
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/cmake/LibompHandleFlags.cmake?rev=370943&r1=370942&r2=370943&view=diff
==============================================================================
--- openmp/trunk/runtime/cmake/LibompHandleFlags.cmake (original)
+++ openmp/trunk/runtime/cmake/LibompHandleFlags.cmake Wed Sep 4 10:47:37 2019
@@ -30,7 +30,6 @@ function(libomp_get_cxxflags cxxflags)
libomp_append(flags_local -Wno-class-memaccess LIBOMP_HAVE_WNO_CLASS_MEMACCESS_FLAG)
libomp_append(flags_local -Wno-covered-switch-default LIBOMP_HAVE_WNO_COVERED_SWITCH_DEFAULT_FLAG)
libomp_append(flags_local -Wno-frame-address LIBOMP_HAVE_WNO_FRAME_ADDRESS_FLAG)
- libomp_append(flags_local -Wno-missing-braces LIBOMP_HAVE_WNO_MISSING_BRACES_FLAG)
libomp_append(flags_local -Wno-strict-aliasing LIBOMP_HAVE_WNO_STRICT_ALIASING_FLAG)
libomp_append(flags_local -Wstringop-overflow=0 LIBOMP_HAVE_WSTRINGOP_OVERFLOW_FLAG)
libomp_append(flags_local -Wno-stringop-truncation LIBOMP_HAVE_WNO_STRINGOP_TRUNCATION_FLAG)
Modified: openmp/trunk/runtime/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/cmake/config-ix.cmake?rev=370943&r1=370942&r2=370943&view=diff
==============================================================================
--- openmp/trunk/runtime/cmake/config-ix.cmake (original)
+++ openmp/trunk/runtime/cmake/config-ix.cmake Wed Sep 4 10:47:37 2019
@@ -51,7 +51,6 @@ check_cxx_compiler_flag(-fno-rtti LIBOMP
check_cxx_compiler_flag(-Wno-class-memaccess LIBOMP_HAVE_WNO_CLASS_MEMACCESS_FLAG)
check_cxx_compiler_flag(-Wno-covered-switch-default LIBOMP_HAVE_WNO_COVERED_SWITCH_DEFAULT_FLAG)
check_cxx_compiler_flag(-Wno-frame-address LIBOMP_HAVE_WNO_FRAME_ADDRESS_FLAG)
-check_cxx_compiler_flag(-Wno-missing-braces LIBOMP_HAVE_WNO_MISSING_BRACES_FLAG)
check_cxx_compiler_flag(-Wno-strict-aliasing LIBOMP_HAVE_WNO_STRICT_ALIASING_FLAG)
check_cxx_compiler_flag(-Wstringop-overflow=0 LIBOMP_HAVE_WSTRINGOP_OVERFLOW_FLAG)
check_cxx_compiler_flag(-Wno-stringop-truncation LIBOMP_HAVE_WNO_STRINGOP_TRUNCATION_FLAG)
Modified: openmp/trunk/runtime/src/kmp_global.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_global.cpp?rev=370943&r1=370942&r2=370943&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_global.cpp (original)
+++ openmp/trunk/runtime/src/kmp_global.cpp Wed Sep 4 10:47:37 2019
@@ -431,7 +431,7 @@ std::atomic<int> __kmp_thread_pool_activ
/* -------------------------------------------------
* GLOBAL/ROOT STATE */
KMP_ALIGN_CACHE
-kmp_global_t __kmp_global = {{0}};
+kmp_global_t __kmp_global;
/* ----------------------------------------------- */
/* GLOBAL SYNCHRONIZATION LOCKS */
More information about the Openmp-commits
mailing list