public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Iain D Sandoe <iains@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-5549] libitm: Fix bootstrap for targets without HAVE_ELF_STYLE_WEAKREF.
Date: Fri, 26 Nov 2021 19:41:18 +0000 (GMT)	[thread overview]
Message-ID: <20211126194118.EC0423858D39@sourceware.org> (raw)

https://gcc.gnu.org/g:caa04517e6f78a562f36897a6e7171f0121101b4

commit r12-5549-gcaa04517e6f78a562f36897a6e7171f0121101b4
Author: Iain Sandoe <iain@sandoe.co.uk>
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 <iain@sandoe.co.uk>
    
    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;


                 reply	other threads:[~2021-11-26 19:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211126194118.EC0423858D39@sourceware.org \
    --to=iains@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).