From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1698) id EC0423858D39; Fri, 26 Nov 2021 19:41:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC0423858D39 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Iain D Sandoe To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-5549] libitm: Fix bootstrap for targets without HAVE_ELF_STYLE_WEAKREF. X-Act-Checkin: gcc X-Git-Author: Iain Sandoe X-Git-Refname: refs/heads/master X-Git-Oldrev: 4a2007594cff78fba6a29a0ec07fad31a7af19ff X-Git-Newrev: caa04517e6f78a562f36897a6e7171f0121101b4 Message-Id: <20211126194118.EC0423858D39@sourceware.org> Date: Fri, 26 Nov 2021 19:41:18 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Nov 2021 19:41:19 -0000 https://gcc.gnu.org/g:caa04517e6f78a562f36897a6e7171f0121101b4 commit r12-5549-gcaa04517e6f78a562f36897a6e7171f0121101b4 Author: Iain Sandoe Date: Sun Nov 21 10:49:29 2021 +0000 libitm: Fix bootstrap for targets without HAVE_ELF_STYLE_WEAKREF. Recent improvements to null address warnings notice that for targets that do not support HAVE_ELF_STYLE_WEAKREF the dummy stub implementation of __cxa_get_globals() means that the address can never be null. Fixed by removing the test for such targets. Signed-off-by: Iain Sandoe libitm/ChangeLog: * eh_cpp.cc (GTM::gtm_thread::init_cpp_exceptions): If the target does not support HAVE_ELF_STYLE_WEAKREF then do not try to test the __cxa_get_globals against NULL. Diff: --- libitm/eh_cpp.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libitm/eh_cpp.cc b/libitm/eh_cpp.cc index 4909427b405..57beb1a147f 100644 --- a/libitm/eh_cpp.cc +++ b/libitm/eh_cpp.cc @@ -178,7 +178,11 @@ GTM::gtm_thread::init_cpp_exceptions () { // Only save and restore the number of uncaught exceptions if this is // actually used in the program. - if (__cxa_get_globals != NULL && __cxa_get_globals () != 0) + if ( +#if HAVE_ELF_STYLE_WEAKREF + __cxa_get_globals != NULL && +#endif + __cxa_get_globals () != 0) cxa_uncaught_count_ptr = &__cxa_get_globals ()->uncaughtExceptions; else cxa_uncaught_count_ptr = 0;