This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][BZ 13690] Do not violate mutex destruction requirements.


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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]