Commit Graph

208734 Commits

Author SHA1 Message Date
Iain Sandoe
ae061a1757 testsuite, ubsan: Add libstdc++ deps where required.
We use the ubsan tests from both C, C++, D and Fortran.
thee sanitizer libraries link to libstdc++.

When we are using the C/gdc/gfortran driver, and the target might
require a path to the libstdc++ (e.g. for handing -static-xxxx or
for embedded runpaths), we need to add a suitable option (or we get
fails at execution time because of the missing paths).

Conversely, we do not want to add multiple instances of these
paths (since that leads to failures on tools that report warnings
for duplicate runpaths).

This patch modifies the _init function to allow a sigle parameter
that determines whether the *asan_init should add a path for
libstdc++ (yes for C driver, no for C++ driver).
gcc/testsuite/ChangeLog:

	* g++.dg/ubsan/ubsan.exp:Add a parameter to init to say that
	we expect the C++ driver to provide paths for libstdc++.
	* gcc.dg/ubsan/ubsan.exp: Add a parameter to init to say that
	we need a path added for libstdc++.
	* gdc.dg/ubsan/ubsan.exp: Likewise.
	* gfortran.dg/ubsan/ubsan.exp: Likewise.
	* lib/ubsan-dg.exp: Handle a single parameter to init that
	requests addition of a path to libstdc++ to link flags.
2024-02-02 15:46:08 +00:00
Iain Sandoe
a6afa0d06b testsuite, asan, hwsan: Add libstdc++ deps where required.
We use the shared asan/hwasan rom both C,C++,D and Fortran.
The sanitizer libraries link to libstdc++.

When we are using the C/gdc/gfortran driver, and the target might
require a path to the libstdc++ (e.g. for handing -static-xxxx or
for embedded runpaths), we need to add a suitable option (or we get
fails at execution time because of the missing paths).

Conversely, we do not want to add multiple instances of these
paths (since that leads to failures on tools that report warnings
for duplicate runpaths).

This patch modifies the _init function to allow a single parameter
that determines whether the *asan_init should add a path for
libstdc++ (yes for C driver, no for C++ driver).

gcc/testsuite/ChangeLog:

	* g++.dg/asan/asan.exp: Add a parameter to init to say that
	we expect the C++ driver to provide paths for libstdc++.
	* g++.dg/hwasan/hwasan.exp: Likewise
	* gcc.dg/asan/asan.exp: Add a parameter to init to say that
	we need a path added for libstdc++.
	* gcc.dg/hwasan/hwasan.exp: Likewise.
	* gdc.dg/asan/asan.exp: Likewise.
	* gfortran.dg/asan/asan.exp: Likewise.
	* lib/asan-dg.exp: Handle a single parameter to init that
	requests addition of a path to libstdc++ to link flags.
	* lib/hwasan-dg.exp: Likewise.
2024-02-02 15:45:47 +00:00
Khem Raj
2c27aa8d75 [PATCH] libgcc: Include stdlib.h for abort() on mingw32
libgcc/
	* config/i386/enable-execute-stack-mingw32.c: Include
	stdlib.h for abort() definition.
2024-02-02 07:43:45 -07:00
Jonathan Wakely
6f75149488 libstdc++: Make std::function deduction guide support explicit object functions [PR113335]
This makes the deduction guides for std::function and std::packaged_task
work for explicit object member functions, i.e. "deducing this", as per
LWG 3617.

libstdc++-v3/ChangeLog:

	PR libstdc++/113335
	* include/bits/std_function.h (__function_guide_helper): Add
	partial specialization for explicit object member functions, as
	per LWG 3617.
	* testsuite/20_util/function/cons/deduction_c++23.cc: Check
	explicit object member functions.
	* testsuite/30_threads/packaged_task/cons/deduction_c++23.cc:
	Likewise.
2024-02-02 13:54:02 +00:00
Jonathan Wakely
f929293589 libstdc++: Fix experimental/names.cc failure on AIX
This fails due to "u" being used in a system header.

FAIL: experimental/names.cc  -std=gnu++17 (test for excess errors)
Excess errors:
/usr/include/sys/poll.h:77: error: expected unqualified-id before ';' token
/usr/include/sys/poll.h:77: error: expected ')' before ';' token

FAIL: experimental/names.cc  -std=gnu++17 (test for excess errors)
Excess errors:
/usr/include/sys/poll.h:102: error: expected unqualified-id before ';' token
/usr/include/sys/poll.h:102: error: expected ')' before ';' token

libstdc++-v3/ChangeLog:

	* testsuite/17_intro/names.cc [_AIX]: Undefine "u".
2024-02-02 13:54:02 +00:00
Jakub Jelinek
9f5caef53e libgcc: Export XF, TF, HF and BFmode specific _BitInt symbols from libgcc_s.so.1 [PR113700]
Rainer pointed out that __PFX__ and __FIXPTPFX__ prefix replacement is done
solely for libgcc-std.ver.in and not for the *.ver files in config.
I've used the __PFX__ prefix even in config/i386/libgcc-glibc.ver because it
was used for similar symbols in libgcc-std.ver.in, and that results in those
symbols being STB_LOCAL in libgcc_s.so.1.  Tests still work because gcc by
default uses -static-libgcc when linking (unlike g++ etc.), but would
have failed when using -shared-libgcc (but I see nothing in the testsuite
actually testing with -shared-libgcc, so am not adding tests).

With the patch, libgcc_s.so.1 now exports
__fixtfbitint@@GCC_14.0.0 FUNC GLOBAL DEFAULT
__fixxfbitint@@GCC_14.0.0 FUNC GLOBAL DEFAULT
__floatbitintbf@@GCC_14.0.0 FUNC GLOBAL DEFAULT
__floatbitinthf@@GCC_14.0.0 FUNC GLOBAL DEFAULT
__floatbitinttf@@GCC_14.0.0 FUNC GLOBAL DEFAULT
__floatbitintxf@@GCC_14.0.0 FUNC GLOBAL DEFAULT
on x86_64-linux which it wasn't before.

2024-02-02  Jakub Jelinek  <jakub@redhat.com>

	PR target/113700
	* config/i386/libgcc-glibc.ver (GCC_14.0.0): Remove __PFX prefixes
	from symbol names.
2024-02-02 11:46:34 +01:00
Jonathan Wakely
cc13e60ba7 doc: Fix typo in description of hardbool attribute
gcc/ChangeLog:

	* doc/extend.texi (Common Type Attributes): Fix typo in
	description of hardbool.
2024-02-02 10:30:35 +00:00
Jakub Jelinek
a049acabcb testsuite: Add another bitint testcase [PR113691]
This is fixed by the PR113692 patch.

