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++: Fix aliasing violation in std::shared_ptr

2022-01-23 Thread Jonathan Wakely via Gcc-patches
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 change? > > > The non-atomic store that sets both reference counts to zero uses a > type-

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

2022-01-21 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Does anybody see a problem with this change? The non-atomic store that sets both reference counts to zero uses a type-punned pointer, which has undefined behaviour. We could use memset to write 8 bytes, but we don't actually need it to be a single store anyway. No other