]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
9 months agolibstdc++: Remove dg-options "-std=gnu++20" from remaining tests
Jonathan Wakely [Fri, 15 Sep 2023 13:27:56 +0000 (14:27 +0100)] 
libstdc++: Remove dg-options "-std=gnu++20" from remaining tests

The testsuite will automatically select C++20 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++23
and C++26 as well.

libstdc++-v3/ChangeLog:

* testsuite/18_support/coroutines/95917.cc: Remove dg-options
-std=gnu++2a.
* testsuite/18_support/coroutines/hash.cc: Likewise.
* testsuite/18_support/coroutines/lwg3460.cc: Likewise.
* testsuite/18_support/destroying_delete.cc: Likewise.
* testsuite/18_support/source_location/1.cc: Likewise.
* testsuite/18_support/source_location/consteval.cc: Likewise.
* testsuite/18_support/source_location/version.cc: Likewise.
* testsuite/19_diagnostics/error_category/operators/three_way.cc:
Likewise.
* testsuite/19_diagnostics/error_code/operators/three_way.cc:
Likewise.
* testsuite/19_diagnostics/error_condition/operators/three_way.cc:
Likewise.
* testsuite/19_diagnostics/stacktrace/output.cc: Likewise.
* testsuite/26_numerics/adjacent_difference/lwg2055.cc:
Likewise.
* testsuite/26_numerics/bit/bit.count/countl_zero.cc: Likewise.
* testsuite/26_numerics/bit/bit.count/countr_one.cc: Likewise.
* testsuite/26_numerics/bit/bit.count/countr_zero.cc: Likewise.
* testsuite/26_numerics/bit/bit.count/popcount.cc: Likewise.
* testsuite/26_numerics/bit/bit.pow.two/bit_ceil.cc: Likewise.
* testsuite/26_numerics/bit/bit.pow.two/has_single_bit.cc:
Likewise.
* testsuite/28_regex/iterators/regex_iterator/lwg3719.cc:
Likewise.
* testsuite/28_regex/iterators/regex_token_iterator/lwg3719.cc:
Likewise.
* testsuite/28_regex/sub_match/compare_c++20.cc: Likewise.
* testsuite/experimental/filesystem/iterators/106201.cc:
Likewise.
* testsuite/experimental/scopeguard/exit.cc: Likewise.
* testsuite/experimental/scopeguard/uniqueres.cc: Likewise.

9 months agolibstdc++: Remove dg-options "-std=gnu++20" from 30_threads tests
Jonathan Wakely [Fri, 15 Sep 2023 13:27:56 +0000 (14:27 +0100)] 
libstdc++: Remove dg-options "-std=gnu++20" from 30_threads tests

The testsuite will automatically select C++20 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++23
and C++26 as well.

libstdc++-v3/ChangeLog:

* testsuite/30_threads/barrier/1.cc: Remove dg-options
-std=gnu++20.
* testsuite/30_threads/barrier/2.cc: Likewise.
* testsuite/30_threads/barrier/arrive.cc: Likewise.
* testsuite/30_threads/barrier/arrive_and_drop.cc: Likewise.
* testsuite/30_threads/barrier/arrive_and_wait.cc: Likewise.
* testsuite/30_threads/barrier/completion.cc: Likewise.
* testsuite/30_threads/condition_variable/members/clock_neg.cc:
Likewise.
* testsuite/30_threads/condition_variable_any/members/clock_neg.cc:
Likewise.
* testsuite/30_threads/condition_variable_any/stop_token/1.cc:
Likewise.
* testsuite/30_threads/condition_variable_any/stop_token/2.cc:
Likewise.
* testsuite/30_threads/future/members/clock_neg.cc: Likewise.
* testsuite/30_threads/headers/stop_token/synopsis.cc: Likewise.
* testsuite/30_threads/headers/thread/types_std_c++20.cc:
Likewise.
* testsuite/30_threads/jthread/1.cc: Likewise.
* testsuite/30_threads/jthread/100612.cc: Likewise.
* testsuite/30_threads/jthread/95989.cc: Likewise.
* testsuite/30_threads/jthread/jthread.cc: Likewise.
* testsuite/30_threads/jthread/version.cc: Likewise.
* testsuite/30_threads/latch/1.cc: Likewise.
* testsuite/30_threads/latch/2.cc: Likewise.
* testsuite/30_threads/latch/3.cc: Likewise.
* testsuite/30_threads/recursive_timed_mutex/try_lock_until/clock_neg.cc:
Likewise.
* testsuite/30_threads/semaphore/1.cc: Likewise.
* testsuite/30_threads/semaphore/2.cc: Likewise.
* testsuite/30_threads/semaphore/least_max_value_neg.cc:
Likewise.
* testsuite/30_threads/semaphore/try_acquire_until.cc: Likewise.
* testsuite/30_threads/shared_future/members/clock_neg.cc:
Likewise.
* testsuite/30_threads/shared_lock/locking/clock_neg.cc:
Likewise.
* testsuite/30_threads/shared_timed_mutex/try_lock_until/clock_neg.cc:
Likewise.
* testsuite/30_threads/stop_token/1.cc: Likewise.
* testsuite/30_threads/stop_token/2.cc: Likewise.
* testsuite/30_threads/stop_token/stop_callback.cc: Likewise.
* testsuite/30_threads/stop_token/stop_callback/deadlock.cc:
Likewise.
* testsuite/30_threads/stop_token/stop_callback/destructible_neg.cc:
Likewise.
* testsuite/30_threads/stop_token/stop_callback/invocable_neg.cc:
Likewise.
* testsuite/30_threads/stop_token/stop_callback/invoke.cc:
Likewise.
* testsuite/30_threads/stop_token/stop_source.cc: Likewise.
* testsuite/30_threads/stop_token/stop_source/assign.cc:
Likewise.
* testsuite/30_threads/stop_token/stop_token.cc: Likewise.
* testsuite/30_threads/stop_token/stop_token/stop_possible.cc:
Likewise.
* testsuite/30_threads/thread/id/operators_c++20.cc: Likewise.
* testsuite/30_threads/timed_mutex/try_lock_until/clock_neg.cc:
Likewise.
* testsuite/30_threads/unique_lock/locking/clock_neg.cc:
Likewise.

9 months agolibstdc++: Remove dg-options "-std=gnu++20" from 27_io tests
Jonathan Wakely [Fri, 15 Sep 2023 13:27:56 +0000 (14:27 +0100)] 
libstdc++: Remove dg-options "-std=gnu++20" from 27_io tests

The testsuite will automatically select C++20 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++23
and C++26 as well.

libstdc++-v3/ChangeLog:

* testsuite/27_io/basic_istream/extractors_character/char/lwg2499.cc:
Remove dg-options -std=gnu++2a.
* testsuite/27_io/basic_istream/extractors_character/char/lwg2499_neg.cc:
Likewise.
* testsuite/27_io/basic_istream/extractors_character/wchar_t/lwg2499.cc:
Likewise.
* testsuite/27_io/basic_istream/extractors_character/wchar_t/lwg2499_neg.cc:
Likewise.
* testsuite/27_io/basic_istringstream/cons/char/1.cc: Likewise.
* testsuite/27_io/basic_istringstream/cons/wchar_t/1.cc:
Likewise.
* testsuite/27_io/basic_istringstream/str/char/2.cc: Likewise.
* testsuite/27_io/basic_istringstream/str/wchar_t/2.cc:
Likewise.
* testsuite/27_io/basic_istringstream/view/char/1.cc: Likewise.
* testsuite/27_io/basic_istringstream/view/wchar_t/1.cc:
Likewise.
* testsuite/27_io/basic_ostream/emit/1.cc: Likewise.
* testsuite/27_io/basic_ostream/inserters_character/char/deleted.cc:
Likewise.
* testsuite/27_io/basic_ostream/inserters_character/wchar_t/deleted.cc:
Likewise.
* testsuite/27_io/basic_ostringstream/cons/char/1.cc: Likewise.
* testsuite/27_io/basic_ostringstream/cons/wchar_t/1.cc:
Likewise.
* testsuite/27_io/basic_ostringstream/str/char/3.cc: Likewise.
* testsuite/27_io/basic_ostringstream/str/wchar_t/3.cc:
Likewise.
* testsuite/27_io/basic_ostringstream/view/char/1.cc: Likewise.
* testsuite/27_io/basic_ostringstream/view/wchar_t/1.cc:
Likewise.
* testsuite/27_io/basic_stringbuf/cons/char/2.cc: Likewise.
* testsuite/27_io/basic_stringbuf/cons/wchar_t/2.cc: Likewise.
* testsuite/27_io/basic_stringbuf/str/char/4.cc: Likewise.
* testsuite/27_io/basic_stringbuf/str/wchar_t/4.cc: Likewise.
* testsuite/27_io/basic_stringbuf/view/char/1.cc: Likewise.
* testsuite/27_io/basic_stringbuf/view/wchar_t/1.cc: Likewise.
* testsuite/27_io/basic_stringstream/cons/char/1.cc: Likewise.
* testsuite/27_io/basic_stringstream/cons/char/97719.cc:
Likewise.
* testsuite/27_io/basic_stringstream/cons/wchar_t/1.cc:
Likewise.
* testsuite/27_io/basic_stringstream/str/char/5.cc: Likewise.
* testsuite/27_io/basic_stringstream/str/wchar_t/5.cc.cc:
Likewise.
* testsuite/27_io/basic_stringstream/view/char/1.cc: Likewise.
* testsuite/27_io/basic_stringstream/view/wchar_t/1.cc:
Likewise.
* testsuite/27_io/basic_syncbuf/1.cc: Likewise.
* testsuite/27_io/basic_syncbuf/2.cc: Likewise.
* testsuite/27_io/basic_syncbuf/basic_ops/1.cc: Likewise.
* testsuite/27_io/basic_syncbuf/requirements/types.cc: Likewise.
* testsuite/27_io/basic_syncbuf/sync_ops/1.cc: Likewise.
* testsuite/27_io/basic_syncstream/1.cc: Likewise.
* testsuite/27_io/basic_syncstream/2.cc: Likewise.
* testsuite/27_io/basic_syncstream/basic_ops/1.cc: Likewise.
* testsuite/27_io/basic_syncstream/requirements/types.cc:
Likewise.
* testsuite/27_io/filesystem/iterators/106201.cc: Likewise.
* testsuite/27_io/filesystem/iterators/lwg3719.cc: Likewise.
* testsuite/27_io/filesystem/path/factory/u8path-depr.cc:
Likewise.
* testsuite/27_io/filesystem/path/nonmember/cmp_c++20.cc:
Likewise.

9 months agolibstdc++: Remove dg-options "-std=gnu++20" from 26_numerics tests
Jonathan Wakely [Fri, 15 Sep 2023 13:27:56 +0000 (14:27 +0100)] 
libstdc++: Remove dg-options "-std=gnu++20" from 26_numerics tests

The testsuite will automatically select C++20 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++23
and C++26 as well.

libstdc++-v3/ChangeLog:

* testsuite/26_numerics/accumulate/constexpr.cc: Remove
dg-options -std=gnu++2a.
* testsuite/26_numerics/accumulate/lwg2055.cc: Likewise.
* testsuite/26_numerics/adjacent_difference/constexpr.cc:
Likewise.
* testsuite/26_numerics/bit/bit.cast/105027.cc: Likewise.
* testsuite/26_numerics/bit/bit.cast/bit_cast.cc: Likewise.
* testsuite/26_numerics/bit/bit.cast/version.cc: Likewise.
* testsuite/26_numerics/bit/bit.count/countl_one.cc: Likewise.
* testsuite/26_numerics/bit/bit.pow.two/bit_ceil_neg.cc:
Likewise.
* testsuite/26_numerics/bit/bit.pow.two/bit_floor.cc: Likewise.
* testsuite/26_numerics/bit/bit.pow.two/bit_width.cc: Likewise.
* testsuite/26_numerics/bit/bit.pow.two/lwg3656.cc: Likewise.
* testsuite/26_numerics/bit/bit.rotate/rotl.cc: Likewise.
* testsuite/26_numerics/bit/bit.rotate/rotr.cc: Likewise.
* testsuite/26_numerics/bit/header-2.cc: Likewise.
* testsuite/26_numerics/bit/header.cc: Likewise.
* testsuite/26_numerics/complex/1.cc: Likewise.
* testsuite/26_numerics/complex/2.cc: Likewise.
* testsuite/26_numerics/complex/comparison_operators/more_constexpr.cc:
Likewise.
* testsuite/26_numerics/complex/operators/more_constexpr.cc:
Likewise.
* testsuite/26_numerics/complex/requirements/more_constexpr.cc:
Likewise.
* testsuite/26_numerics/complex/value_operations/more_constexpr.cc:
Likewise.
* testsuite/26_numerics/endian/1.cc: Likewise.
* testsuite/26_numerics/endian/2.cc: Likewise.
* testsuite/26_numerics/endian/3.cc: Likewise.
* testsuite/26_numerics/exclusive_scan/constexpr.cc: Likewise.
* testsuite/26_numerics/inclusive_scan/constexpr.cc: Likewise.
* testsuite/26_numerics/inner_product/constexpr.cc: Likewise.
* testsuite/26_numerics/inner_product/lwg2055.cc: Likewise.
* testsuite/26_numerics/iota/constexpr.cc: Likewise.
* testsuite/26_numerics/lerp/1.cc: Likewise.
* testsuite/26_numerics/lerp/constexpr.cc: Likewise.
* testsuite/26_numerics/lerp/version.cc: Likewise.
* testsuite/26_numerics/midpoint/floating.cc: Likewise.
* testsuite/26_numerics/midpoint/integral.cc: Likewise.
* testsuite/26_numerics/midpoint/pointer.cc: Likewise.
* testsuite/26_numerics/midpoint/pointer_neg.cc: Likewise.
* testsuite/26_numerics/midpoint/version.cc: Likewise.
* testsuite/26_numerics/numbers/1.cc: Likewise.
* testsuite/26_numerics/numbers/2.cc: Likewise.
* testsuite/26_numerics/numbers/3.cc: Likewise.
* testsuite/26_numerics/numbers/float128.cc: Likewise.
* testsuite/26_numerics/numbers/nonfloat_neg.cc: Likewise.
* testsuite/26_numerics/partial_sum/constexpr.cc: Likewise.
* testsuite/26_numerics/partial_sum/lwg2055.cc: Likewise.
* testsuite/26_numerics/random/concept.cc: Likewise.
* testsuite/26_numerics/reduce/constexpr.cc: Likewise.
* testsuite/26_numerics/slice/compare.cc: Likewise.
* testsuite/26_numerics/transform_exclusive_scan/constexpr.cc:
Likewise.
* testsuite/26_numerics/transform_inclusive_scan/constexpr.cc:
Likewise.
* testsuite/26_numerics/transform_reduce/constexpr.cc: Likewise.

9 months agolibstdc++: Remove dg-options "-std=gnu++20" from 24_iterators tests
Jonathan Wakely [Fri, 15 Sep 2023 13:27:56 +0000 (14:27 +0100)] 
libstdc++: Remove dg-options "-std=gnu++20" from 24_iterators tests

The testsuite will automatically select C++20 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++23
and C++26 as well.

libstdc++-v3/ChangeLog:

* testsuite/24_iterators/aliases.cc: Remove dg-options
-std=gnu++2a.
* testsuite/24_iterators/associated_types/incrementable.traits.cc:
Likewise.
* testsuite/24_iterators/associated_types/iterator.traits.cc:
Likewise.
* testsuite/24_iterators/associated_types/readable.traits.cc:
Likewise.
* testsuite/24_iterators/back_insert_iterator/constexpr.cc:
Likewise.
* testsuite/24_iterators/back_insert_iterator/pr93884.cc:
Likewise.
* testsuite/24_iterators/bidirectional/concept.cc: Likewise.
* testsuite/24_iterators/common_iterator/1.cc: Likewise.
* testsuite/24_iterators/common_iterator/100823.cc: Likewise.
* testsuite/24_iterators/common_iterator/2.cc: Likewise.
* testsuite/24_iterators/contiguous/concept.cc: Likewise.
* testsuite/24_iterators/contiguous/tag.cc: Likewise.
* testsuite/24_iterators/counted_iterator/1.cc: Likewise.
* testsuite/24_iterators/counted_iterator/lwg3389.cc: Likewise.
* testsuite/24_iterators/counted_iterator/lwg3643.cc: Likewise.
* testsuite/24_iterators/customization_points/92894.cc:
Likewise.
* testsuite/24_iterators/customization_points/iter_move.cc:
Likewise.
* testsuite/24_iterators/customization_points/iter_swap.cc:
Likewise.
* testsuite/24_iterators/customization_points/lwg3420.cc:
Likewise.
* testsuite/24_iterators/forward/concept.cc: Likewise.
* testsuite/24_iterators/front_insert_iterator/constexpr.cc:
Likewise.
* testsuite/24_iterators/front_insert_iterator/pr93884.cc:
Likewise.
* testsuite/24_iterators/headers/iterator/synopsis_c++20.cc:
Likewise.
* testsuite/24_iterators/indirect_callable/92894.cc: Likewise.
* testsuite/24_iterators/indirect_callable/projected-adl.cc:
Likewise.
* testsuite/24_iterators/indirect_callable/projected.cc:
Likewise.
* testsuite/24_iterators/input/concept.cc: Likewise.
* testsuite/24_iterators/insert_iterator/constexpr.cc: Likewise.
* testsuite/24_iterators/istream_iterator/cons/sentinel.cc:
Likewise.
* testsuite/24_iterators/istream_iterator/sentinel.cc: Likewise.
* testsuite/24_iterators/istreambuf_iterator/cons/sentinel.cc:
Likewise.
* testsuite/24_iterators/istreambuf_iterator/sentinel.cc:
Likewise.
* testsuite/24_iterators/move_iterator/cust.cc: Likewise.
* testsuite/24_iterators/move_iterator/dr3435.cc: Likewise.
* testsuite/24_iterators/move_iterator/input_iterator.cc:
Likewise.
* testsuite/24_iterators/move_iterator/lwg3390.cc: Likewise.
* testsuite/24_iterators/move_iterator/lwg3391.cc: Likewise.
* testsuite/24_iterators/move_iterator/move_only.cc: Likewise.
* testsuite/24_iterators/move_iterator/p2520r0.cc: Likewise.
* testsuite/24_iterators/move_iterator/rel_ops_c++20.cc:
Likewise.
* testsuite/24_iterators/move_iterator/sentinel.cc: Likewise.
* testsuite/24_iterators/normal_iterator/cmp_c++20.cc: Likewise.
* testsuite/24_iterators/output/concept.cc: Likewise.
* testsuite/24_iterators/random_access/concept.cc: Likewise.
* testsuite/24_iterators/range_access/range_access_cpp20.cc:
Likewise.
* testsuite/24_iterators/range_access/range_access_cpp20_neg.cc:
Likewise.
* testsuite/24_iterators/range_operations/100768.cc: Likewise.
* testsuite/24_iterators/range_operations/advance.cc: Likewise.
* testsuite/24_iterators/range_operations/advance_overflow.cc:
Likewise.
* testsuite/24_iterators/range_operations/distance.cc: Likewise.
* testsuite/24_iterators/range_operations/lwg3392.cc: Likewise.
* testsuite/24_iterators/range_operations/next.cc: Likewise.
* testsuite/24_iterators/range_operations/prev.cc: Likewise.
* testsuite/24_iterators/reverse_iterator/cust.cc: Likewise.
* testsuite/24_iterators/reverse_iterator/dr3435.cc: Likewise.
* testsuite/24_iterators/reverse_iterator/rel_ops_c++20.cc:
Likewise.

9 months agolibstdc++: Remove dg-options "-std=gnu++20" from 23_containers tests
Jonathan Wakely [Fri, 15 Sep 2023 13:27:56 +0000 (14:27 +0100)] 
libstdc++: Remove dg-options "-std=gnu++20" from 23_containers tests

The testsuite will automatically select C++20 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++23
and C++26 as well.

libstdc++-v3/ChangeLog:

