gcc-patches@gcc.gnu.org
[Top] [All Lists]

Re: [PATCH] Speed up single-threaded case of atomic ops and reduce tex

Subject: Re: [PATCH] Speed up single-threaded case of atomic ops and reduce text size
From: Richard Guenther
Date: Wed, 16 Aug 2006 15:03:06 +0200 CEST
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@xxxxxxx>
Novell / SUSE Labs

<Prev in Thread] Current Thread [Next in Thread>