2024-02-02  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/113691
	* gcc.dg/bitint-83.c: New test.
2024-02-02 11:30:06 +01:00
Jakub Jelinek
fb28d5cdae lower-bitint: Handle casts from large/huge _BitInt to pointer/reference types [PR113692]
I thought one needs to cast first to pointer-sized integer before casting to
pointer, but apparently that is not the case.
So the following patch arranges for the large/huge _BitInt to
pointer/reference conversions to use the same code as for conversions
of them to small integral types.

2024-02-02  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/113692
	* gimple-lower-bitint.cc (bitint_large_huge::lower_stmt): Handle casts
	from large/huge BITINT_TYPEs to POINTER_TYPE/REFERENCE_TYPE as
	final_cast_p.

	* gcc.dg/bitint-82.c: New test.
2024-02-02 11:30:06 +01:00
Jakub Jelinek
49e75666c5 lower-bitint: Handle uninitialized large/huge SSA_NAMEs as inline asm inputs [PR113699]
Similar problem to calls with uninitialized large/huge _BitInt SSA_NAME
arguments, var_to_partition will not work for those, but unlike calls
where we just create a new uninitialized SSA_NAME here we need to change
the inline asm input to be an uninitialized VAR_DECL.

2024-02-02  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/113699
	* gimple-lower-bitint.cc (bitint_large_huge::lower_asm): Handle
	uninitialized large/huge _BitInt SSA_NAME inputs.

	* gcc.dg/bitint-81.c: New test.
2024-02-02 11:30:05 +01:00
Jonathan Wakely
5b069117e2 libstdc++: Implement some missing functions for net::ip::network_v6
libstdc++-v3/ChangeLog:

	* include/experimental/internet (network_v6::network): Define.
	(network_v6::hosts): Finish implementing.
	(network_v6::to_string): Do not concatenate std::string to
	arbitrary std::basic_string specialization.
	* testsuite/experimental/net/internet/network/v6/cons.cc: New
	test.
2024-02-02 10:27:16 +00:00
Jonathan Wakely
a6286584e5 libstdc++: Fix invalid order in PSTL inplace_merge test [PR90276]
This looks like a typo in the upstream test that causes a failure in
debug mode. It has been reported upstream.

libstdc++-v3/ChangeLog:

	PR libstdc++/90276
	* testsuite/25_algorithms/pstl/alg_merge/inplace_merge.cc: Fix
	comparison function to use less-than instead of equality.
2024-02-02 10:27:16 +00:00
Jonathan Wakely
723a7c1ad2 libstdc++: Avoid reusing moved-from iterators in PSTL tests [PR90276]
The reverse_invoker utility for PSTL tests uses forwarding references for
all parameters, but some of those parameters get forwarded to move
constructors which then leave the objects in a moved-from state. When
the parameters are forwarded a second time that results in making new
copies of moved-from iterators.  For libstdc++ debug mode iterators, the
moved-from state is singular, which means copying them will abort at
runtime.

The fix is to make copies of iterator arguments instead of forwarding
them.

The callers of reverse_invoker::operator() also forward the iterators
multiple times, but that's OK because reverse_invoker accepts them by
forwarding reference but then breaks the chain of forwarding and copies
them as lvalues.

libstdc++-v3/ChangeLog:

	PR libstdc++/90276
	* testsuite/util/pstl/test_utils.h (reverse_invoker): Do not use
	perfect forwarding for iterator arguments.
2024-02-02 10:27:16 +00:00
Jakub Jelinek
a8f335ccb6 tree-ssa-math-opts: Fix is_widening_mult_rhs_p - unbreak bootstrap [PR113705]
On Tue, Jan 30, 2024 at 07:33:10AM -0000, Roger Sayle wrote:
+             wide_int bits = wide_int::from (tree_nonzero_bits (rhs),
+                                             prec,
+                                             TYPE_SIGN (TREE_TYPE (rhs)));
...
> +               if (gimple_assign_rhs_code (stmt) == BIT_AND_EXPR
> +                   && TREE_CODE (gimple_assign_rhs2 (stmt)) == INTEGER_CST
> +                   && wi::to_wide (gimple_assign_rhs2 (stmt))
> +                      == wi::mask (hprec, false, prec))

This change broke bootstrap on aarch64-linux.
The problem can be seen even on the reduced testcase.

The IL on the unreduced testcase before widening_mul has:
  # val_583 = PHI <val_26(13), val_164(40)>
...
  pretmp_266 = MEM[(const struct wide_int_storage *)&D.160657].len;
  _264 = pretmp_266 & 65535;
...
  _176 = (sizetype) val_583;
  _439 = (sizetype) _264;
  _284 = _439 * 8;
  _115 = _176 + _284;
where 583/266/264 have unsigned int type and 176/439/284/115 have sizetype.
widening_mul first turns that into:
  # val_583 = PHI <val_26(13), val_164(40)>
...
  pretmp_266 = MEM[(const struct wide_int_storage *)&D.160657].len;
  _264 = pretmp_266 & 65535;
...
  _176 = (sizetype) val_583;
  _439 = (sizetype) _264;
  _284 = _264 w* 8;
  _115 = _176 + _284;
and then is_widening_mult_rhs_p is called, with type sizetype (64-bit),
rhs _264, hprec 32 and prec 64.  Now tree_nonzero_bits (rhs) is
65535, so bits is 64-bit wide_int 65535, stmt is BIT_AND_EXPR,
but we ICE on the
wi::to_wide (gimple_assign_rhs2 (stmt)) == wi::mask (hprec, false, prec)
comparison because wi::to_wide on gimple_assign_rhs2 (stmt) - unsigned int
65535 gives 32-bit wide_int 65535, while wi::mask (hprec, false, prec)
gives 64-bit wide_int 0xffffffff and comparison between different precision
wide_ints is forbidden.

The following patch fixes it the same way how bits is computed earlier,
by calling wide_int::from on the wi::to_wide (gimple_assign_rhs2 (stmt)),
so we compare 64-bit 65535 with 64-bit 0xffffffff.

2024-02-02  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/113705
	* tree-ssa-math-opts.cc (is_widening_mult_rhs_p): Use wide_int_from
	around wi::to_wide in order to compare value in prec precision.

	* g++.dg/opt/pr113705.C: New test.
2024-02-02 11:26:43 +01:00
Rainer Orth
e5b14d956e testsuite: i386: Fix gcc.target/i386/pr71321.c on Solaris/x86
gcc.target/i386/pr71321.c FAILs on 64-bit Solaris/x86 with the native
assembler:

FAIL: gcc.target/i386/pr71321.c scan-assembler-not lea.*0