* testsuite/23_containers/array/comparison_operators/96851.cc:
Remove dg-options -std=gnu++2a.
* testsuite/23_containers/array/comparison_operators/constexpr.cc:
Likewise.
* testsuite/23_containers/array/creation/1.cc: Likewise.
* testsuite/23_containers/array/creation/110167.cc: Likewise.
* testsuite/23_containers/array/creation/2.cc: Likewise.
* testsuite/23_containers/array/creation/3_neg.cc: Likewise.
* testsuite/23_containers/array/requirements/constexpr_fill.cc:
Likewise.
* testsuite/23_containers/array/requirements/constexpr_swap.cc:
Likewise.
* testsuite/23_containers/deque/48101-3_neg.cc: Likewise.
* testsuite/23_containers/deque/erasure.cc: Likewise.
* testsuite/23_containers/deque/modifiers/emplace/92878_92947.cc:
Likewise.
* testsuite/23_containers/deque/operators/cmp_c++20.cc:
Likewise.
* testsuite/23_containers/forward_list/48101-3_neg.cc: Likewise.
* testsuite/23_containers/forward_list/cmp_c++20.cc: Likewise.
* testsuite/23_containers/forward_list/erasure.cc: Likewise.
* testsuite/23_containers/forward_list/modifiers/92878_92947.cc:
Likewise.
* testsuite/23_containers/forward_list/operations/remove_cxx20_return.cc:
Likewise.
* testsuite/23_containers/forward_list/operations/unique_cxx20_return.cc:
Likewise.
* testsuite/23_containers/list/48101-3_neg.cc: Likewise.
* testsuite/23_containers/list/cmp_c++20.cc: Likewise.
* testsuite/23_containers/list/erasure.cc: Likewise.
* testsuite/23_containers/list/modifiers/emplace/92878_92947.cc:
Likewise.
* testsuite/23_containers/list/operations/remove_cxx20_return.cc:
Likewise.
* testsuite/23_containers/list/operations/unique_cxx20_return.cc:
Likewise.
* testsuite/23_containers/map/48101-3_neg.cc: Likewise.
* testsuite/23_containers/map/erasure.cc: Likewise.
* testsuite/23_containers/map/modifiers/emplace/92878_92947.cc:
Likewise.
* testsuite/23_containers/map/operations/contains.cc: Likewise.
* testsuite/23_containers/map/operators/cmp_c++20.cc: Likewise.
* testsuite/23_containers/multimap/48101-3_neg.cc: Likewise.
* testsuite/23_containers/multimap/modifiers/emplace/92878_92947.cc:
Likewise.
* testsuite/23_containers/multimap/operations/contains.cc:
Likewise.
* testsuite/23_containers/multimap/operators/cmp_c++20.cc:
Likewise.
* testsuite/23_containers/multiset/48101-3_neg.cc: Likewise.
* testsuite/23_containers/multiset/modifiers/emplace/92878_92947.cc:
Likewise.
* testsuite/23_containers/multiset/operations/contains.cc:
Likewise.
* testsuite/23_containers/multiset/operators/cmp_c++20.cc:
Likewise.
* testsuite/23_containers/priority_queue/92878_92947.cc:
Likewise.
* testsuite/23_containers/queue/92878_92947.cc: Likewise.
* testsuite/23_containers/queue/cmp_c++20.cc: Likewise.
* testsuite/23_containers/set/48101-3_neg.cc: Likewise.
* testsuite/23_containers/set/erasure.cc: Likewise.
* testsuite/23_containers/set/modifiers/emplace/92878_92947.cc:
Likewise.
* testsuite/23_containers/set/operations/contains.cc: Likewise.
* testsuite/23_containers/set/operators/cmp_c++20.cc: Likewise.
* testsuite/23_containers/span/1.cc: Likewise.
* testsuite/23_containers/span/101411.cc: Likewise.
* testsuite/23_containers/span/2.cc: Likewise.
* testsuite/23_containers/span/deduction.cc: Likewise.
* testsuite/23_containers/span/explicit.cc: Likewise.
* testsuite/23_containers/span/layout_compat.cc: Likewise.
* testsuite/23_containers/span/lwg3255.cc: Likewise.
* testsuite/23_containers/span/nothrow_cons.cc: Likewise.
* testsuite/23_containers/span/trivially_copyable.cc: Likewise.
* testsuite/23_containers/stack/92878_92947.cc: Likewise.
* testsuite/23_containers/stack/cmp_c++20.cc: Likewise.
* testsuite/23_containers/unordered_map/48101-3_neg.cc:
Likewise.
* testsuite/23_containers/unordered_map/erasure.cc: Likewise.
* testsuite/23_containers/unordered_map/modifiers/92878_92947.cc:
Likewise.
* testsuite/23_containers/unordered_map/operations/1.cc:
Likewise.
* testsuite/23_containers/unordered_map/operations/contains.cc:
Likewise.
* testsuite/23_containers/unordered_multimap/48101-3_neg.cc:
Likewise.
* testsuite/23_containers/unordered_multimap/modifiers/92878_92947.cc:
Likewise.
* testsuite/23_containers/unordered_multimap/operations/1.cc:
Likewise.
* testsuite/23_containers/unordered_multimap/operations/contains.cc:
Likewise.
* testsuite/23_containers/unordered_multiset/48101-3_neg.cc:
Likewise.
* testsuite/23_containers/unordered_multiset/modifiers/92878_92947.cc:
Likewise.
* testsuite/23_containers/unordered_multiset/operations/1.cc:
Likewise.
* testsuite/23_containers/unordered_multiset/operations/contains.cc:
Likewise.
* testsuite/23_containers/unordered_set/48101-3_neg.cc:
Likewise.
* testsuite/23_containers/unordered_set/erasure.cc: Likewise.
* testsuite/23_containers/unordered_set/modifiers/92878_92947.cc:
Likewise.
* testsuite/23_containers/unordered_set/operations/1.cc:
Likewise.
* testsuite/23_containers/unordered_set/operations/contains.cc:
Likewise.
* testsuite/23_containers/vector/48101-3_neg.cc: Likewise.
* testsuite/23_containers/vector/bool/capacity/constexpr.cc:
Likewise.
* testsuite/23_containers/vector/bool/cmp_c++20.cc: Likewise.
* testsuite/23_containers/vector/bool/cons/constexpr.cc:
Likewise.
* testsuite/23_containers/vector/bool/element_access/constexpr.cc:
Likewise.
* testsuite/23_containers/vector/bool/iterator_c++20.cc:
Likewise.
* testsuite/23_containers/vector/bool/modifiers/assign/constexpr.cc:
Likewise.
* testsuite/23_containers/vector/bool/modifiers/constexpr.cc:
Likewise.
* testsuite/23_containers/vector/bool/modifiers/swap/constexpr.cc:
Likewise.
* testsuite/23_containers/vector/capacity/constexpr.cc:
Likewise.
* testsuite/23_containers/vector/cmp_c++20.cc: Likewise.
* testsuite/23_containers/vector/cons/constexpr.cc: Likewise.
* testsuite/23_containers/vector/data_access/constexpr.cc:
Likewise.
* testsuite/23_containers/vector/element_access/constexpr.cc:
Likewise.
* testsuite/23_containers/vector/erasure.cc: Likewise.
* testsuite/23_containers/vector/modifiers/assign/constexpr.cc:
Likewise.
* testsuite/23_containers/vector/modifiers/constexpr.cc:
Likewise.
* testsuite/23_containers/vector/modifiers/emplace/92878_92947.cc:
Likewise.
* testsuite/23_containers/vector/modifiers/swap/constexpr.cc:
Likewise.
* testsuite/23_containers/vector/requirements/version.cc:
Likewise.

9 months agolibstdc++: Remove dg-options "-std=gnu++20" from 21_strings tests
Jonathan Wakely [Fri, 15 Sep 2023 13:27:56 +0000 (14:27 +0100)] 
libstdc++: Remove dg-options "-std=gnu++20" from 21_strings tests

The testsuite will automatically select C++20 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++23
and C++26 as well.

libstdc++-v3/ChangeLog:

* testsuite/21_strings/basic_string/cons/char/105995.cc: Remove
dg-options -std=gnu++20.
* testsuite/21_strings/basic_string/cons/char/constexpr.cc:
Likewise.
* testsuite/21_strings/basic_string/cons/wchar_t/constexpr.cc:
Likewise.
* testsuite/21_strings/basic_string/erasure.cc: Likewise.
* testsuite/21_strings/basic_string/hash/hash_char8_t.cc:
Likewise.
* testsuite/21_strings/basic_string/literals/constexpr.cc:
Likewise.
* testsuite/21_strings/basic_string/modifiers/constexpr.cc:
Likewise.
* testsuite/21_strings/basic_string/modifiers/swap/constexpr-wchar_t.cc:
Likewise.
* testsuite/21_strings/basic_string/modifiers/swap/constexpr.cc:
Likewise.
* testsuite/21_strings/basic_string/operations/ends_with/char.cc:
Likewise.
* testsuite/21_strings/basic_string/operations/ends_with/nonnull.cc:
Likewise.
* testsuite/21_strings/basic_string/operations/ends_with/wchar_t.cc:
Likewise.
* testsuite/21_strings/basic_string/operations/starts_with/char.cc:
Likewise.
* testsuite/21_strings/basic_string/operations/starts_with/nonnull.cc:
Likewise.
* testsuite/21_strings/basic_string/operations/starts_with/wchar_t.cc:
Likewise.
* testsuite/21_strings/basic_string/operators/char/cmp_c++20.cc:
Likewise.
* testsuite/21_strings/basic_string/operators/wchar_t/cmp_c++20.cc:
Likewise.
* testsuite/21_strings/basic_string_view/cons/char/range.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/copy/char/constexpr.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/copy/wchar_t/constexpr.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/ends_with/char.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/ends_with/nonnull.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/ends_with/wchar_t.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/starts_with/char.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/starts_with/nonnull.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/starts_with/wchar_t.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operators/char/cmp_c++20.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operators/wchar_t/cmp_c++20.cc:
Likewise.
* testsuite/21_strings/basic_string_view/requirements/constexpr_iter.cc:
Likewise.
* testsuite/21_strings/char_traits/requirements/constexpr_functions_c++20.cc:
Likewise.

9 months agolibstdc++: Remove dg-options "-std=gnu++20" from 20_utils tests
Jonathan Wakely [Fri, 15 Sep 2023 13:27:56 +0000 (14:27 +0100)] 
libstdc++: Remove dg-options "-std=gnu++20" from 20_utils tests

The testsuite will automatically select C++20 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++23
and C++26 as well.

libstdc++-v3/ChangeLog:

* testsuite/20_util/allocator/105975.cc: Remove dg-options
-std=gnu++2a.
* testsuite/20_util/allocator/rebind_c++20.cc: Likewise.
* testsuite/20_util/allocator/requirements/constexpr.cc:
Likewise.
* testsuite/20_util/allocator/requirements/typedefs_c++20.cc:
Likewise.
* testsuite/20_util/allocator_traits/header-2.cc: Likewise.
* testsuite/20_util/allocator_traits/header.cc: Likewise.
* testsuite/20_util/allocator_traits/members/92878_92947.cc:
Likewise.
* testsuite/20_util/any/assign/92878_92947.cc: Likewise.
* testsuite/20_util/any/cons/92878_92947.cc: Likewise.
* testsuite/20_util/assume_aligned/1.cc: Likewise.
* testsuite/20_util/assume_aligned/2_neg.cc: Likewise.
* testsuite/20_util/assume_aligned/3.cc: Likewise.
* testsuite/20_util/assume_aligned/97132.cc: Likewise.
* testsuite/20_util/bind/constexpr.cc: Likewise.
* testsuite/20_util/bitset/operations/96303.cc: Likewise.
* testsuite/20_util/common_reference/100894.cc: Likewise.
* testsuite/20_util/common_reference/requirements/alias_decl.cc:
Likewise.
* testsuite/20_util/common_reference/requirements/explicit_instantiation.cc:
Likewise.
* testsuite/20_util/common_reference/requirements/typedefs.cc:
Likewise.
* testsuite/20_util/duration/comparison_operators/three_way.cc:
Likewise.
* testsuite/20_util/exchange/constexpr.cc: Likewise.
* testsuite/20_util/exchange/noexcept.cc: Likewise.
* testsuite/20_util/from_chars/1_c++20_neg.cc: Likewise.
* testsuite/20_util/from_chars/compare.cc: Likewise.
* testsuite/20_util/function_objects/bind_front/1.cc: Likewise.
* testsuite/20_util/function_objects/bind_front/107784.cc:
Likewise.
* testsuite/20_util/function_objects/bind_front/111327.cc:
Likewise.
* testsuite/20_util/function_objects/bind_front/2.cc: Likewise.
* testsuite/20_util/function_objects/bind_front/97101.cc:
Likewise.
* testsuite/20_util/function_objects/bind_front/constexpr.cc:
Likewise.
* testsuite/20_util/function_objects/constexpr_searcher.cc:
Likewise.
* testsuite/20_util/function_objects/identity/1.cc: Likewise.
* testsuite/20_util/function_objects/invoke/constexpr.cc:
Likewise.
* testsuite/20_util/function_objects/mem_fn/constexpr.cc:
Likewise.
* testsuite/20_util/function_objects/not_fn/constexpr.cc:
Likewise.
* testsuite/20_util/integer_comparisons/1.cc: Likewise.
* testsuite/20_util/integer_comparisons/2.cc: Likewise.
* testsuite/20_util/integer_comparisons/equal.cc: Likewise.
* testsuite/20_util/integer_comparisons/equal_neg.cc: Likewise.
* testsuite/20_util/integer_comparisons/greater.cc: Likewise.
* testsuite/20_util/integer_comparisons/greater_equal.cc:
Likewise.
* testsuite/20_util/integer_comparisons/greater_equal_neg.cc:
Likewise.
* testsuite/20_util/integer_comparisons/greater_neg.cc:
Likewise.
* testsuite/20_util/integer_comparisons/in_range.cc: Likewise.
* testsuite/20_util/integer_comparisons/in_range_neg.cc:
Likewise.
* testsuite/20_util/integer_comparisons/less.cc: Likewise.
* testsuite/20_util/integer_comparisons/less_equal.cc: Likewise.
* testsuite/20_util/integer_comparisons/less_equal_neg.cc:
Likewise.
* testsuite/20_util/integer_comparisons/less_neg.cc: Likewise.
* testsuite/20_util/integer_comparisons/not_equal.cc: Likewise.
* testsuite/20_util/integer_comparisons/not_equal_neg.cc:
Likewise.
* testsuite/20_util/is_bounded_array/requirements/explicit_instantiation.cc:
Likewise.
* testsuite/20_util/is_bounded_array/requirements/typedefs.cc:
Likewise.
* testsuite/20_util/is_bounded_array/value.cc: Likewise.
* testsuite/20_util/is_constant_evaluated/1.cc: Likewise.
* testsuite/20_util/is_constant_evaluated/noexcept.cc: Likewise.
* testsuite/20_util/is_constructible/92878_92947.cc: Likewise.
* testsuite/20_util/is_layout_compatible/is_corresponding_member.cc:
Likewise.
* testsuite/20_util/is_layout_compatible/value.cc: Likewise.
* testsuite/20_util/is_layout_compatible/version.cc: Likewise.
* testsuite/20_util/is_nothrow_constructible/value_c++20.cc:
Likewise.
* testsuite/20_util/is_nothrow_convertible/requirements/explicit_instantiation.cc:
Likewise.
* testsuite/20_util/is_nothrow_convertible/requirements/typedefs.cc:
Likewise.
* testsuite/20_util/is_nothrow_convertible/value.cc: Likewise.
* testsuite/20_util/is_pod/deprecated-2a.cc: Likewise.
* testsuite/20_util/is_pointer_interconvertible/value.cc:
Likewise.
* testsuite/20_util/is_pointer_interconvertible/version.cc:
Likewise.
* testsuite/20_util/is_pointer_interconvertible/with_class.cc:
Likewise.
* testsuite/20_util/is_unbounded_array/requirements/explicit_instantiation.cc:
Likewise.
* testsuite/20_util/is_unbounded_array/requirements/typedefs.cc:
Likewise.
* testsuite/20_util/is_unbounded_array/value.cc: Likewise.
* testsuite/20_util/optional/assignment/92878_92947.cc:
Likewise.
* testsuite/20_util/optional/cons/92878_92947.cc: Likewise.
* testsuite/20_util/optional/constexpr/assign.cc: Likewise.
* testsuite/20_util/optional/constexpr/cons/conv.cc: Likewise.
* testsuite/20_util/optional/constexpr/modifiers.cc: Likewise.
* testsuite/20_util/optional/constexpr/swap.cc: Likewise.
* testsuite/20_util/optional/relops/96269.cc: Likewise.
* testsuite/20_util/optional/relops/three_way.cc: Likewise.
* testsuite/20_util/pair/comparison_operators/constexpr_c++20.cc:
Likewise.
* testsuite/20_util/pair/cons/92878_92947.cc: Likewise.
* testsuite/20_util/pair/constexpr_assign.cc: Likewise.
* testsuite/20_util/pair/constexpr_swap.cc: Likewise.
* testsuite/20_util/pair/requirements/structural.cc: Likewise.
* testsuite/20_util/pointer_traits/pointer_to_constexpr.cc:
Likewise.
* testsuite/20_util/polymorphic_allocator/allocate_object.cc:
Likewise.
* testsuite/20_util/polymorphic_allocator/construct_c++2a.cc:
Likewise.
* testsuite/20_util/polymorphic_allocator/lwg3237.cc: Likewise.
* testsuite/20_util/reference_wrapper/constexpr.cc: Likewise.
* testsuite/20_util/reference_wrapper/incomplete.cc: Likewise.
* testsuite/20_util/remove_cvref/requirements/alias_decl.cc:
Likewise.
* testsuite/20_util/remove_cvref/requirements/explicit_instantiation.cc:
Likewise.
* testsuite/20_util/remove_cvref/value.cc: Likewise.
* testsuite/20_util/scoped_allocator/construct_pair_c++2a.cc:
Likewise.
* testsuite/20_util/shared_ptr/atomic/atomic_shared_ptr.cc:
Likewise.
* testsuite/20_util/shared_ptr/casts/rval.cc: Likewise.
* testsuite/20_util/shared_ptr/comparison/cmp_c++20.cc:
Likewise.
* testsuite/20_util/shared_ptr/cons/alias-rval.cc: Likewise.
* testsuite/20_util/shared_ptr/creation/92878_92947.cc:
Likewise.
* testsuite/20_util/shared_ptr/creation/array.cc: Likewise.
* testsuite/20_util/shared_ptr/creation/overwrite.cc: Likewise.
* testsuite/20_util/shared_ptr/creation/version.cc: Likewise.
* testsuite/20_util/time_point/4.cc: Likewise.
* testsuite/20_util/time_point/comparison_operators/three_way.cc:
Likewise.
* testsuite/20_util/to_address/1.cc: Likewise.
* testsuite/20_util/to_address/1_neg.cc: Likewise.
* testsuite/20_util/to_address/debug.cc: Likewise.
* testsuite/20_util/to_address/lwg3545.cc: Likewise.
* testsuite/20_util/to_chars/compare.cc: Likewise.
* testsuite/20_util/tuple/comparison_operators/three_way.cc:
Likewise.
* testsuite/20_util/tuple/cons/102270.cc: Likewise.
* testsuite/20_util/tuple/cons/constexpr_allocator_arg_t.cc:
Likewise.
* testsuite/20_util/tuple/constexpr_swap.cc: Likewise.
* testsuite/20_util/type_identity/requirements/alias_decl.cc:
Likewise.
* testsuite/20_util/type_identity/requirements/explicit_instantiation.cc:
Likewise.
* testsuite/20_util/type_identity/requirements/typedefs.cc:
Likewise.
* testsuite/20_util/typeindex/comparison_operators_c++20.cc:
Likewise.
* testsuite/20_util/unique_ptr/comparison/compare_c++20.cc:
Likewise.
* testsuite/20_util/unique_ptr/creation/92878_92947.cc:
Likewise.
* testsuite/20_util/unique_ptr/creation/for_overwrite.cc:
Likewise.
* testsuite/20_util/unique_ptr/creation/for_overwrite__neg.cc:
Likewise.
* testsuite/20_util/unique_ptr/io/lwg2948.cc: Likewise.
* testsuite/20_util/unwrap_reference/1.cc: Likewise.
* testsuite/20_util/unwrap_reference/2.cc: Likewise.
* testsuite/20_util/unwrap_reference/3.cc: Likewise.
* testsuite/20_util/uses_allocator/92878_92947.cc: Likewise.
* testsuite/20_util/uses_allocator/lwg3527.cc: Likewise.
* testsuite/20_util/uses_allocator/make_obj.cc: Likewise.
* testsuite/20_util/uses_allocator/uninitialized_construct.cc:
Likewise.
* testsuite/20_util/variant/92878_92947.cc: Likewise.
* testsuite/20_util/variant/95915.cc: Likewise.
* testsuite/20_util/variant/constexpr.cc: Likewise.
* testsuite/20_util/variant/relops/three_way.cc: Likewise.
* testsuite/20_util/variant/visit_neg.cc: Likewise.
* testsuite/20_util/variant/visit_r.cc: Likewise.
* testsuite/20_util/weak_ptr/atomic_weak_ptr.cc: Likewise.

9 months agolibstdc++: Remove dg-options "-std=gnu++20" from <compare> tests
Jonathan Wakely [Fri, 15 Sep 2023 13:05:07 +0000 (14:05 +0100)] 
libstdc++: Remove dg-options "-std=gnu++20" from <compare> tests

The testsuite will automatically select C++20 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++23
and C++26 as well.

libstdc++-v3/ChangeLog:

* testsuite/18_support/comparisons/algorithms/fallback.cc:
Remove dg-options -std=gnu++2a.
* testsuite/18_support/comparisons/algorithms/partial_order.cc:
Likewise.
* testsuite/18_support/comparisons/algorithms/strong_order.cc:
Likewise.
* testsuite/18_support/comparisons/algorithms/strong_order_floats.cc:
Likewise.
* testsuite/18_support/comparisons/algorithms/weak_order.cc:
Likewise.
* testsuite/18_support/comparisons/categories/94565.cc:
Likewise.
* testsuite/18_support/comparisons/categories/partialord.cc:
Likewise.
* testsuite/18_support/comparisons/categories/strongord.cc:
Likewise.
* testsuite/18_support/comparisons/categories/weakord.cc:
Likewise.
* testsuite/18_support/comparisons/categories/zero_neg.cc:
Likewise.
* testsuite/18_support/comparisons/common/1.cc: Likewise.
* testsuite/18_support/comparisons/object/93479.cc: Likewise.
* testsuite/18_support/comparisons/object/lwg3530.cc: Likewise.

9 months agolibstdc++: Remove dg-options "-std=gnu++20" from <atomic> tests
Jonathan Wakely [Fri, 15 Sep 2023 13:27:56 +0000 (14:27 +0100)] 
libstdc++: Remove dg-options "-std=gnu++20" from <atomic> tests

The testsuite will automatically select C++20 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++23
and C++26 as well.

libstdc++-v3/ChangeLog:

