This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: volatile qualifier hurts single-threaded optimized case


> bits/atomicity.h has volatile qualifiers on the _Atomic_word* arguments to
> the __*_single and __*_dispatch variants of the atomic operations.  This
> huts especially the single-threaded optimization variants which are usually
> inlined.  Removing those qualifiers allows to reduce code size significantly
> as can be seen in the following simple testcase

I've been able to reproduce this with your example and the following
patch. Thanks for looking at this.

without volatile:
19: 00000000   546 FUNC    GLOBAL DEFAULT    2 _Z3fooPKcS0_

with:
19: 00000000   578 FUNC    GLOBAL DEFAULT    2 _Z3fooPKcS0_

I don't understand the ABI objections to your suggestion, and feel like
there must be a misunderstanding somewhere. These helper functions are
not exported at all, in fact. Also, the *_dispatch and *_single parts
of the atomicity.h interface are new with 4.2, so I'd like to get the
correct signatures in with their introduction, and not have to patch
this up later.

?

tested x86/linux
abi tested x86/linux

-benjamin





Attachment: p.20060830-1
Description: Text document


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