https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119645
Thomas Schwinge <tschwinge at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |redi at gcc dot gnu.org
--- Comment #4 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
(In reply to GCC Commits from comment #3)
> commit r16-563-g1321df5bc05663021313c17f4af54b950aa05d01
> GCN, nvptx libstdc++: Force use of '__atomic' builtins: revert
> 'atomicity_dir=cpu/generic/atomicity_builtins' hard-coding [PR119645]"
>
> Thanks to commit 86627faec10da53d7532805019e5296fcf15ac09
> "libstdc++: Rewrite atomic builtin checks [PR70560]", for both GCN, nvptx
> we now get:
>
> +configure:16060: checking for atomic builtins for _Atomic_word
> +[...]
> +configure:16073: result: yes
>
> ..., and thus may revert the
> 'atomicity_dir=cpu/generic/atomicity_builtins'
> hard-coding added in commit 059b5509c14904b55c37f659170240ae0d2c1c8e
> "GCN, nvptx libstdc++: Force use of '__atomic' builtins [PR119645]".
>
> PR target/119645
> libstdc++-v3/
> * configure.host [GCN, nvptx] (atomicity_dir): Don't set.
... which reverts half of:
(In reply to GCC Commits from comment #2)
> commit r15-9256-g059b5509c14904b55c37f659170240ae0d2c1c8e
> GCN, nvptx libstdc++: Force use of '__atomic' builtins [PR119645]
The other half, however, we cannot revert, as we'd then for both GCN, nvptx
regress this one:
> -checking for lock policy for shared_ptr reference counts... mutex
> +checking for lock policy for shared_ptr reference counts... atomic
... due to:
configure:[...]: checking for lock policy for shared_ptr reference counts
[...]
-configure:16414: $? = 0
-configure:16430: result: atomic
+conftest.cpp:28:7: error: #error "No 2-byte compare-and-swap"
+ 28 | # error "No 2-byte compare-and-swap"
+ | ^~~~~
+configure:16162: $? = 1
+configure: failed program was:
+|[...]
+| #if ! defined __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2
+| # error "No 2-byte compare-and-swap"
+| #elif ! defined __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
+| # error "No 4-byte compare-and-swap"
+| #endif
+|
+| int
+| main ()
+| {
+|
+| ;
+| return 0;
+| }
+configure:16184: result: mutex
(That 'GLIBCXX_ENABLE_LOCK_POLICY' check has been challenged before: "Why do we
care about 2-byte CAS on targets with 4-byte _Atomic_word?!")
We thus keep that one hard-coded:
> PR target/119645
> libstdc++-v3/
> * acinclude.m4 (GLIBCXX_ENABLE_LOCK_POLICY) [GCN, nvptx]:
> Hard-code results.