This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [rs6000] Don't emit libcall notes around TLS address
On Tue, Jun 14, 2005 at 12:16:58PM +0200, Steven Bosscher wrote:
> IIUC this be done with a const builtin to turn it into something like
>
> int foo2 (void)
> {
> int *t1 = builtin_get_tls_addr (a);
> bar (*t1);
> int *t2 = builtin_get_tls_addr (a);
> bar (*t2);
> int *t3 = builtin_get_tls_addr (a);
> bar (*t3);
> }
>
> which PRE would turn into this:
>
> int foo2 (void)
> {
> int *t1 = builtin_get_tls_addr (a);
Yes, this could be done. Though, really, I'm not sure a builtin buys
us anything here over just treating the ADDR_EXPR specially.
> If so, would you have ideas for a similar trick for the local-dynamic
> case?
Well, you need to split the address into two parts, like it really is
in practice. A builtin with no arguments for the base plus a DTP_EXPR
for the offset. You'll want an EXPR not a builtin so that it can get
stuffed into TARGET_MEM_REF at some point.
r~