This is the mail archive of the 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] TLS support for powerpc/powerpc64 (take 2)

On Fri, May 09, 2003 at 05:08:00PM -0700, Richard Henderson wrote:
> On Sat, May 10, 2003 at 09:31:09AM +0930, Alan Modra wrote:
> > > You should use init_one_libfunc instead of gen_rtx_SYMBOL_REF
> > > so that the proper SYMBOL_REF_FLAGS are set.  I'm surprised
> > > that you didn't see problems on the ppc64 port because of this.
> > 
> > That code preceded your SYMBOL_REF_FLAGS changes..
> Right, but you've tested the merge, havn't you?  The new tests in
> symbol_ref_operand should have tripped up something, shouldn't they?

Yes, the patch was tested with code using __thread, and no, those tests
didn't trip anything.

Richard, these functions now have the changes you recommended:

+/* Construct the SYMBOL_REF for the tls_get_addr function.  */
+static GTY(()) rtx rs6000_tls_symbol;
+static rtx
+rs6000_tls_get_addr ()
+  if (!rs6000_tls_symbol)
+    rs6000_tls_symbol = init_one_libfunc ("__tls_get_addr");
+  return rs6000_tls_symbol;
+/* Construct the SYMBOL_REF for TLS GOT references.  */
+static GTY(()) rtx rs6000_got_symbol;
+static rtx
+rs6000_got_sym ()
+  if (!rs6000_got_symbol)
+    {
+      rs6000_got_symbol = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_");
+      SYMBOL_REF_FLAGS (rs6000_got_symbol) |= SYMBOL_FLAG_LOCAL;
+      SYMBOL_REF_FLAGS (rs6000_got_symbol) |= SYMBOL_FLAG_EXTERNAL;
+    }     
+  return rs6000_got_symbol;
I believe that Alan addressed your other issues.  David approved the
patch for powerpc issues.  Can it go in now?

(Builds of both targets are broken for mainline right now, with or
without the TLS patch, but testing of the patch against Friday's CVS,
with the changes above, was successful.)


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