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: [rs6000] Don't emit libcall notes around TLS address


On Wed, Jun 15, 2005 at 12:22:13AM +0200, Steven Bosscher wrote:
> ... or did you have something completely different in mind?

How about something completely different.

One new builtin, __builtin_tls_ld_base(); void* result.

One new TLS_ADDR_EXPR, with two operands.  The first operand is
a VAR_DECL node, and is the second is either:

  (1) zero, i.e. unused, in the case the var_decl is global-dynamic.

  (2) a register, the result of __builtin_tls_ld_base, in the case
      the var_decl is local-dynamic.

The type of the TLS_ADDR_EXPR would be correct as for an ADDR_EXPR.
The node itself would not be propagated into any of the INDIRECT_REF
nodes, and so we get the cse'ing that we want.  It's nice and obvious
to alias analysis, however, which should avoid any of the problems
you might have been considering wrt wanting to keep them around as
regular variables.

We ignore TARGET_MEM_REF wrt local-dynamic for now.  I expect this
teeny bit can be cleaned up at rtl level.


r~


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