public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/113292] [modules] internal error when compiling header to module containing static thread_local variable
Date: Tue, 16 Jan 2024 22:41:02 +0000	[thread overview]
Message-ID: <bug-113292-4-T5U6hDXvHL@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113292-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113292

--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Nathaniel Shead <nshead@gcc.gnu.org>:

https://gcc.gnu.org/g:14338386970bc6c2d46b81181f48622fdf25d705

commit r14-8168-g14338386970bc6c2d46b81181f48622fdf25d705
Author: Nathaniel Shead <nathanieloshead@gmail.com>
Date:   Thu Jan 11 16:49:39 2024 +1100

    c++: Support thread_local statics in header modules [PR113292]

    Currently, thread_locals in header modules cause ICEs. This patch makes
    the required changes for them to work successfully.

    This requires additionally writing the DECL_TLS_MODEL for thread-local
    variables to the module interface, and the TLS wrapper function needs to
    have its DECL_BEFRIENDING_CLASSES written too as this is used to
    retrieve what VAR_DECL it's a wrapper for when emitting a definition at
    end of TU processing.

            PR c++/113292

    gcc/cp/ChangeLog:
            * decl2.cc (get_tls_wrapper_fn): Set DECL_CONTEXT.
            (c_parse_final_cleanups): Suppress warning for no definition of
            TLS wrapper functions in header modules.
            * module.cc (trees_out::lang_decl_vals): Write wrapped variable
            for TLS wrapper functions.
            (trees_in::lang_decl_vals): Read it.
            (trees_out::decl_value): Write TLS model for thread-local vars.
            (trees_in::decl_value): Read it for new decls. Remember to emit
            definitions of TLS wrapper functions later.

    gcc/testsuite/ChangeLog:

            * g++.dg/modules/pr113292_a.H: New test.
            * g++.dg/modules/pr113292_b.C: New test.
            * g++.dg/modules/pr113292_c.C: New test.

    Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>

  reply	other threads:[~2024-01-16 22:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-09 16:14 [Bug c++/113292] New: " nov.ondrej at gmail dot com
2024-01-16 22:41 ` cvs-commit at gcc dot gnu.org [this message]
2024-01-27 10:32 ` [Bug c++/113292] " nshead at gcc dot gnu.org

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=bug-113292-4-T5U6hDXvHL@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).