Re: [PATCH] libstdc++: Skip atomic instructions in _Sp_counted_base::_M_release when both counts are 1

2021-08-02 Thread Maged Michael via Gcc-patches
Please find attached an updated patch after incorporating Jonathan's suggestions. Changes from the last patch include: - Add a TSAN macro to bits/c++config. - Use separate constexpr bool-s for the conditions for lock-freedom, double-width and alignment. - Move the code in the optimized path to a s

Re: [PATCH] libstdc++: Skip atomic instructions in _Sp_counted_base::_M_release when both counts are 1

2021-08-02 Thread Maged Michael via Gcc-patches
This is the right patch. The previous one is missing noexcept. Sorry. On Mon, Aug 2, 2021 at 9:23 AM Maged Michael wrote: > Please find attached an updated patch after incorporating Jonathan's > suggestions. > > Changes from the last patch include: > - Add a TSAN macro to bits/c++config. > - Us

Re: [PATCH] libstdc++: Skip atomic instructions in _Sp_counted_base::_M_release when both counts are 1

2021-08-04 Thread Maged Michael via Gcc-patches
Thanks, Jonathan! On Wed, Aug 4, 2021 at 11:32 AM Jonathan Wakely wrote: > On Tue, 3 Aug 2021 at 21:59, Jonathan Wakely wrote: > > > > On Mon, 2 Aug 2021 at 14:29, Maged Michael wrote: > > > > > > This is the right patch. The previous one is missing noexcept. Sorry. > > > > > > > > > On Mon, Aug

Re: [PATCH] libstdc++: Skip atomic instructions in _Sp_counted_base::_M_release when both counts are 1

2021-08-04 Thread Maged Michael via Gcc-patches
Sorry. I totally missed the rest of your message and the patch. My fuzzy eyesight, which usually guesses correctly 90% of the time, mistook "Secondly" on a line by itself for "Sincerely" :-) On Wed, Aug 4, 2021 at 11:32 AM Jonathan Wakely wrote: > On Tue, 3 Aug 2021 at 21:59, Jonathan Wakely wro

Re: [PATCH] libstdc++: Skip atomic instructions in _Sp_counted_base::_M_release when both counts are 1

2021-08-04 Thread Maged Michael via Gcc-patches
On Wed, Aug 4, 2021 at 1:19 PM Maged Michael wrote: > Sorry. I totally missed the rest of your message and the patch. My fuzzy > eyesight, which usually guesses correctly 90% of the time, mistook > "Secondly" on a line by itself for "Sincerely" :-) > > On Wed, Aug 4, 2021 at 11:32 AM Jonathan Wak

Re: [PATCH] libstdc++: Skip atomic instructions in _Sp_counted_base::_M_release when both counts are 1

2021-08-04 Thread Maged Michael via Gcc-patches
On Wed, Aug 4, 2021 at 3:32 PM Jonathan Wakely wrote: > On Wed, 4 Aug 2021 at 18:19, Maged Michael wrote: > > > > Sorry. I totally missed the rest of your message and the patch. My fuzzy > eyesight, which usually guesses correctly 90% of the time, mistook > "Secondly" on a line by itself for "Sin

Re: [PATCH] libstdc++: Fix aliasing violation in std::shared_ptr

2022-01-23 Thread Maged Michael via Gcc-patches
Thanks Jonathan! On Sun, Jan 23, 2022 at 5:51 PM Jonathan Wakely wrote: > I thought I'd CC'd Maged on this patch, but apparently not. I've > pushed it to trunk now. > > On Fri, 21 Jan 2022 at 13:50, Jonathan Wakely wrote: > > > > Tested powerpc64le-linux. Does anybody see a problem with this cha

Re: [PATCH] libstdc++: Skip atomic instructions in _Sp_counted_base::_M_release when both counts are 1

2021-06-10 Thread Maged Michael via Gcc-patches
Would appreciate any comments on this proposed patch. Thanks, Maged On Thu, Dec 17, 2020 at 3:49 PM Maged Michael wrote: > Please find a proposed patch for _Sp_counted_base::_M_release to skip the > two atomic instructions that decrement each of the use count and the weak > count when both are

Re: [PATCH] libstdc++: Skip atomic instructions in _Sp_counted_base::_M_release when both counts are 1

2021-07-16 Thread Maged Michael via Gcc-patches
Thank you, Jonathan, for the detailed comments! I'll update the patch accordingly. On Fri, Jul 16, 2021 at 9:55 AM Jonathan Wakely wrote: > On Thu, 17 Dec 2020 at 20:51, Maged Michael wrote: > > > > Please find a proposed patch for _Sp_counted_base::_M_release to skip the > > two atomic instruct

[PATCH] libstdc++: Skip atomic instructions in _Sp_counted_base::_M_release when both counts are 1

2020-12-17 Thread Maged Michael via Gcc-patches
Please find a proposed patch for _Sp_counted_base::_M_release to skip the two atomic instructions that decrement each of the use count and the weak count when both are 1. I proposed the general idea in an earlier thread ( https://gcc.gnu.org/pipermail/libstdc++/2020-December/051642.html) and got us

Re: [PATCH] libstdc++: Skip atomic instructions in _Sp_counted_base::_M_release when both counts are 1

2021-01-05 Thread Maged Michael via Gcc-patches
Please let me know if more information about this patch is needed. Thank you. Maged On Thu, Dec 17, 2020 at 3:49 PM Maged Michael wrote: > Please find a proposed patch for _Sp_counted_base::_M_release to skip the > two atomic instructions that decrement each of the use count and the weak > co