This is the mail archive of the gcc-bugs@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]

[Bug libstdc++/51798] [4.7 regression] libstdc++ atomicity performance regression due to __sync_fetch_and_add


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51798

Andrew Macleod <amacleod at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bkoz at redhat dot com

--- Comment #4 from Andrew Macleod <amacleod at redhat dot com> 2012-01-24 05:41:43 UTC ---
Looking at the old sync.md and rs6000.c files, it looks to me like
sync_fetch_and_add always issued a lwsync before the operation and an isync
afterwards.  

With the new atomics, it looks like making these fetch_and_add operations use
acq_rel mode, we'd get exactly the same code.  I suspect it would be safe to
convert those uses in atomicity.h to acq_rel.  If acq_rel wasn't sufficient,
power would likely have had a defect somewhere over the years...  

At least that would appear to be safe(r) to me on the surface...  And it would
return the missing performance?  I'd be more hesitant about relaxing the mode
any further than that.


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