The problem is that /bin/as doesn't fully support cfi directives, so the
.eh_frame section is specified explicitly, which includes ".long 0".
The regular expression above includes ".*", which does multiline
matches.  AFAICS those aren't needed here.

This patch changes the RE not to use multiline patches.

Tested on i386-pc-solaris2.11 (as and gas) and i686-pc-linux-gnu.

2024-02-01  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	gcc/testsuite:
	* gcc.target/i386/pr71321.c (scan-assembler-not): Avoid multiline
	matches.
2024-02-02 11:25:45 +01:00
Jonathan Wakely
f60d7e1c64 libstdc++: Allow explicit conversion of string views with different traits
This was changed by LWG 3857.

libstdc++-v3/ChangeLog:

	* include/std/string_view (basic_string_view(R&&)): Remove
	constraint that traits_type must be the same, as per LWG 3857.
	* testsuite/21_strings/basic_string_view/cons/char/range_c++20.cc:
	Explicit conversion between different specializations should be
	allowed.
	* testsuite/21_strings/basic_string_view/cons/wchar_t/range_c++20.cc:
	Likewise.
2024-02-02 10:18:04 +00:00
Jonathan Wakely
67f5a8c802 libstdc++: Remove noexcept from std::osyncstream::operator=
This should not be noexcept because its _M_syncbuf member has a
potentially-throwing move assignment operator. The noexcept was removed
by LWG 3867.

libstdc++-v3/ChangeLog:

	* include/std/syncstream (basic_osyncstream::operator=): Remove
	noexcept, as per LWG 3867.
2024-02-02 10:18:04 +00:00
Jonathan Wakely
91adf2182a libstdc++: Remove noexcept from std::generator::promise_type::yield_value
This overload of std::generator::promise_type::yield_value calls things
which might throw, so should not be noexcept. The noexcept was remove by
LWG 3894.

libstdc++-v3/ChangeLog:

	* include/std/generator (promise_type::yield_value): Remove
	noexcept from fourth overload, as per LWG 3894.
2024-02-02 10:18:04 +00:00
Rainer Orth
a9e3818fdc testsuite: i386: Fix gcc.target/i386/sse2-stv-1.c on Solaris/x86
gcc.target/i386/sse2-stv-1.c FAILs on 32-bit Solaris/x86:

FAIL: gcc.target/i386/sse2-stv-1.c scan-assembler-not %[er]sp
FAIL: gcc.target/i386/sse2-stv-1.c scan-assembler-not shldl

The test assumes the Linux/x86 default of -mno-stackrealign, while
32-bit Solaris/x86 default to -mstackrealign.

Fixed by explicitly specifying -mno-stackrealign.

Tested on i386-pc-solaris2.11 and i686-pc-linux-gnu.

2024-02-01  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	gcc/testsuite:
	* gcc.target/i386/sse2-stv-1.c (dg-options): Add -mno-stackrealign.
2024-02-02 10:12:18 +01:00
Rainer Orth
5487daffa6 testsuite: i386: Restrict gcc.target/i386/pr80569.c to gas
gcc.target/i386/pr80569.c FAILs on Solaris/x86 with the native
assembler:

FAIL: gcc.target/i386/pr80569.c (test for excess errors)

Excess errors:
Assembler: pr80569.c
        "/var/tmp//ccm4_iqb.s", line 2 : Illegal mnemonic
        Near line: "    .code16gcc"
        "/var/tmp//ccm4_iqb.s", line 2 : Syntax error
        Near line: "    .code16gcc"

.code16gcc is a gas extension, so restrict the test to gas.

Tested on i386-pc-solaris2.11 (as and gas) and i686-pc-linux-gnu.

2024-02-01  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	gcc/testsuite:
	* gcc.target/i386/pr80569.c: Require gas.
2024-02-02 10:06:01 +01:00
Lehua Ding
3e0b495311 Revert "RISC-V: Allow LICM hoist POLY_INT configuration code sequence"
This reverts commit 74489c1907.
2024-02-02 17:03:18 +08:00
Iain Sandoe
f4aa644dbb testsuite, libphobos: Update link flags [PR112864].
The regressions here are primarily from duplicated '-B' additions.

We remove the duplicate on the link line.
We also make sure that platforms with extensions other than .so for
shared libs will have the correct paths.

	PR target/112864

libphobos/ChangeLog:

	* testsuite/lib/libphobos.exp: Use ${shlib_ext} instead of
	hard-wiring '.so'.
	* testsuite/testsuite_flags.in: Remove duplicate -B option
	for spec file path.
2024-02-02 09:01:57 +00:00
Iain Sandoe
bec7100445 testsuite, Objective-C++: Update link flags [PR112863].
These regressions are caused by missing or duplicate runpaths which
now fire linker warnings.

We need to add options to locate libobjc (and on Darwin libobjc-gnu)
along with libstdc++.
Usually '-L' options are added to point to the relevant directories for
the uninstalled libraries.

In cases where libraries are available as both shared and convenience
some additional checks are made.

For some targets -static-xxxx options are handled by specs substitution
and need a '-B' option rather than '-L'.  For Darwin, when embedded
runpaths are in use (the default for all versions after macOS 10.11),
'-B' is also needed to provide the runpath.

When '-B' is used, this results in a '-L' for each path that exists (so
that appending a '-L' as well is a needless duplicate).  There are also
cases where tools warn for duplicates, leading to spurious fails.

	PR target/112863

gcc/testsuite/ChangeLog:

	* lib/obj-c++.exp: Decide on whether to present -B or -L to
	reference the paths to uninstalled libobjc/libobjc-gnu and
	libstdc++ and use that to generate the link flags.
2024-02-02 09:01:22 +00:00
Iain Sandoe
e439c7827f testsuite, gfortran: Update link flags [PR112862].
The regressions here are caused by two issues:
1. In some cases there is no generated runpath for libatomic
2. In other cases there are duplicate paths.

This patch simplifies the addition of the options in the main
gfortran exp and removes the duplicates elewhere.

We need to add options to locate libgfortran and the dependent libs
libquadmath (supporting REAL*16) and libatomic (supporting operations
used by coarrays).  Usually '-L' options are added to point to the
relevant directories for the uninstalled libraries.

In cases where libraries are available as both shared and convenience
some additional checks are made.

For some targets -static-xxxx options are handled by specs substitution
and need a '-B' option rather than '-L'.  For Darwin, when embedded
runpaths are in use (the default for all versions after macOS 10.11),
'-B' is also needed to provide the runpath.

When '-B' is used, this results in a '-L' for each path that exists (so
that appending a '-L' as well is a needless duplicate).  There are also
cases where tools warn for duplicates, leading to spurious fails.

	PR target/112862