* testsuite/29_atomics/atomic/compare_exchange_padding.cc:
Remove dg-options -std=gnu++2a.
* testsuite/29_atomics/atomic/cons/value_init.cc: Likewise.
* testsuite/29_atomics/atomic/lock_free_aliases.cc: Likewise.
* testsuite/29_atomics/atomic/requirements/types_neg.cc:
Likewise.
* testsuite/29_atomics/atomic/wait_notify/1.cc: Likewise.
* testsuite/29_atomics/atomic/wait_notify/100334.cc: Likewise.
* testsuite/29_atomics/atomic/wait_notify/102994.cc: Likewise.
* testsuite/29_atomics/atomic/wait_notify/2.cc: Likewise.
* testsuite/29_atomics/atomic/wait_notify/bool.cc: Likewise.
* testsuite/29_atomics/atomic/wait_notify/generic.cc: Likewise.
* testsuite/29_atomics/atomic/wait_notify/pointers.cc: Likewise.
* testsuite/29_atomics/atomic_flag/cons/value_init.cc: Likewise.
* testsuite/29_atomics/atomic_flag/test/explicit.cc: Likewise.
* testsuite/29_atomics/atomic_flag/test/implicit.cc: Likewise.
* testsuite/29_atomics/atomic_flag/wait_notify/1.cc: Likewise.
* testsuite/29_atomics/atomic_float/1.cc: Likewise.
* testsuite/29_atomics/atomic_float/95282.cc: Likewise.
* testsuite/29_atomics/atomic_float/requirements.cc: Likewise.
* testsuite/29_atomics/atomic_float/value_init.cc: Likewise.
* testsuite/29_atomics/atomic_float/wait_notify.cc: Likewise.
* testsuite/29_atomics/atomic_integral/cons/value_init.cc:
Likewise.
* testsuite/29_atomics/atomic_integral/wait_notify.cc: Likewise.
* testsuite/29_atomics/atomic_ref/compare_exchange_padding.cc:
Likewise.
* testsuite/29_atomics/atomic_ref/deduction.cc: Likewise.
* testsuite/29_atomics/atomic_ref/float.cc: Likewise.
* testsuite/29_atomics/atomic_ref/generic.cc: Likewise.
* testsuite/29_atomics/atomic_ref/integral.cc: Likewise.
* testsuite/29_atomics/atomic_ref/pointer.cc: Likewise.
* testsuite/29_atomics/atomic_ref/requirements.cc: Likewise.
* testsuite/29_atomics/headers/atomic/types_std_c++20.cc:
Likewise.
* testsuite/29_atomics/headers/atomic/types_std_c++20_neg.cc:
Likewise.
* testsuite/29_atomics/headers/atomic/types_std_c++2a.cc:
Likewise.
* testsuite/29_atomics/headers/atomic/types_std_c++2a_neg.cc:
Likewise.

9 months agolibstdc++: Add missing tests for std::basic_filebuf::native_handle()
Jonathan Wakely [Fri, 15 Sep 2023 23:09:53 +0000 (00:09 +0100)] 
libstdc++: Add missing tests for std::basic_filebuf::native_handle()

I forgot to 'git add' these files in the commit that added the new
member function to basic_filebuf.

libstdc++-v3/ChangeLog:

* testsuite/27_io/basic_filebuf/native_handle/char/1.cc: New test.
* testsuite/27_io/basic_filebuf/native_handle/wchar_t/1.cc: New test.

9 months agolibstdc++: Implement C++26 native handles for file streams (P1759R6)
Jonathan Wakely [Fri, 15 Sep 2023 12:43:43 +0000 (13:43 +0100)] 
libstdc++: Implement C++26 native handles for file streams (P1759R6)

The new __basic_file::native_handle() function can be added for C++11
and above, because the names "native_handle" and "native_handle_type"
are already reserved since C++11. Exporting those symbols from the
shared library does no harm, even if the feature gets dropped before the
C++23 standard is final.

The new member functions of std::fstream etc. are only declared for
C++26 and so are not instantiated in src/c++11/fstream-inst.cc. Declare
them with the always_inline attribute so that no symbol definitions are
needed in the library (we can change this later when C++26 support is
less experimental).

libstdc++-v3/ChangeLog:

* acinclude.m4 (GLIBCXX_CHECK_FILEBUF_NATIVE_HANDLES): New
macro.
* config.h.in: Regenerate.
* config/abi/pre/gnu.ver (GLIBCXX_3.4.32): Export new
basic_filebuf members.
* config/io/basic_file_stdio.cc (__basic_file::native_handle):
Define new function.
* config/io/basic_file_stdio.h (__basic_file::native_handle):
Declare new function.
* configure: Regenerate.
* configure.ac: Use GLIBCXX_CHECK_FILEBUF_NATIVE_HANDLES.
* include/bits/version.def (fstream_native_handles): New macro.
* include/bits/version.h: Regenerate.
* include/std/fstream (basic_filebuf::native_handle)
(basic_fstream::native_handle, basic_ifstream::native_handle)
(basic_ofstream::native_handle): New functions.
* src/c++11/Makefile.am: Move compilation of basic_file.cc,
locale_init.cc and localename.cc to here.
* src/c++11/Makefile.in: Regenerate.
* src/c++98/locale_init.cc: Moved to...
* src/c++11/locale_init.cc: ...here.
* src/c++98/localename.cc: Moved to...
* src/c++11/localename.cc: ...here.
* src/c++98/Makefile.am: Remove basic_file.cc, locale_init.cc
and localename.cc from here.
* src/c++98/Makefile.in: Regenerate.
* testsuite/27_io/basic_filebuf/native_handle/version.cc: New test.
* testsuite/27_io/basic_fstream/native_handle/char/1.cc: New test.
* testsuite/27_io/basic_fstream/native_handle/wchar_t/1.cc: New test.
* testsuite/27_io/basic_ifstream/native_handle/char/1.cc: New test.
* testsuite/27_io/basic_ifstream/native_handle/wchar_t/1.cc: New test.
* testsuite/27_io/basic_ofstream/native_handle/char/1.cc: New test.
* testsuite/27_io/basic_ofstream/native_handle/wchar_t/1.cc: New test.

9 months agolibstdc++: Add log line to testsuite output
Jonathan Wakely [Thu, 14 Sep 2023 12:57:05 +0000 (13:57 +0100)] 
libstdc++: Add log line to testsuite output

Write a line to the log when using a testsuite_files file.

libstdc++-v3/ChangeLog:

* testsuite/libstdc++-dg/conformance.exp: Add log line when
using testsuite_files.

9 months agolibstdc++: Simplify dejagnu directives for some tests using threads
Jonathan Wakely [Thu, 7 Sep 2023 12:56:15 +0000 (13:56 +0100)] 
libstdc++: Simplify dejagnu directives for some tests using threads

Replace dg-require-effective-target directives with a target selector on
the dg-do directive.

We can also remove { dg-require-effective-target pthread } and the
associated { dg-options "-pthread" } by allowing it to run on
non-pthread targets and conditionally adding -pthread only for pthread
targets.

libstdc++-v3/ChangeLog:

* testsuite/20_util/shared_ptr/atomic/3.cc: Simplify dg
directives.
* testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc:
Likewise.
* testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc:
Likewise.
* testsuite/20_util/synchronized_pool_resource/allocate.cc:
Likewise.
* testsuite/20_util/synchronized_pool_resource/allocate_single.cc:
Likewise.
* testsuite/20_util/synchronized_pool_resource/cons.cc:
Likewise.
* testsuite/20_util/synchronized_pool_resource/cons_single.cc:
Likewise.
* testsuite/20_util/synchronized_pool_resource/is_equal.cc:
Likewise.
* testsuite/20_util/synchronized_pool_resource/multithreaded.cc:
Likewise.
* testsuite/20_util/synchronized_pool_resource/options.cc:
Likewise.
* testsuite/20_util/synchronized_pool_resource/release.cc:
Likewise.
* testsuite/20_util/synchronized_pool_resource/release_single.cc:
Likewise.
* testsuite/30_threads/condition_variable_any/stop_token/wait_on.cc:
Likewise.
* testsuite/30_threads/stop_token/stop_callback/deadlock-mt.cc:
Likewise.
* testsuite/30_threads/stop_token/stop_callback/destroy.cc:
Likewise.

9 months agolibstdc++: Remove dg-options "-std=gnu++2a" from XFAIL std::span tests
Jonathan Wakely [Thu, 7 Sep 2023 13:17:50 +0000 (14:17 +0100)] 
libstdc++: Remove dg-options "-std=gnu++2a" from XFAIL std::span tests

The testsuite will automatically select C++20 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++23
and C++26 as well.

We can also combine the { dg-require-effective-target c++2a } directive
with the dg-do selector.

We need to add the no_pch options for tests that define
_GLIBCXX_ASSERTIONS in the test, otherwise the PCH is included without
that defined.

libstdc++-v3/ChangeLog:

* testsuite/23_containers/span/back_assert_neg.cc: Remove
dg-options and add effective target selector to dg-do. Add
no_pch.
* testsuite/23_containers/span/back_neg.cc: Likewise.
* testsuite/23_containers/span/cons_1_assert_neg.cc: Likewise.
* testsuite/23_containers/span/cons_2_assert_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/24_iterators/range_operations/advance_debug_neg.cc:
Likewise.

9 months agolibstdc++: Remove dg-options "-std=gnu++23" from remaining tests
Jonathan Wakely [Fri, 1 Sep 2023 20:28:05 +0000 (21:28 +0100)] 
libstdc++: Remove dg-options "-std=gnu++23" from remaining tests

The testsuite will automatically select C++23 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++26
as well.

libstdc++-v3/ChangeLog:

* testsuite/18_support/headers/limits/synopsis_cxx23.cc: Remove
dg-options.
* testsuite/18_support/headers/stdfloat/types_std.cc: Likewise.
* testsuite/18_support/type_info/constexpr.cc: Likewise.
* testsuite/19_diagnostics/stacktrace/current.cc: Likewise.
* testsuite/19_diagnostics/stacktrace/entry.cc: Likewise.
* testsuite/19_diagnostics/stacktrace/stacktrace.cc: Likewise.
* testsuite/19_diagnostics/stacktrace/synopsis.cc: Likewise.
* testsuite/19_diagnostics/stacktrace/version.cc: Likewise.
* testsuite/20_util/aligned_storage/deprecated-2b.cc: Likewise.
* testsuite/20_util/aligned_union/deprecated-2b.cc: Likewise.
* testsuite/20_util/bitset/access/constexpr.cc: Likewise.
* testsuite/20_util/bitset/cons/constexpr_c++23.cc: Likewise.
* testsuite/20_util/bitset/count/constexpr.cc: Likewise.
* testsuite/20_util/bitset/ext/constexpr.cc: Likewise.
* testsuite/20_util/bitset/operations/constexpr_c++23.cc:
Likewise.
* testsuite/20_util/bitset/version.cc: Likewise.
* testsuite/20_util/from_chars/8.cc: Likewise.
* testsuite/20_util/from_chars/constexpr.cc: Likewise.
* testsuite/20_util/function/cons/deduction_c++23.cc: Likewise.
* testsuite/20_util/function_objects/invoke/4.cc: Likewise.
* testsuite/20_util/function_objects/invoke/dangling_ref.cc:
Likewise.
* testsuite/20_util/is_scoped_enum/value.cc: Likewise.
* testsuite/20_util/is_scoped_enum/version.cc: Likewise.
* testsuite/20_util/move_only_function/call.cc: Likewise.
* testsuite/20_util/move_only_function/cons.cc: Likewise.
* testsuite/20_util/move_only_function/move.cc: Likewise.
* testsuite/20_util/move_only_function/version.cc: Likewise.
* testsuite/20_util/optional/monadic/and_then.cc: Likewise.
* testsuite/20_util/optional/monadic/or_else.cc: Likewise.
* testsuite/20_util/optional/monadic/or_else_neg.cc: Likewise.
* testsuite/20_util/optional/monadic/pr109242.cc: Likewise.
* testsuite/20_util/optional/monadic/transform.cc: Likewise.
* testsuite/20_util/pair/p2321r2.cc: Likewise.
* testsuite/20_util/reference_from_temporary/value.cc: Likewise.
* testsuite/20_util/reference_from_temporary/value2.cc:
Likewise.
* testsuite/20_util/reference_from_temporary/version.cc:
Likewise.
* testsuite/20_util/to_chars/constexpr.cc: Likewise.
* testsuite/20_util/to_chars/float128_c++23.cc: Likewise.
* testsuite/20_util/to_chars/float16_c++23.cc: Likewise.
* testsuite/20_util/to_chars/version.cc: Likewise.
* testsuite/20_util/to_underlying/1.cc: Likewise.
* testsuite/20_util/to_underlying/version.cc: Likewise.
* testsuite/20_util/tuple/p2321r2.cc: Likewise.
* testsuite/20_util/unique_ptr/assign/constexpr.cc: Likewise.
* testsuite/20_util/unique_ptr/comparison/constexpr.cc:
Likewise.
* testsuite/20_util/unique_ptr/cons/constexpr_c++20.cc:
Likewise.
* testsuite/20_util/unique_ptr/creation/constexpr.cc: Likewise.
* testsuite/20_util/unique_ptr/modifiers/constexpr.cc: Likewise.
* testsuite/20_util/unique_ptr/specialized_algorithms/constexpr.cc: Likewise.
* testsuite/20_util/unreachable/1.cc: Likewise.
* testsuite/20_util/unreachable/version.cc: Likewise.
* testsuite/20_util/uses_allocator/lwg3677.cc: Likewise.
* testsuite/21_strings/basic_string/capacity/char/resize_and_overwrite.cc: Likewise.
* testsuite/21_strings/basic_string/operations/contains/char.cc:
Likewise.
* testsuite/21_strings/basic_string/operations/contains/nonnull.cc: Likewise.
* testsuite/21_strings/basic_string/operations/contains/wchar_t.cc: Likewise.
* testsuite/21_strings/basic_string_view/cons/char/range_c++20.cc: Likewise.
* testsuite/21_strings/basic_string_view/cons/wchar_t/range_c++20.cc: Likewise.
* testsuite/21_strings/basic_string_view/operations/contains/char.cc: Likewise.
* testsuite/21_strings/basic_string_view/operations/contains/char/2.cc: Likewise.
* testsuite/21_strings/basic_string_view/operations/contains/nonnull.cc: Likewise.
* testsuite/21_strings/basic_string_view/operations/contains/wchar_t.cc: Likewise.
* testsuite/23_containers/queue/cons_from_iters.cc: Likewise.
* testsuite/23_containers/stack/cons_from_iters.cc: Likewise.
* testsuite/23_containers/vector/bool/element_access/1.cc:
Likewise.
* testsuite/24_iterators/const_iterator/1.cc: Likewise.
* testsuite/25_algorithms/contains/1.cc: Likewise.
* testsuite/25_algorithms/contains_subrange/1.cc: Likewise.
* testsuite/25_algorithms/find_last/1.cc: Likewise.
* testsuite/25_algorithms/find_last_if/1.cc: Likewise.
* testsuite/25_algorithms/find_last_if_not/1.cc: Likewise.
* testsuite/25_algorithms/fold_left/1.cc: Likewise.
* testsuite/25_algorithms/fold_right/1.cc: Likewise.
* testsuite/25_algorithms/iota/1.cc: Likewise.
* testsuite/26_numerics/bit/bit.byteswap/byteswap.cc: Likewise.
* testsuite/26_numerics/bit/bit.byteswap/version.cc: Likewise.
* testsuite/26_numerics/complex/ext_c++23.cc: Likewise.
* testsuite/26_numerics/headers/cmath/c99_classification_macros_c++23.cc: Likewise.
* testsuite/26_numerics/headers/cmath/constexpr_std_c++23.cc:
Likewise.
* testsuite/26_numerics/headers/cmath/functions_std_c++23.cc:
Likewise.
* testsuite/26_numerics/headers/cmath/nextafter_c++23.cc:
Likewise.
* testsuite/26_numerics/numbers/4.cc: Likewise.
* testsuite/27_io/basic_ostream/inserters_other/char/volatile_ptr.cc: Likewise.
* testsuite/27_io/filesystem/path/native/conv_c++23.cc:
Likewise.
* testsuite/27_io/spanstream/1.cc: Likewise.
* testsuite/27_io/spanstream/2.cc: Likewise.
* testsuite/27_io/spanstream/version.cc: Likewise.
* testsuite/29_atomics/atomic_float/requirements_cxx23.cc:
Likewise.
* testsuite/29_atomics/headers/stdatomic.h/c_compat.cc:
Likewise.
* testsuite/29_atomics/headers/stdatomic.h/version.cc: Likewise.
* testsuite/30_threads/packaged_task/cons/deduction_c++23.cc:
Likewise.
* testsuite/experimental/filesystem/path/native/conv_c++23.cc:
Likewise.
* testsuite/std/ranges/adaptors/adjacent/1.cc: Likewise.
* testsuite/std/ranges/adaptors/adjacent_transform/1.cc:
Likewise.
* testsuite/std/ranges/adaptors/as_const/1.cc: Likewise.
* testsuite/std/ranges/adaptors/as_rvalue/1.cc: Likewise.
* testsuite/std/ranges/adaptors/chunk/1.cc: Likewise.
* testsuite/std/ranges/adaptors/chunk_by/1.cc: Likewise.
* testsuite/std/ranges/adaptors/enumerate/1.cc: Likewise.
* testsuite/std/ranges/adaptors/join_with/1.cc: Likewise.
* testsuite/std/ranges/adaptors/lwg3715.cc: Likewise.
* testsuite/std/ranges/adaptors/slide/1.cc: Likewise.
* testsuite/std/ranges/adaptors/stride/1.cc: Likewise.
* testsuite/std/ranges/cartesian_product/1.cc: Likewise.
* testsuite/std/ranges/range_adaptor_closure.cc: Likewise.
* testsuite/std/ranges/repeat/1.cc: Likewise.
* testsuite/std/ranges/version_c++23.cc: Likewise.
* testsuite/std/ranges/zip/1.cc: Likewise.
* testsuite/std/ranges/zip_transform/1.cc: Likewise.

9 months agolibstdc++: Remove dg-options "-std=gnu++23" from std::expected tests
Jonathan Wakely [Fri, 1 Sep 2023 20:28:05 +0000 (21:28 +0100)] 
libstdc++: Remove dg-options "-std=gnu++23" from std::expected tests

The testsuite will automatically select C++23 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++26
as well.

libstdc++-v3/ChangeLog:

* testsuite/20_util/expected/assign.cc: Remove dg-options.
* testsuite/20_util/expected/bad.cc: Likewise.
* testsuite/20_util/expected/cons.cc: Likewise.
* testsuite/20_util/expected/equality.cc: Likewise.
* testsuite/20_util/expected/illformed_neg.cc: Likewise.
* testsuite/20_util/expected/lwg3877.cc: Likewise.
* testsuite/20_util/expected/lwg3938.cc: Likewise.
* testsuite/20_util/expected/monadic.cc: Likewise.
* testsuite/20_util/expected/observers.cc: Likewise.
* testsuite/20_util/expected/requirements.cc: Likewise.
* testsuite/20_util/expected/swap.cc: Likewise.
* testsuite/20_util/expected/synopsis.cc: Likewise.
* testsuite/20_util/expected/unexpected.cc: Likewise.
* testsuite/20_util/expected/version.cc: Likewise.

9 months agolibstdc++: Remove dg-options "-std=gnu++20" from std::chrono tests
Jonathan Wakely [Fri, 1 Sep 2023 20:28:07 +0000 (21:28 +0100)] 
libstdc++: Remove dg-options "-std=gnu++20" from std::chrono tests

The testsuite will automatically select C++20 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++23
and C++26 as well.

libstdc++-v3/ChangeLog:

* testsuite/20_util/duration/arithmetic/overflow_c++20.cc:
Remove dg-options.
* testsuite/20_util/duration/io.cc: Likewise.
* testsuite/std/time/clock/file/io.cc: Likewise.
* testsuite/std/time/clock/file/members.cc: Likewise.
* testsuite/std/time/clock/file/overview.cc: Likewise.
* testsuite/std/time/clock/gps/1.cc: Likewise.
* 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/1.cc: Likewise.
* testsuite/std/time/clock/tai/io.cc: Likewise.
* testsuite/std/time/clock/utc/1.cc: Likewise.
* testsuite/std/time/clock/utc/io.cc: Likewise.
* testsuite/std/time/clock/utc/leap_second_info.cc: Likewise.
* testsuite/std/time/day/1.cc: Likewise.
* testsuite/std/time/day/io.cc: Likewise.
* testsuite/std/time/exceptions.cc: Likewise.
* testsuite/std/time/format.cc: Likewise.
* testsuite/std/time/hh_mm_ss/1.cc: Likewise.
* testsuite/std/time/hh_mm_ss/109772.cc: Likewise.
* testsuite/std/time/hh_mm_ss/io.cc: Likewise.
* testsuite/std/time/is_am/1.cc: Likewise.
* testsuite/std/time/is_pm/1.cc: Likewise.
* testsuite/std/time/make12/1.cc: Likewise.
* testsuite/std/time/make24/1.cc: Likewise.
* testsuite/std/time/month/1.cc: Likewise.
* testsuite/std/time/month/io.cc: Likewise.
* testsuite/std/time/month_day/1.cc: Likewise.
* testsuite/std/time/month_day/io.cc: Likewise.
* testsuite/std/time/month_day_last/1.cc: Likewise.
* testsuite/std/time/month_day_last/io.cc: Likewise.
* testsuite/std/time/month_weekday/1.cc: Likewise.
* testsuite/std/time/month_weekday/io.cc: Likewise.
* testsuite/std/time/month_weekday_last/1.cc: Likewise.
* testsuite/std/time/month_weekday_last/io.cc: Likewise.
* testsuite/std/time/parse.cc: Likewise.
* testsuite/std/time/syn_c++20.cc: Likewise.
* testsuite/std/time/time_zone/get_info_local.cc: Likewise.
* testsuite/std/time/time_zone/get_info_sys.cc: Likewise.
* testsuite/std/time/time_zone/requirements.cc: Likewise.
* testsuite/std/time/traits/is_clock.cc: Likewise.
* testsuite/std/time/tzdb/1.cc: Likewise.
* testsuite/std/time/tzdb/leap_seconds.cc: Likewise.
* testsuite/std/time/tzdb_list/1.cc: Likewise.
* testsuite/std/time/tzdb_list/requirements.cc: Likewise.
* testsuite/std/time/weekday/1.cc: Likewise.
* testsuite/std/time/weekday/io.cc: Likewise.
* testsuite/std/time/weekday_indexed/io.cc: Likewise.
* testsuite/std/time/weekday_last/1.cc: Likewise.
* testsuite/std/time/weekday_last/io.cc: Likewise.
* testsuite/std/time/year/1.cc: Likewise.
* testsuite/std/time/year/2.cc: Likewise.
* testsuite/std/time/year/io.cc: Likewise.
* testsuite/std/time/weekday_indexed/1.cc: Likewise.
* testsuite/std/time/year_month/1.cc: Likewise.
* testsuite/std/time/year_month/2.cc: Likewise.
* testsuite/std/time/year_month/io.cc: Likewise.
* testsuite/std/time/year_month_day/1.cc: Likewise.
* testsuite/std/time/year_month_day/2.cc: Likewise.
* testsuite/std/time/year_month_day/3.cc: Likewise.
* testsuite/std/time/year_month_day/4.cc: Likewise.
* testsuite/std/time/year_month_day/io.cc: Likewise.
* testsuite/std/time/year_month_day_last/1.cc: Likewise.
* testsuite/std/time/year_month_day_last/2.cc: Likewise.
* testsuite/std/time/year_month_day_last/io.cc: Likewise.
* testsuite/std/time/year_month_weekday/1.cc: Likewise.
* testsuite/std/time/year_month_weekday/2.cc: Likewise.
* testsuite/std/time/year_month_weekday/3.cc: Likewise.
* testsuite/std/time/year_month_weekday/io.cc: Likewise.
* testsuite/std/time/year_month_weekday_last/1.cc: Likewise.
* testsuite/std/time/year_month_weekday_last/2.cc: Likewise.
* testsuite/std/time/year_month_weekday_last/io.cc: Likewise.
* testsuite/std/time/zoned_time/1.cc: Likewise.
* testsuite/std/time/zoned_time/custom.cc: Likewise.
* testsuite/std/time/zoned_time/deduction.cc: Likewise.
* testsuite/std/time/zoned_time/io.cc: Likewise.
* testsuite/std/time/zoned_time/req_neg.cc: Likewise.
* testsuite/std/time/zoned_time/requirements.cc: Likewise.
* testsuite/std/time/zoned_traits.cc: Likewise.

9 months agolibstdc++: Remove dg-options "-std=gnu++20" from std::format tests
Jonathan Wakely [Fri, 1 Sep 2023 20:28:03 +0000 (21:28 +0100)] 
libstdc++: Remove dg-options "-std=gnu++20" from std::format tests

The testsuite will automatically select C++20 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++23
and C++26 as well.

libstdc++-v3/ChangeLog:

* testsuite/std/format/arguments/args.cc: Remove dg-options.
* testsuite/std/format/arguments/lwg3810.cc: Likewise.
* testsuite/std/format/error.cc: Likewise.
* testsuite/std/format/format_string.cc: Likewise.
* testsuite/std/format/formatter/concept.cc: Likewise.
* testsuite/std/format/formatter/ext_float.cc: Likewise.
* testsuite/std/format/formatter/requirements.cc: Likewise.
* testsuite/std/format/functions/107871.cc: Likewise.
* testsuite/std/format/functions/format.cc: Likewise.
* testsuite/std/format/functions/format_to.cc: Likewise.
* testsuite/std/format/functions/format_to_n.cc: Likewise.
* testsuite/std/format/functions/size.cc: Likewise.
* testsuite/std/format/functions/vformat_to.cc: Likewise.
* testsuite/std/format/parse_ctx.cc: Likewise.
* testsuite/std/format/string.cc: Likewise.
* testsuite/std/format/string_neg.cc: Likewise.
* testsuite/std/format/functions/format_c++23.cc: Removed.

9 months agolibstdc++: Remove dg-options "-std=gnu++2a" from constrained algo tests
Jonathan Wakely [Mon, 11 Sep 2023 13:16:27 +0000 (14:16 +0100)] 
libstdc++: Remove dg-options "-std=gnu++2a" from constrained algo tests

The testsuite will automatically select C++20 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++23
and C++26 as well.

libstdc++-v3/ChangeLog:

* testsuite/20_util/function_objects/range.cmp/equal_to.cc:
Remove dg-options.
* testsuite/20_util/function_objects/range.cmp/greater.cc:
Likewise.
* testsuite/20_util/function_objects/range.cmp/greater_equal.cc:
Likewise.
* testsuite/20_util/function_objects/range.cmp/less.cc:
Likewise.
* testsuite/20_util/function_objects/range.cmp/less_equal.cc:
Likewise.
* testsuite/20_util/function_objects/range.cmp/lwg3530.cc:
Likewise.
* testsuite/20_util/function_objects/range.cmp/not_equal_to.cc:
Likewise.
* testsuite/20_util/specialized_algorithms/construct_at/1.cc:
Likewise.
* testsuite/20_util/specialized_algorithms/construct_at/92878_92947.cc:
Likewise.
* testsuite/20_util/specialized_algorithms/construct_at/95788.cc:
Likewise.
* testsuite/20_util/specialized_algorithms/destroy/constrained.cc:
Likewise.
* testsuite/20_util/specialized_algorithms/uninitialized_copy/constrained.cc:
Likewise.
* testsuite/20_util/specialized_algorithms/uninitialized_default_construct/constrained.cc:
Likewise.
* testsuite/20_util/specialized_algorithms/uninitialized_fill/94017.cc:
Likewise.
* testsuite/20_util/specialized_algorithms/uninitialized_fill/constrained.cc:
Likewise.
* testsuite/20_util/specialized_algorithms/uninitialized_fill_n/94017.cc:
Likewise.
* testsuite/20_util/specialized_algorithms/uninitialized_move/constrained.cc:
Likewise.
* testsuite/20_util/specialized_algorithms/uninitialized_value_construct/constrained.cc:
Likewise.
* testsuite/25_algorithms/adjacent_find/constexpr.cc: Likewise.
* testsuite/25_algorithms/adjacent_find/constrained.cc:
Likewise.
* testsuite/25_algorithms/all_of/constexpr.cc: Likewise.
* testsuite/25_algorithms/all_of/constrained.cc: Likewise.
* testsuite/25_algorithms/any_of/constexpr.cc: Likewise.
* testsuite/25_algorithms/any_of/constrained.cc: Likewise.
* testsuite/25_algorithms/binary_search/constexpr.cc: Likewise.
* testsuite/25_algorithms/binary_search/constrained.cc:
Likewise.
* testsuite/25_algorithms/clamp/constrained.cc: Likewise.
* testsuite/25_algorithms/constexpr_macro.cc: Likewise.
* testsuite/25_algorithms/copy/95578.cc: Likewise.
* testsuite/25_algorithms/copy/constexpr.cc: Likewise.
* testsuite/25_algorithms/copy/constrained.cc: Likewise.
* testsuite/25_algorithms/copy/debug/constexpr_neg.cc: Likewise.
* testsuite/25_algorithms/copy_backward/95578.cc: Likewise.
* testsuite/25_algorithms/copy_backward/constexpr.cc: Likewise.
* testsuite/25_algorithms/copy_backward/constrained.cc:
Likewise.
* testsuite/25_algorithms/copy_backward/debug/constexpr_neg.cc:
Likewise.
* testsuite/25_algorithms/copy_if/constexpr.cc: Likewise.
* testsuite/25_algorithms/copy_if/constrained.cc: Likewise.
* testsuite/25_algorithms/copy_n/constexpr.cc: Likewise.
* testsuite/25_algorithms/copy_n/constrained.cc: Likewise.
* testsuite/25_algorithms/count/constexpr.cc: Likewise.
* testsuite/25_algorithms/count/constrained.cc: Likewise.
* testsuite/25_algorithms/count_if/constexpr.cc: Likewise.
* testsuite/25_algorithms/count_if/constrained.cc: Likewise.
* testsuite/25_algorithms/cpp_lib_constexpr.cc: Likewise.
* testsuite/25_algorithms/equal/95578.cc: Likewise.
* testsuite/25_algorithms/equal/constexpr.cc: Likewise.
* testsuite/25_algorithms/equal/constexpr_neg.cc: Likewise.
* testsuite/25_algorithms/equal/constrained.cc: Likewise.
* testsuite/25_algorithms/equal/debug/constexpr_neg.cc:
Likewise.
* testsuite/25_algorithms/equal_range/constexpr.cc: Likewise.
* testsuite/25_algorithms/equal_range/constrained.cc: Likewise.
* testsuite/25_algorithms/fill/94017.cc: Likewise.
* testsuite/25_algorithms/fill/constexpr.cc: Likewise.
* testsuite/25_algorithms/fill/constrained.cc: Likewise.
* testsuite/25_algorithms/fill_n/94017.cc: Likewise.
* testsuite/25_algorithms/fill_n/constexpr.cc: Likewise.
* testsuite/25_algorithms/fill_n/constrained.cc: Likewise.
* testsuite/25_algorithms/find/constexpr.cc: Likewise.
* testsuite/25_algorithms/find/constrained.cc: Likewise.
* testsuite/25_algorithms/find_end/constexpr.cc: Likewise.
* testsuite/25_algorithms/find_end/constrained.cc: Likewise.
* testsuite/25_algorithms/find_first_of/constexpr.cc: Likewise.
* testsuite/25_algorithms/find_first_of/constrained.cc:
Likewise.
* testsuite/25_algorithms/find_if/constexpr.cc: Likewise.
* testsuite/25_algorithms/find_if/constrained.cc: Likewise.
* testsuite/25_algorithms/find_if_not/constexpr.cc: Likewise.
* testsuite/25_algorithms/find_if_not/constrained.cc: Likewise.
* testsuite/25_algorithms/for_each/constexpr.cc: Likewise.
* testsuite/25_algorithms/for_each/constrained.cc: Likewise.
* testsuite/25_algorithms/generate/constexpr.cc: Likewise.
* testsuite/25_algorithms/generate/constrained.cc: Likewise.
* testsuite/25_algorithms/generate_n/constexpr.cc: Likewise.
* testsuite/25_algorithms/generate_n/constrained.cc: Likewise.
* testsuite/25_algorithms/heap/constrained.cc: Likewise.
* testsuite/25_algorithms/includes/constrained.cc: Likewise.
* testsuite/25_algorithms/inplace_merge/constrained.cc:
Likewise.
* testsuite/25_algorithms/is_heap/constexpr.cc: Likewise.
* testsuite/25_algorithms/is_heap_until/constexpr.cc: Likewise.
* testsuite/25_algorithms/is_partitioned/constexpr.cc: Likewise.
* testsuite/25_algorithms/is_partitioned/constrained.cc:
Likewise.
* testsuite/25_algorithms/is_permutation/constexpr.cc: Likewise.
* testsuite/25_algorithms/is_permutation/constrained.cc:
Likewise.
* testsuite/25_algorithms/is_sorted/constexpr.cc: Likewise.
* testsuite/25_algorithms/is_sorted/constrained.cc: Likewise.
* testsuite/25_algorithms/is_sorted_until/constexpr.cc:
Likewise.
* testsuite/25_algorithms/is_sorted_until/constrained.cc:
Likewise.
* testsuite/25_algorithms/iter_swap/constexpr.cc: Likewise.
* testsuite/25_algorithms/lexicographical_compare/93972.cc:
Likewise.
* testsuite/25_algorithms/lexicographical_compare/95578.cc:
Likewise.
* testsuite/25_algorithms/lexicographical_compare/constexpr.cc:
Likewise.
* testsuite/25_algorithms/lexicographical_compare/constrained.cc:
Likewise.
* testsuite/25_algorithms/lexicographical_compare_three_way/1.cc:
Likewise.
* testsuite/25_algorithms/lexicographical_compare_three_way/constexpr.cc:
Likewise.
* testsuite/25_algorithms/lower_bound/constexpr.cc: Likewise.
* testsuite/25_algorithms/lower_bound/constrained.cc: Likewise.
* testsuite/25_algorithms/lower_bound/debug/constexpr_partitioned_neg.cc:
Likewise.
* testsuite/25_algorithms/lower_bound/debug/constexpr_partitioned_pred_neg.cc:
Likewise.
* testsuite/25_algorithms/lower_bound/debug/constexpr_valid_range_neg.cc:
Likewise.
* testsuite/25_algorithms/make_heap/constexpr.cc: Likewise.
* testsuite/25_algorithms/max/constrained.cc: Likewise.
* testsuite/25_algorithms/max_element/constrained.cc: Likewise.
* testsuite/25_algorithms/merge/constexpr.cc: Likewise.
* testsuite/25_algorithms/merge/constrained.cc: Likewise.
* testsuite/25_algorithms/min/constrained.cc: Likewise.
* testsuite/25_algorithms/min_element/constrained.cc: Likewise.
* testsuite/25_algorithms/minmax/constrained.cc: Likewise.
* testsuite/25_algorithms/minmax_element/constrained.cc:
Likewise.
* testsuite/25_algorithms/mismatch/constexpr.cc: Likewise.
* testsuite/25_algorithms/mismatch/constrained.cc: Likewise.
* testsuite/25_algorithms/move/93872.cc: Likewise.
* testsuite/25_algorithms/move/95578.cc: Likewise.
* testsuite/25_algorithms/move/constexpr.cc: Likewise.
* testsuite/25_algorithms/move/constrained.cc: Likewise.
* testsuite/25_algorithms/move_backward/93872.cc: Likewise.
* testsuite/25_algorithms/move_backward/95578.cc: Likewise.
* testsuite/25_algorithms/move_backward/constrained.cc:
Likewise.
* testsuite/25_algorithms/next_permutation/constexpr.cc:
Likewise.
* testsuite/25_algorithms/next_permutation/constrained.cc:
Likewise.
* testsuite/25_algorithms/none_of/constexpr.cc: Likewise.
* testsuite/25_algorithms/none_of/constrained.cc: Likewise.
* testsuite/25_algorithms/nth_element/constexpr.cc: Likewise.
* testsuite/25_algorithms/nth_element/constrained.cc: Likewise.
* testsuite/25_algorithms/partial_sort/constexpr.cc: Likewise.
* testsuite/25_algorithms/partial_sort/constrained.cc: Likewise.
* testsuite/25_algorithms/partial_sort_copy/constexpr.cc:
Likewise.
* testsuite/25_algorithms/partial_sort_copy/constrained.cc:
Likewise.
* testsuite/25_algorithms/partition/constexpr.cc: Likewise.
* testsuite/25_algorithms/partition/constrained.cc: Likewise.
* testsuite/25_algorithms/partition_copy/constexpr.cc: Likewise.
* testsuite/25_algorithms/partition_copy/constrained.cc:
Likewise.
* testsuite/25_algorithms/partition_point/constexpr.cc:
Likewise.
* testsuite/25_algorithms/partition_point/constrained.cc:
Likewise.
* testsuite/25_algorithms/pop_heap/constexpr.cc: Likewise.
* testsuite/25_algorithms/prev_permutation/constexpr.cc:
Likewise.
* testsuite/25_algorithms/prev_permutation/constrained.cc:
Likewise.
* testsuite/25_algorithms/push_heap/constexpr.cc: Likewise.
* testsuite/25_algorithms/remove/constexpr.cc: Likewise.
* testsuite/25_algorithms/remove/constrained.cc: Likewise.
* testsuite/25_algorithms/remove_copy/constexpr.cc: Likewise.
* testsuite/25_algorithms/remove_copy/constrained.cc: Likewise.
* testsuite/25_algorithms/remove_copy_if/constexpr.cc: Likewise.
* testsuite/25_algorithms/remove_copy_if/constrained.cc:
Likewise.
* testsuite/25_algorithms/remove_if/constexpr.cc: Likewise.
* testsuite/25_algorithms/remove_if/constrained.cc: Likewise.
* testsuite/25_algorithms/replace/constrained.cc: Likewise.
* testsuite/25_algorithms/replace_copy/constexpr.cc: Likewise.
* testsuite/25_algorithms/replace_copy/constrained.cc: Likewise.
* testsuite/25_algorithms/replace_copy_if/constexpr.cc:
Likewise.
* testsuite/25_algorithms/replace_copy_if/constrained.cc:
Likewise.
* testsuite/25_algorithms/replace_if/constexpr.cc: Likewise.
* testsuite/25_algorithms/replace_if/constrained.cc: Likewise.
* testsuite/25_algorithms/reverse/constexpr.cc: Likewise.
* testsuite/25_algorithms/reverse/constrained.cc: Likewise.
* testsuite/25_algorithms/reverse_copy/constexpr.cc: Likewise.
* testsuite/25_algorithms/reverse_copy/constrained.cc: Likewise.
* testsuite/25_algorithms/rotate/constexpr.cc: Likewise.
* testsuite/25_algorithms/rotate/constrained.cc: Likewise.
* testsuite/25_algorithms/rotate_copy/constexpr.cc: Likewise.
* testsuite/25_algorithms/rotate_copy/constrained.cc: Likewise.
* testsuite/25_algorithms/sample/constrained.cc: Likewise.
* testsuite/25_algorithms/search/constexpr.cc: Likewise.
* testsuite/25_algorithms/search/constrained.cc: Likewise.
* testsuite/25_algorithms/search_n/97828.cc: Likewise.
* testsuite/25_algorithms/search_n/constexpr.cc: Likewise.
* testsuite/25_algorithms/search_n/constrained.cc: Likewise.
* testsuite/25_algorithms/set_difference/constexpr.cc: Likewise.
* testsuite/25_algorithms/set_difference/constrained.cc:
Likewise.
* testsuite/25_algorithms/set_intersection/constexpr.cc:
Likewise.
* testsuite/25_algorithms/set_intersection/constrained.cc:
Likewise.
* testsuite/25_algorithms/set_symmetric_difference/constexpr.cc:
Likewise.
* testsuite/25_algorithms/set_symmetric_difference/constrained.cc:
Likewise.
* testsuite/25_algorithms/set_union/constexpr.cc: Likewise.
* testsuite/25_algorithms/set_union/constrained.cc: Likewise.
* testsuite/25_algorithms/shift_left/1.cc: Likewise.
* testsuite/25_algorithms/shift_right/1.cc: Likewise.
* testsuite/25_algorithms/shuffle/constrained.cc: Likewise.
* testsuite/25_algorithms/sort/constexpr.cc: Likewise.
* testsuite/25_algorithms/sort/constrained.cc: Likewise.
* testsuite/25_algorithms/sort_heap/constexpr.cc: Likewise.
* testsuite/25_algorithms/stable_partition/constrained.cc:
Likewise.
* testsuite/25_algorithms/stable_sort/constrained.cc: Likewise.
* testsuite/25_algorithms/swap/constexpr.cc: Likewise.
* testsuite/25_algorithms/swap_ranges/constexpr.cc: Likewise.
* testsuite/25_algorithms/swap_ranges/constrained.cc: Likewise.
* testsuite/25_algorithms/transform/constexpr.cc: Likewise.
* testsuite/25_algorithms/transform/constrained.cc: Likewise.
* testsuite/25_algorithms/unique/constexpr.cc: Likewise.
* testsuite/25_algorithms/unique/constrained.cc: Likewise.
* testsuite/25_algorithms/unique_copy/constexpr.cc: Likewise.
* testsuite/25_algorithms/unique_copy/constrained.cc: Likewise.
* testsuite/25_algorithms/upper_bound/constexpr.cc: Likewise.
* testsuite/25_algorithms/upper_bound/constrained.cc: Likewise.
* testsuite/25_algorithms/upper_bound/debug/constexpr_partitioned_neg.cc:
Likewise.
* testsuite/25_algorithms/upper_bound/debug/constexpr_partitioned_pred_neg.cc:
Likewise.
* testsuite/25_algorithms/upper_bound/debug/constexpr_valid_range_neg.cc:
Likewise.

9 months agolibstdc++: Remove dg-options "-std=gnu++20" from <concepts> and <ranges> tests
Jonathan Wakely [Mon, 4 Sep 2023 13:06:43 +0000 (14:06 +0100)] 
libstdc++: Remove dg-options "-std=gnu++20" from <concepts> and <ranges> tests

The testsuite will automatically select C++20 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++23
and C++26 as well.

libstdc++-v3/ChangeLog:

