This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, updated] Make emulated TLS lto-friendly.



On 8 Jul 2010, at 00:22, Richard Henderson wrote:



+  /* If we need the var, and it's an emulated TLS entity, that
+     means we need the control var.  */
+  if (!targetm.have_tls && DECL_THREAD_LOCAL_P (node->decl))
+    {
+      struct varpool_node *cv_node;
+      cv_node = varpool_node (emutls_decl (node->decl)) ;
+      varpool_mark_needed_node (cv_node);
+    }

Do you really need this kind of thing anymore, since you're exposing the use of the control variable so early? I would have thought that varpool.c would no longer need any special-casing for !have_tls.

this is my understanding (which might be flawed &| incomplete).


Whilst we are on the parse side - and building varpool & cgraph, the relationship is not fully exposed (that happens when gimplication is done).

So my reasoning was that the "ghost/proxy" vars should be made to track the user-land ones until then.

It would be possible to put all the checks for 'used-ness' and finalization in emutls_finish() but it seemed more elegant to do so in the places I put it.

I'm happy either way ..

Iain



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]