gcc/testsuite/ChangeLog:

	* gfortran.dg/coarray/caf.exp: Remove duplicate additions of
	libatomic handling.
	* gfortran.dg/dg.exp: Likewise.
	* lib/gfortran.exp: Decide on whether to present -B or -L to
	reference the paths to uninstalled libgfortran, libqadmath and
	libatomic and use that to generate the link flags.
2024-02-02 09:00:30 +00:00
Juzhe-Zhong
74489c1907 RISC-V: Allow LICM hoist POLY_INT configuration code sequence
Realize in recent benchmark evaluation (coremark-pro zip-test):

        vid.v   v2
        vmv.v.i v5,0
.L9:
        vle16.v v3,0(a4)
        vrsub.vx        v4,v2,a6   ---> LICM failed to hoist it outside the loop.

The root cause is:

(insn 56 47 57 4 (set (subreg:DI (reg:HI 220) 0)
        (reg:DI 223)) "rvv.c":11:9 208 {*movdi_64bit}  -> Its result used by the following vrsub.vx then supress the hoist of the vrsub.vx
     (nil))

(insn 57 56 59 4 (set (reg:RVVMF2HI 216)
        (if_then_else:RVVMF2HI (unspec:RVVMF32BI [
                    (const_vector:RVVMF32BI repeat [
                            (const_int 1 [0x1])
                        ])
                    (reg:DI 350)
                    (const_int 2 [0x2]) repeated x2
                    (const_int 1 [0x1])
                    (reg:SI 66 vl)
                    (reg:SI 67 vtype)
                ] UNSPEC_VPREDICATE)
            (minus:RVVMF2HI (vec_duplicate:RVVMF2HI (reg:HI 220))
                (reg:RVVMF2HI 217))
            (unspec:RVVMF2HI [
                    (reg:DI 0 zero)
                ] UNSPEC_VUNDEF))) "rvv.c":11:9 6938 {pred_subrvvmf2hi_reverse_scalar}
     (expr_list:REG_DEAD (reg:HI 220)
        (nil)))

This patch fixes it generate (set (reg:HI) (subreg:HI (reg:DI))) instead of (set (subreg:DI (reg:DI)) (reg:DI)).

After this patch:

	vid.v	v2
	vrsub.vx	v2,v2,a7
	vmv.v.i	v4,0
.L3:
	vle16.v	v3,0(a4)

Tested on both RV32 and RV64 no regression.

gcc/ChangeLog:

	* config/riscv/riscv.cc (riscv_legitimize_move): Fix poly_int dest generation.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/autovec/poly_licm-1.c: New test.
	* gcc.target/riscv/rvv/autovec/poly_licm-2.c: New test.
2024-02-02 16:56:55 +08:00
Rainer Orth
8939854ad6 testsuite: i386: Fix gcc.target/i386/pieces-memcpy-7.c etc. on Solaris/x86
gcc.target/i386/pieces-memcpy-7.c etc. FAIL on 32-bit Solaris/x86:

FAIL: gcc.target/i386/pieces-memcpy-7.c scan-assembler-not %[re]bp
FAIL: gcc.target/i386/pieces-memcpy-8.c scan-assembler-not %[re]bp
FAIL: gcc.target/i386/pieces-memcpy-9.c scan-assembler-not %[re]bp
FAIL: gcc.target/i386/pieces-memset-36.c scan-assembler-not %[re]bp
FAIL: gcc.target/i386/pieces-memset-40.c scan-assembler-not %[re]bp
FAIL: gcc.target/i386/pieces-memset-9.c scan-assembler-not %[re]bp

The problem is that the tests assume -mno-stackrealign while 32-bit
Solaris/x86 defaults to -mstackrealign.

Fixed by explicitly specifying -mno-stackrealign.

Tested on i386-pc-solaris2.11 and i686-pc-linux-gnu.

2024-02-01  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	gcc/testsuite:
	* gcc.target/i386/pieces-memcpy-7.c (dg-additional-options): Add
	-mno-stackrealign.
	* gcc.target/i386/pieces-memcpy-8.c: Likewise.
	* gcc.target/i386/pieces-memcpy-9.c: Likewise.
	* gcc.target/i386/pieces-memset-36.c: Likewise.
	* gcc.target/i386/pieces-memset-40.c: Likewise.
	* gcc.target/i386/pieces-memset-9.c: Likewise.
2024-02-02 09:46:50 +01:00
Rainer Orth
63f0907bbb testsuite: i386: Fix gcc.target/i386/apx-ndd-cmov.c on Solaris/x86
gcc.target/i386/apx-ndd-cmov.c FAILs on 64-bit Solaris/x86 with the
native assembler:

FAIL: gcc.target/i386/apx-ndd-cmov.c scan-assembler-times cmove[^\\n\\r]*, %eax 1
FAIL: gcc.target/i386/apx-ndd-cmov.c scan-assembler-times cmovge[^\\n\\r]*, %eax 1

The gas vs. as difference is

-       cmove   c+4(%rip), %esi, %eax
+       cmovl.e c+4(%rip), %esi, %eax

-       cmovge  %ecx, %edx, %eax
+       cmovl.ge        %ecx, %edx, %eax

This patch accounts for both forms.

Tested on i386-pc-solaris2.11 (as and gas) and i686-pc-linux-gnu.

2024-02-01  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	gcc/testsuite:
	* gcc.target/i386/apx-ndd-cmov.c (scan-assembler-times): Allow for
	cmovl.e, cmovl.ge.
2024-02-02 09:33:16 +01:00
Sandra Loosemore
56891a20ac MAINTAINERS: Update my e-mail address.
ChangeLog/
	* MAINTAINERS: Update my e-mail address.
2024-02-01 22:28:42 -07:00
Jason Merrill
f499860990 c++: no_unique_address and constexpr [PR112439]
Here, because we don't build a CONSTRUCTOR for an empty base, we were
wrongly marking the Foo CONSTRUCTOR as complete after initializing the Empty
member.  Fixed by checking empty_base here as well.

	PR c++/112439

gcc/cp/ChangeLog:

	* constexpr.cc (cxx_eval_store_expression): Check empty_base
	before marking a CONSTRUCTOR readonly.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp2a/no_unique_address15.C: New test.
2024-02-01 22:22:06 -05:00
Jason Merrill
0b786ff38a c++: variable template array of unknown bound [PR113638]
When we added variable templates, we didn't extend the VAR_HAD_UNKNOWN_BOUND
handling for class template static data members to handle them as well.

	PR c++/113638

gcc/cp/ChangeLog:

	* cp-tree.h: Adjust comment.
	* pt.cc (instantiate_template): Set VAR_HAD_UNKNOWN_BOUND for
	variable template.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp1y/var-templ-array1.C: New test.
