https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110606
--- Comment #12 from Drea Pinski <pinskia at gcc dot gnu.org> ---
I wonder if we mark the call as being pure/const things will just work. rs6000
backend is not doing that either.
It just does:
rs6000_tls_symbol = init_one_libfunc ("__tls_get_addr");
While x86 does:
const char *sym
= ((TARGET_ANY_GNU_TLS && !TARGET_64BIT)
? "___tls_get_addr" : "__tls_get_addr");
ix86_tls_symbol = gen_rtx_SYMBOL_REF (Pmode, sym);
So I still think it is a backend issue (just in this case the issue is also for
both x86 and rs6000).