Commit graph

14667 commits

Author SHA1 Message Date
GCC Administrator
b9fd8399ec Daily bump. 2023-11-14 12:23:39 +00:00
Arsen Arsenović
db50aea625
*: add modern gettext
This patch updates gettext.m4 and related .m4 files and adds
gettext-runtime as a gmp/mpfr/... style host library, allowing newer
libintl to be used.

This patch /does not/ add build-time tools required for
internationalizing (msgfmt et al), instead, it just updates the runtime
library.  The result should be a distribution that acts exactly the same
when a copy of gettext is present, and disables internationalization
otherwise.

There should be no changes in behavior when gettext is included in-tree.
When gettext is not included in tree, nor available on the system, the
programs will be built without localization.

ChangeLog:

	PR bootstrap/12596
	* .gitignore: Add '/gettext*'.
	* configure.ac (host_libs): Replace intl with gettext.
	(hbaseargs, bbaseargs, baseargs): Split baseargs into
	{h,b}baseargs.
	(skip_barg): New flag.  Skips appending current flag to
	bbaseargs.
	<library exemptions>: Exempt --with-libintl-{type,prefix} from
	target and build machine argument passing.
	* configure: Regenerate.
	* Makefile.def (host_modules): Replace intl module with gettext
	module.
	(configure-ld): Depend on configure-gettext.
	* Makefile.in: Regenerate.

config/ChangeLog:

	* intlmacosx.m4: Import from gettext-0.22 (serial 8).
	* gettext.m4: Sync with gettext-0.22 (serial 77).
	* gettext-sister.m4 (ZW_GNU_GETTEXT_SISTER_DIR): Load gettext's
	uninstalled-config.sh, or call AM_GNU_GETTEXT if missing.
	* iconv.m4: Sync with gettext-0.22 (serial 26).

contrib/ChangeLog:

	* prerequisites.sha512: Add gettext.
	* prerequisites.md5: Add gettext.
	* download_prerequisites: Add gettext.

gcc/ChangeLog:

	* configure: Regenerate.
	* aclocal.m4: Regenerate.
	* Makefile.in (LIBDEPS): Remove (potential) ./ prefix from
	LIBINTL_DEP.
	* doc/install.texi: Document new (notable) flags added by the
	optional gettext tree and by AM_GNU_GETTEXT.  Document libintl/libc
	with gettext dependency.

libcpp/ChangeLog:

	* configure: Regenerate.
	* aclocal.m4: Regenerate.

libstdc++-v3/ChangeLog:

	* configure: Regenerate.
2023-11-14 00:47:11 +01:00
Jonathan Wakely
c28b0326ce libstdc++: Add dg-timeout-factor to remaining <chrono> IO tests
I meant to add these changes as part of r14-4959-g7d06b29f814580 but
missed these files out.

libstdc++-v3/ChangeLog:

	* testsuite/std/time/clock/file/io.cc: Double timeout using
	dg-timeout-factor.
	* testsuite/std/time/clock/gps/io.cc: Likewise.
	* testsuite/std/time/clock/local/io.cc: Likewise.
	* testsuite/std/time/clock/system/io.cc: Likewise.
	* testsuite/std/time/clock/tai/io.cc: Likewise.
	* testsuite/std/time/clock/utc/io.cc: Likewise.