2024-02-01 22:21:02 -05:00
Pan Li
e0701f8f7b RISC-V: Cleanup the comments for the psabi
This patch would like to cleanup some comments which are out of date or incorrect.

gcc/ChangeLog:

	* config/riscv/riscv.cc (riscv_get_arg_info): Cleanup comments.
	(riscv_pass_by_reference): Ditto.
	(riscv_fntype_abi): Ditto.

Signed-off-by: Pan Li <pan2.li@intel.com>
2024-02-02 10:23:52 +08:00
Juzhe-Zhong
22622a5a31 RISC-V: Remove vsetvl_pre bogus instructions in VSETVL PASS
I realize there is a RTL regression between GCC-14 and GCC-13.
https://godbolt.org/z/Ga7K6MqaT

GCC-14:
(insn 9 13 31 2 (set (reg:DI 15 a5 [138])
        (unspec:DI [
                (const_int 64 [0x40])
            ] UNSPEC_VLMAX)) "/app/example.c":5:15 2566 {vlmax_avldi}
     (expr_list:REG_EQUIV (unspec:DI [
                (const_int 64 [0x40])
            ] UNSPEC_VLMAX)
        (nil)))
(insn 31 9 10 2 (parallel [
            (set (reg:DI 15 a5 [138])
                (unspec:DI [
                        (reg:DI 0 zero)
                        (const_int 32 [0x20])
                        (const_int 7 [0x7])
                        (const_int 1 [0x1]) repeated x2
                    ] UNSPEC_VSETVL))
            (set (reg:SI 66 vl)
                (unspec:SI [
                        (reg:DI 0 zero)
                        (const_int 32 [0x20])
                        (const_int 7 [0x7])
                    ] UNSPEC_VSETVL))
            (set (reg:SI 67 vtype)
                (unspec:SI [
                        (const_int 32 [0x20])
                        (const_int 7 [0x7])
                        (const_int 1 [0x1]) repeated x2
                    ] UNSPEC_VSETVL))
        ]) "/app/example.c":5:15 3281 {vsetvldi}
     (nil))

GCC-13:
(insn 10 7 26 2 (set (reg/f:DI 11 a1 [139])
        (plus:DI (reg:DI 11 a1 [142])
            (const_int 800 [0x320]))) "/app/example.c":6:32 5 {adddi3}
     (nil))
(insn 26 10 9 2 (parallel [
            (set (reg:DI 15 a5)
                (unspec:DI [
                        (reg:DI 0 zero)
                        (const_int 32 [0x20])
                        (const_int 7 [0x7])
                        (const_int 1 [0x1]) repeated x2
                    ] UNSPEC_VSETVL))
            (set (reg:SI 66 vl)
                (unspec:SI [
                        (reg:DI 0 zero)
                        (const_int 32 [0x20])
                        (const_int 7 [0x7])
                    ] UNSPEC_VSETVL))
            (set (reg:SI 67 vtype)
                (unspec:SI [
                        (const_int 32 [0x20])
                        (const_int 7 [0x7])
                        (const_int 1 [0x1]) repeated x2
                    ] UNSPEC_VSETVL))
        ]) "/app/example.c":5:15 792 {vsetvldi}
     (nil))

GCC-13 doesn't have:
(insn 9 13 31 2 (set (reg:DI 15 a5 [138])
        (unspec:DI [
                (const_int 64 [0x40])
            ] UNSPEC_VLMAX)) "/app/example.c":5:15 2566 {vlmax_avldi}
     (expr_list:REG_EQUIV (unspec:DI [
                (const_int 64 [0x40])
            ] UNSPEC_VLMAX)
        (nil)))

vsetvl_pre doesn't emit any assembler which is just used for occupying scalar register.
It should be removed in VSETVL PASS.

Tested on both RV32 and RV64 no regression.

gcc/ChangeLog:

	* config/riscv/riscv-vsetvl.cc (vsetvl_pre_insn_p): New function.
	(pre_vsetvl::cleaup): Remove vsetvl_pre.
	(pre_vsetvl::remove_vsetvl_pre_insns): New function.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/vsetvl/vsetvl_pre-1.c: New test.
2024-02-02 10:23:06 +08:00
Jiahao Xu
92acc92ee5 LoongArch: Fix incorrect return type for frecipe/frsqrte intrinsic functions
gcc/ChangeLog:

	* config/loongarch/larchintrin.h
	(__frecipe_s): Update function return type.
	(__frecipe_d): Ditto.
	(__frsqrte_s): Ditto.
	(__frsqrte_d): Ditto.

gcc/testsuite/ChangeLog:

	* gcc.target/loongarch/larch-frecipe-intrinsic.c: New test.
2024-02-02 10:14:13 +08:00
Li Wei
593d518a63 LoongArch: Adjust cost of vector_stmt that match multiply-add pattern.
We found that when only 128-bit vectorization was enabled, 549.fotonik3d_r
failed to vectorize effectively. For this reason, we adjust the cost of
128-bit vector_stmt that match the multiply-add pattern to facilitate 128-bit
vectorization.
The experimental results show that after the modification, 549.fotonik3d_r
performance can be improved by 9.77% under the 128-bit vectorization option.

gcc/ChangeLog:

	* config/loongarch/loongarch.cc (loongarch_multiply_add_p): New.
	(loongarch_vector_costs::add_stmt_cost): Adjust.

gcc/testsuite/ChangeLog:

	* gfortran.dg/vect/vect-10.f90: New test.
2024-02-02 09:22:07 +08:00
Xi Ruoyao
f72586e5b9 LoongArch: Don't split the instructions containing relocs for extreme code model.
The ABI mandates the pcalau12i/addi.d/lu32i.d/lu52i.d instructions for
addressing a symbol to be adjacent.  So model them as "one large
instruction", i.e. define_insn, with two output registers.  The real
address is the sum of these two registers.

The advantage of this approach is the RTL passes can still use ldx/stx
instructions to skip an addi.d instruction.

gcc/ChangeLog:

	* config/loongarch/loongarch.md (unspec): Add
	UNSPEC_LA_PCREL_64_PART1 and UNSPEC_LA_PCREL_64_PART2.
	(la_pcrel64_two_parts): New define_insn.
	* config/loongarch/loongarch.cc (loongarch_tls_symbol): Fix a
	typo in the comment.
	(loongarch_call_tls_get_addr): If -mcmodel=extreme
	-mexplicit-relocs={always,auto}, use la_pcrel64_two_parts for
	addressing the TLS symbol and __tls_get_addr.  Emit an REG_EQUAL
	note to allow CSE addressing __tls_get_addr.
	(loongarch_legitimize_tls_address): If -mcmodel=extreme
	-mexplicit-relocs={always,auto}, address TLS IE symbols with
	la_pcrel64_two_parts.
	(loongarch_split_symbol): If -mcmodel=extreme
	-mexplicit-relocs={always,auto}, address symbols with
	la_pcrel64_two_parts.
	(loongarch_output_mi_thunk): Clean up unreachable code.  If
	-mcmodel=extreme -mexplicit-relocs={always,auto}, address the MI
	thunks with la_pcrel64_two_parts.

