This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: glibc 2.21 - Master is frozen solid at -26 degC.
- From: David Miller <davem at davemloft dot net>
- To: roland at hack dot frob dot com
- Cc: carlos at redhat dot com, libc-alpha at sourceware dot org, schwab at linux-m68k dot org, vapier at gentoo dot org, joseph at codesourcery dot com, azanella at linux dot vnet dot ibm dot com, krebbel at linux dot vnet dot ibm dot com, david dot holsgrove at xilinx dot com, chunglin_tang at mentor dot com, kkojima at rr dot iij4u dot or dot jp, thomas at codesourcery dot com, cmetcalf at tilera dot com
- Date: Wed, 28 Jan 2015 12:19:58 -0800 (PST)
- Subject: Re: glibc 2.21 - Master is frozen solid at -26 degC.
- Authentication-results: sourceware.org; auth=none
- References: <54C71B4C dot 4070307 at redhat dot com> <20150127 dot 155611 dot 1325169014377724430 dot davem at davemloft dot net> <20150128190812 dot 2BC3D2C3B11 at topped-with-meat dot com>
From: Roland McGrath <roland@hack.frob.com>
Date: Wed, 28 Jan 2015 11:08:12 -0800 (PST)
>> nptl-init.c: In function sighandler_setxid :
>> nptl-init.c:242:1: error: optimization may eliminate reads and/or writes to register variables [-Werror=volatile-register-var]
>> nptl-init.c:242:1: error: optimization may eliminate reads and/or writes to register variables [-Werror=volatile-register-var]
>>
>> I get these all over the NPTL code, and every instance points to the
>> function's declaration rather than at any code within the function, which
>> makes tracking down what it's unhappy about not so easy.
>>
>> I'll keep digging into this.
>
> In the GCC source, that message is only for global register variables
> declared as volatile AFAIK. I expect it's for the __thread_self global in
> sysdeps/sparc/nptl/tls.h but there is no volatile there, so I don't know
> how it would come about.
It's happening indirectly via typeof(), for example in sighandler_setxid() we
have:
if (atomic_decrement_val (&__xidcmd->cntr) == 0)
'cntr' is volatile, and then to get the types right the non-v9 32-bit sparc
macros for atomics do things like:
register __typeof (*(mem)) __acev_tmp __asm ("%g6"); \
register __typeof (mem) __acev_mem __asm ("%g1") = (mem); \
register __typeof (*(mem)) __acev_oldval __asm ("%g5"); \
and that's where the warnings come from. I fixed it just like MIPS did
by using a union.
This has allowed me to start working on the semaphore bits.