__thread_pointer on powerpc

Mathieu Desnoyers mathieu.desnoyers@efficios.com
Wed Dec 15 02:16:17 GMT 2021


Hi Florian,

In the recent patchset introducing rseq support in glibc, __thread_pointer
is wired up for powerpc.

Based on my interpretation of

https://gcc.gnu.org/onlinedocs/gcc-6.1.0/gcc/Local-Register-Variables.html

it appears that using "register void *__result asm ("r2")" is not sufficient
to guarantee that the compiler will indeed use this register. It's documented
as being just a hint that the compiler is free to optimize away.

I suspect we may want to add something like:

asm ("" : "=r" (__result));

just after the variable definition, to force the compiler to use this variable
as output to an inline asm.

Thoughts ?

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com


More information about the Libc-alpha mailing list