On 3/20/23 15:26, Jakub Jelinek wrote:
On Mon, Mar 20, 2023 at 03:15:32PM -0400, Jason Merrill wrote:
+      else if (VAR_P (decl)
+              && CP_DECL_THREAD_LOCAL_P (decl)
+              && (!DECL_EXTERNAL (decl) || flag_extern_tls_init)

Hmm, I wonder why we don't check the above line in var_needs_tls_wrapper?

It is tested in get_tls_init_fn (one of the 2 previous callers of
var_needs_tls_wrapper).  No idea why it isn't in get_tls_wrapper_fn (the
other caller of it).

I suppose because we might see a definition of the variable later on, and we don't want to have previously decided to omit the wrapper because we hadn't seen it yet.

Jason

Reply via email to