* testsuite/std/concepts/1.cc: Remove dg-options.
* testsuite/std/concepts/2.cc: Likewise.
* testsuite/std/concepts/concepts.callable/invocable.cc:
Likewise.
* testsuite/std/concepts/concepts.callable/regular_invocable.cc:
Likewise.
* testsuite/std/concepts/concepts.callable/relation.cc:
Likewise.
* testsuite/std/concepts/concepts.callable/strictweakorder.cc:
Likewise.
* testsuite/std/concepts/concepts.lang/concept.arithmetic/floating_point.cc: Likewise.
* testsuite/std/concepts/concepts.lang/concept.arithmetic/integral.cc: Likewise.
* testsuite/std/concepts/concepts.lang/concept.arithmetic/signed_integral.cc: Likewise.
* testsuite/std/concepts/concepts.lang/concept.arithmetic/unsigned_integral.cc: Likewise.
* testsuite/std/concepts/concepts.lang/concept.assignable/1.cc:
Likewise.
* testsuite/std/concepts/concepts.lang/concept.common/1.cc:
Likewise.
* testsuite/std/concepts/concepts.lang/concept.commonref/1.cc:
Likewise.
* testsuite/std/concepts/concepts.lang/concept.constructible/1.cc: Likewise.
* testsuite/std/concepts/concepts.lang/concept.convertible/1.cc:
Likewise.
* testsuite/std/concepts/concepts.lang/concept.copyconstructible/1.cc: Likewise.
* testsuite/std/concepts/concepts.lang/concept.defaultinitializable/1.cc: Likewise.
* testsuite/std/concepts/concepts.lang/concept.defaultinitializable/lwg3149.cc: Likewise.
* testsuite/std/concepts/concepts.lang/concept.derived/1.cc:
Likewise.
* testsuite/std/concepts/concepts.lang/concept.destructible/1.cc: Likewise.
* testsuite/std/concepts/concepts.lang/concept.moveconstructible/1.cc: Likewise.
* testsuite/std/concepts/concepts.lang/concept.same/1.cc:
Likewise.
* testsuite/std/concepts/concepts.lang/concept.swappable/swap.cc: Likewise.
* testsuite/std/concepts/concepts.lang/concept.swappable/swappable.cc: Likewise.
* testsuite/std/concepts/concepts.lang/concept.swappable/swappable_with.cc: Likewise.
* testsuite/std/concepts/concepts.object/copyable.cc: Likewise.
* testsuite/std/concepts/concepts.object/movable.cc: Likewise.
* testsuite/std/concepts/concepts.object/regular.cc: Likewise.
* testsuite/std/concepts/concepts.object/semiregular.cc:
Likewise.
* testsuite/std/ranges/97600.cc: Likewise.
* testsuite/std/ranges/access/101782.cc: Likewise.
* testsuite/std/ranges/access/begin.cc: Likewise.
* testsuite/std/ranges/access/begin_neg.cc: Likewise.
* testsuite/std/ranges/access/cbegin.cc: Likewise.
* testsuite/std/ranges/access/cdata.cc: Likewise.
* testsuite/std/ranges/access/cend.cc: Likewise.
* testsuite/std/ranges/access/crbegin.cc: Likewise.
* testsuite/std/ranges/access/crend.cc: Likewise.
* testsuite/std/ranges/access/data.cc: Likewise.
* testsuite/std/ranges/access/empty.cc: Likewise.
* testsuite/std/ranges/access/end.cc: Likewise.
* testsuite/std/ranges/access/end_neg.cc: Likewise.
* testsuite/std/ranges/access/lwg3467.cc: Likewise.
* testsuite/std/ranges/access/p2602.cc: Likewise.
* testsuite/std/ranges/access/rbegin.cc: Likewise.
* testsuite/std/ranges/access/rend.cc: Likewise.
* testsuite/std/ranges/access/size.cc: Likewise.
* testsuite/std/ranges/access/size_neg.cc: Likewise.
* testsuite/std/ranges/access/ssize.cc: Likewise.
* testsuite/std/ranges/adaptors/100479.cc: Likewise.
* testsuite/std/ranges/adaptors/100577.cc: Likewise.
* testsuite/std/ranges/adaptors/93978.cc: Likewise.
* testsuite/std/ranges/adaptors/95322.cc: Likewise.
* testsuite/std/ranges/adaptors/99433.cc: Likewise.
* testsuite/std/ranges/adaptors/all.cc: Likewise.
* testsuite/std/ranges/adaptors/common.cc: Likewise.
* testsuite/std/ranges/adaptors/conditionally_borrowed.cc:
Likewise.
* testsuite/std/ranges/adaptors/counted.cc: Likewise.
* testsuite/std/ranges/adaptors/detail/copyable_box.cc:
Likewise.
* testsuite/std/ranges/adaptors/drop.cc: Likewise.
* testsuite/std/ranges/adaptors/drop_while.cc: Likewise.
* testsuite/std/ranges/adaptors/elements.cc: Likewise.
* testsuite/std/ranges/adaptors/filter.cc: Likewise.
* testsuite/std/ranges/adaptors/join.cc: Likewise.
* testsuite/std/ranges/adaptors/lazy_split.cc: Likewise.
* testsuite/std/ranges/adaptors/lazy_split_neg.cc: Likewise.
* testsuite/std/ranges/adaptors/lwg3286.cc: Likewise.
* testsuite/std/ranges/adaptors/lwg3313_neg.cc: Likewise.
* testsuite/std/ranges/adaptors/lwg3325_neg.cc: Likewise.
* testsuite/std/ranges/adaptors/lwg3406.cc: Likewise.
* testsuite/std/ranges/adaptors/p1739.cc: Likewise.
* testsuite/std/ranges/adaptors/p2281.cc: Likewise.
* testsuite/std/ranges/adaptors/p2770r0.cc: Likewise.
* testsuite/std/ranges/adaptors/reverse.cc: Likewise.
* testsuite/std/ranges/adaptors/sizeof.cc: Likewise.
* testsuite/std/ranges/adaptors/split.cc: Likewise.
* testsuite/std/ranges/adaptors/take.cc: Likewise.
* testsuite/std/ranges/adaptors/take_while.cc: Likewise.
* testsuite/std/ranges/adaptors/transform.cc: Likewise.
* testsuite/std/ranges/empty_view.cc: Likewise.
* testsuite/std/ranges/headers/ranges/synopsis.cc: Likewise.
* testsuite/std/ranges/iota/difference_type.cc: Likewise.
* testsuite/std/ranges/iota/iota_view.cc: Likewise.
* testsuite/std/ranges/iota/iterator.cc: Likewise.
* testsuite/std/ranges/iota/lwg3292_neg.cc: Likewise.
* testsuite/std/ranges/iota/max_size_type.cc: Likewise.
* testsuite/std/ranges/istream_view.cc: Likewise.
* testsuite/std/ranges/p2259.cc: Likewise.
* testsuite/std/ranges/p2325.cc: Likewise.
* testsuite/std/ranges/p2367.cc: Likewise.
* testsuite/std/ranges/range.cc: Likewise.
* testsuite/std/ranges/refinements.cc: Likewise.
* testsuite/std/ranges/safe_range.cc: Likewise.
* testsuite/std/ranges/safe_range_types.cc: Likewise.
* testsuite/std/ranges/single_view.cc: Likewise.
* testsuite/std/ranges/sized.cc: Likewise.
* testsuite/std/ranges/subrange/1.cc: Likewise.
* testsuite/std/ranges/subrange/97512.cc: Likewise.
* testsuite/std/ranges/subrange/constexpr.cc: Likewise.
* testsuite/std/ranges/subrange/lwg3282_neg.cc: Likewise.
* testsuite/std/ranges/subrange/lwg3286.cc: Likewise.
* testsuite/std/ranges/subrange/lwg3433.cc: Likewise.
* testsuite/std/ranges/subrange/sizeof.cc: Likewise.
* testsuite/std/ranges/subrange/tuple_like.cc: Likewise.
* testsuite/std/ranges/view.cc: Likewise.

9 months agolibstdc++: Remove dg-options "-std=c++20" from <span> and <cuchar> tests
Jonathan Wakely [Mon, 4 Sep 2023 15:01:16 +0000 (16:01 +0100)] 
libstdc++: Remove dg-options "-std=c++20" from <span> and <cuchar> tests

The testsuite will automatically select C++20 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++23
and C++26 as well.

There doesn't seem to be any reason they need to use strict -std=c++20
mode, so don't add the { dg-add-options strict_std } directive, just let
them use strict or non-strict modes.

libstdc++-v3/ChangeLog:

* testsuite/21_strings/headers/cuchar/functions_std_cxx20.cc:
Remove dg-options.
* testsuite/23_containers/span/contiguous_range_neg.cc:
Likewise.
* testsuite/23_containers/span/everything.cc: Likewise.

9 months agolibstdc++: Replace dg-options "-std=c++20" with dg-add-options strict_std
Jonathan Wakely [Mon, 4 Sep 2023 13:11:54 +0000 (14:11 +0100)] 
libstdc++: Replace dg-options "-std=c++20" with dg-add-options strict_std

The testsuite will automatically select C++20 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++23
and C++26 as well. Because they test a problem seen with -std=c++20 add
the new { dg-add-options strict_std } directive so that the test runner
uses -std=c++NN not -std=gnu++NN.

libstdc++-v3/ChangeLog:

* testsuite/24_iterators/reverse_iterator/100639.cc: Remove
dg-options and add dg-add-options strict_std.
* testsuite/std/ranges/iota/93267.cc: Likewise.
* testsuite/std/ranges/iota/96042.cc: Likewise.
* testsuite/std/ranges/iota/size.cc: Likewise.
* testsuite/std/ranges/subrange/96042.cc: Likewise.

9 months agolibstdc++: Replace dg-options "-std=c++17" with dg-add-options strict_std
Jonathan Wakely [Mon, 4 Sep 2023 13:10:15 +0000 (14:10 +0100)] 
libstdc++: Replace dg-options "-std=c++17" with dg-add-options strict_std

These tests can (and should) also be run for later standards, so replace
the { dg-options "-std=c++17" } with { dg-add-options strict_std }.

* testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/compile_cxx17.cc:
Replace dg-options -std=c++17 with dg-add-options strict_std.
* testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/compile_cxx17.cc:
Likewise.

9 months agolibstdc++: Replace dg-options "-std=c++11" with dg-add-options strict_std
Jonathan Wakely [Mon, 4 Sep 2023 13:10:15 +0000 (14:10 +0100)] 
libstdc++: Replace dg-options "-std=c++11" with dg-add-options strict_std

These tests can (and should) also be run for later standards, so replace
the { dg-options "-std=c++11" } with { dg-add-options strict_std } and a
target selector for c++11.

libstdc++-v3/ChangeLog:

* testsuite/23_containers/deque/48101-2_neg.cc: Replace
dg-options with target selector.
* testsuite/23_containers/forward_list/48101-2_neg.cc: Likewise.
* testsuite/23_containers/list/48101-2_neg.cc: Likewise.
* testsuite/23_containers/map/48101-2_neg.cc: Likewise.
* testsuite/23_containers/map/48101_neg.cc: Likewise.
* testsuite/23_containers/multimap/48101-2_neg.cc: Likewise.
* testsuite/23_containers/multimap/48101_neg.cc: Likewise.
* testsuite/23_containers/multiset/48101-2_neg.cc: Likewise.
* testsuite/23_containers/set/48101-2_neg.cc: Likewise.
* testsuite/23_containers/unordered_map/48101-2_neg.cc:
Likewise.
* testsuite/23_containers/unordered_multimap/48101-2_neg.cc:
Likewise.
* testsuite/23_containers/unordered_multiset/48101-2_neg.cc:
Likewise.
* testsuite/23_containers/unordered_set/48101-2_neg.cc:
Likewise.
* testsuite/23_containers/vector/48101-2_neg.cc: Likewise.

9 months agolibstdc++: Add support for running tests with multiple -std options
Jonathan Wakely [Fri, 1 Sep 2023 20:27:57 +0000 (21:27 +0100)] 
libstdc++: Add support for running tests with multiple -std options

This copies the code from the compiler's gcc/testsuite/lib/g++-dg.exp so
that each test can be run multiple times, with different -std options.
This means that we can remove most { dg-options "-std=gnu++20" }
directives from tests, because the testsuite will automatically select
a set of -std options that includes that version.

Tests that should only run for a specific standard (e.g. ones that use
something like { dg-do run { target c++11_only } }) should still specify
that standard with { dg-options "-std=gnu++11" }, which overrides the
automatic selection. But a dg-options that selects a newer standard than
the default can be removed, because that standard will be selected
automatically based on a selector like { target c++20 } in the dg-do
directive. This will allow those tests to be run for more than just the
one they currently hardcode, so that e.g. std::format tests can be run
for all of C++20, C++23 and C++26. Currently that has to be done by
adding a second test file that uses a different dg-options line.

By default most tests will continue to run with only the default dialect
(currently -std=gnu++17) so that the time to run the entire testsuite is
not increased. We can revisit this later if increasing the testsuite
time (and coverage) is acceptable. Libstdc++ developers can easily
override the defaults to run for multiple versions. To test all
versions, either add 'set v3_std_list { 98 11 14 17 20 23 26 }' to
~/.dejagnurc or define GLIBCXX_TESTSUITE_STDS="98,11,14,17,20,23,26" in
the environment.

This should be more efficient than the current way to test with multple
standards, i.e. --target_board=unix{-std=c++14,-std=c++17,-std=c++20},
because today all tests with an explicit -std option hardcoded in them
get run for each target board variation but using the exact same
hardcoded -std every time. With the new approach you can just use the
default --target_board=unix and set GLIBCXX_TESTSUITE_STDS="14,17,20"
and now a test that has { target c++20 } will only run once (and be
UNSUPPORTED twice), instead of running with identical options three
times.

In order to support ~/.dejagnurc and $DEJAGNU files that need to work
with versions of GCC without this change, a new variable is added to
site.tmp to detect whether v3_std_list is supported. That allows e.g.

if { [info exists v3-use-std-list] } {
  set v3_std_list { 11 17 23 }
  set target_list { "unix{,-m32}" }
} else {
  set target_list { "unix{,-std=gnu++2b,-std=gnu++11,-m32}" }
}

libstdc++-v3/ChangeLog:

* doc/xml/manual/test.xml: Update documentation on running and
writing tests.
* doc/html/manual/test.html: Regenerate.
* testsuite/Makefile.am: Add v3-use-std-list to site.tmp
* testsuite/Makefile.in: Regenerate.
* testsuite/lib/dg-options.exp (add_options_for_strict_std): New
proc.
* testsuite/lib/libstdc++.exp (search_for): New utility proc.
(v3-dg-runtest): New proc to replace dg-runtest.
* testsuite/libstdc++-dg/conformance.exp: Use v3-dg-runtest.

9 months agolibstdc++: Fix 29_atomics/headers/atomic/types_std_c++2a_neg.cc for C++23
Jonathan Wakely [Fri, 15 Sep 2023 20:37:46 +0000 (21:37 +0100)] 
libstdc++: Fix 29_atomics/headers/atomic/types_std_c++2a_neg.cc for C++23

This test fails when run as C++23 because the <bits/stdc++.h> PCH
includes <stdatomic.h> which declares ::memory_order, invalidating the
test's assumptions. Disable PCH so that the test verifies that <atomic>
doesn't declare ::memory_order, as originally intended.

Also fix the using-declaration which would be invalid even if the type
was declared in the global namespace, and adjust the expected error.

libstdc++-v3/ChangeLog:

* testsuite/29_atomics/headers/atomic/types_std_c++2a_neg.cc:
Fix test to work for C++23 and C++26 too.

9 months agofix PR 111259 invalid zcmp mov predicate.
Fei Gao [Fri, 15 Sep 2023 01:20:08 +0000 (01:20 +0000)] 
fix PR 111259 invalid zcmp mov predicate.

The code changes are from Palmer.

root cause:
In a gcc build with --enable-checking=yes, REGNO (op) checks
rtx code and expected code 'reg'. so a rtx with 'subreg' causes
an internal compiler error.

solution:
Restrict predicate to allow 'reg' only.

gcc/ChangeLog:

* config/riscv/predicates.md: Restrict predicate
to allow 'reg' only.
Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
9 months agolibstdc++: Use C++20 constraints in <bit>
Patrick Palka [Fri, 15 Sep 2023 19:26:26 +0000 (15:26 -0400)] 
libstdc++: Use C++20 constraints in <bit>

Using a type-constraint instead of enable_if_t in the return types of
these functions greatly reduces the size of their mangled names.  And by
now it's probably safe to assume recent compilers have sufficient C++20
concepts support to handle such constraints.

libstdc++-v3/ChangeLog:

* include/std/bit: Include <concepts>.
(byteswap): Use a type-constraint instead of enable_if_t
inside the return type, and use std::integral.
(_If_is_unsigned_integer): Replace with ...
(__unsigned_integer): ... this.
(rotl): Use a type-constraint instead of enable_if_t inside
the return type.
(countl_zero): Likewise.
(countl_one): Likewise.
(countr_zero): Likewise.
(countr_one): Likewise.
(popcount): Likewise.
(has_single_bit): Likewise.
(bit_ceil): Likewise.
(bit_floor): Likewise.
(bit_width): Likewise.

9 months agoanalyzer: support diagnostics that don't have a stmt
David Malcolm [Fri, 15 Sep 2023 17:47:42 +0000 (13:47 -0400)] 
analyzer: support diagnostics that don't have a stmt

gcc/analyzer/ChangeLog:
* analyzer.cc (get_stmt_location): Handle null stmt.
* diagnostic-manager.cc (saved_diagnostic::saved_diagnostic): Copy
m_loc from ploc.
(saved_diagnostic::operator==): Compare m_loc.
(saved_diagnostic::calc_best_epath): Only use m_stmt_finder if
m_loc is unknown.
(dedupe_key::dedupe_key): Initialize m_loc.
(dedupe_key::operator==): Compare m_loc.
(dedupe_key::get_location): Use m_loc if it's known.
(dedupe_key::m_loc): New field.
(diagnostic_manager::emit_saved_diagnostic): Only call
get_emission_location if m_loc is unknown, preferring to use m_loc
if it's available.
* diagnostic-manager.h (saved_diagnostic::m_loc): New field.
(pending_location::pending_location): Initialize m_loc.  Add
overload taking a location_t rather than a stmt/stmt_finder.
(pending_location::m_loc): New field.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
9 months agoanalyzer: introduce pending_location
David Malcolm [Fri, 15 Sep 2023 17:47:42 +0000 (13:47 -0400)] 
analyzer: introduce pending_location

No functional change intended.

gcc/analyzer/ChangeLog:
* analyzer.h (struct pending_location): New forward decl.
* diagnostic-manager.cc (saved_diagnostic::saved_diagnostic):
Replace params "enode", "snode", "stmt", and "stmt_finder" with
"ploc".
(diagnostic_manager::add_diagnostic): Likewise for both overloads.
* diagnostic-manager.h (saved_diagnostic::saved_diagnostic):
Likewise.
(struct pending_location): New.
(diagnostic_manager::add_diagnostic): Replace params "enode",
"snode", "stmt", and "stmt_finder" with "ploc".
* engine.cc (impl_region_model_context::warn): Update call to
add_diagnostic for above change.
(impl_sm_context::warn): Likewise.
(impl_region_model_context::on_state_leak): Likewise.
* infinite-recursion.cc
(exploded_graph::detect_infinite_recursion): Likewise.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
9 months agoanalyzer: handle volatile ops
David Malcolm [Fri, 15 Sep 2023 17:47:42 +0000 (13:47 -0400)] 
analyzer: handle volatile ops

gcc/analyzer/ChangeLog:
* region-model.cc (region_model::get_gassign_result): Handle
volatile ops by using a conjured_svalue.

gcc/testsuite/ChangeLog:
* c-c++-common/analyzer/volatile-1.c: New test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
9 months agoFortran: improve bounds-checking for array sections [PR30802]
Harald Anlauf [Fri, 15 Sep 2023 17:13:38 +0000 (19:13 +0200)] 
Fortran: improve bounds-checking for array sections [PR30802]

gcc/fortran/ChangeLog:

PR fortran/30802
* trans-array.cc (trans_array_bound_check): Add optional argument
COMPNAME for explicit specification of array component name.
(array_bound_check_elemental): Helper function for generating
bounds-checking code for elemental dimensions.
(gfc_conv_expr_descriptor): Use bounds-checking also for elemental
dimensions, i.e. those not handled by the scalarizer.

gcc/testsuite/ChangeLog:

PR fortran/30802
* gfortran.dg/bounds_check_fail_6.f90: New test.

9 months agoMATCH: Improve zero_one_valued_p for cases without range information
Andrew Pinski [Thu, 14 Sep 2023 21:47:04 +0000 (14:47 -0700)] 
MATCH: Improve zero_one_valued_p for cases without range information

I noticed we sometimes lose range information in forwprop due to a few
match and simplify patterns optimizing away casts. So the easier way
to these cases is to add a match for zero_one_valued_p wich mathes
a cast from another zero_one_valued_p.
This also adds the case of `x & zero_one_valued_p` as being zero_one_valued_p
which allows catching more cases too.

OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

gcc/ChangeLog:

* match.pd (zero_one_valued_p): Match a cast from a zero_one_valued_p.
Also match `a & zero_one_valued_p` too.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/bool-13.c: Update testcase as we now do
the MIN/MAX during forwprop1.

9 months agoMATCH: Fix `(1 >> X) != 0` pattern for vector types
Andrew Pinski [Thu, 14 Sep 2023 14:39:31 +0000 (07:39 -0700)] 
MATCH: Fix `(1 >> X) != 0` pattern for vector types

I had missed that integer_onep can match vector types with uniform constant of `1`.
This means the shifter could be an scalar type and then doing a comparison against `0`
would be an invalid transformation.
This fixes the problem by adding a check for the type of the integer_onep to make
sure it is a INTEGRAL_TYPE_P (which does not match a vector type).

OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

PR tree-optimization/111414

gcc/ChangeLog:

* match.pd (`(1 >> X) != 0`): Check to see if
the integer_onep was an integral type (not a vector type).

gcc/testsuite/ChangeLog:

* gcc.c-torture/compile/pr111414-1.c: New test.

9 months agoAlways do PHI analysis and before loop analysis.
Andrew MacLeod [Wed, 13 Sep 2023 14:09:16 +0000 (10:09 -0400)] 
Always do PHI analysis and before loop analysis.

