[PATCH] Speed up single-threaded case of atomic ops and reduce text size

Richard Guenther rguenther@suse.de
Wed Aug 16 13:03:00 GMT 2006


On Wed, 16 Aug 2006, Paolo Carlini wrote:

> Paolo Carlini wrote:
> 
> > I'm guilty of having rushed Richard to post this patch (sorry!), which, in
> > general, I like indeed. However, it has to wait a bit for us (v3
> > maintainers) to carefully weigh the delicate points raised in the discussion
> > thread with Hans about volatile & single-thread & signals... Thanks for the
> > patience, Richard.
> 
> ... by the way, the patch, as-is, triggers a warning:
> 
> /home/paolo/Gcc/svn-dirs/trunk-build/i686-pc-linux-gnu/libstdc++-v3/include/bits/atomicity.h:
> In function '_Atomic_word __gnu_cxx::__exchange_and_add_single(volatile
> _Atomic_word*, int)':
> /home/paolo/Gcc/svn-dirs/trunk-build/i686-pc-linux-gnu/libstdc++-v3/include/bits/atomicity.h:65:
> warning: cast from type 'volatile _Atomic_word*' to type '_Atomic_word*' casts
> away constness
> /home/paolo/Gcc/svn-dirs/trunk-build/i686-pc-linux-gnu/libstdc++-v3/include/bits/atomicity.h:
> In function 'void __gnu_cxx::__atomic_add_single(volatile _Atomic_word*,
> int)':
> /home/paolo/Gcc/svn-dirs/trunk-build/i686-pc-linux-gnu/libstdc++-v3/include/bits/atomicity.h:73:
> warning: cast from type 'volatile _Atomic_word*' to type '_Atomic_word*' casts
> away constness

Uh, do we build with -Wcast-qual?  There's nothing to get this warning
shut up unfortunately.  But yes, the "real" fix is to get rid of the
volatile qualifier in the function prototype, but this can't be done
on v3 due to the ABI issues you mentioned.

Richard.

--
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs



More information about the Libstdc++ mailing list