This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix DCE REG_LIBCALL note moving from noop move insns (PR rtl-optimization/33644)
On 10/19/07, Richard Kenner <firstname.lastname@example.org> wrote:
> > The last time this came up, it was pretty much agreed that the main
> > reason to still have libcalls was to allow dynamic TLS addresses
> > (which involve calls) to be CSE-ed. I don't know if this actually
> > works as expected right now, I've never checked that.
> I'd expect this to be very similar, if not identical, to a call to
> something like _muldi3. Why isn't it?
Things like a multiplication can be CSE-ed in tree-ssa, so there
should not be any libcalls of this kind to CSE in the generated RTL.
But TLS addressing is not exposed in GIMPLE so you can't CSE the TLS
static __thread int a, b;
int foo (void)
return a + b;
Compile with -fpic. There should only be one call to __tls_get_addr
to get a base address. Without libcalls there will be two calls. The
base address is not exposed in tree-ssa.
Search for TLS_ADDR_EXPR with Google ;-)