This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ 13690] Do not violate mutex destruction requirements.
- From: Torvald Riegel <triegel at redhat dot com>
- To: David Miller <davem at davemloft dot net>
- Cc: libc-alpha at sourceware dot org, carlos at redhat dot com
- Date: Thu, 16 Jul 2015 12:59:14 +0200
- Subject: Re: [PATCH][BZ 13690] Do not violate mutex destruction requirements.
- Authentication-results: sourceware.org; auth=none
- References: <1436905273 dot 19451 dot 14 dot camel at localhost dot localdomain> <20150715 dot 160555 dot 934366773890383260 dot davem at davemloft dot net>
On Wed, 2015-07-15 at 16:05 -0700, David Miller wrote:
> From: Torvald Riegel <triegel@redhat.com>
> Date: Tue, 14 Jul 2015 22:21:13 +0200
>
> > Dave, could you test on sparc, please?
>
> This breaks the sparc build:
>
> gconv_db.c: In function â__gconv_find_transformâ:
> gconv_db.c:734:7: error: unused variable â__privateâ [-Werror=unused-variable]
> gconv_db.c:741:7: error: unused variable â__privateâ [-Werror=unused-variable]
> gconv_db.c:760:7: error: unused variable â__privateâ [-Werror=unused-variable]
> gconv_db.c:768:3: error: unused variable â__privateâ [-Werror=unused-variable]
> gconv_db.c: In function â__gconv_close_transformâ:
> gconv_db.c:802:3: error: unused variable â__privateâ [-Werror=unused-variable]
> cc1: all warnings being treated as errors
> make[2]: *** [/home/davem/src/GIT/GLIBC/build-sparcv9/iconv/gconv_db.o] Error 1
> make[2]: *** Waiting for unfinished jobs....
> gconv_db.c: In function â__gconv_find_transformâ:
> gconv_db.c:734:7: error: unused variable â__privateâ [-Werror=unused-variable]
> gconv_db.c:741:7: error: unused variable â__privateâ [-Werror=unused-variable]
> gconv_db.c:760:7: error: unused variable â__privateâ [-Werror=unused-variable]
> gconv_db.c:768:3: error: unused variable â__privateâ [-Werror=unused-variable]
> gconv_db.c: In function â__gconv_close_transformâ:
> gconv_db.c:802:3: error: unused variable â__privateâ [-Werror=unused-variable]
> cc1: all warnings being treated as errors
This is surprising. Unless I'm missing something else, it seems the
compiler is inferring that a lock is never in contended state (the only
use of __private is in the futex_wake call) -- but for that the compiler
would either have to analyze multi-threaded executions, or there are
cases when the lock isn't used.
It would be straight-forward to put an attribute((unused)) on __private,
but maybe we should investigate further what's really going on there.
Thoughts?