https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124124
--- Comment #3 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot
Uni-Bielefeld.DE> ---
> --- Comment #1 from Tomasz KamiĆski <tkaminsk at gcc dot gnu.org> ---
> I think that following two are missing:
> // { dg-require-atomic-cmpxchg-word "" }
> // { dg-add-options libatomic }
>
> Could you check if following change fixes it:
>
> diff --git a/libstdc++-v3/testsuite/29_atomics/atomic/cons/zero_padding.cc
> b/libstdc++-v3/testsuite/29_atomics/atomic/cons/zero_padding.cc
> index ad48d66de3a..3c8a4a8f428 100644
> --- a/libstdc++-v3/testsuite/29_atomics/atomic/cons/zero_padding.cc
> +++ b/libstdc++-v3/testsuite/29_atomics/atomic/cons/zero_padding.cc
> @@ -1,6 +1,6 @@
> // { dg-do run { target c++11 } }
> -// { dg-require-thread-fence "" }
> -// { dg-add-options no_pch }
> +// { dg-require-atomic-cmpxchg-word "" }
> +// { dg-add-options libatomic }
Unfortunately, this doesn't help:
* dg-require-atomic-cmpxchg-word returns 1 on for both -m32 and -64, as
it should: i386-*-solaris2* defaults to -march=pentium4 despite the
target triple.
* dg-add-options libatomic is a no-op on x86 as can be seen in dg-options.exp
(add_options_for_libatomic)
When I run the compilation with -save-temps, I find that the calls occur
in just two functions: 5 times each in
void test_struct<Ctor>(std::atomic<Ctor>&, Ctor const&)
void test_floating<long double>(std::atomic<long double>&, long double
const&)