gcc/testsuite/ChangeLog:

	* gcc.target/loongarch/func-call-extreme-1.c (dg-options):
	Use -O2 instead of -O0 to ensure the pcalau12i/addi/lu32i/lu52i
	instruction sequences are not reordered by the compiler.
	(NOIPA): Disallow interprocedural optimizations.
	* gcc.target/loongarch/func-call-extreme-2.c: Remove the content
	duplicated from func-call-extreme-1.c, include it instead.
	(dg-options): Likewise.
	* gcc.target/loongarch/func-call-extreme-3.c (dg-options):
	Likewise.
	* gcc.target/loongarch/func-call-extreme-4.c (dg-options):
	Likewise.
	* gcc.target/loongarch/cmodel-extreme-1.c: New test.
	* gcc.target/loongarch/cmodel-extreme-2.c: New test.
	* g++.target/loongarch/cmodel-extreme-mi-thunk-1.C: New test.
	* g++.target/loongarch/cmodel-extreme-mi-thunk-2.C: New test.
	* g++.target/loongarch/cmodel-extreme-mi-thunk-3.C: New test.
2024-02-02 09:16:24 +08:00
Lulu Cheng
3932899a83 LoongArch: Added support for loading __get_tls_addr symbol address using call36.
gcc/ChangeLog:

	* config/loongarch/loongarch.cc (loongarch_call_tls_get_addr):
	Add support for call36.

gcc/testsuite/ChangeLog:

	* gcc.target/loongarch/explicit-relocs-medium-call36-auto-tls-ld-gd.c: New test.
2024-02-02 09:16:19 +08:00
Lulu Cheng
5fbd80223e LoongArch: Enable explicit reloc for extreme TLS GD/LD with -mexplicit-relocs=auto.
Binutils does not support relaxation using four instructions to obtain
symbol addresses

gcc/ChangeLog:

	* config/loongarch/loongarch.cc (loongarch_explicit_relocs_p):
	When the code model of the symbol is extreme and -mexplicit-relocs=auto,
	the macro instruction loading symbol address is not applicable.
	(loongarch_call_tls_get_addr): Adjust code.
	(loongarch_legitimize_tls_address): Likewise.

gcc/testsuite/ChangeLog:

	* gcc.target/loongarch/explicit-relocs-extreme-auto-tls-ld-gd.c: New test.
	* gcc.target/loongarch/explicit-relocs-medium-auto-tls-ld-gd.c: New test.
2024-02-02 09:16:15 +08:00
Lulu Cheng
fa972949d0 LoongArch: Add the macro implementation of mcmodel=extreme.
gcc/ChangeLog:

	* config/loongarch/loongarch-protos.h (loongarch_symbol_extreme_p):
	Add function declaration.
	* config/loongarch/loongarch.cc (loongarch_symbolic_constant_p):
	For SYMBOL_PCREL64, non-zero addend of "la.local $rd,$rt,sym+addend"
	is not allowed
	(loongarch_load_tls): Added macro support in extreme mode.
	(loongarch_call_tls_get_addr): Likewise.
	(loongarch_legitimize_tls_address): Likewise.
	(loongarch_force_address): Likewise.
	(loongarch_legitimize_move): Likewise.
	(loongarch_output_mi_thunk): Likewise.
	(loongarch_option_override_internal): Remove the code that detects
	explicit relocs status.
	(loongarch_handle_model_attribute): Likewise.
	* config/loongarch/loongarch.md (movdi_symbolic_off64): New template.
	* config/loongarch/predicates.md (symbolic_off64_operand): New predicate.
	(symbolic_off64_or_reg_operand): Likewise.

gcc/testsuite/ChangeLog:

	* gcc.target/loongarch/attr-model-5.c: New test.
	* gcc.target/loongarch/func-call-extreme-5.c: New test.
	* gcc.target/loongarch/func-call-extreme-6.c: New test.
	* gcc.target/loongarch/tls-extreme-macro.c: New test.
2024-02-02 09:16:11 +08:00
Lulu Cheng
252f7705a5 LoongArch: Merge template got_load_tls_{ld/gd/le/ie}.
gcc/ChangeLog:

	* config/loongarch/loongarch.cc (loongarch_load_tls):
	Load all types of tls symbols through one function.
	(loongarch_got_load_tls_gd): Delete.
	(loongarch_got_load_tls_ld): Delete.
	(loongarch_got_load_tls_ie): Delete.
	(loongarch_got_load_tls_le): Delete.
	(loongarch_call_tls_get_addr): Modify the called function name.
	(loongarch_legitimize_tls_address): Likewise.
	* config/loongarch/loongarch.md (@got_load_tls_gd<mode>): Delete.
	(@load_tls<mode>): New template.
	(@got_load_tls_ld<mode>): Delete.
	(@got_load_tls_le<mode>): Delete.
	(@got_load_tls_ie<mode>): Delete.
2024-02-02 09:16:05 +08:00
Lulu Cheng
3499793d04 LoongArch: Modify the address calculation logic for obtaining array element values through fp.
Modify address calculation logic from (((a x C) + fp) + offset) to ((fp + offset) + a x C).
Thereby modifying the register dependencies and optimizing the code.
The value of C is 2 4 or 8.