PHI analysis wasn't being done if loop analysis found a value.  Always
do the PHI analysis, and run it for an iniital value before invoking
loop analysis.

* gimple-range-fold.cc (fold_using_range::range_of_phi): Always
run phi analysis, and do it before loop analysis.

9 months agoFix indentation.
Andrew MacLeod [Wed, 13 Sep 2023 13:58:39 +0000 (09:58 -0400)] 
Fix indentation.

No functio0nal change, indentation was incorrect.

* gimple-range-fold.cc (fold_using_range::range_of_phi): Fix
indentation.

9 months agoFix PR111407--SSA corruption due to widening_mul opt on conflict across an abnormal...
Qing Zhao [Fri, 15 Sep 2023 13:46:52 +0000 (13:46 +0000)] 
Fix PR111407--SSA corruption due to widening_mul opt on conflict across an abnormal edge

This is a bug in tree-ssa-math-opts.cc, when applying the widening mul
optimization, the compiler needs to check whether the operand is in a
ABNORMAL PHI, if YES, we should avoid the transformation.

PR tree-optimization/111407

gcc/ChangeLog:

* tree-ssa-math-opts.cc (convert_mult_to_widen): Avoid the transform
when one of the operands is subject to abnormal coalescing.

gcc/testsuite/ChangeLog:

* gcc.dg/pr111407.c: New test.

9 months agoada: Fix minor glitch in finish_record_type
Eric Botcazou [Thu, 7 Sep 2023 08:47:31 +0000 (10:47 +0200)] 
ada: Fix minor glitch in finish_record_type

The size needs to be rounded up to the storage unit in all cases.

gcc/ada/

* gcc-interface/utils.cc (finish_record_type): Round the size in
the padding case as well.

9 months agoada: Explicitly analyze and expand null array aggregates
Piotr Trojanek [Thu, 7 Sep 2023 20:13:51 +0000 (22:13 +0200)] 
ada: Explicitly analyze and expand null array aggregates

Null array aggregates have present but empty lists of expressions and
component associations. This confuses the previous code for ordinary
array aggregates, which assumes that if a list of either expressions or
component associations is present, then it is non-empty.

This patch adds explicit handling for null array aggregates to avoid
assertion failures in code for ordinary array aggregates.

gcc/ada/

* exp_aggr.adb (Build_Array_Aggr_Code): Don't build aggregate code
for null array aggregates.
* sem_aggr.adb (Resolve_Array_Aggregate): Don't examine formatting
of a null array aggregate.

9 months agoada: Fix wrong optimization of extended return for discriminated record type
Eric Botcazou [Thu, 7 Sep 2023 14:44:36 +0000 (16:44 +0200)] 
ada: Fix wrong optimization of extended return for discriminated record type

This happens when the discriminants of the record type have default values.

gcc/ada/ChangeLog:

* inline.adb (Expand_Inlined_Call): In the case of a function call
that returns an unconstrained type and initializes an object, set
the No_Initialization flag on the new declaration of the object.

9 months agoada: Do not perform local-exception-to-goto optimization on barrier functions
Patrick Bernardi [Tue, 15 Aug 2023 19:52:57 +0000 (15:52 -0400)] 
ada: Do not perform local-exception-to-goto optimization on barrier functions

The local-exception-to-goto optimization is no longer applied to entry
barrier functions as entry barriers cannot contain exception handlers and
this optimization interferes with another optimization that occurs for
simple barrier functions.

In particular, the simple barrier optimization removes the push error label
statements generated by the local-exception-to-goto optimization. This
causes a Storage_Error in GIGI when the restriction No_Exception_Propagation
is  active and a protected object contains more than one simple entry
barrier.

gcc/ada/

* exp_ch6.adb (Expand_N_Subprogram_Body): Do not perform
local-exception-to- goto optimization on barrier functions.
* exp_ch9.adb (Expand_Entry_Barrier): Simplify the if statement
around the simple barrier optimization and remove an old, no
longer relevant comment.

9 months agoada: Generate runtime restrictions list when the standard library is suppressed
Patrick Bernardi [Thu, 17 Aug 2023 20:24:13 +0000 (16:24 -0400)] 
ada: Generate runtime restrictions list when the standard library is suppressed

With the introduction of Jorvik support into the light-tasking runtime comes
the requirement to detect voliations of runtime restrictions (for example
Max_Entry_Queue_Length) where previously they could be hard coded in the
runtime. This means we now need the binder to populate
System.System.Restrictions.Run_Time_Restrictions when the standard library
is suppressed.

gcc/ada/

* bindgen.adb (Gen_Adainit): Generate restrictions when standard
library is suppressed.
(Gen_Output_File_Ada): Ditto.
(Gen_Restrictions): Ditto.

9 months agoada: Fix internal error on misaligned component with variable nominal size
Eric Botcazou [Thu, 7 Sep 2023 08:53:39 +0000 (10:53 +0200)] 
ada: Fix internal error on misaligned component with variable nominal size

The back-end cannot handle this kind of components even when they are small.

gcc/ada/

* exp_util.adb (Component_May_Be_Bit_Aligned): Do not return false
for a small component of a record type with a variant part.

9 months agoada: Fix internal error on aggregate nested in container aggregate
Eric Botcazou [Wed, 6 Sep 2023 07:37:29 +0000 (09:37 +0200)] 
ada: Fix internal error on aggregate nested in container aggregate

This handles the case where a component association is present.

gcc/ada/

* exp_aggr.adb (Convert_To_Assignments): In the case of a
component association, call Is_Container_Aggregate on the parent's
parent.
(Expand_Array_Aggregate): Likewise.

9 months agoada: Remove GNAT Pro details regarding mold
Kévin Le Gouguec [Wed, 6 Sep 2023 08:02:26 +0000 (10:02 +0200)] 
ada: Remove GNAT Pro details regarding mold

gcc/ada/

* doc/gnat_ugn/building_executable_programs_with_gnat.rst: Remove
extended discussion regarding mold run-time dependencies;
packaging changes in GNAT Pro have made them obsolete.

9 months agoada: Fix internal error on expression function with Refined_Post aspect
Eric Botcazou [Tue, 5 Sep 2023 11:21:24 +0000 (13:21 +0200)] 
ada: Fix internal error on expression function with Refined_Post aspect

This occurs when the expression function calls a protected function and the
-gnata switch is specified, because the compiler wrongly freezes the called
function when analyzing the expression function, a fallout of the wrapping
scheme used for the Post and Refined_Post aspects.

gcc/ada/

* sem_res.adb (Resolve_Call): When the target is an entity, do not
freeze it if the current scope is the inner wrapper function built
for an expression function with a Post or Refined_Post aspect.

9 months agoada: Clean up scope depth and related code (tech debt)
Bob Duff [Tue, 5 Sep 2023 18:40:22 +0000 (14:40 -0400)] 
ada: Clean up scope depth and related code (tech debt)

The main point of this patch is to remove the special case
for Atree.F_Scope_Depth_Value in the Assert that Field_Present
in Get_Field_Value. Pulling on that thread leads to lots
of related cleanup.

gcc/ada/ChangeLog:

* atree.adb (Node_Kind_Table): Specify parameter explicitly in
GNAT.Table instantiations. Use fully qualified references instead
of relying on use clauses.
(Get_Field_Value): Remove special case for F_Scope_Depth_Value.
That is, enable the Field_Present check in that case.
(It was already enabled for all other fields.) Violations of this
check were already fixed.
(Print_Node_Statistics): Sort the output in decreasing order of
frequencies.
(Print_Field_Statistics): Likewise (sort).
* accessibility.adb (Accessibility_Level): Pass Allow_Alt_Model in
recursive calls. Apparently, an oversight.
(Innermost_Master_Scope_Depth): Need to special-case the 'Old
attribute and allocators.
* einfo-utils.ads (Scope_Depth): Use Scope_Kind_Id to get
predicate checks.
(Scope_Depth_Set): Likewise.
(Scope_Depth_Default_0): Likewise.
* einfo-utils.adb: As for spec.
* frontend.adb (Frontend): Remove unnecessary "return;".
* gen_il-types.ads (Scope_Kind): New union type.
* gen_il-gen-gen_entities.adb (Scope_Kind): New union type.
* sem.ads: Move "with Einfo.Entities;" from body to spec.
(Scope_Stack_Entry): Declare Entity to be of Scope_Kind_Id to get
predicate checks. We had previously been putting non-scopes on the
scope stack; this prevents such anomalies.
* sem.adb: Move "with Einfo.Entities;" from body to spec.
* sem_ch8.ads: Move "with Einfo.Entities;" from body to spec. Add
"with Types;".
(Push_Scope): Use Scope_Kind_Id to get predicate checks.
* sem_ch8.adb: Move "with Einfo.Entities;" from body to spec. Add
"with Types;".
(Push_Scope): Use Scope_Kind_Id to get predicate checks.
(Pop_Scope): Use Scope_Kind_Id on popped entity to get predicate
checks. This prevents anomalies where a scope pushed onto the
stack is later mutated to a nonscope before being popped.
* sem_util.ads (Find_Enclosing_Scope): Add postcondition to ensure
that the enclosing scope of a node N is not the same node N.
Clearly, N does not enclose itself.
* sem_util.adb (Find_Enclosing_Scope): There were several bugs
where Find_Enclosing_Scope(N) = N. For example, if N is an entity,
then we would typically go up to its declaration, and then back
down to the Defining_Entity of the declaration, which is N itself.
There were other cases where Find_Enclosing_Scope of an entity
disagreed with Scope. Clearly, Find_Enclosing_Scope and Scope
should agree (when both are defined). Such bugs caused latent bugs
in accessibility.adb related to 'Old, and fixing bugs here caused
such bugs to be revealed. These are fixed by calling Scope when N
is an entity.

Co-authored-by: Ronan Desplanques <desplanques@adacore.com>
9 months agoada: Crash on creation of extra formals on type extension
Javier Miranda [Tue, 5 Sep 2023 06:57:10 +0000 (06:57 +0000)] 
ada: Crash on creation of extra formals on type extension

Revert previous patch and fix the pending issue.

gcc/ada/

* accessibility.ads (Needs_Result_Accessibility_Extra_Formal):
Removed.
* accessibility.adb (Needs_Result_Accessibility_Level_Param):
Removed.
(Needs_Result_Accessibility_Extra_Formal): Removed.
(Needs_Result_Accessibility_Level): Revert previous patch.
* sem_ch6.adb (Parent_Subprogram): Handle function overriding an
enumeration literal.
(Create_Extra_Formals): Ensure that the parent subprogram has all
its extra formals.

9 months agoRISC-V: Fix using wrong mode to get reduction insn vlmax
Lehua Ding [Fri, 15 Sep 2023 11:13:42 +0000 (19:13 +0800)] 
RISC-V: Fix using wrong mode to get reduction insn vlmax

This patch fix using wrong mode when emit vlmax reduction insn. We should
use src operand instead dest operand (which always LMUL=m1) to get the vlmax
length. This patch alse remove dest_mode and mask_mode from insn_expander
constructor, which can be geted by insn_flags.

gcc/ChangeLog:

* config/riscv/riscv-protos.h (enum insn_flags): Change name.
(enum insn_type): Ditto.
* config/riscv/riscv-v.cc (get_mask_mode_from_insn_flags): Removed.
(emit_vlmax_insn): Adjust.
(emit_nonvlmax_insn): Adjust.
(emit_vlmax_insn_lra): Adjust.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/vsetvl/wredsum_vlmax.c: New test.

9 months agofortran: Remove reference count update [PR108957]
Mikael Morin [Fri, 15 Sep 2023 11:40:08 +0000 (13:40 +0200)] 
fortran: Remove reference count update [PR108957]

Remove one reference count incrementation following the assignment of a
symbol pointer to a local variable.  Most symbol pointers are "weak" pointer
and don't need any reference count update when they are assigned, and it is
especially the case of local variables.

This fixes a memory leak with the testcase from the PR (not included).

PR fortran/108957

gcc/fortran/ChangeLog:

* gfortran.h (gfc_symbol): Add comment documenting reference counting.
* parse.cc (parse_interface): Remove reference count incrementation.

9 months agotest: Block SLP check of slp-35.c for vect_strided5
Juzhe-Zhong [Fri, 15 Sep 2023 10:06:03 +0000 (18:06 +0800)] 
test: Block SLP check of slp-35.c for vect_strided5

gcc/testsuite/ChangeLog:

* gcc.dg/vect/slp-35.c: Block SLP check for vect_strided5 targets.

9 months agotest: Block SLP check of slp-34.c for vect_strided5
Juzhe-Zhong [Fri, 15 Sep 2023 10:00:24 +0000 (18:00 +0800)] 
test: Block SLP check of slp-34.c for vect_strided5

Since RISC-V use vsseg5 which is the vect_store_lanes with stride 5
if failed on RISC-V.

gcc/testsuite/ChangeLog:

* gcc.dg/vect/slp-34.c: Block check for vect_strided5.

9 months agotest: Block vect_strided5 for slp-34-big-array.c SLP check
Juzhe-Zhong [Fri, 15 Sep 2023 09:54:44 +0000 (17:54 +0800)] 
test: Block vect_strided5 for slp-34-big-array.c SLP check

If failed on RISC-V since it use vect_store_lanes with array 5.

gcc/testsuite/ChangeLog:

* gcc.dg/vect/slp-34-big-array.c: Block SLP check for vect_strided5.

9 months agotest: Block slp-16.c check for target support vect_strided6
Juzhe-Zhong [Fri, 15 Sep 2023 09:03:49 +0000 (17:03 +0800)] 
test: Block slp-16.c check for target support vect_strided6

This testcase FAIL in RISC-V because RISC-V support vect_load_lanes with 6.
FAIL: gcc.dg/vect/slp-16.c -flto -ffat-lto-objects  scan-tree-dump-times vect "vectorizing stmts using SLP" 2
FAIL: gcc.dg/vect/slp-16.c scan-tree-dump-times vect "vectorizing stmts using SLP" 2

Since it use vlseg6 (vect_load_lanes with array size = 6)

gcc/testsuite/ChangeLog:

* gcc.dg/vect/slp-16.c: Block vect_strided6.
* lib/target-supports.exp: Add strided type.

9 months agotest: Isolate slp-1.c check of target supports vect_strided5
Juzhe-Zhong [Fri, 15 Sep 2023 09:16:36 +0000 (17:16 +0800)] 
test: Isolate slp-1.c check of target supports vect_strided5

This test failed in RISC-V:
FAIL: gcc.dg/vect/slp-1.c -flto -ffat-lto-objects  scan-tree-dump-times vect "vectorizing stmts using SLP" 4
FAIL: gcc.dg/vect/slp-1.c scan-tree-dump-times vect "vectorizing stmts using SLP" 4

Because this loop:
  /* SLP with unrolling by 8.  */
  for (i = 0; i < N; i++)
    {
      out[i*5] = 8;
      out[i*5 + 1] = 7;
      out[i*5 + 2] = 81;
      out[i*5 + 3] = 28;
      out[i*5 + 4] = 18;
    }

is using vect_load_lanes with array size = 5.
instead of SLP.

When we adjust the COST of LANES load store, then it will use SLP.

gcc/testsuite/ChangeLog:

* gcc.dg/vect/slp-1.c: Add vect_stried5.

9 months agotest: Remove XPASS for RISCV
Juzhe-Zhong [Fri, 15 Sep 2023 08:30:04 +0000 (16:30 +0800)] 
test: Remove XPASS for RISCV

Like ARM SVE, this test cause FAILs of XPASS:
XPASS: gcc.dg/Wstringop-overflow-47.c pr97027 (test for warnings, line 72)
XPASS: gcc.dg/Wstringop-overflow-47.c pr97027 (test for warnings, line 77)
XPASS: gcc.dg/Wstringop-overflow-47.c pr97027 note (test for warnings, line 68)

on RISC-V

gcc/testsuite/ChangeLog:

* gcc.dg/Wstringop-overflow-47.c: Add riscv.

9 months agoRISC-V: Refactor expand_reduction and cleanup enum reduction_type
Lehua Ding [Fri, 15 Sep 2023 03:45:55 +0000 (11:45 +0800)] 
RISC-V: Refactor expand_reduction and cleanup enum reduction_type

This patch refactors expand_reduction, remove the reduction_type argument
and add insn_flags argument to determine the passing of the operands.
ops has also been modified to restrict it to only two cases and to remove
operand that are not in use.

gcc/ChangeLog:

* config/riscv/autovec-opt.md: Adjust.
* config/riscv/autovec.md: Ditto.
* config/riscv/riscv-protos.h (enum class): Delete enum reduction_type.
(expand_reduction): Adjust expand_reduction prototype.
* config/riscv/riscv-v.cc (need_mask_operand_p): New helper function.
(expand_reduction): Refactor expand_reduction.

9 months agolibstdc++: Fix constraints for std::variant default constructor
Jonathan Wakely [Thu, 14 Sep 2023 09:27:09 +0000 (10:27 +0100)] 
libstdc++: Fix constraints for std::variant default constructor

The standard says the default ctor should be constrained, not deleted.
Our use of a defaulted default ctor and _Enable_default_constructor base
class results in it being deleted.

libstdc++-v3/ChangeLog:

* include/std/variant (variant): Remove derivation from
_Enable_default_constructor base class.
(variant::variant()): Constrain.
* testsuite/20_util/variant/default_ctor.cc: New test.

9 months agolibstdc++: Remove non-void static assertions in variant's std::get [PR111172]
Jonathan Wakely [Tue, 12 Sep 2023 20:28:38 +0000 (21:28 +0100)] 
libstdc++: Remove non-void static assertions in variant's std::get [PR111172]

A void template argument would cause a substitution failure when trying
to form a reference for the return type, so the function body would
never be instantiated.

libstdc++-v3/ChangeLog:

PR libstdc++/111172
* include/std/variant (get<T>): Remove !is_void static
assertions.

9 months agolibstdc++: Add operator bool to <charconv> result types (P2497R0)
Jonathan Wakely [Thu, 17 Aug 2023 23:24:46 +0000 (00:24 +0100)] 
libstdc++: Add operator bool to <charconv> result types (P2497R0)

C++26 adds these convenience conversions.

libstdc++-v3/ChangeLog:

* include/bits/version.def (to_chars): Define new value for
C++26.
* include/bits/version.h: Regenerate.
* include/std/charconv (to_chars_result::operator bool): New
function.
(from_chars_result::operator bool): New function.
* testsuite/20_util/to_chars/version.cc: Update expected value.
* testsuite/20_util/from_chars/result.cc: New test.
* testsuite/20_util/to_chars/result.cc: New test.

9 months agoaarch64: Fix loose ldpstp check [PR111411]
Richard Sandiford [Fri, 15 Sep 2023 08:19:14 +0000 (09:19 +0100)] 
aarch64: Fix loose ldpstp check [PR111411]

aarch64_operands_ok_for_ldpstp contained the code:

  /* One of the memory accesses must be a mempair operand.
     If it is not the first one, they need to be swapped by the
     peephole.  */
  if (!aarch64_mem_pair_operand (mem_1, GET_MODE (mem_1))
       && !aarch64_mem_pair_operand (mem_2, GET_MODE (mem_2)))
    return false;

But the requirement isn't just that one of the accesses must be a
valid mempair operand.  It's that the lower access must be, since
that's the access that will be used for the instruction operand.

gcc/
PR target/111411
* config/aarch64/aarch64.cc (aarch64_operands_ok_for_ldpstp): Require
the lower memory access to a mem-pair operand.

gcc/testsuite/
PR target/111411
* gcc.dg/rtl/aarch64/pr111411.c: New test.

9 months agoLoongArch: Reimplement multilib build option handling.
Yang Yujie [Wed, 13 Sep 2023 09:52:14 +0000 (17:52 +0800)] 
LoongArch: Reimplement multilib build option handling.

Library build options from --with-multilib-list used to be processed with
*self_spec, which missed the driver's initial canonicalization.  This
caused limitations on CFLAGS override and the use of driver-only options
like -m[no]-lsx.

The problem is solved by promoting the injection rules of --with-multilib-list
options to the first element of DRIVER_SELF_SPECS, to make them execute before
the canonialization.  The library-build options are also hard-coded in
the driver and can be used conveniently by the builders of other non-gcc
libraries via the use of -fmultiflags.

Bootstrapped and tested on loongarch64-linux-gnu.

ChangeLog:

* config-ml.in: Remove unneeded loongarch clause.
* configure.ac: Register custom makefile fragments mt-loongarch-*
for loongarch targets.
* configure: Regenerate.

config/ChangeLog:

* mt-loongarch-mlib: New file.  Pass -fmultiflags when building
target libraries (FLAGS_FOR_TARGET).
* mt-loongarch-elf: New file.
* mt-loongarch-gnu: New file.

gcc/ChangeLog:

* config.gcc: Pass the default ABI via TM_MULTILIB_CONFIG.
* config/loongarch/loongarch-driver.h: Invoke MLIB_SELF_SPECS
before the driver canonicalization routines.
* config/loongarch/loongarch.h: Move definitions of CC1_SPEC etc.
to loongarch-driver.h
* config/loongarch/t-linux: Move multilib-related definitions to
t-multilib.
* config/loongarch/t-multilib: New file.  Inject library build
options obtained from --with-multilib-list.
* config/loongarch/t-loongarch: Same.

9 months agoRISC-V: Support combine extend and reduce sum to widen reduce sum
Lehua Ding [Thu, 14 Sep 2023 15:35:42 +0000 (23:35 +0800)] 
RISC-V: Support combine extend and reduce sum to widen reduce sum

