Go to file
Thomas Schwinge 0804fea065 GCN, nvptx libstdc++: Force use of '__atomic' builtins [PR119645]
For both GCN, nvptx, this gets rid of 'configure'-time:

    configure: WARNING: No native atomic operations are provided for this platform.
    configure: WARNING: They will be faked using a mutex.
    configure: WARNING: Performance of certain classes will degrade as a result.

..., and changes:

    -checking for lock policy for shared_ptr reference counts... mutex
    +checking for lock policy for shared_ptr reference counts... atomic

That means, '[...]/[target]/libstdc++-v3/', 'Makefile's change:

    -ATOMICITY_SRCDIR = config/cpu/generic/atomicity_mutex
    +ATOMICITY_SRCDIR = config/cpu/generic/atomicity_builtins

..., and '[...]/[target]/libstdc++-v3/config.h' changes:

    /* Defined if shared_ptr reference counting should use atomic operations. */
    -/* #undef HAVE_ATOMIC_LOCK_POLICY */
    +#define HAVE_ATOMIC_LOCK_POLICY 1

    /* Define if the compiler supports C++11 atomics. */
    -/* #undef _GLIBCXX_ATOMIC_BUILTINS */
    +#define _GLIBCXX_ATOMIC_BUILTINS 1

..., and '[...]/[target]/libstdc++-v3/include/[target]/bits/c++config.h'
changes:

    /* Defined if shared_ptr reference counting should use atomic operations. */
    -/* #undef _GLIBCXX_HAVE_ATOMIC_LOCK_POLICY */
    +#define _GLIBCXX_HAVE_ATOMIC_LOCK_POLICY 1

    /* Define if the compiler supports C++11 atomics. */
    -/* #undef _GLIBCXX_ATOMIC_BUILTINS */
    +#define _GLIBCXX_ATOMIC_BUILTINS 1

This means that '[...]/[target]/libstdc++-v3/libsupc++/atomicity.cc',
'[...]/[target]/libstdc++-v3/libsupc++/atomicity.o' then uses atomic
instructions for synchronization instead of C++ static local variables, which
in turn for their guard variables, via 'libstdc++-v3/libsupc++/guard.cc', used
'libgcc/gthr.h' recursive mutexes, which currently are unsupported for GCN.

For GCN, this turns ~500 libstdc++ execution test FAILs into PASSes, and also
progresses:

    PASS: g++.dg/tree-ssa/pr20458.C  -std=gnu++17 (test for excess errors)
    [-FAIL:-]{+PASS:+} g++.dg/tree-ssa/pr20458.C  -std=gnu++17 execution test
    PASS: g++.dg/tree-ssa/pr20458.C  -std=gnu++26 (test for excess errors)
    [-FAIL:-]{+PASS:+} g++.dg/tree-ssa/pr20458.C  -std=gnu++26 execution test
    UNSUPPORTED: g++.dg/tree-ssa/pr20458.C  -std=gnu++98: exception handling not supported

(For nvptx, there is no effective change, due to other misconfiguration.)

	PR target/119645
	libstdc++-v3/
	* acinclude.m4 (GLIBCXX_ENABLE_LOCK_POLICY) [GCN, nvptx]:
	Hard-code results.
	* configure: Regenerate.
	* configure.host [GCN, nvptx] (atomicity_dir): Set to
	'cpu/generic/atomicity_builtins'.

(cherry picked from commit 059b5509c1)
2025-04-17 09:35:51 +02:00
.github Minor formatting fix for newly-added file from previous commit 2023-11-01 19:28:56 -04:00
INSTALL
c++tools Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
config Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
contrib Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
fixincludes Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
gcc nvptx: Support '-mfake-ptx-alloca': defer failure to run-time 'alloca' usage 2025-04-17 09:35:26 +02:00
gnattools Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
gotools Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
include OpenMP: 'interop' construct - add ME support + target-independent libgomp 2025-03-22 00:28:19 +01:00
libada Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libatomic Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libbacktrace Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libcc1 Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libcody Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libcpp Daily bump. 2025-03-28 00:23:52 +00:00
libdecnumber Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libffi Merge branch 'releases/gcc-14' into devel/omp/gcc-14 2024-08-01 11:09:11 +02:00
libgcc nvptx: Support '-mfake-ptx-alloca': defer failure to run-time 'alloca' usage 2025-04-17 09:35:26 +02:00
libgfortran Merge remote-tracking branch 'origin/releases/gcc-14' into devel/omp/gcc-14 2025-04-08 23:51:05 +02:00
libgm2 Daily bump. 2024-11-21 00:26:12 +00:00
libgo libgo: bump libgo version for GCC 14 release 2024-02-05 11:28:30 -08:00
libgomp OpenACC 2.7: adjust 2.6 references to 2.7 2025-04-11 13:51:55 +00:00
libgrust Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libiberty Daily bump. 2024-09-13 00:21:45 +00:00
libitm Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libobjc Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libphobos Daily bump. 2025-03-22 00:27:43 +01:00
libquadmath LoongArch: Add LoongArch architecture detection to __float128 support in libgfortran and libquadmath [PR119408]. 2025-04-08 09:19:14 +08:00
libsanitizer Daily bump. 2024-09-06 00:22:34 +00:00
libssp Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libstdc++-v3 GCN, nvptx libstdc++: Force use of '__atomic' builtins [PR119645] 2025-04-17 09:35:51 +02:00
libvtv Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
lto-plugin Daily bump. 2024-09-05 00:22:17 +00:00
maintainer-scripts Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
zlib Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
.dir-locals.el
.gitattributes
.gitignore *: add modern gettext 2023-11-14 00:47:11 +01:00
ABOUT-NLS
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
ChangeLog Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
ChangeLog.jit
ChangeLog.omp GCN, nvptx: Don't default-disable libstdc++ build 2025-03-19 10:01:51 +01:00
ChangeLog.tree-ssa
MAINTAINERS MAINTAINERS: Update my email address 2024-04-04 16:39:52 +02:00
Makefile.def Disable libstdc++ dependency for libffi 2024-05-07 11:49:57 +02:00
Makefile.in Disable libstdc++ dependency for libffi 2024-05-07 11:49:57 +02:00
Makefile.tpl Fix up postboot dependencies [PR106472] 2024-04-02 13:40:27 +02:00
README
SECURITY.txt SECURITY.txt: Drop "exploitable" in reference to hardening issues 2024-01-09 10:49:01 -05:00
ar-lib
compile
config-ml.in
config.guess
config.rpath
config.sub
configure GCN, nvptx: Don't default-disable libstdc++ build 2025-03-19 10:01:51 +01:00
configure.ac GCN, nvptx: Don't default-disable libstdc++ build 2025-03-19 10:01:51 +01:00
depcomp
install-sh
libtool-ldflags
libtool.m4 Build: fix error in fixinclude configure 2023-11-22 11:54:33 +01:00
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
symlink-tree
test-driver
ylwrap

README

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.