The following is the assembly code before and after a loop modification in spec2006 401.bzip:

                 old                      |                 new
 735 .L71:                                |  735 .L71:
 736         slli.d  $r12,$r15,2          |  736         slli.d  $r12,$r15,2
 737         ldx.w   $r13,$r22,$r12       |  737         ldx.w   $r13,$r22,$r12
 738         addi.d  $r15,$r15,-1         |  738         addi.d  $r15,$r15,-1
 739         slli.w  $r16,$r15,0          |  739         slli.w  $r16,$r15,0
 740         addi.w  $r13,$r13,-1         |  740         addi.w  $r13,$r13,-1
 741         slti    $r14,$r13,0          |  741         slti    $r14,$r13,0
 742         add.w   $r12,$r26,$r13       |  742         add.w   $r12,$r26,$r13
 743         maskeqz $r12,$r12,$r14       |  743         maskeqz $r12,$r12,$r14
 744         masknez $r14,$r13,$r14       |  744         masknez $r14,$r13,$r14
 745         or      $r12,$r12,$r14       |  745         or      $r12,$r12,$r14
 746         ldx.bu  $r14,$r30,$r12       |  746         ldx.bu  $r14,$r30,$r12
 747         lu12i.w $r13,4096>>12        |  747         alsl.d  $r14,$r14,$r18,2
 748         ori     $r13,$r13,432        |  748         ldptr.w $r13,$r14,0
 749         add.d   $r13,$r13,$r3        |  749         addi.w  $r17,$r13,-1
 750         alsl.d  $r14,$r14,$r13,2     |  750         stptr.w $r17,$r14,0
 751         ldptr.w $r13,$r14,-1968      |  751         slli.d  $r13,$r13,2
 752         addi.w  $r17,$r13,-1         |  752         stx.w   $r12,$r22,$r13
 753         st.w    $r17,$r14,-1968      |  753         ldptr.w $r12,$r19,0
 754         slli.d  $r13,$r13,2          |  754         blt     $r12,$r16,.L71
 755         stx.w   $r12,$r22,$r13       |  755         .align  4
 756         ldptr.w $r12,$r18,-2048      |  756
 757         blt     $r12,$r16,.L71       |  757
 758         .align  4                    |  758

This patch is ported from riscv's commit r14-3111.

gcc/ChangeLog:

	* config/loongarch/loongarch.cc (mem_shadd_or_shadd_rtx_p): New function.
	(loongarch_legitimize_address): Add logical transformation code.
2024-02-02 09:13:33 +08:00
GCC Administrator
e255454046 Daily bump. 2024-02-02 00:18:18 +00:00
Marek Polacek
8efcdbf59b c++: -Wdangling-reference tweak to unbreak aarch64
My recent -Wdangling-reference change to not warn on std::span-like classes
unfortunately caused a new warning: extending reference_like_class_p also
opens the door to new warnings since we use reference_like_class_p for
checking the return type of the function: either it must be a reference
or a reference_like_class_p.

We can consider even non-templates as std::span-like to get rid of the
warning here.

gcc/cp/ChangeLog:

	* call.cc (reference_like_class_p): Consider even non-templates for
	std::span-like classes.

gcc/ChangeLog:

	* doc/invoke.texi: Update -Wdangling-reference documentation.

gcc/testsuite/ChangeLog:

	* g++.dg/warn/Wdangling-reference21.C: New test.
2024-02-01 16:21:36 -05:00
Uros Bizjak
44764984cf i386: Improve *cmp<dwi>_doubleword splitter [PR113701]
The fix for PR70321 introduced a splitter that split a doubleword
comparison into a pair of XORs followed by an IOR to set the (zero)
flags register.  To help the reload, splitter forced SUBREG pieces of
double-word input values to a pseudo, but this regressed
gcc.target/i386/pr82580.c:

int f0 (U x, U y) { return x == y; }

from:
	xorq    %rdx, %rdi
	xorq    %rcx, %rsi
	xorl    %eax, %eax
	orq     %rsi, %rdi
	sete    %al
	ret

to:
	xchgq   %rdi, %rsi
	movq    %rdx, %r8
	movq    %rcx, %rax
	movq    %rsi, %rdx
	movq    %rdi, %rcx
	xorq    %rax, %rcx
	xorq    %r8, %rdx
	xorl    %eax, %eax
	orq     %rcx, %rdx
	sete    %al
	ret

To mitigate the regression, remove this legacy heuristic (workaround?).
There have been many incremental changes and improvements to x86 TImode
and register allocation, so this legacy workaround is not only no longer
useful, but it actually hurts register allocation.  The patched compiler
now produces:

        xchgq   %rdi, %rsi
        xorl    %eax, %eax
        xorq    %rsi, %rdx
        xorq    %rdi, %rcx
        orq     %rcx, %rdx
        sete    %al
        ret

	PR target/113701

gcc/ChangeLog:

	* config/i386/i386.md (*cmp<dwi>_doubleword):
	Do not force SUBREG pieces to pseudos.
2024-02-01 21:25:05 +01:00
Jakub Jelinek
e9b2f15d98 libgcc: Avoid warnings on __gcc_nested_func_ptr_created [PR113402]
I'm seeing hundreds of
In file included from ../../../libgcc/libgcc2.c:56:
../../../libgcc/libgcc2.h:32:13: warning: conflicting types for built-in function ‘__gcc_nested_func_ptr_created’; expected ‘void(void *, void *, void *)’
+[-Wbuiltin-declaration-mismatch]
   32 | extern void __gcc_nested_func_ptr_created (void *, void *, void **);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warnings.

Either we need to add like in r14-6218
  #pragma GCC diagnostic ignored "-Wbuiltin-declaration-mismatch"