This patch add combine pattern to combine extend and reduce sum
to widen reduce sum. The pattern in autovec.md was adjusted as
needed. Note that the current vectorization cannot generate reduce
operand which is LMUL=M8, because this means that we need an LMUL=M16
for the extended operand, which is currently not possible. So I've
added VI_QHS_NO_M8 and VF_HS_NO_M8 mode iterator, which exclude
mode which is LMUL=M8.

PR target/111381

gcc/ChangeLog:

* config/riscv/autovec-opt.md (*reduc_plus_scal_<mode>):
New combine pattern.
(*fold_left_widen_plus_<mode>): Ditto.
(*mask_len_fold_left_widen_plus_<mode>): Ditto.
* config/riscv/autovec.md (reduc_plus_scal_<mode>):
Change from define_expand to define_insn_and_split.
(fold_left_plus_<mode>): Ditto.
(mask_len_fold_left_plus_<mode>): Ditto.
* config/riscv/riscv-v.cc (expand_reduction):
Support widen reduction.
* config/riscv/vector-iterators.md (UNSPEC_WREDUC_SUM):
Add new iterators and attrs.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/widen/widen_reduc-1.c: New test.
* gcc.target/riscv/rvv/autovec/widen/widen_reduc_order-1.c: New test.
* gcc.target/riscv/rvv/autovec/widen/widen_reduc_order-2.c: New test.
* gcc.target/riscv/rvv/autovec/widen/widen_reduc_order_run-1.c: New test.
* gcc.target/riscv/rvv/autovec/widen/widen_reduc_order_run-2.c: New test.
* gcc.target/riscv/rvv/autovec/widen/widen_reduc_run-1.c: New test.

9 months agoDaily bump.
GCC Administrator [Fri, 15 Sep 2023 00:18:10 +0000 (00:18 +0000)] 
Daily bump.

9 months agodiagnostics: support multithreaded diagnostic paths
David Malcolm [Thu, 14 Sep 2023 20:28:45 +0000 (16:28 -0400)] 
diagnostics: support multithreaded diagnostic paths

This patch extends the existing diagnostic_path class so that as well
as list of events, there is a list of named threads, with each event
being associated with one of the threads.

No GCC diagnostics take advantage of this, but GCC plugins may find a
use for this; an example is provided in the testsuite.

Given that there is still a single list of events within a
diagnostic_path, the events in a diagnostic_path have a specific global
ordering even if they are in multiple threads.

Within the SARIF serialization, the patch adds the "executionOrder"
property to threadFlowLocation objects (SARIF v2.1.0 3.38.11).  This is
1-based in order to match the human-readable numbering of events shown
in messages emitted by pretty-printer.cc's "%@".

With -fdiagnostics-path-format=separate-events, the threads are not
shown.

With -fdiagnostics-path-format=inline-events, the threads and the
per-thread stack activity are tracked and visalized separately.  An
example can be seen in the testsuite.

gcc/analyzer/ChangeLog:
* checker-event.h (checker_event::get_thread_id): New.
* checker-path.h (class checker_path): Implement thread-related
vfuncs via a single simple_diagnostic_thread instance named
"main".

gcc/ChangeLog:
* diagnostic-event-id.h (diagnostic_thread_id_t): New typedef.
* diagnostic-format-sarif.cc (class sarif_thread_flow): New.
(sarif_thread_flow::sarif_thread_flow): New.
(sarif_builder::make_code_flow_object): Reimplement, creating
per-thread threadFlow objects, populating them with the relevant
events.
(sarif_builder::make_thread_flow_object): Delete, moving the
code into sarif_builder::make_code_flow_object.
(sarif_builder::make_thread_flow_location_object): Add
"path_event_idx" param.  Use it to set "executionOrder"
property.
* diagnostic-path.h (diagnostic_event::get_thread_id): New
pure-virtual vfunc.
(class diagnostic_thread): New.
(diagnostic_path::num_threads): New pure-virtual vfunc.
(diagnostic_path::get_thread):  New pure-virtual vfunc.
(diagnostic_path::multithreaded_p): New decl.
(simple_diagnostic_event::simple_diagnostic_event): Add optional
thread_id param.
(simple_diagnostic_event::get_thread_id): New accessor.
(simple_diagnostic_event::m_thread_id): New.
(class simple_diagnostic_thread): New.
(simple_diagnostic_path::simple_diagnostic_path): Move definition
to diagnostic.cc.
(simple_diagnostic_path::num_threads): New.
(simple_diagnostic_path::get_thread): New.
(simple_diagnostic_path::add_thread): New.
(simple_diagnostic_path::add_thread_event): New.
(simple_diagnostic_path::m_threads): New.
* diagnostic-show-locus.cc (layout::layout): Add pretty_printer
param for overriding the context's printer.
(diagnostic_show_locus): Likwise.
* diagnostic.cc (simple_diagnostic_path::simple_diagnostic_path):
Move here from diagnostic-path.h.  Add main thread.
(simple_diagnostic_path::num_threads): New.
(simple_diagnostic_path::get_thread): New.
(simple_diagnostic_path::add_thread): New.
(simple_diagnostic_path::add_thread_event): New.
(simple_diagnostic_event::simple_diagnostic_event): Add thread_id
param and use it to initialize m_thread_id.  Reformat.
* diagnostic.h: Add pretty_printer param for overriding the
context's printer.
* tree-diagnostic-path.cc: Add #define INCLUDE_VECTOR.
(can_consolidate_events): Compare thread ids.
(class per_thread_summary): New.
(event_range::event_range): Add per_thread_summary arg.
(event_range::print): Add "pp" param and use it rather than dc's
printer.
(event_range::m_thread_id): New field.
(event_range::m_per_thread_summary): New field.
(path_summary::multithreaded_p): New.
(path_summary::get_events_for_thread_id): New.
(path_summary::m_per_thread_summary): New field.
(path_summary::m_thread_id_to_events): New field.
(path_summary::get_or_create_events_for_thread_id): New.
(path_summary::path_summary): Create per_thread_summary instances
as needed and associate the event_range instances with them.
(base_indent): Move here from print_path_summary_as_text.
(per_frame_indent): Likewise.
(class thread_event_printer): New, adapted from parts of
print_path_summary_as_text.
(print_path_summary_as_text): Make static.  Reimplement to
moving most of existing code to class thread_event_printer,
capturing state as per-thread as appropriate.
(default_tree_diagnostic_path_printer): Add missing 'break' on
final case.

gcc/testsuite/ChangeLog:
* gcc.dg/plugin/diagnostic-test-paths-multithreaded-inline-events.c:
New test.
* gcc.dg/plugin/diagnostic-test-paths-multithreaded-sarif.c: New
test.
* gcc.dg/plugin/diagnostic-test-paths-multithreaded-separate-events.c:
New test.
* gcc.dg/plugin/diagnostic_plugin_test_paths.c: Add support for
generating multithreaded paths.
* gcc.dg/plugin/plugin.exp: Add the new tests.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
9 months agoanalyzer: fix missing return in compatible_epath_p
David Malcolm [Thu, 14 Sep 2023 20:28:45 +0000 (16:28 -0400)] 
analyzer: fix missing return in compatible_epath_p

gcc/analyzer/ChangeLog:
* diagnostic-manager.cc (compatible_epath_p): Fix missing return.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
9 months agoanalyzer: use unique_ptr for rejected_constraint
David Malcolm [Thu, 14 Sep 2023 20:28:44 +0000 (16:28 -0400)] 
analyzer: use unique_ptr for rejected_constraint

gcc/analyzer/ChangeLog:
* diagnostic-manager.cc (process_worklist_item): Use
std::unique_ptr rather than plain rejected_constraint *.
* engine.cc (exploded_path::feasible_p): Likewise.
(feasibility_state::maybe_update_for_edge): Likewise.
* exploded-graph.h (feasibility_problem::feasibility_problem):
Likewise.
(feasibility_problem::~feasibility_problem): Delete.
(feasibility_problem::m_rc): Use std::unique_ptr.
(feasibility_state::maybe_update_for_edge): Likewise.
* feasible-graph.cc (feasible_graph::add_feasibility_problem):
Likewise.
* feasible-graph.h (class infeasible_node): Likewise.
(feasible_graph::add_feasibility_problem): Likewise.
* region-model.cc (region_model::add_constraint): Likewise.
(region_model::maybe_update_for_edge): Likewise.
(region_model::apply_constraints_for_gcond): Likewise.
(region_model::apply_constraints_for_gswitch): Likewise.
(region_model::apply_constraints_for_exception): Likewise.
* region-model.h (class region_model): Likewise for decls.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
9 months agoggc, jit: forcibly clear GTY roots in jit
David Malcolm [Thu, 14 Sep 2023 20:28:44 +0000 (16:28 -0400)] 
ggc, jit: forcibly clear GTY roots in jit

As part of Antoyo's work on supporting LTO in rustc_codegen_gcc, he
noticed an ICE inside libgccjit when compiling certain rust files.

Debugging libgccjit showed that outdated information from a previous
in-memory compile was referring to ad-hoc locations in the previous
compile's line_table.

The issue turned out to be the function decls in internal_fn_fnspec_array
from the previous compile keeping alive the symtab nodes for these
functions, and from this finding other functions in the previous
compile, walking their CFGs, and finding ad-hoc data pointers in an edge
with a location_t using ad-hoc data from the previous line_table
instance, and thus a use-after-free ICE attempting to use this ad-hoc
data.

Previously in toplev::finalize we've fixed global state "piecemeal" by
calling out to individual source_name_cc_finalize functions.  However,
it occurred to me that we have run-time information on where the
GTY-marked pointers are.

Hence this patch takes something of a "big hammer" approach by adding a
new ggc_common_finalize that walks the GC roots, zeroing all of the
pointers.  I stepped through this in the debugger and observed that, in
particular, this correctly zeroes the internal_fn_fnspec_array at the end
of a libgccjit compile.  Antoyo reports that this fixes the ICE for him.
Doing so uncovered an ICE with libgccjit in dwarf2cfi.cc due to reuse of
global variables from the previous compile, which this patch also fixes.

I noticed that in ggc_mark_roots when clearing deletable roots we only
clear the initial element in each gcc_root_tab_t.  This looks like a
latent bug to me, which the patch fixes.  That said, there don't seem to
be any deletable roots where the number of elements != 1.

gcc/ChangeLog:
* dwarf2cfi.cc (dwarf2cfi_cc_finalize): New.
* dwarf2out.h (dwarf2cfi_cc_finalize): New decl.
* ggc-common.cc (ggc_mark_roots): Multiply by rti->nelt when
clearing the deletable gcc_root_tab_t.
(ggc_common_finalize): New.
* ggc.h (ggc_common_finalize): New decl.
* toplev.cc (toplev::finalize): Call dwarf2cfi_cc_finalize and
ggc_common_finalize.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
9 months agomodula2: Add missing comments to M2CaseList.mod and add testcases
Gaius Mulley [Thu, 14 Sep 2023 20:00:45 +0000 (21:00 +0100)] 
modula2: Add missing comments to M2CaseList.mod and add testcases

This patch adds procedure block comments to M2CaseList.mod, changes
date values to use unique digits and add a new test case.

gcc/m2/ChangeLog:

* gm2-compiler/M2CaseList.mod (NewRanges): Add block
comment.
(NewSet): Add block comment.
(DisplayRanges): Add block comment.
(IncludeElement): Add block comment.
(IncludeElements): Add block comment.
(appendString): Add block comment.
(appendEnum): Add block comment.
(appendTree): Add block comment.
(SubrangeErrors): Add block comment.

gcc/testsuite/ChangeLog:

* gm2/switches/case/fail/subrangecase.mod: Replace 19
with 17.
* gm2/switches/case/fail/subrangecase2.mod: Ditto.
* gm2/switches/case/fail/subrangecase3.mod: Ditto.
* gm2/switches/case/fail/subrangecase4.mod: Ditto.
* gm2/switches/case/pass/subrangecase.mod: Ditto.
* gm2/switches/case/pass/subrangecase2.mod: Ditto.
* gm2/switches/case/pass/subrangecase3.mod: Ditto.
* gm2/switches/case/pass/subrangecase4.mod: Ditto.
* gm2/switches/case/fail/calendar.mod: New test.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
9 months agogcc: xtensa: use salt/saltu in xtensa_expand_scc
Max Filippov [Thu, 7 Sep 2023 03:13:22 +0000 (20:13 -0700)] 
gcc: xtensa: use salt/saltu in xtensa_expand_scc

gcc/
* config/xtensa/predicates.md (xtensa_cstoresi_operator): Add
unsigned comparisons.
* config/xtensa/xtensa.cc (xtensa_expand_scc): Add code
generation of salt/saltu instructions.
* config/xtensa/xtensa.h (TARGET_SALT): New macro.
* config/xtensa/xtensa.md (salt, saltu): New instruction
patterns.

9 months agomodula2: introduce case checking when switching on subranges
Gaius Mulley [Thu, 14 Sep 2023 18:35:24 +0000 (19:35 +0100)] 
modula2: introduce case checking when switching on subranges

This patch extends the -Wcase-enum warning to catch missing elements
from subranges.  The patch also includes removal of unused parameters
from M2SymInit.mod and M2CaseList.mod.

gcc/m2/ChangeLog:

* gm2-compiler/M2CaseList.mod (appendString): New procedure.
(appendEnum): Re-implement.
(NoOfSetElements): New procedure function.
(isPrintableChar): New procedure function.
(appendTree): New procedure.
(SubrangeErrors): New procedure.
(EmitMissingRangeErrors): Call SubrangeErrors if appropriate.
* gm2-compiler/M2SymInit.mod (SetFieldInitializedNo): Avoid
using a temporary variable once.
(IsLocalVar): Comment out.
(RecordContainsVarient): Remove fieldtype.
(GenerateNoteFlow): Remove lst parameter.
(CheckDeferredRecordAccess): Remove lst parameter.
(CheckUnary): Remove lst parameter.  Remove procSym.
(CheckBinary): Remove lst parameter.  Remove procSym.
(CheckIndrX): Remove lst parameter.  Remove procSym.
(CheckXIndr): Remove bblst and procSym parameters.
(CheckRecordField): Remove procSym, op1tok, op2tok and op2.
(CheckBecomes): Remove procSym and bblst.
(CheckComparison): Remove procSym and bblst.
(CheckAddr): Remove procSym parameter.
* gm2-gcc/m2expr.cc (m2expr_CSTIntToString): New function.
(m2expr_CSTIntToChar): New function.
* gm2-gcc/m2expr.def (CSTIntToString): New procedure function
declaration.
(CSTIntToChar): New procedure function declaration.
* gm2-gcc/m2expr.h (m2expr_CSTIntToChar): New prototype.
(m2expr_CSTIntToString): New prototype.

gcc/testsuite/ChangeLog:

* gm2/switches/case/fail/subrangecase.mod: New test.
* gm2/switches/case/fail/subrangecase2.mod: New test.
* gm2/switches/case/fail/subrangecase3.mod: New test.
* gm2/switches/case/fail/subrangecase4.mod: New test.
* gm2/switches/case/fail/subrangecase5.mod: New test.
* gm2/switches/case/fail/subrangecase6.mod: New test.
* gm2/switches/case/pass/subrangecase.mod: New test.
* gm2/switches/case/pass/subrangecase2.mod: New test.
* gm2/switches/case/pass/subrangecase3.mod: New test.
* gm2/switches/case/pass/subrangecase4.mod: New test.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
9 months ago[RA]: Improve cost calculation of pseudos with equivalences
Vladimir N. Makarov [Thu, 14 Sep 2023 14:26:48 +0000 (10:26 -0400)] 
[RA]: Improve cost calculation of pseudos with equivalences

RISCV target developers reported that RA can spill pseudo used in a
loop although there are enough registers to assign.  It happens when
the pseudo has an equivalence outside the loop and the equivalence is
not merged into insns using the pseudo.  IRA sets up that memory cost
to zero when the pseudo has an equivalence and it means that the
pseudo will be probably spilled.  This approach worked well for i686
(different approaches were benchmarked long time ago on spec2k).
Although common sense says that the code is wrong and this was
confirmed by RISCV developers.

I've tried the following patch on I7-9700k and it improved spec17 fp
by 1.5% (21.1 vs 20.8) although spec17 int is a bit worse by 0.45%
(8.54 vs 8.58).  The average generated code size is practically the
same (0.001% difference).

In the future we probably need to try more sophisticated cost
calculation which should take into account that the equiv can not be
combined in usage insns and the costs of reloads because of this.

gcc/ChangeLog:

* ira-costs.cc (find_costs_and_classes): Decrease memory cost
by equiv savings.

9 months agoRISC-V: Refactor vector reduction patterns
Lehua Ding [Wed, 13 Sep 2023 06:59:40 +0000 (14:59 +0800)] 
RISC-V: Refactor vector reduction patterns

This patch adjust reduction patterns struct, change it from:
           (any_reduc:VI
             (vec_duplicate:VI
               (vec_select:<VEL>
                 (match_operand:<V_LMUL1> 4 "register_operand"      "   vr,   vr")
                 (parallel [(const_int 0)])))
             (match_operand:VI           3 "register_operand"      "   vr,   vr"))
to:
           (unspec:<V_LMUL1> [
             (match_operand:VI            3 "register_operand"      "   vr,   vr")
             (match_operand:<V_LMUL1>     4 "register_operand"      "   vr,   vr")
           ] ANY_REDUC)

The reason for the change is that the semantics of the previous pattern is incorrect.
GCC does not have a standard rtx code to express the reduction calculation process.
It makes more sense to use UNSPEC.

Further, all reduction icode are geted by the UNSPEC and MODE (code_for_pred (unspec, mode)),
so that all reduction patterns can have a uniform icode name. After this adjust, widen_reducop
and widen_freducop are redundant.

gcc/ChangeLog:

* config/riscv/autovec.md: Change rtx code to unspec.
* config/riscv/riscv-protos.h (expand_reduction): Change prototype.
* config/riscv/riscv-v.cc (expand_reduction): Change prototype.
* config/riscv/riscv-vector-builtins-bases.cc (class widen_reducop):
Removed.
(class widen_freducop): Removed.
* config/riscv/vector-iterators.md (minu): Add reduc unspec, iterators, attrs.
* config/riscv/vector.md (@pred_reduc_<reduc><mode>): Change name.
(@pred_<reduc_op><mode>): New name.
(@pred_widen_reduc_plus<v_su><mode>): Change name.
(@pred_reduc_plus<order><mode>): Change name.
(@pred_widen_reduc_plus<order><mode>): Change name.

9 months agoRISC-V: Cleanup redundant reduction patterns after refactor vector mode
Lehua Ding [Wed, 13 Sep 2023 05:07:40 +0000 (13:07 +0800)] 
RISC-V: Cleanup redundant reduction patterns after refactor vector mode

This patch cleanups redundant reduction patterns after Juzhe change vector mode
from fixed-size to scalable-size. For example, whether it is zvl32b, zvl64b,
zvl128b, RVVM1SI indicates that it occupies a vector register. Therefore, it is
easy to map vector modes to LMUL1 vector modes with define_mode_attr without
creating a separate pattern for each LMUL1 Mode. For example, this patch can
combine four patterns (@pred_reduc_<reduc><VQI:mode><VQI_LMUL1:mode>,
@pred_reduc_<reduc><VHI:mode><VHI_LMUL1:mode>
@pred_reduc_<reduc><VSI:mode><VSI_LMUL1:mode>,
@pred_reduc_<reduc><VDI:mode><VDI_LMUL1:mode>) to a single pattern
@pred_reduc_<reduc><mode>.

gcc/ChangeLog:

* config/riscv/riscv-v.cc (expand_reduction): Adjust call.
* config/riscv/riscv-vector-builtins-bases.cc: Adjust call.
* config/riscv/vector-iterators.md: New iterators and attrs.
* config/riscv/vector.md (@pred_reduc_<reduc><VQI:mode><VQI_LMUL1:mode>):
Removed.
(@pred_reduc_<reduc><VHI:mode><VHI_LMUL1:mode>): Removed.
(@pred_reduc_<reduc><VSI:mode><VSI_LMUL1:mode>): Removed.
(@pred_reduc_<reduc><VDI:mode><VDI_LMUL1:mode>): Removed.
(@pred_reduc_<reduc><mode>): Added.
(@pred_widen_reduc_plus<v_su><VQI:mode><VHI_LMUL1:mode>): Removed.
(@pred_widen_reduc_plus<v_su><VHI:mode><VSI_LMUL1:mode>): Removed.
(@pred_widen_reduc_plus<v_su><mode>): Added.
(@pred_widen_reduc_plus<v_su><VSI:mode><VDI_LMUL1:mode>): Removed.
(@pred_reduc_<reduc><VHF:mode><VHF_LMUL1:mode>): Removed.
(@pred_reduc_<reduc><VSF:mode><VSF_LMUL1:mode>): Removed.
(@pred_reduc_<reduc><VDF:mode><VDF_LMUL1:mode>): Removed.
(@pred_reduc_plus<order><VHF:mode><VHF_LMUL1:mode>): Removed.
(@pred_reduc_plus<order><VSF:mode><VSF_LMUL1:mode>): Removed.
(@pred_reduc_plus<order><mode>): Added.
(@pred_reduc_plus<order><VDF:mode><VDF_LMUL1:mode>): Removed.
(@pred_widen_reduc_plus<order><VHF:mode><VSF_LMUL1:mode>): Removed.
(@pred_widen_reduc_plus<order><VSF:mode><VDF_LMUL1:mode>): Removed.
(@pred_widen_reduc_plus<order><mode>): Added.

9 months agoaarch64: Restore SVE WHILE costing
Richard Sandiford [Thu, 14 Sep 2023 14:37:41 +0000 (15:37 +0100)] 
aarch64: Restore SVE WHILE costing