2023-11-13 23:22:19 +00:00
Jonathan Wakely
2c492f99fc libstdc++: Micro-optimization for std::optional [PR112480]
This small change removes a branch when clearing a std::optional<T> for
types with no-op destructors. For types where the destructor can be
optimized away (e.g. because it's trivial, or empty and can be inlined)
the _M_destroy() function does nothing but set _M_engaged to false.
Setting _M_engaged=false unconditionally is cheaper than only doing it
when initially true, because it allows the compiler to remove a branch.

The compiler thinks it would be incorrect to unconditionally introduce a
store there, because it could conflict with reads in other threads, so
it won't do that optimization itself. We know it's safe to do because
we're in a non-const member function, so the standard forbids any
potentially concurrent calls to other member functions of the same
object. Making the store unconditional can't create a data race that
isn't already present in the program.

libstdc++-v3/ChangeLog:

	PR libstdc++/112480
	* include/std/optional (_Optional_payload_base::_M_reset): Set
	_M_engaged to false unconditionally.
2023-11-13 23:22:19 +00:00
Jonathan Wakely
807f47497f libstdc++: Do not use assume attribute for Clang [PR112467]
Clang has an 'assume' attribute, but it's a function attribute not a
statement attribute. The recently-added use of the statement form causes
an error with Clang.

libstdc++-v3/ChangeLog:

	PR libstdc++/112467
	* include/bits/stl_bvector.h (_M_assume_normalized): Do not use
	statement form of assume attribute for Clang.
2023-11-11 00:41:09 +00:00
Jonathan Wakely
f7251b7886 libstdc++: Simplify std::string_view comparisons (LWG 3950)
LWG 3950 points out that the comparisons of std::basic_string_view can
be simplified to just a single overload of operator== and a single
overload of operator<=>. Those overloads work fine for homogeneous
comparisons of two string view objects.

libstdc++-v3/ChangeLog:

	* include/std/string_view (operator==, operator<=>): Remove
	redundant overloads (LWG 3950).
2023-11-11 00:41:09 +00:00
Jonathan Wakely
7c02efd45f libstdc++: Fix broken tests for <complex.h>
When I added these tests I gave them .h file extensions, so they've
never been run.

They need to use the no_pch option, so that they only test the
<complex.h> header and don't get <complex> via <bits/stdc++.h>.

libstdc++-v3/ChangeLog:

	* testsuite/26_numerics/headers/complex.h/std_c++11.h: Moved to...
	* testsuite/26_numerics/headers/complex.h/std_c++11.cc: ...here.
	* testsuite/26_numerics/headers/complex.h/std_c++98.h: Moved to...
	* testsuite/26_numerics/headers/complex.h/std_c++98.cc: ...here.
	Check macro first and then #undef.
	* testsuite/26_numerics/headers/complex.h/std_gnu++11.h: Moved to...
	* testsuite/26_numerics/headers/complex.h/std_gnu++11.cc: ...here.
2023-11-11 00:41:09 +00:00
Jonathan Wakely
0953497a81 libstdc++: Add static_assert to std::integer_sequence [PR112473]
C++20 allows class types as non-type template parameters, but
std::integer_sequence explicitly disallows them. Enforce that.

libstdc++-v3/ChangeLog:

	PR libstdc++/112473
	* include/bits/utility.h (integer_sequence): Add static_assert.
	* testsuite/20_util/integer_sequence/112473.cc: New test.
2023-11-11 00:41:09 +00:00
Jonathan Wakely
94cc8e9d6f libstdc++: Fix test that fails with -ffreestanding
The -ffreestanding option disables Debug Mode, forcibly #undef'ing
_GLIBCXX_DEBUG. This means that the dangling checks in std::pair are
disabled for -ffreestanding in C++17 and earlier, because they depend on
_GLIBCXX_DEBUG. Adjust the target specifiers for the errors currently
matching c++17_down so they also require the hosted effective target.

libstdc++-v3/ChangeLog:

	* testsuite/20_util/pair/dangling_ref.cc: Add hosted effective
	target for specifiers using c++17_down.
2023-11-11 00:41:09 +00:00
Jonathan Wakely
090589e84b libstdc++: Deprecate std::atomic_xxx overloads for std::shared_ptr
These overloads are deprecated in C++20 (and likely to be removed for
C++26). The std::atomic<std::shared_ptr<T>> specialization should be
preferred in new code.

libstdc++-v3/ChangeLog:

	* include/bits/shared_ptr_atomic.h (atomic_is_lock_free)
	(atomic_load_explicit, atomic_load, atomic_store_explicit)
	(atomic_store, atomic_exchange_explicit, atomic_exchange)
	(atomic_compare_exchange_strong, atomic_compare_exchange_weak)
	(atomic_compare_exchange_strong_explicit)
	(atomic_compare_exchange_weak_explicit): Add deprecated
	attribute for C++20 and later.
	* testsuite/20_util/shared_ptr/atomic/1.cc: Suppress deprecated
	warnings.
	* testsuite/20_util/shared_ptr/atomic/2.cc: Likewise.
	* testsuite/20_util/shared_ptr/atomic/3.cc: Likewise.
	* testsuite/29_atomics/atomic/lwg3220.cc: Likewise.
2023-11-11 00:41:08 +00:00
Jonathan Wakely
64bcf3f07a libstdc++: Add [[nodiscard]] to lock types
Adding this attribute means users get a warning when they accidentally
create a temporary lock instead of creating an automatic variable with
block scope.

For std::lock_guard both constructors have side effects (they both take
a mutex and so both cause it to be unlocked at the end of the full
expression when a temporary is constructed). Ideally we would just put
the attribute on the class instead of the constructors, but that doesn't
work with GCC (PR c++/85973).

For std::unique_lock the default constructor and std::defer_lock_t
constructor do not cause any locking or unlocking, so do not need to
give a warning. It might still be a mistake to create a temporary using
those constructors, but it's harmless and seems unlikely anyway. For a
lock object created with one of those constructors you would expect the
lock object to be referred to later in the function, and that would not
even compile if it was constructed as an unnamed temporary.

std::scoped_lock gets the same treatment as std::lock_guard, except that
the explicit specialization for zero lockables has no side effects so
doesn't need to warn.

libstdc++-v3/ChangeLog:

	* include/bits/std_mutex.h (lock_guard): Add [[nodiscard]]
	attribute to constructors.
	* include/bits/unique_lock.h (unique_lock): Likewise.
	* include/std/mutex (scoped_lock, scoped_lock<Mutex>): Likewise.
	* testsuite/30_threads/lock_guard/cons/nodiscard.cc: New test.
	* testsuite/30_threads/scoped_lock/cons/nodiscard.cc: New test.
	* testsuite/30_threads/unique_lock/cons/nodiscard.cc: New test.
2023-11-11 00:41:08 +00:00
Jonathan Wakely
a92a434024 libstdc++: Add [[nodiscard]] to std::span members
All std::span member functions are pure functions that have no side
effects. They are only useful for their return value, so they should all
warn if that value is not used.

libstdc++-v3/ChangeLog:

	* include/std/span (span, as_bytes, as_writable_bytes): Add
	[[nodiscard]] attribute on all non-void functions.
	* testsuite/23_containers/span/back_assert_neg.cc: Suppress
	nodiscard warning.
	* testsuite/23_containers/span/back_neg.cc: Likewise.
	* testsuite/23_containers/span/first_2_assert_neg.cc: Likewise.
	* testsuite/23_containers/span/first_assert_neg.cc: Likewise.
	* testsuite/23_containers/span/first_neg.cc: Likewise.
	* testsuite/23_containers/span/front_assert_neg.cc: Likewise.
	* testsuite/23_containers/span/front_neg.cc: Likewise.
	* testsuite/23_containers/span/index_op_assert_neg.cc: Likewise.
	* testsuite/23_containers/span/index_op_neg.cc: Likewise.
	* testsuite/23_containers/span/last_2_assert_neg.cc: Likewise.
	* testsuite/23_containers/span/last_assert_neg.cc: Likewise.
	* testsuite/23_containers/span/last_neg.cc: Likewise.
	* testsuite/23_containers/span/subspan_2_assert_neg.cc:
	Likewise.
	* testsuite/23_containers/span/subspan_3_assert_neg.cc:
	Likewise.
	* testsuite/23_containers/span/subspan_4_assert_neg.cc:
	Likewise.
	* testsuite/23_containers/span/subspan_5_assert_neg.cc:
	Likewise.
	* testsuite/23_containers/span/subspan_6_assert_neg.cc:
	Likewise.
	* testsuite/23_containers/span/subspan_assert_neg.cc: Likewise.
	* testsuite/23_containers/span/subspan_neg.cc: Likewise.
	* testsuite/23_containers/span/nodiscard.cc: New test.
2023-11-11 00:41:08 +00:00
Jonathan Wakely
898fd81b83 libstdc++: Remove handling for underscore-prefixed libm functions [PR111638]
The checks in linkage.m4 try to support math functions prefixed with
underscores, like _acosf and _isinf. However, that doesn't work because
they're renamed to the standard names using a macro, but then <cmath>
undefines that macro again.

This simply removes everything related to those underscored functions.

libstdc++-v3/ChangeLog:

	PR libstdc++/111638
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* linkage.m4 (GLIBCXX_MAYBE_UNDERSCORED_FUNCS): Remove.
	(GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1): Do not check for _foo.
	(GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1): Likewise.
	(GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2): Likewise.
	(GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3): Likewise.
	(GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2): Do not use
	GLIBCXX_MAYBE_UNDERSCORED_FUNCS.
2023-11-11 00:41:08 +00:00
Nathaniel Shead
0b880466e9 libstdc++: Add missing functions to <cmath> [PR79700]
This patch adds the -f and -l variants of the C99 <math.h> functions to
<cmath> under namespace std (so std::sqrtf, std::fabsl, etc.) for C++11
and up.

libstdc++-v3/ChangeLog:

	PR libstdc++/79700
	* include/c_global/cmath (acosf, acosl, asinf, asinl, atanf)
	(atanl, atan2f, atan2l, ceilf, ceill, cosf, cosl, coshf, coshl)
	(expf, expl, fabsf, fabsl, floorf, floorl, fmodf, fmodl, frexpf)
	(frexpl, ldexpf, ldexpl, logf, logl, log10f, log10l, modff)
	(modfl, powf, powl, sinf, sinl, sinhf, sinhl, sqrtf, sqrtl, tanf)
	(tanl, tanhf, tanhl): Add using-declarations in namespace std.
	* testsuite/26_numerics/headers/cmath/equivalent_functions.cc:
	New test.
	* testsuite/26_numerics/headers/cmath/functions_std_c++17.cc:
	Add checks for existence of above names.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
2023-11-11 00:41:08 +00:00
Arsen Arsenović
644390c8bc
libstdc++: mark 20_util/scoped_allocator/noexcept.cc R-E-T hosted
libstdc++-v3/ChangeLog:

	* testsuite/20_util/scoped_allocator/noexcept.cc: Mark as
	requiring hosted.
2023-11-10 00:10:51 +01:00
Arsen Arsenović
d9dbc835d4
libstdc++: declare std::allocator in !HOSTED as an extension
This allows us to add features to freestanding which allow specifying
non-default allocators (generators, collections, ...) without having to
modify them.

libstdc++-v3/ChangeLog:

	* include/bits/memoryfwd.h: Remove HOSTED check around allocator
	and its specializations.
2023-11-10 00:10:51 +01:00
Patrick Palka
d63282fa5b libstdc++: Fix forwarding in __take/drop_of_repeat_view [PR112453]
We need to respect the value category of the repeat_view passed to these
two functions when accessing the view's _M_value member.  This revealed
that the space-efficient partial specialization of __box lacks && overloads
of operator* to match those of the primary template (inherited from
std::optional).

	PR libstdc++/112453

libstdc++-v3/ChangeLog:

	* include/std/ranges (__detail::__box<_Tp>::operator*): Define
	&& overloads as well.
	(__detail::__take_of_repeat_view): Forward __r when accessing
	its _M_value member.
	(__detail::__drop_of_repeat_view): Likewise.
	* testsuite/std/ranges/repeat/1.cc (test07): New test.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
2023-11-09 15:15:08 -05:00
François Dumont
c4cf9aa247 libstdc++: [_Hashtable] Use RAII type to manage rehash functor state
Replace usage of __try/__catch with a RAII type to restore rehash functor
state when needed.

libstdc++-v3/ChangeLog:

	* include/bits/hashtable_policy.h (_RehashStateGuard): New.
	(_Insert_base<>::_M_insert_range(_IIt, _IIt, const _NodeGet&, false_type)):
	Adapt.
	* include/bits/hashtable.h (__rehash_guard_t): New.
	(__rehash_state): Remove.
	(_M_rehash): Remove.
	(_M_rehash_aux): Rename into _M_rehash.
	(_M_assign_elements, _M_insert_unique_node, _M_insert_multi_node): Adapt.
	(rehash): Adapt.
2023-11-09 19:16:35 +01:00
François Dumont
04d8a47608 libstdc++: [_Hashtable] Use RAII type to guard node while constructing value
libstdc++-v3/ChangeLog:

	* include/bits/hashtable_policy.h
	(struct _NodePtrGuard<_HashtableAlloc, _NodePtr>): New.
	(_ReuseAllocNode::operator()(_Args&&...)): Use latter to guard allocated node
	pointer while constructing in place the value_type instance.
2023-11-09 06:24:31 +01:00
Alexandre Oliva
e39b3e02c2 libstdc++: optimize bit iterators assuming normalization [PR110807]
The representation of bit iterators, using a pointer into an array of
words, and an unsigned bit offset into that word, makes for some
optimization challenges: because the compiler doesn't know that the
offset is always in a certain narrow range, beginning at zero and
ending before the word bitwidth, when a function loads an offset that
it hasn't normalized itself, it may fail to derive certain reasonable
conclusions, even to the point of retaining useless calls that elicit
incorrect warnings.

Case at hand: The 110807.cc testcase for bit vectors assigns a 1-bit
list to a global bit vector variable.  Based on the compile-time
constant length of the list, we decide in _M_insert_range whether to
use the existing storage or to allocate new storage for the vector.
After allocation, we decide in _M_copy_aligned how to copy any
preexisting portions of the vector to the newly-allocated storage.
When copying two or more words, we use __builtin_memmove.

However, because we compute the available room using bit offsets
without range information, even comparing them with constants, we fail
to infer ranges for the preexisting vector depending on word size, and
may thus retain the memmove call despite knowing we've only allocated
one word.

Other parts of the compiler then detect the mismatch between the
constant allocation size and the much larger range that could
theoretically be copied into the newly-allocated storage if we could
reach the call.

Ensuring the compiler is aware of the constraints on the offset range
enables it to do a much better job at optimizing.  Using attribute
assume (_M_offset <= ...) didn't work, because gimple lowered that to
something that vrp could only use to ensure 'this' was non-NULL.
Exposing _M_offset as an automatic variable/gimple register outside
the unevaluated assume operand enabled the optimizer to do its job.

Rather than placing such load-then-assume constructs all over, I
introduced an always-inline member function in bit iterators that does
the job of conveying to the compiler the information that the
assumption is supposed to hold, and various calls throughout functions
pertaining to bit iterators that might not otherwise know that the
offsets have to be in range, so that the compiler no longer needs to
make conservative assumptions that prevent optimizations.

With the explicit assumptions, the compiler can correlate the test for
available storage in the vector with the test for how much storage
might need to be copied, and determine that, if we're not asking for
enough room for two or more words, we can omit entirely the code to
copy two or more words, without any runtime overhead whatsoever: no
traces remain of the undefined behavior or of the tests that inform
the compiler about the assumptions that must hold.


for  libstdc++-v3/ChangeLog

	PR libstdc++/110807
	* include/bits/stl_bvector.h (_Bit_iterator_base): Add
	_M_assume_normalized member function.  Call it in _M_bump_up,
	_M_bump_down, _M_incr, operator==, operator<=>, operator<, and
	operator-.
	(_Bit_iterator): Also call it in operator*.
	(_Bit_const_iterator): Likewise.
2023-11-09 00:01:37 -03:00
GCC Administrator
c48f105685 Daily bump. 2023-11-08 00:17:35 +00:00
François Dumont
8f2a59c262 libstdc++: [_Hashtable] Add missing node destructor call
libstdc++-v3/ChangeLog:

	* include/bits/hashtable_policy.h
	(_Hashtable_alloc<>::_M_allocate_node): Add missing call to node destructor
	on construct exception.
2023-11-07 22:25:29 +01:00
Richard Biener
7562f089a1 libstdc++/112351 - deal with __gthread_once failure during locale init
The following makes the C++98 locale init path follow the way the
C++11 performs initialization.  This way we deal with pthread_once
failing, falling back to non-threadsafe initialization which, given we
initialize from the library, should be serialized by the dynamic
loader already.

	PR libstdc++/112351
libstdc++-v3/
	* src/c++98/locale.cc (locale::facet::_S_initialize_once):
	Check whether _S_c_locale is already initialized.
	(locale::facet::_S_get_c_locale): Always perform non-threadsafe
	init when threadsafe init failed.
2023-11-07 13:55:07 +01:00
GCC Administrator
2cca6ae615 Daily bump. 2023-11-07 00:17:18 +00:00
Ian Lance Taylor
2b64e4a540 libstdc++: use -D_GNU_SOURCE when building libbacktrace
PR libbacktrace/111315
	PR libbacktrace/112263
	* acinclude.m4: Set -D_GNU_SOURCE in BACKTRACE_CPPFLAGS and when
	grepping link.h for dl_iterate_phdr.
	* configure: Regenerate.
2023-11-06 15:11:43 -08:00
Jonathan Wakely
3d654f96d4 libstdc++: Improve static assert messages for monadic operations
The monadic operations for std::optional and std::expected make use of
internal helper traits __is_optional nad __is_expected, which are not
very user-friendly when shown in diagnostics. Add messages to the
assertions explaining the problem more clearly.

libstdc++-v3/ChangeLog:

	* include/std/expected (expected::and_then, expected::or_else):
	Add string literals to static assertions.
	* include/std/optional (optional::and_then, optional::or_else):
	Likewise.
2023-11-06 10:15:20 +00:00
GCC Administrator
eb4e1b625f Daily bump. 2023-11-05 00:17:12 +00:00
Feng Jisen
ada871cfad libstdc++: Remove redundant partial specialization in _Nth_type
libstdc++-v3/ChangeLog:

	* include/bits/utility.h (_Nth_type): Remove redundant partial
	specialization.
2023-11-04 08:31:45 +00:00
Jonathan Wakely
51f94778b4 libstdc++: Use strerror_r in std::generic_category()::message(int) [PR110133]
Use strerror_r instead of strerror when available, due to the latter not
being thread-safe. This is complicated by Glibc providing a GNU-specific
strerror_r which is not compatible with POSIX strerror_r, so we need to
dispatch on the return type.

We can use the recently-added std::string::__resize_and_overwrite to
write directly into the string buffer when possible. Because we estimate
the initial buffer size we might end up with excess capacity in the
returned std::string. We can slightly tweak the std::system_error
constructors to make use of that excess capacity, so that in some cases
we require fewer allocations to construct the std::system_error::what()
string.

libstdc++-v3/ChangeLog:

	PR libstdc++/110133
	* include/std/system_error (system_error::system_error): Group
	arguments so that concatenation can reuse rvalue's capacity.
	* src/c++11/system_error.cc (strerror_string): New function.
	[_GLIBCXX_HAVE_STRERROR_R] (use_strerror_result): New functions.
	(generic_error_category::message): Use strerror_string.
	(system_error_category::message): Likewise.
2023-11-04 08:31:45 +00:00
Jonathan Wakely
6933c05ade libstdc++: Replace "_N" in examples of naming conventions
The name "_N" is listed as a reserved name on Solaris, so we shouldn't
use it as an example of our naming conventions.

libstdc++-v3/ChangeLog:

	* doc/xml/manual/appendix_contributing.xml: Replace example that
	uses a BADNAME.
	* doc/html/manual/source_code_style.html: Regenerate.
2023-11-04 08:31:45 +00:00
GCC Administrator
9daed0b538 Daily bump. 2023-11-03 00:16:58 +00:00
Jonathan Wakely
6afa984f47 libstdc++: Add assertion to std::string_view::remove_suffix [PR112314]
libstdc++-v3/ChangeLog:

	PR libstdc++/112314
	* include/std/string_view (string_view::remove_suffix): Add
	debug assertion.
	* testsuite/21_strings/basic_string_view/modifiers/remove_prefix/debug.cc:
	New test.
	* testsuite/21_strings/basic_string_view/modifiers/remove_suffix/debug.cc:
	New test.
2023-11-02 14:53:23 +00:00
Jonathan Wakely
8a4cde6319 libstdc++: Fix warning during configure
The checks for snprintf give a -Wformat warning due to a missing
argument.

libstdc++-v3/ChangeLog:

	* acinclude.m4 (GLIBCXX_ENABLE_C99): Fix snprintf checks.
	* configure: Regenerate.
2023-11-02 13:48:22 +00:00
GCC Administrator
a5c157b95a Daily bump. 2023-10-31 00:17:32 +00:00
François Dumont
6504b4a498 libstdc++: [_GLIBCXX_INLINE_VERSION] Add comment on emul TLS symbols
libstdc++-v3/ChangeLog:

	* config/abi/pre/gnu-versioned-namespace.ver: Add comment on recently
	added emul TLS symbols.
2023-10-30 22:07:49 +01:00
François Dumont
5ea11700e5 libstdc++: [_GLIBCXX_INLINE_VERSION] Un-weak handle_contract_violation
libstdc++-v3/ChangeLog:

	* src/experimental/contract.cc
	[_GLIBCXX_INLINE_VERSION](handle_contract_violation): Rework comment.
	Remove weak attribute.
2023-10-30 21:49:31 +01:00
GCC Administrator
39a11d8e0b Daily bump. 2023-10-30 00:17:23 +00:00
François Dumont
3c444fb2ff libstdc++: [_GLIBCXX_INLINE_VERSION] Add emul TLS symbols
libstdc++-v3/ChangeLog:

	* config/abi/pre/gnu-versioned-namespace.ver: Add missing emul TLS
	symbols.
2023-10-29 22:20:28 +01:00
François Dumont
5d1b723cef libstdc++: [_GLIBCXX_INLINE_VERSION] Provide handle_contract_violation symbol
libstdc++-v3/ChangeLog:

	* src/experimental/contract.cc
	[_GLIBCXX_INLINE_VERSION](handle_contract_violation): Provide symbol
	without version namespace decoration for gcc.
2023-10-29 22:10:33 +01:00
GCC Administrator
ecca503bf4 Daily bump. 2023-10-27 00:17:12 +00:00
Jonathan Wakely
0c305f3dec libstdc++: Fix exception thrown by std::shared_lock::unlock() [PR112089]
The incorrect errc constant here looks like a copy&paste error.

libstdc++-v3/ChangeLog:

	PR libstdc++/112089
	* include/std/shared_mutex (shared_lock::unlock): Change errc
	constant to operation_not_permitted.
	* testsuite/30_threads/shared_lock/locking/112089.cc: New test.
2023-10-26 21:10:47 +01:00
Jonathan Wakely
7d06b29f81 libstdc++: Add dg-timeout-factor to <chrono> IO tests
This avoids failures due to compilation timeouts when testing with a low
tool_timeout value.

libstdc++-v3/ChangeLog:

	* testsuite/20_util/duration/io.cc: Double timeout using
	dg-timeout-factor.
	* testsuite/std/time/day/io.cc: Likewise.
	* testsuite/std/time/format.cc: Likewise.
	* testsuite/std/time/hh_mm_ss/io.cc: Likewise.
	* testsuite/std/time/month/io.cc: Likewise.
	* testsuite/std/time/month_day/io.cc: Likewise.
	* testsuite/std/time/month_day_last/io.cc: Likewise.
	* testsuite/std/time/month_weekday/io.cc: Likewise.
	* testsuite/std/time/month_weekday_last/io.cc: Likewise.
	* testsuite/std/time/weekday/io.cc: Likewise.
	* testsuite/std/time/weekday_indexed/io.cc: Likewise.
	* testsuite/std/time/weekday_last/io.cc: Likewise.
	* testsuite/std/time/year/io.cc: Likewise.
	* testsuite/std/time/year_month/io.cc: Likewise.
	* testsuite/std/time/year_month_day/io.cc: Likewise.
	* testsuite/std/time/year_month_day_last/io.cc: Likewise.
	* testsuite/std/time/year_month_weekday/io.cc: Likewise.
	* testsuite/std/time/year_month_weekday_last/io.cc: Likewise.
	* testsuite/std/time/zoned_time/io.cc: Likewise.
2023-10-26 21:10:47 +01:00
GCC Administrator
f75fc1f083 Daily bump. 2023-10-26 00:17:43 +00:00
Jonathan Wakely
f32c1e1e96 libstdc++: Build libstdc++_libbacktrace.a as PIC [PR111936]
In order for std::stacktrace to be used in a shared library, the
libbacktrace symbols need to be built with -fPIC. Add the libtool
-prefer-pic flag to the commands in src/libbacktrace/Makefile so that
the archive contains PIC objects.

libstdc++-v3/ChangeLog:

	PR libstdc++/111936
	* src/libbacktrace/Makefile.am: Add -prefer-pic to libtool
	compile commands.
	* src/libbacktrace/Makefile.in: Regenerate.
2023-10-25 11:08:57 +01:00
GCC Administrator
444a485f8f Daily bump. 2023-10-25 00:19:04 +00:00
Paul M. Bendixen
c1eee808a9 libstdc++: Include cstdarg in freestanding
P1642 includes cstdarg in the full headers to include.
This commit includes it along with cstdalign and cstdbool that were
left out when updating in an earlier commit.

libstdc++/Changelog

	* include/Makefile.am: Move cstdarg, cstdalign and cstdbool to
	freestanding.
	* include/Makefile.in: Regenerate.

Signed-off-by: Paul M. Bendixen <paulbendixen@gmail.com>
2023-10-24 21:21:31 +01:00
GCC Administrator
3b6327461d Daily bump. 2023-10-23 00:16:43 +00:00
Iain Sandoe
6a6d3817af Config,Darwin: Allow for configuring Darwin to use embedded runpath.
Recent Darwin versions place contraints on the use of run paths
specified in environment variables.  This breaks some assumptions
in the GCC build.

This change allows the user to configure a Darwin build to use
'@rpath/libraryname.dylib' in library names and then to add an
embedded runpath to executables (and libraries with dependents).

The embedded runpath is added by default unless the user adds
'-nodefaultrpaths' to the link line.

For an installed compiler, it means that any executable built with
that compiler will reference the runtimes installed with the
compiler (equivalent to hard-coding the library path into the name
of the library).

During build-time configurations  any "-B" entries will be added to
the runpath thus the newly-built libraries will be found by exes.

Since the install name is set in libtool, that decision needs to be
available here (but might also cause dependent ones in Makefiles,
so we need to export a conditional).

This facility is not available for Darwin 8 or earlier, however the
existing environment variable runpath does work there.

We default this on for systems where the external DYLD_LIBRARY_PATH
does not work and off for Darwin 8 or earlier.  For systems that can
use either method, if the value is unset, we use the default (which
is currently DYLD_LIBRARY_PATH).

ChangeLog:

	* configure: Regenerate.
	* configure.ac: Do not add default runpaths to GCC exes
	when we are building -static-libstdc++/-static-libgcc (the
	default).
	* libtool.m4: Add 'enable-darwin-at-runpath'.  Act  on the
	enable flag to alter Darwin libraries to use @rpath names.

gcc/ChangeLog:

	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths.
	* config/darwin.h: Handle Darwin rpaths.
	* config/darwin.opt: Handle Darwin rpaths.
	* Makefile.in:  Handle Darwin rpaths.

gcc/ada/ChangeLog:

	* gcc-interface/Makefile.in: Handle Darwin rpaths.

gcc/jit/ChangeLog:
	* Make-lang.in: Handle Darwin rpaths.

libatomic/ChangeLog:

	* Makefile.am: Handle Darwin rpaths.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths.

libbacktrace/ChangeLog:

	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths.

libcc1/ChangeLog:

	* configure: Regenerate.

libffi/ChangeLog:

	* Makefile.am: Handle Darwin rpaths.
	* Makefile.in: Regenerate.
	* configure: Regenerate.

libgcc/ChangeLog:

	* config/t-slibgcc-darwin: Generate libgcc_s
	with an @rpath name.
	* config.host: Handle Darwin rpaths.

libgfortran/ChangeLog:

	* Makefile.am: Handle Darwin rpaths.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths

libgm2/ChangeLog:

	* Makefile.am: Handle Darwin rpaths.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths.
	* libm2cor/Makefile.am: Handle Darwin rpaths.
	* libm2cor/Makefile.in: Regenerate.
	* libm2iso/Makefile.am: Handle Darwin rpaths.
	* libm2iso/Makefile.in: Regenerate.
	* libm2log/Makefile.am: Handle Darwin rpaths.
	* libm2log/Makefile.in: Regenerate.
	* libm2min/Makefile.am: Handle Darwin rpaths.
	* libm2min/Makefile.in: Regenerate.
	* libm2pim/Makefile.am: Handle Darwin rpaths.
	* libm2pim/Makefile.in: Regenerate.

libgomp/ChangeLog:

	* Makefile.am: Handle Darwin rpaths.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths

libitm/ChangeLog:

	* Makefile.am: Handle Darwin rpaths.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths.

libobjc/ChangeLog:

	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths.

libphobos/ChangeLog:

	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths.
	* libdruntime/Makefile.am: Handle Darwin rpaths.
	* libdruntime/Makefile.in: Regenerate.
	* src/Makefile.am: Handle Darwin rpaths.
	* src/Makefile.in: Regenerate.

libquadmath/ChangeLog:

	* Makefile.am: Handle Darwin rpaths.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths.

libsanitizer/ChangeLog:

	* asan/Makefile.am: Handle Darwin rpaths.
	* asan/Makefile.in: Regenerate.
	* configure: Regenerate.
	* hwasan/Makefile.am: Handle Darwin rpaths.
	* hwasan/Makefile.in: Regenerate.
	* lsan/Makefile.am: Handle Darwin rpaths.
	* lsan/Makefile.in: Regenerate.
	* tsan/Makefile.am: Handle Darwin rpaths.
	* tsan/Makefile.in: Regenerate.
	* ubsan/Makefile.am: Handle Darwin rpaths.
	* ubsan/Makefile.in: Regenerate.

libssp/ChangeLog:

	* Makefile.am: Handle Darwin rpaths.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths.

libstdc++-v3/ChangeLog:

	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths.
	* src/Makefile.am: Handle Darwin rpaths.
	* src/Makefile.in: Regenerate.

libvtv/ChangeLog:

	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths.

lto-plugin/ChangeLog:
	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths.

zlib/ChangeLog:
	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths.
2023-10-22 19:30:02 +01:00
GCC Administrator
bc43a9e21c Daily bump. 2023-10-22 00:16:41 +00:00
Jonathan Wakely
405a4140fc libstdc++: Split std::basic_string::_M_use_local_data into two functions
This splits out the activate-the-union-member-for-constexpr logic from
_M_use_local_data, so that it can be used separately in cases that don't
need to use std::pointer_traits<pointer>::pointer_to to obtain the
return value.

This leaves only three uses of _M_use_local_data() which are all of the
same form:

  __s._M_data(_M_use_local_data());
  __s._M_set_length(0);

We could remove _M_use_local_data() and change those three places to use
a new _M_reset() function that does:

  _M_init_local_buf();
  _M_data(_M_local_data());
  _M_set_length(0);

This is left for a future change.

libstdc++-v3/ChangeLog:

	* include/bits/basic_string.h (_M_init_local_buf()): New
	function.
	(_M_use_local_data()): Use _M_init_local_buf.
	(basic_string(), basic_string(const Alloc&))
	(basic_string(basic_string&&))
	(basic_string(basic_string&&, const Alloc&)): Use
	_M_init_local_buf instead of _M_use_local_data().
	* include/bits/basic_string.tcc (swap(basic_string&))
	(_M_construct(InIter, InIter, input_iterator_tag))
	(_M_construct(InIter, InIter, forward_iterator_tag))
	(_M_construct(size_type, CharT), reserve()): Likewise.
2023-10-21 11:54:00 +01:00