(but in that case because of the libgcc2.h prototype (why is it there?)
it would need to be also with #pragma GCC diagnostic push/pop around),
or we could go with just following how the builtins are prototyped on the
compiler side and only cast to void ** when dereferencing (which is in
a single spot in each TU).

2024-02-01  Jakub Jelinek  <jakub@redhat.com>

	PR libgcc/113402
	* libgcc2.h (__gcc_nested_func_ptr_created): Change type of last
	argument from void ** to void *.
	* config/i386/heap-trampoline.c (__gcc_nested_func_ptr_created):
	Change type of dst from void ** to void * and cast dst to void **
	before dereferencing it.
	* config/aarch64/heap-trampoline.c (__gcc_nested_func_ptr_created):
	Likewise.
2024-02-01 21:10:10 +01:00
Jakub Jelinek
03519175e2 libgcc: Fix up i386/t-heap-trampoline [PR113403]
I'm seeing
../../../libgcc/shared-object.mk:14: warning: overriding recipe for target 'heap-trampoline.o'
../../../libgcc/shared-object.mk:14: warning: ignoring old recipe for target 'heap-trampoline.o'
../../../libgcc/shared-object.mk:17: warning: overriding recipe for target 'heap-trampoline_s.o'
../../../libgcc/shared-object.mk:17: warning: ignoring old recipe for target 'heap-trampoline_s.o'

This patch fixes that.

2024-02-01  Jakub Jelinek  <jakub@redhat.com>

	PR libgcc/113403
	* config/i386/t-heap-trampoline: Add to LIB2ADDEHSHARED
	i386/heap-trampoline.c rather than aarch64/heap-trampoline.c.
2024-02-01 21:10:02 +01:00
Patrick Palka
65b4cba9d6 libstdc++: Implement P2165R4 changes to std::pair/tuple/etc [PR113309]
This implements the C++23 paper P2165R4 Compatibility between tuple,
pair and tuple-like objects, which builds upon many changes from the
earlier C++23 paper P2321R2 zip.

Some declarations had to be moved around so that they're visible from
<bits/stl_pair.h> without introducing new includes and bloating the
header.  In the end, the only new include is for <bits/utility.h> from
<bits/stl_iterator.h>, for tuple_element_t.

	PR libstdc++/113309
	PR libstdc++/109203

libstdc++-v3/ChangeLog:

	* include/bits/ranges_util.h (__detail::__pair_like): Don't
	define in C++23 mode.
	(__detail::__pair_like_convertible_from): Adjust as per P2165R4.
	(__detail::__is_subrange<subrange>): Moved from <ranges>.
	(__detail::__is_tuple_like_v<subrange>): Likewise.
	* include/bits/stl_iterator.h: Include <bits/utility.h> for
	C++23.
	(__different_from): Move to <concepts>.
	(__iter_key_t): Adjust for C++23 as per P2165R4.
	(__iter_val_t): Likewise.
	* include/bits/stl_pair.h (pair, array): Forward declare.
	(get): Forward declare all overloads relevant to P2165R4
	tuple-like constructors.
	(__is_tuple_v): Define for C++23.
	(__is_tuple_like_v): Define for C++23.
	(__tuple_like): Define for C++23 as per P2165R4.
	(__pair_like): Define for C++23 as per P2165R4.
	(__eligibile_tuple_like): Define for C++23.
	(__eligibile_pair_like): Define for C++23.
	(pair::_S_constructible_from_pair_like): Define for C++23.
	(pair::_S_convertible_from_pair_like): Define for C++23.
	(pair::_S_dangles_from_pair_like): Define for C++23.
	(pair::pair): Define overloads taking a tuple-like type for
	C++23 as per P2165R4.
	(pair::_S_assignable_from_tuple_like): Define for C++23.
	(pair::_S_const_assignable_from_tuple_like): Define for C++23.
	(pair::operator=): Define overloads taking a tuple-like type for
	C++23 as per P2165R4.
	* include/bits/utility.h (ranges::__detail::__is_subrange):
	Moved from <ranges>.
	* include/bits/version.def (tuple_like): Define for C++23.
	* include/bits/version.h: Regenerate.
	* include/std/concepts (__different_from): Moved from
	<bits/stl_iterator.h>.
	(ranges::__swap::__adl_swap): Clarify which __detail namespace.
	* include/std/map (__cpp_lib_tuple_like): Define C++23.
	* include/std/ranges (__detail::__is_subrange): Moved to
	<bits/utility.h>.
	(__detail::__is_subrange<subrange>): Moved to <bits/ranges_util.h>
	(__detail::__has_tuple_element): Adjust for C++23 as per P2165R4.
	(__detail::__tuple_or_pair): Remove as per P2165R4.  Replace all
	uses with plain tuple as per P2165R4.
	* include/std/tuple (__cpp_lib_tuple_like): Define for C++23.
	(__tuple_like_tag_t): Define for C++23.
	(__tuple_cmp): Forward declare for C++23.
	(_Tuple_impl::_Tuple_impl): Define overloads taking
	__tuple_like_tag_t and a tuple-like type for C++23.
	(_Tuple_impl::_M_assign): Likewise.
	(tuple::__constructible_from_tuple_like): Define for C++23.
	(tuple::__convertible_from_tuple_like): Define for C++23.
	(tuple::__dangles_from_tuple_like): Define for C++23.
	(tuple::tuple): Define overloads taking a tuple-like type for
	C++23 as per P2165R4.
	(tuple::__assignable_from_tuple_like): Define for C++23.
	(tuple::__const_assignable_from_tuple_like): Define for C++23.
	(tuple::operator=): Define overloads taking a tuple-like type
	for C++23 as per P2165R4.
	(tuple::__tuple_like_common_comparison_category): Define for C++23.
	(tuple::operator<=>): Define overload taking a tuple-like type
	for C++23 as per P2165R4.
	(array, get): Forward declarations moved to <bits/stl_pair.h>.
	(tuple_cat): Constrain with __tuple_like for C++23 as per P2165R4.
	(apply): Likewise.
	(make_from_tuple): Likewise.
	(__tuple_like_common_reference): Define for C++23.
	(basic_common_reference): Adjust as per P2165R4.
	(__tuple_like_common_type): Define for C++23.
	(common_type): Adjust as per P2165R4.
	* include/std/unordered_map (__cpp_lib_tuple_like): Define for
	C++23.
	* include/std/utility (__cpp_lib_tuple_like): Define for C++23.
	* testsuite/std/ranges/zip/1.cc (test01): Adjust to handle pair
	and 2-tuple interchangeably.
	(test05): New test.
	* testsuite/20_util/pair/p2165r4.cc: New test.
	* testsuite/20_util/tuple/p2165r4.cc: New test.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
2024-02-01 14:59:46 -05:00
Patrick Palka
87d162383e libstdc++/pair: Factor out const-assignability helper for C++20
This is consistent with std::tuple's __const_assignable helper, and will
be useful for implementing the new pair::operator= overloads from P2165R4.

libstdc++-v3/ChangeLog:

	* include/bits/stl_pair.h (pair::_S_const_assignable): Define,
	factored out from ...
	(pair::operator=): ... the constraints of the const overloads.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
2024-02-01 14:56:02 -05:00
John David Anglin
b14209715e Set num_threads to 50 on 32-bit hppa in two libgomp loop tests
We support a maximum of 50 threads on 32-bit hppa.

2024-02-01  John David Anglin  <danglin@gcc.gnu.org>

libgomp/ChangeLog:

	* testsuite/libgomp.c++/loop-3.C: Set num_threads to 50
	on 32-bit hppa.
	* testsuite/libgomp.c/omp-loop03.c: Likewise.
2024-02-01 19:09:53 +00:00
John David Anglin
d71c7f107a xfail gnat.dg/trampoline3.adb scan-assembler-not check on hppa*-*-*
We still require an executable stack for trampolines on hppa*-*-*.

2024-02-01  John David Anglin  <danglin@gcc.gnu.org>

gcc/testsuite/ChangeLog:

	* gnat.dg/trampoline3.adb: xfail scan-assembler-not
	check on hppa*-*-*.
2024-02-01 18:57:15 +00:00
John David Anglin
f26094751e hppa: Fix bug in atomic_storedi_1 pattern
The first alternative stores the floating-point status register
in the destination.  It should store zero.  We need to copy %fr0
to another floating-point register to initialize it to zero.

2024-02-01  John David Anglin  <danglin@gcc.gnu.org>

gcc/ChangeLog:

	* config/pa/pa.md (atomic_storedi_1): Fix bug in
	alternative 1.
2024-02-01 18:48:34 +00:00