AArch64 previously costed WHILELO instructions on the first call
to add_stmt_cost.  This was because, at the time, only add_stmt_cost
had access to the loop_vec_info.

However, after the AVX512 changes, we only calculate the masks later.
This patch moves the WHILELO costing to finish_cost, which is in any
case a more logical place for it to be.  It also means that we can
check the final decision about whether to use predicated loops.

gcc/
* config/aarch64/aarch64.cc (aarch64_vector_costs::analyze_loop_info):
Move WHILELO handling to...
(aarch64_vector_costs::finish_cost): ...here.  Check whether the
vectorizer has decided to use a predicated loop.

gcc/testsuite/
* gcc.target/aarch64/sve/cost_model_15.c: New test.

9 months agoMATCH: Support `(a != (CST+1)) & (a > CST)` optimizations
Andrew Pinski [Wed, 13 Sep 2023 23:50:33 +0000 (16:50 -0700)] 
MATCH: Support `(a != (CST+1)) & (a > CST)` optimizations

Even though this is done via reassocation, match can support
these with a simple change to detect that the difference is just
one. This allows to optimize these earlier and even during phiopt
for an example.

This patch adds the following cases:
(a != (CST+1)) & (a > CST) -> a > (CST+1)
(a != (CST-1)) & (a < CST) -> a < (CST-1)
(a == (CST-1)) | (a >= CST) -> a >= (CST-1)
(a == (CST+1)) | (a <= CST) -> a <= (CST+1)

Canonicalizations of comparisons causes this case to show up more.

OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

PR tree-optimization/106164

gcc/ChangeLog:

* match.pd (`(X CMP1 CST1) AND/IOR (X CMP2 CST2)`):
Expand to support constants that are off by one.

gcc/testsuite/ChangeLog:

* gcc.dg/pr21643.c: Update test now that match does
the combing of the comparisons.
* gcc.dg/tree-ssa/cmpbit-5.c: New test.
* gcc.dg/tree-ssa/phi-opt-35.c: New test.

9 months agoImprove error message for if with an else part while in switch
Andrew Pinski [Wed, 12 Jul 2023 05:14:18 +0000 (22:14 -0700)] 
Improve error message for if with an else part while in switch

While writing some match.pd code, I was trying to figure
out why I was getting an `expected ), got (` error message
while writing an if statement with an else clause. For switch
statements, the if statements cannot have an else clause so
it would be better to have a decent error message saying that
explictly.

OK? Bootstrapped and tested on x86_64-linux-gnu.

gcc/ChangeLog:

* genmatch.cc (parser::parse_result): For an else clause
of an if statement inside a switch, error out explictly.

9 months agoRISC-V: Support VLS modes mask operations
Juzhe-Zhong [Thu, 14 Sep 2023 12:43:58 +0000 (20:43 +0800)] 
RISC-V: Support VLS modes mask operations

This patch support mask operations (comparison and logical).

This patch reduce these FAILs of "vect" testsuite:
FAIL: gcc.dg/vect/vect-bic-bitmask-12.c -flto -ffat-lto-objects  scan-tree-dump dce7 "<=\\s*.+{ 255,.+}"
FAIL: gcc.dg/vect/vect-bic-bitmask-12.c scan-tree-dump dce7 "<=\\s*.+{ 255,.+}"
FAIL: gcc.dg/vect/vect-bic-bitmask-23.c -flto -ffat-lto-objects  scan-tree-dump dce7 "<=\\s*.+{ 255, 15, 1, 65535 }"
FAIL: gcc.dg/vect/vect-bic-bitmask-23.c scan-tree-dump dce7 "<=\\s*.+{ 255, 15, 1, 65535 }"

Full regression passed (with reducing 4 FAILs).

gcc/ChangeLog:

* config/riscv/autovec-opt.md: Add VLS mask modes.
* config/riscv/autovec.md (@vcond_mask_<mode><vm>): Remove @.
(vcond_mask_<mode><vm>): Add VLS mask modes.
* config/riscv/vector.md: Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/vls/def.h: Add VLS tests.
* gcc.target/riscv/rvv/autovec/vls/cmp-1.c: New test.
* gcc.target/riscv/rvv/autovec/vls/cmp-2.c: New test.
* gcc.target/riscv/rvv/autovec/vls/cmp-3.c: New test.
* gcc.target/riscv/rvv/autovec/vls/cmp-4.c: New test.
* gcc.target/riscv/rvv/autovec/vls/cmp-5.c: New test.
* gcc.target/riscv/rvv/autovec/vls/cmp-6.c: New test.
* gcc.target/riscv/rvv/autovec/vls/mask-1.c: New test.
* gcc.target/riscv/rvv/autovec/vls/mask-2.c: New test.
* gcc.target/riscv/rvv/autovec/vls/mask-3.c: New test.

9 months agolibstdc++: Add testcase for std::make_integer_sequence bug [PR111357]
Jonathan Wakely [Thu, 14 Sep 2023 08:18:34 +0000 (09:18 +0100)] 
libstdc++: Add testcase for std::make_integer_sequence bug [PR111357]

The compiler bug has been fixed on trunk, but this adds a regression test
for the library component.

libstdc++-v3/ChangeLog:

PR c++/111357
* testsuite/20_util/integer_sequence/pr111357.cc: New test.

9 months agolibstdc++: Support dg-additional-files in tests
Jonathan Wakely [Wed, 13 Sep 2023 09:57:08 +0000 (10:57 +0100)] 
libstdc++: Support dg-additional-files in tests

Some tests rely on text files with specific content being present in the
test directory.  This has historically been done by copying
testsuite/data/*.tst and testsuite/data/*.txt to the test dir at the
start, in the libstdc++_init procedure.  Some tests modify their data
files, so if the same test runs more than once in the same directory the
second and subsequent tests will see the modified files, and FAIL
because the content of the file is not in the expected state.

This change adds support for the dg-additional-files directive from the
main compiler testsuite and changes v3_target_compile to copy the
specified files to the directory where the test will run.  This ensures
that a fresh copy of the files is present each time the test runs.

Eventually all tests could be transitioned to use dg-additional-files
and then libstdc++_init could be changed to remove the initial copy of
all files.  This change only adds dg-additional-files to the tests that
modify their files and FAIL when re-run in the same directory.

The tests that rely on additional data files have comments containing
the strings "@require@" and "@diff@" which seem to be related to the
libstdc++-v3/mkcheck.in testing script that was removed in 2003.  Those
comments can be used to find tests that should be migrated to use the
new dg-additional-files support, and then the comments can be removed.

libstdc++-v3/ChangeLog:

* testsuite/27_io/basic_filebuf/seekoff/char/1-io.cc: Use
dg-additional-files. Remove @require@ and @diff@ comments.
* testsuite/27_io/basic_filebuf/seekoff/char/2-io.cc: Likewise.
* testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc: Likewise.
* testsuite/27_io/basic_filebuf/seekpos/char/2-io.cc: Likewise.
* testsuite/lib/dg-options.exp (v3_additional_files): New
global variable.
(dg-additional-files): New proc.
* testsuite/lib/libstdc++.exp (v3_target_compile): Copy
additional files to test directory.

9 months agolibstdc++: Remove some more unconditional uses of atomics
Jonathan Wakely [Tue, 12 Sep 2023 11:04:37 +0000 (12:04 +0100)] 
libstdc++: Remove some more unconditional uses of atomics

These atomics cause linker errors on arm4t where __sync_synchronize is
not defined. For single-threaded targets we don't need the atomics.

libstdc++-v3/ChangeLog:

* include/experimental/io_context (io_context) [!_GLIBCXX_HAS_GTHREADS]:
Use a plain integer for _M_work_count for single-threaded
targets.
* include/experimental/memory_resource (__get_default_resource)
[!_GLIBCXX_HAS_GTHREADS]: Use unsynchronized type for
single-threaded targets.
* src/c++17/default_resource.h: Adjust preprocessor conditions
to match memory_resource.cc.
* src/c++17/memory_resource.cc [!_GLIBCXX_HAS_GTHREADS]
(atomic_mem_res): Use unsynchronized type for single-threaded
targets.

9 months agoada: Improve detection of deactivated code for warnings with -gnatwt
Yannick Moy [Fri, 4 Aug 2023 13:01:28 +0000 (15:01 +0200)] 
ada: Improve detection of deactivated code for warnings with -gnatwt

Switch -gnatwt is used in GNAT to track deleted code. It can be emitted
by GNAT on code that is intentionally deactivated for a given configuration.
The current test to suppress spurious warnings is not complex enough to
detect all such cases. Now improved, by using the same test as used in
GNATprove to suppress warnings related to a "statically disabled condition
which evaluates to a given value", as described in SPARK UG 7.3.2.

gcc/ada/

* exp_util.adb (Is_Statically_Disabled): New function to detect a
"statically disabled condition which evaluates to a given value",
as described in SPARK UG 7.3.2.
(Kill_Dead_Code): Call the new function Is_Statically_Disabled for
conditions of if statements.
* exp_util.ads (Is_Statically_Disabled): New function spec.

9 months agoada: Assertion failure on expansion of record with invariant
Javier Miranda [Wed, 30 Aug 2023 19:19:13 +0000 (19:19 +0000)] 
ada: Assertion failure on expansion of record with invariant

gcc/ada/

* exp_util.adb (Process_Record_Component): Adjust assertion on the
availablity of the invariant procedure; required because the
invariant procedure is built by the expander, and hence it is not
available compiling generic units or when the sources have errors,
since expansion is then disabled.

9 months agoada: Assertion failure on calculation of Large_Max_Size_Mutable
Javier Miranda [Mon, 28 Aug 2023 19:14:39 +0000 (19:14 +0000)] 
ada: Assertion failure on calculation of Large_Max_Size_Mutable

gcc/ada/

* sem_util.adb (Large_Max_Size_Mutable): Protect access to
attribute Is_Array_Type.

9 months agoada: Assertion failure on for-of loop iterating on selected component
Javier Miranda [Mon, 28 Aug 2023 18:32:18 +0000 (18:32 +0000)] 
ada: Assertion failure on for-of loop iterating on selected component

gcc/ada/

* sem_util.adb (Is_Dependent_Component_Of_Mutable_Object): Protect
access to Entity attribute and add missing code to check function
selector in a prefix form call.

9 months agoada: Fix late finalization for function call in delta aggregate
Eric Botcazou [Sun, 27 Aug 2023 07:34:59 +0000 (09:34 +0200)] 
ada: Fix late finalization for function call in delta aggregate

The problem occurs at library level because the temporary created for the
function call lives in the elaboration routine but is finalized only when
the package itself is.

It turns out that there is no need for this temporary, since the expansion
of delta aggregates already creates a (properly finalized) temporary.

gcc/ada/

* exp_ch6.adb (Expand_Ctrl_Function_Call): Also do nothing for the
expression of a delta aggregate.

9 months agoada: Fix premature finalization in loop over limited iterable container
Eric Botcazou [Fri, 25 Aug 2023 08:47:30 +0000 (10:47 +0200)] 
ada: Fix premature finalization in loop over limited iterable container

This happens when the iterable container is obtained as the result of a
call to a function that is a subprogram parameter of a generic construct.

gcc/ada/

* exp_util.adb (Initialized_By_Aliased_BIP_Func_Call): Make the name
matching more robust.

9 months agoada: Assertion failure adding extra formals to late overriding subp.
Javier Miranda [Thu, 24 Aug 2023 19:32:59 +0000 (19:32 +0000)] 
ada: Assertion failure adding extra formals to late overriding subp.

gcc/ada/

* sem_ch6.adb (Parent_Subprogram): Complete assertion.

9 months agotree-optimization/111294 - better DCE after forwprop
Richard Biener [Thu, 14 Sep 2023 07:31:23 +0000 (09:31 +0200)] 
tree-optimization/111294 - better DCE after forwprop

The following adds more aggressive DCE to forwprop to clean up dead
stmts when folding a stmt leaves some operands unused.  The patch
uses simple_dce_from_worklist for this purpose, queueing original
operands before substitution and folding, but only if we folded the
stmt.

This removes one dead stmt biasing threading costs in a later pass
but it doesn't resolve the optimization issue in the PR yet.

PR tree-optimization/111294
* tree-ssa-forwprop.cc (pass_forwprop::execute): Track
operands that eventually become dead and use simple_dce_from_worklist
to remove their definitions if they did so.

* gcc.dg/tree-ssa/evrp10.c: Adjust.
* gcc.dg/tree-ssa/evrp6.c: Likewise.
* gcc.dg/tree-ssa/forwprop-31.c: Likewise.
* gcc.dg/tree-ssa/neg-cast-3.c: Likewise.

9 months agoaarch64: Coerce addresses to be suitable for LD1RQ
Richard Sandiford [Thu, 14 Sep 2023 10:39:53 +0000 (11:39 +0100)] 
aarch64: Coerce addresses to be suitable for LD1RQ

In the following test:

  svuint8_t ld(uint8_t *ptr) { return svld1rq(svptrue_b8(), ptr + 2); }

ptr + 2 is a valid address for an Advanced SIMD load, but not for
an SVE load.  We therefore ended up generating:

        ldr     q0, [x0, 2]
        dup     z0.q, z0.q[0]

This patch makes us generate LD1RQ for that case too.  It takes the
slightly old-school approach of making the predicate broader than
the constraint.  That is: any valid memory address is accepted as
an operand before RA.  If the instruction remains during RA, LRA will
coerce the address to match the constraint.  If the instruction gets
split before RA, the splitter will load invalid addresses into a
scratch register.

gcc/
* config/aarch64/aarch64-sve.md (@aarch64_vec_duplicate_vq<mode>_le):
Accept all nonimmediate_operands, but keep the existing constraints.
If the instruction is split before RA, load invalid addresses into
a temporary register.
* config/aarch64/predicates.md (aarch64_sve_dup_ld1rq_operand): Delete.

gcc/testsuite/
* gcc.target/aarch64/sve/acle/general/ld1rq_1.c: New test.

9 months agolibstdc++: Add dg-require-thread-fence in several tests
Christophe Lyon [Thu, 14 Sep 2023 08:59:20 +0000 (08:59 +0000)] 
libstdc++: Add dg-require-thread-fence in several tests

Some targets like arm-eabi with newlib and default settings rely on
__sync_synchronize() to ensure synchronization.  Newlib does not
implement it by default, to make users aware they have to take special
care.

This makes a few tests fail to link.

This patch requires the missing thread-fence effective target in the
tests that need it, making them UNSUPPORTED instead of FAIL and
UNRESOLVED.

2023-09-10  Christophe Lyon  <christophe.lyon@linaro.org>

libstdc++-v3/
* testsuite/29_atomics/atomic/compare_exchange_padding.cc: Likewise.
* testsuite/29_atomics/atomic/cons/value_init.cc: Likewise.
* testsuite/29_atomics/atomic_float/value_init.cc: Likewise.
* testsuite/29_atomics/atomic_integral/cons/value_init.cc: Likewise.
* testsuite/29_atomics/atomic_ref/compare_exchange_padding.cc: Likewise.
* testsuite/29_atomics/atomic_ref/generic.cc: Likewise.
* testsuite/29_atomics/atomic_ref/integral.cc: Likewise.
* testsuite/29_atomics/atomic_ref/pointer.cc: Likewise.

9 months agoRISC-V: Fix ICE in get_avl_or_vl_reg
Juzhe-Zhong [Thu, 14 Sep 2023 07:52:13 +0000 (15:52 +0800)] 
RISC-V: Fix ICE in get_avl_or_vl_reg

update v1 -> v2: Add available fortran compiler check in rvv-fortran.exp.

This patch fix https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111395 ICE

update v2 -> v3: Remove redundant format.

PR target/111395

gcc/ChangeLog:

* config/riscv/riscv-vsetvl.cc (avl_info::operator==): Fix ICE.
(vector_insn_info::global_merge): Ditto.
(vector_insn_info::get_avl_or_vl_reg): Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/fortran/pr111395.f90: New test.
* gcc.target/riscv/rvv/rvv-fortran.exp: New test.

9 months agoRISC-V: Format VSETVL PASS code
Juzhe-Zhong [Thu, 14 Sep 2023 07:54:37 +0000 (15:54 +0800)] 
RISC-V: Format VSETVL PASS code

gcc/ChangeLog:

* config/riscv/riscv-vsetvl.cc (pass_vsetvl::global_eliminate_vsetvl_insn): Format it.

9 months agoLoongArch: Change the value of branch_cost from 2 to 6.
Lulu Cheng [Wed, 13 Sep 2023 03:01:34 +0000 (11:01 +0800)] 
LoongArch: Change the value of branch_cost from 2 to 6.

gcc/ChangeLog:

* config/loongarch/loongarch-def.c: Modify the default value of
branch_cost.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/cmov_ii.c: New test.

9 months agolibstdc++: Limit <stacktrace> synopsis test to normal namespace
François Dumont [Wed, 13 Sep 2023 20:23:30 +0000 (22:23 +0200)] 
libstdc++: Limit <stacktrace> synopsis test to normal namespace

libstdc++-v3/ChangeLog

* testsuite/19_diagnostics/stacktrace/synopsis.cc: Add
{ dg-require-normal-namespace "" }.

9 months agoxtensa: Optimize several boolean evaluations of EQ/NE against constant zero
Takayuki 'January June' Suwa [Fri, 8 Sep 2023 08:48:56 +0000 (17:48 +0900)] 
xtensa: Optimize several boolean evaluations of EQ/NE against constant zero

An idiomatic implementation of boolean evaluation of whether a register is
zero or not in Xtensa is to assign 0 and 1 to the temporary and destination,
and then issue the MOV[EQ/NE]Z machine instruction
(See 8.3.2 Instruction Idioms, Xtensa ISA refman., p.599):

;; A2 = (A3 != 0) ? 1 : 0;
movi.n a9, 1
movi.n a2, 0
movnez a2, a9, a3  ;; if (A3 != 0) A2 = A9;

As you can see in the above idiom, if the source and destination are the
same register, a move instruction from the source to another temporary
register must be prepended:

;; A2 = (A2 == 0) ? 1 : 0;
mov.n a10, a2
movi.n a9, 1
movi.n a2, 0
moveqz a2, a9, a10  ;; if (A10 == 0) A2 = A9;

Fortunately, we can reduce the number of instructions and temporary
registers with a few tweaks:

;; A2 = (A3 != 0) ? 1 : 0;
movi.n a2, 1
moveqz a2, a3, a3  ;; if (A3 == 0) A2 = A3;

;; A2 = (A2 != 0) ? 1 : 0;
movi.n a9, 1
movnez a2, a9, a2  ;; if (A2 != 0) A2 = A9;

;; A2 = (A3 == 0) ? 1 : 0;
movi.n a2, -1
        moveqz a2, a3, a3  ;; if (A3 == 0) A2 = A3;
        addi.n a2, a2, 1

;; A2 = (A2 == 0) ? 1 : 0;
movi.n a9, -1
movnez a2, a9, a2  ;; if (A2 != 0) A2 = A9;
addi.n a2, a2, 1

Additionally, if TARGET_NSA is configured, the fact that it returns 32 iff
the source of the NSAU machine instruction is 0, otherwise less than, can be
used in boolean evaluation of EQ comparison.

;; A2 = (A3 == 0) ? 1 : 0;
nsau a2, a3      ;; Source and destination can be the same register
srli a2, a2, 5

Furthermore, this patch also saves one instruction when determining whether
the ANDing with mask values in which 1s are lined up from the upper or lower
bit end (for example, 0xFFE00000 or 0x003FFFFF) is 0 or not.

gcc/ChangeLog:

* config/xtensa/xtensa.cc (xtensa_expand_scc):
Revert the changes from the last patch, as the work in the RTL
expansion pass is too far to determine the physical registers.
* config/xtensa/xtensa.md (*eqne_INT_MIN): Ditto.
(eq_zero_NSA, eqne_zero, *eqne_zero_masked_bits): New patterns.

9 months agoLoongArch: Fix bug of '<optab>di3_fake'.
Lulu Cheng [Mon, 11 Sep 2023 08:20:29 +0000 (16:20 +0800)] 
LoongArch: Fix bug of '<optab>di3_fake'.

PR target/111334

gcc/ChangeLog:

* config/loongarch/loongarch.md: Fix bug of '<optab>di3_fake'.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/pr111334.c: New test.

9 months agoLoongArch: Add tests for ASX vector xvssran/xvssrani/xvssrarn/xvssrarni instructions.
Xiaolong Chen [Wed, 13 Sep 2023 04:37:41 +0000 (12:37 +0800)] 
LoongArch: Add tests for ASX vector xvssran/xvssrani/xvssrarn/xvssrarni instructions.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/vector/lasx/lasx-xvssran.c: New test.
* gcc.target/loongarch/vector/lasx/lasx-xvssrani.c: New test.
* gcc.target/loongarch/vector/lasx/lasx-xvssrarn.c: New test.
* gcc.target/loongarch/vector/lasx/lasx-xvssrarni.c: New test.

9 months agoLoongArch: Add tests for ASX vector xvssrln/xvssrlni/xvssrlrn/xvssrlrni instructions.
Xiaolong Chen [Wed, 13 Sep 2023 04:35:41 +0000 (12:35 +0800)] 
LoongArch: Add tests for ASX vector xvssrln/xvssrlni/xvssrlrn/xvssrlrni instructions.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/vector/lasx/lasx-xvssrln.c: New test.
* gcc.target/loongarch/vector/lasx/lasx-xvssrlni.c: New test.
* gcc.target/loongarch/vector/lasx/lasx-xvssrlrn.c: New test.
* gcc.target/loongarch/vector/lasx/lasx-xvssrlrni.c: New test.