Re: [PING][PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-03-25 Thread xndcn
Wow, thank you all, you guys! 在 2024年3月14日星期四,Jonathan Wakely 写道: > On Fri, 16 Feb 2024 at 15:15, Jonathan Wakely wrote: > > > > On Fri, 16 Feb 2024 at 14:10, Jakub Jelinek wrote: > > > > > > On Fri, Feb 16, 2024 at 01:51:54PM +, Jonathan Wakely wrote: > > > > Ah, although __atomic_compare_e

Re: [PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-03-14 Thread Jonathan Wakely
On Fri, 16 Feb 2024 at 15:15, Jonathan Wakely wrote: > > On Fri, 16 Feb 2024 at 14:10, Jakub Jelinek wrote: > > > > On Fri, Feb 16, 2024 at 01:51:54PM +, Jonathan Wakely wrote: > > > Ah, although __atomic_compare_exchange only takes pointers, the > > > compiler replaces that with a call to __at

Re: [PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-02-16 Thread Jonathan Wakely
On Fri, 16 Feb 2024 at 14:10, Jakub Jelinek wrote: > > On Fri, Feb 16, 2024 at 01:51:54PM +, Jonathan Wakely wrote: > > Ah, although __atomic_compare_exchange only takes pointers, the > > compiler replaces that with a call to __atomic_compare_exchange_n > > which takes the newval by value, whic

Re: [PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-02-16 Thread Jakub Jelinek
On Fri, Feb 16, 2024 at 01:51:54PM +, Jonathan Wakely wrote: > Ah, although __atomic_compare_exchange only takes pointers, the > compiler replaces that with a call to __atomic_compare_exchange_n > which takes the newval by value, which presumably uses an 80-bit FP > register and so the padding

Re: [PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-02-16 Thread Jonathan Wakely
On Fri, 16 Feb 2024 at 12:38, Jonathan Wakely wrote: > > On Fri, 2 Feb 2024 at 16:52, xndcn wrote: > > > > Thank you for your careful review! > > > > > But we don't need a new one if it's going to be used in exactly one test > > > and if the new option does the same thing for all targets that ru

Re: [PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-02-16 Thread Jonathan Wakely
On Fri, 2 Feb 2024 at 16:52, xndcn wrote: > > Thank you for your careful review! > > > But we don't need a new one if it's going to be used in exactly one test > > and if the new option does the same thing for all targets that run the test. > Got it, thanks. Now add option "-latomic" directly, bu

Re: [PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-02-02 Thread xndcn
Thank you for your careful review! > But we don't need a new one if it's going to be used in exactly one test and > if the new option does the same thing for all targets that run the test. Got it, thanks. Now add option "-latomic" directly, but it still rely on the trick "[atomic_link_flags [get_

Re: [PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-02-01 Thread Jonathan Wakely
On Wed, 31 Jan 2024 at 17:20, xndcn wrote: > > Thanks! > > > Why not just use -latomic unconditionally here? > testsuites of libstdc++ seems to have some tricks to find and link > libatomic.a by using "dg-add-options libatomic", which do nothing for > x86 target. In previous email, we decide not t

Re: [PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-01-31 Thread xndcn
Thanks! > Why not just use -latomic unconditionally here? testsuites of libstdc++ seems to have some tricks to find and link libatomic.a by using "dg-add-options libatomic", which do nothing for x86 target. In previous email, we decide not to pollute the current option, so we add a new libatomic_1

Re: [PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-01-30 Thread Jakub Jelinek
On Tue, Jan 30, 2024 at 04:34:30PM +, Jonathan Wakely wrote: > > --- /dev/null > > +++ > > b/libstdc++-v3/testsuite/29_atomics/atomic_float/compare_exchange_padding.cc > > @@ -0,0 +1,50 @@ > > +// { dg-do run { target c++20 } } > > +// { dg-options "-O0" } > > +// { dg-timeout 10 } Why dg-tim

Re: [PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-01-30 Thread Jonathan Wakely
On Tue, 16 Jan 2024 at 16:17, xndcn wrote: > > Sorry about the mangled content... > So I add a new add-options for libatomic_16b: > > --- > libstdc++-v3/ChangeLog: > > * include/bits/atomic_base.h: add __builtin_clear_padding in > __atomic_float constructor. > * testsuite/lib/dg-options.exp: add n

Re: [PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-01-30 Thread Jonathan Wakely
On Tue, 16 Jan 2024 at 16:17, xndcn wrote: > > Sorry about the mangled content... > So I add a new add-options for libatomic_16b: > > --- > libstdc++-v3/ChangeLog: > > * include/bits/atomic_base.h: add __builtin_clear_padding in > __atomic_float constructor. > * testsuite/lib/dg-options.exp: add n

[PING][PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-01-30 Thread xndcn
Ping, thanks. I do not have access to the repo, anyone can please help me submit the patch? Thanks. xndcn 于2024年1月17日周三 00:16写道: > > Sorry about the mangled content... > So I add a new add-options for libatomic_16b: > > --- > libstdc++-v3/ChangeLog: > > * include/bits/atomic_base.h: add __builtin

Re: [PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-01-24 Thread xndcn
Hi, is it OK for trunk? I do not have access to the repo, can you please help me submit the patch? Thanks. xndcn 于2024年1月17日周三 00:16写道: > > Sorry about the mangled content... > So I add a new add-options for libatomic_16b: > > --- > libstdc++-v3/ChangeLog: > > * include/bits/atomic_base.h: add __

Re: [PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-01-16 Thread xndcn
Sorry about the mangled content... So I add a new add-options for libatomic_16b: --- libstdc++-v3/ChangeLog: * include/bits/atomic_base.h: add __builtin_clear_padding in __atomic_float constructor. * testsuite/lib/dg-options.exp: add new add-options for libatomic_16b. * testsuite/29_atomics/atomi

Re: [PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-01-16 Thread Xi Ruoyao
On Tue, 2024-01-16 at 17:53 +0800, xndcn wrote: > Thanks, so I add a test: atomic_float/compare_exchange_padding.cc, > which will fail due to timeout without the patch. Please resend in plain text instead of HTML. Sending in HTML causes the patch mangled. And libstdc++ patches should CC libstd..

Re: [PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-01-16 Thread xndcn
Thanks, so I add a test: atomic_float/compare_exchange_padding.cc, which will fail due to timeout without the patch. --- libstdc++-v3/ChangeLog: * include/bits/atomic_base.h: add __builtin_clear_padding in __atomic_float constructor. * testsuite/lib/dg-options.exp: enable libatomic for IA32 and

Re: [PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-01-14 Thread H.J. Lu
On Sun, Jan 7, 2024, 5:02 PM xndcn wrote: > Hi, I found __atomic_float constructor does not clear padding, > while __compare_exchange assumes it as zeroed padding. So it is easy to > reproducing a infinite loop in X86-64 with long double type like: > --- > -O0 -std=c++23 -mlong-double-80 > #inclu

[PING][PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-01-14 Thread xndcn
Ping. Thanks. xndcn 于2024年1月8日周一 09:01写道: > Hi, I found __atomic_float constructor does not clear padding, > while __compare_exchange assumes it as zeroed padding. So it is easy to > reproducing a infinite loop in X86-64 with long double type like: > --- > -O0 -std=c++23 -mlong-double-80 > #incl

[PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-01-07 Thread xndcn
Hi, I found __atomic_float constructor does not clear padding, while __compare_exchange assumes it as zeroed padding. So it is easy to reproducing a infinite loop in X86-64 with long double type like: --- -O0 -std=c++23 -mlong-double-80 #include #include #define T long double int main() { st