Commit Graph

204290 Commits

Author SHA1 Message Date
Tamar Christina
19610580d4 ifcvt: replace C++ sort with vec::qsort [PR109154]
As requested later on, this replaces the C++ sort with vec::qsort.

gcc/ChangeLog:

	PR tree-optimization/109154
	* tree-if-conv.cc (INCLUDE_ALGORITHM): Remove.
	(cmp_arg_entry): New.
	(predicate_scalar_phi): Use it.
2023-10-02 11:48:26 +01:00
Iain Sandoe
76547f4c97 testsuite, Darwin: Skip g++.dg/debug/dwarf2/pr85550.C
There are two problems here; first that the emitted asm for
-fdebug-types-section is ELF-specfic leading to assembler errors for
Mach-O.  If we fix this, we get a secondary fail since the debug linker
does not recognise DW_FORM_ref_sig8.  Disable ths test until we get
DWARF-5 support in the external Darwin toolchain components.

gcc/testsuite/ChangeLog:

	* g++.dg/debug/dwarf2/pr85550.C: Skip for Darwin.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
2023-10-02 07:58:43 +01:00
Richard Sandiford
e465e5e4a9 Fix profiledbootstrap poly_int fallout [PR111642]
rtl-tests.cc and simplify-rtx.cc used partial specialisation
to try to restrict the NUM_POLY_INT_COEFFS>1 tests without
resorting to preprocessor tests.  That now triggers an error
in some configurations, since the NUM_POLY_INT_COEFFS>1 tests
used the global poly_int64, whose definition does not depend
on the template parameter.

This patch uses local types that do depend on the template parameter.

gcc/
	PR bootstrap/111642
	* rtl-tests.cc (const_poly_int_tests<N>::run): Use a local
	poly_int64 typedef.
	* simplify-rtx.cc (simplify_const_poly_int_tests<N>::run): Likewise.
2023-10-02 07:20:45 +01:00
Joern Rennecke
9464e72bcc cpymem for RISC-V with v extension
gcc/
	* config/riscv/riscv-protos.h (riscv_vector::expand_block_move):
	Declare.
	* config/riscv/riscv-v.cc (riscv_vector::expand_block_move):
	New function.
	* config/riscv/riscv.md (cpymemsi): Use riscv_vector::expand_block_move.
	Change to ..
	(cpymem<P:mode>) .. this.

gcc/testsuite/
	* gcc.target/riscv/rvv/base/cpymem-1.c: New test.
	* gcc.target/riscv/rvv/base/cpymem-2.c: Likewise.

Co-Authored-By: Juzhe-Zhong <juzhe.zhong@rivai.ai>
2023-10-02 03:33:31 +01:00
GCC Administrator
e7a23bbf1f Daily bump. 2023-10-02 00:17:00 +00:00
Joern Rennecke
5f3da480e7 Fix typo in add_options_for_riscv_v, add_options_for_riscv_zfh, add_options_for_riscv_d .
gcc/testsuite/
	* lib/target-supports.exp (add_options_for_riscv_v):
	Fix typo in first regexp.
	(add_options_for_riscv_zfh): Likewise.
	(add_options_for_riscv_d): Likewise.
2023-10-01 22:53:43 +01:00
Stefan Schulze Frielinghaus
86b2ffc0b8 rtl-optimization/110939 Really fix narrow comparison of memory and constant
In the former fix in commit 41ef5a3416 I
completely missed the fact that the normal form of a CONST_INT for a
mode with fewer bits than in HOST_WIDE_INT is a sign extended version of
the actual constant.  This even holds true for unsigned constants.

Fixed by masking out the upper bits for the incoming constant and sign
extending the resulting unsigned constant.

gcc/ChangeLog:

	* combine.cc (simplify_compare_const): Properly handle unsigned
	constants while narrowing comparison of memory and constants.
2023-10-01 16:11:32 +02:00
Feng Wang
e4a4b8e983 RISC-V:Optimize the MASK opt generation
The corresponding MASK and TARGET will be automatically generated.

Accoring to Kito's advice, using "MASK(name) Var(other_flag_name)"
to generate MASK and TARGET MACRO automatically.
This patch improve the MACRO generation of MASK_* and TARGET_*.
Due to the more and more riscv extensions are added, the default target_flag
is full.
Before this patch,if you want to add new MACRO,you should define the
MACRO in the riscv-opts.h manually.
After this patch, you just need two steps:
1.Define the new TargetVariable.
2.Define "MASK(name) Var(new_target_flag).

gcc/ChangeLog:

	* config/riscv/riscv-opts.h (MASK_ZICSR): Delete.
	(MASK_ZIFENCEI): Delete;
	(MASK_ZIHINTNTL): Ditto.
	(MASK_ZIHINTPAUSE): Ditto.
	(TARGET_ZICSR): Ditto.
	(TARGET_ZIFENCEI): Ditto.
	(TARGET_ZIHINTNTL): Ditto.
	(TARGET_ZIHINTPAUSE): Ditto.
	(MASK_ZAWRS): Ditto.
	(TARGET_ZAWRS): Ditto.
	(MASK_ZBA): Ditto.
	(MASK_ZBB): Ditto.
	(MASK_ZBC): Ditto.
	(MASK_ZBS): Ditto.
	(TARGET_ZBA): Ditto.
	(TARGET_ZBB): Ditto.
	(TARGET_ZBC): Ditto.
	(TARGET_ZBS): Ditto.
	(MASK_ZFINX): Ditto.
	(MASK_ZDINX): Ditto.
	(MASK_ZHINX): Ditto.
	(MASK_ZHINXMIN): Ditto.
	(TARGET_ZFINX): Ditto.
	(TARGET_ZDINX): Ditto.
	(TARGET_ZHINX): Ditto.
	(TARGET_ZHINXMIN): Ditto.
	(MASK_ZBKB): Ditto.
	(MASK_ZBKC): Ditto.
	(MASK_ZBKX): Ditto.
	(MASK_ZKNE): Ditto.
	(MASK_ZKND): Ditto.
	(MASK_ZKNH): Ditto.
	(MASK_ZKR): Ditto.
	(MASK_ZKSED): Ditto.
	(MASK_ZKSH): Ditto.
	(MASK_ZKT): Ditto.
	(TARGET_ZBKB): Ditto.
	(TARGET_ZBKC): Ditto.
	(TARGET_ZBKX): Ditto.
	(TARGET_ZKNE): Ditto.
	(TARGET_ZKND): Ditto.
	(TARGET_ZKNH): Ditto.
	(TARGET_ZKR): Ditto.
	(TARGET_ZKSED): Ditto.
	(TARGET_ZKSH): Ditto.
	(TARGET_ZKT): Ditto.
	(MASK_ZTSO): Ditto.
	(TARGET_ZTSO): Ditto.
	(MASK_VECTOR_ELEN_32): Ditto.
	(MASK_VECTOR_ELEN_64): Ditto.
	(MASK_VECTOR_ELEN_FP_32): Ditto.
	(MASK_VECTOR_ELEN_FP_64): Ditto.
	(MASK_VECTOR_ELEN_FP_16): Ditto.
	(TARGET_VECTOR_ELEN_32): Ditto.
	(TARGET_VECTOR_ELEN_64): Ditto.
	(TARGET_VECTOR_ELEN_FP_32): Ditto.
	(TARGET_VECTOR_ELEN_FP_64): Ditto.
	(TARGET_VECTOR_ELEN_FP_16): Ditto.
	(MASK_ZVBB): Ditto.
	(MASK_ZVBC): Ditto.
	(TARGET_ZVBB): Ditto.
	(TARGET_ZVBC): Ditto.
	(MASK_ZVKG): Ditto.
	(MASK_ZVKNED): Ditto.
	(MASK_ZVKNHA): Ditto.
	(MASK_ZVKNHB): Ditto.
	(MASK_ZVKSED): Ditto.
	(MASK_ZVKSH): Ditto.
	(MASK_ZVKN): Ditto.
	(MASK_ZVKNC): Ditto.
	(MASK_ZVKNG): Ditto.
	(MASK_ZVKS): Ditto.
	(MASK_ZVKSC): Ditto.
	(MASK_ZVKSG): Ditto.
	(MASK_ZVKT): Ditto.
	(TARGET_ZVKG): Ditto.
	(TARGET_ZVKNED): Ditto.
	(TARGET_ZVKNHA): Ditto.
	(TARGET_ZVKNHB): Ditto.
	(TARGET_ZVKSED): Ditto.
	(TARGET_ZVKSH): Ditto.
	(TARGET_ZVKN): Ditto.
	(TARGET_ZVKNC): Ditto.
	(TARGET_ZVKNG): Ditto.
	(TARGET_ZVKS): Ditto.
	(TARGET_ZVKSC): Ditto.
	(TARGET_ZVKSG): Ditto.
	(TARGET_ZVKT): Ditto.
	(MASK_ZVL32B): Ditto.
	(MASK_ZVL64B): Ditto.
	(MASK_ZVL128B): Ditto.
	(MASK_ZVL256B): Ditto.
	(MASK_ZVL512B): Ditto.
	(MASK_ZVL1024B): Ditto.
	(MASK_ZVL2048B): Ditto.
	(MASK_ZVL4096B): Ditto.
	(MASK_ZVL8192B): Ditto.
	(MASK_ZVL16384B): Ditto.
	(MASK_ZVL32768B): Ditto.
	(MASK_ZVL65536B): Ditto.
	(TARGET_ZVL32B): Ditto.
	(TARGET_ZVL64B): Ditto.
	(TARGET_ZVL128B): Ditto.
	(TARGET_ZVL256B): Ditto.
	(TARGET_ZVL512B): Ditto.
	(TARGET_ZVL1024B): Ditto.
	(TARGET_ZVL2048B): Ditto.
	(TARGET_ZVL4096B): Ditto.
	(TARGET_ZVL8192B): Ditto.
	(TARGET_ZVL16384B): Ditto.
	(TARGET_ZVL32768B): Ditto.
	(TARGET_ZVL65536B): Ditto.
	(MASK_ZICBOZ): Ditto.
	(MASK_ZICBOM): Ditto.
	(MASK_ZICBOP): Ditto.
	(TARGET_ZICBOZ): Ditto.
	(TARGET_ZICBOM): Ditto.
	(TARGET_ZICBOP): Ditto.
	(MASK_ZICOND): Ditto.
	(TARGET_ZICOND): Ditto.
	(MASK_ZFA): Ditto.
	(TARGET_ZFA): Ditto.
	(MASK_ZFHMIN): Ditto.
	(MASK_ZFH): Ditto.
	(MASK_ZVFHMIN): Ditto.
	(MASK_ZVFH): Ditto.
	(TARGET_ZFHMIN): Ditto.
	(TARGET_ZFH): Ditto.
	(TARGET_ZVFHMIN): Ditto.
	(TARGET_ZVFH): Ditto.
	(MASK_ZMMUL): Ditto.
	(TARGET_ZMMUL): Ditto.
	(MASK_ZCA): Ditto.
	(MASK_ZCB): Ditto.
	(MASK_ZCE): Ditto.
	(MASK_ZCF): Ditto.
	(MASK_ZCD): Ditto.
	(MASK_ZCMP): Ditto.
	(MASK_ZCMT): Ditto.
	(TARGET_ZCA): Ditto.
	(TARGET_ZCB): Ditto.
	(TARGET_ZCE): Ditto.
	(TARGET_ZCF): Ditto.
	(TARGET_ZCD): Ditto.
	(TARGET_ZCMP): Ditto.
	(TARGET_ZCMT): Ditto.
	(MASK_SVINVAL): Ditto.
	(MASK_SVNAPOT): Ditto.
	(TARGET_SVINVAL): Ditto.
	(TARGET_SVNAPOT): Ditto.
	(MASK_XTHEADBA): Ditto.
	(MASK_XTHEADBB): Ditto.
	(MASK_XTHEADBS): Ditto.
	(MASK_XTHEADCMO): Ditto.
	(MASK_XTHEADCONDMOV): Ditto.
	(MASK_XTHEADFMEMIDX): Ditto.
	(MASK_XTHEADFMV): Ditto.
	(MASK_XTHEADINT): Ditto.
	(MASK_XTHEADMAC): Ditto.
	(MASK_XTHEADMEMIDX): Ditto.
	(MASK_XTHEADMEMPAIR): Ditto.
	(MASK_XTHEADSYNC): Ditto.
	(TARGET_XTHEADBA): Ditto.
	(TARGET_XTHEADBB): Ditto.
	(TARGET_XTHEADBS): Ditto.
	(TARGET_XTHEADCMO): Ditto.
	(TARGET_XTHEADCONDMOV): Ditto.
	(TARGET_XTHEADFMEMIDX): Ditto.
	(TARGET_XTHEADFMV): Ditto.
	(TARGET_XTHEADINT): Ditto.
	(TARGET_XTHEADMAC): Ditto.
	(TARGET_XTHEADMEMIDX): Ditto.
	(TARGET_XTHEADMEMPAIR): Ditto.
	(TARGET_XTHEADSYNC): Ditto.
	(MASK_XVENTANACONDOPS): Ditto.
	(TARGET_XVENTANACONDOPS): Ditto.
	* config/riscv/riscv.opt: Add new Mask defination.
	* doc/options.texi: Add explanation for this new usage.
	* opt-functions.awk: Add new function to find the index
	of target variable from extra_target_vars.
	* opt-read.awk: Add new function to store the Mask flags.
	* opth-gen.awk: Add new function to output the defination of
	Mask Macro and Target Macro.
2023-10-01 16:09:28 +08:00
Joern Rennecke
f416a3fdbe Make riscv_vector::legitimize_move adjust SRC in the caller.
2023-09-29  Joern Rennecke  <joern.rennecke@embecosm.com>
	    Juzhe-Zhong  <juzhe.zhong@rivai.ai>

	PR target/111566

gcc/
	* config/riscv/riscv-protos.h (riscv_vector::legitimize_move):
	Change second parameter to rtx *.
	* config/riscv/riscv-v.cc (risv_vector::legitimize_move): Likewise.
	* config/riscv/vector.md: Changed callers of
	riscv_vector::legitimize_move.
	(*mov<mode>_mem_to_mem): Remove.

gcc/testsuite/

	* gcc.target/riscv/rvv/autovec/vls/mov-1.c: Adapt test.
	* gcc.target/riscv/rvv/autovec/vls/mov-10.c: Ditto.
	* gcc.target/riscv/rvv/autovec/vls/mov-3.c: Ditto.
	* gcc.target/riscv/rvv/autovec/vls/mov-5.c: Ditto.
	* gcc.target/riscv/rvv/autovec/vls/mov-7.c: Ditto.
	* gcc.target/riscv/rvv/autovec/vls/mov-8.c: Ditto.
	* gcc.target/riscv/rvv/autovec/vls/mov-9.c: Ditto.1
	* gcc.target/riscv/rvv/autovec/vls/mov-2.c: Removed.
	* gcc.target/riscv/rvv/autovec/vls/mov-4.c: Removed.
	* gcc.target/riscv/rvv/autovec/vls/mov-6.c: Removed.
	* gcc.target/riscv/rvv/fortran/pr111566.f90: New test.

Co-Authored-By: Juzhe-Zhong  <juzhe.zhong@rivai.ai>
2023-10-01 06:21:40 +01:00
GCC Administrator
125781fb2c Daily bump. 2023-10-01 00:18:19 +00:00
Patrick O'Neill
04e772bbdc RISC-V: Use safe_grow_cleared for vector info [PR111649]
Resolves a riscv*-*-* bootstrap failure due to a newly-turned-on assert.

2023-09-30  Jakub Jelinek  <jakub@redhat.com>

gcc/ChangeLog:

	PR target/111649

	* config/riscv/riscv-vsetvl.cc (vector_infos_manager::vector_infos_manager):
	Replace safe_grow with safe_grow_cleared.
2023-09-30 16:09:45 -07:00
Jakub Jelinek
1e6815071f gimple-match-head: Fix a pasto in function comment
This function comment has been pasted from gimple_bitwise_equal_p and haven't
been adjusted for different function name.

2023-09-30  Jakub Jelinek  <jakub@redhat.com>

	* gimple-match-head.cc (gimple_bitwise_inverted_equal_p): Fix a pasto
	in function comment.
2023-09-30 11:35:24 +02:00
Jakub Jelinek
09b512466c lowerbitint: Fix 2 bitint lowering bugs [PR111625]
This patch fixes 2 issues.  One is when we want to get address of
an uninitialized large/huge bitint SSA_NAME for multiplication/division/modulo
or conversion to floating point (binary or decimal), the code just creates
an uninitialized limb sized variable and passes address of that, but I forgot
to initialize *prec in that case, so it invoked UB at compile time rather
than at runtime.  As it is UB, we could use anything valid as precision there,
say 2 bits for signed, 1 bit for unsigned as smallest possible set of values,
or full bitint precision as full random value.  Though, because we only pass
address to a single limb, I think it is best to pass the bitsize of the limb.

And the other issue is that when ranger in range_to_prec finds some range
is undefined_p (), it will assert {lower,upper}_bound () method isn't called
on it, but we were.  So, the patch adjusts range_to_proc to treat it like
the !optimized case, full bitint precision.

2023-09-30  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/111625
	PR middle-end/111637
	* gimple-lower-bitint.cc (range_to_prec): Use prec or -prec if
	r.undefined_p ().
	(bitint_large_huge::handle_operand_addr): For uninitialized operands
	use limb_prec or -limb_prec precision.
2023-09-30 11:28:44 +02:00
Jakub Jelinek
9d249b7e31 vec.h: Uncomment static_assert
Now that poly_int_pod has been removed and other changes mostly to use
{quick,safe}_grow_cleared instead of {quick,safe}_grow for types with
non-trivial default construction, we can enable even the last static
assertion.  From now on, {quick,safe}_grow can only be used with
trivially default constructible types.

2023-09-30  Jakub Jelinek  <jakub@redhat.com>

	* vec.h (quick_grow): Uncomment static_assert.
2023-09-30 11:26:14 +02:00
Jivan Hakobyan
d6fe757b39 RISC-V: Add type attribute in *<optab>_not_const<mode> pattern
After f088b768d0 commit riscv_sched_variable_issue function requires
that all insns should have a type attribute.

When I sent my previous patch there was no such limitation.
Currently, I have regressions on my tests. This patch fixes them.

gcc/ChangeLog:
	* config/riscv/bitmanip.md (*<optab>_not_const<mode>): Added type attribute
2023-09-29 21:21:02 -06:00
Eugene Rozenfeld
6cc9904811 Remove .PHONY targets when building .fda files during autoprofiledbootstrap
These .PHONY targets are always executed and were breaking `make install`
for autoprofiledbootstrap build.

Tested on x86_64-pc-linux-gnu.

gcc/c/ChangeLog:
	* Make-lang.in: Make create_fdas_for_cc1 target not .PHONY

gcc/cp/ChangeLog:
	* Make-lang.in: Make create_fdas_for_cc1plus target not .PHONY

gcc/lto/ChangeLog:
	* Make-lang.in: Make create_fdas_for_lto1 target not .PHONY
2023-09-29 18:13:03 -07:00
GCC Administrator
87c00507b8 Daily bump. 2023-09-30 00:17:24 +00:00
Gaius Mulley
c00fcbdab8 modula2: testsuite correction to m2date.mod
This patch corrects the m2date day of the week message.
The days of the week array start with Thursday reflecting the
1st Jan 1970.

gcc/testsuite/ChangeLog:

	* gm2/iso/run/pass/m2date.mod (DayName): Reordered.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-09-30 00:48:09 +01:00
Xiao Zeng
44efc743ac Fix INSN costing and more zicond tests
So this ends up looking a lot like the bits that I had to revert several weeks
ago :-)

The core issue we have is given an INSN the generic code will cost the SET_SRC
and SET_DEST and sum them.  But that's far from ideal on a RISC target.

For a register destination, the cost can be determined be looking at just the
SET_SRC.  Which is precisely what this patch does.  When the outer code is an
INSN and we're presented with a SET we take one of two paths.

If the destination is a register, then we recurse just on the SET_SRC and we're
done.  Otherwise we fall back to the existing code which sums the cost of the
SET_SRC and SET_DEST.  That fallback path isn't great and probably could be
further improved (just costing SET_DEST in that case is probably quite
reasonable).

The difference between this version and the bits that slipped through by
accident several weeks ago is that old version mis-used the API due to a thinko
on my part.

This tightens up various zicond tests to avoid undesirable matching.

This has been tested on rv64gc -- the only difference it makes on the testsuite
is the new tests (included in this patch) flip from failing to passing.

Pushed to the trunk.

gcc/
	* config/riscv/riscv.cc (riscv_rtx_costs): Better handle costing
	SETs when the outer code is INSN.

gcc/testsuite
	* gcc.target/riscv/zicond-primitiveSemantics_compare_imm.c: New test.
	* gcc.target/riscv/zicond-primitiveSemantics_compare_imm_return_0_imm.c:
	Likewise.
	* gcc.target/riscv/zicond-primitiveSemantics_compare_imm_return_imm_imm.c:
	Likewise.
	* gcc.target/riscv/zicond-primitiveSemantics_compare_imm_return_imm_reg.c:
	Likewise.
	* gcc.target/riscv/zicond-primitiveSemantics_compare_imm_return_reg_reg.c:
	Likewise.
	* gcc.target/riscv/zicond-primitiveSemantics_compare_reg.c: Likewise.
	* gcc.target/riscv/zicond-primitiveSemantics_compare_reg_return_0_imm.c:
	Likewise.
	* gcc.target/riscv/zicond-primitiveSemantics_compare_reg_return_imm_imm.c:
	Likewise.
	* gcc.target/riscv/zicond-primitiveSemantics_compare_reg_return_imm_reg.c:
	Likewise.
	* gcc.target/riscv/zicond-primitiveSemantics_compare_reg_return_reg_reg.c:
	Likewise.
	* gcc.target/riscv/zicond-primitiveSemantics.c: Tighten expected regexp.
	* gcc.target/riscv/zicond-primitiveSemantics_return_0_imm.c: Likewise.
	* gcc.target/riscv/zicond-primitiveSemantics_return_imm_imm.c: Likewise.
	* gcc.target/riscv/zicond-primitiveSemantics_return_imm_reg.c: Likewise.
	* gcc.target/riscv/zicond-primitiveSemantics_return_reg_reg.c: Likewise.
	* gcc.target/riscv/zicond-xor-01.c: Likewise.
2023-09-29 16:35:16 -06:00
Patrick O'Neill
4f1e5379fd RISC-V: Specify -mabi=lp64d in wredsum_vlmax.c testcase
Resolves this error on rv32gcv:
cc1: error: ABI requires '-march=rv32'
compiler exited with status 1
FAIL: gcc.target/riscv/rvv/vsetvl/wredsum_vlmax.c   -O0  (test for excess errors)

Tested for regressions using glibc rv32gcv/rv64gcv multilib on
r14-4339-geaa41a6dc12.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/vsetvl/wredsum_vlmax.c: Specify -mabi=lp64d.

Signed-off-by: Patrick O'Neill <patrick@rivosinc.com>
2023-09-29 15:01:12 -07:00
Patrick O'Neill
895ec1956a check_GNU_style.py: Skip .md square bracket linting
This testcase causes lots of false-positives for machine description files.

contrib/ChangeLog:

	* check_GNU_style_lib.py: Skip machine description file bracket linting.

Signed-off-by: Patrick O'Neill <patrick@rivosinc.com>
2023-09-29 14:13:02 -07:00
Jivan Hakobyan
51d09e67df RISC-V: Replace not + bitwise_imm with li + bitwise_not
In the case when we have C code like this

int foo (int a) {
   return 100 & ~a;
}

GCC generates the following instruction sequence

foo:
     not     a0,a0
     andi    a0,a0,100
     ret

This patch replaces that with this sequence
foo:
     li a5,100
     andn a0,a5,a0
     ret

The profitability comes from an out-of-order processor being able to
issue the "li a5, 100" at any time after it's fetched while "not a0, a0" has
to wait until any prior setter of a0 has reached completion.

gcc/ChangeLog:
	* config/riscv/bitmanip.md (*<optab>_not_const<mode>): New split
	pattern.

gcc/testsuite/ChangeLog:
	* gcc.target/riscv/zbb-andn-orn-01.c: New test.
	* gcc.target/riscv/zbb-andn-orn-02.c: Likewise.
2023-09-29 13:42:47 -06:00
Richard Sandiford
eaa41a6dc1 Remove poly_int_pod
poly_int was written before the switch to C++11 and so couldn't
use explicit default constructors.  This led to an awkward split
between poly_int_pod and poly_int.  poly_int simply inherited from
poly_int_pod and added constructors, with the argumentless constructor
having an empty body.  But inheritance meant that poly_int had to
repeat the assignment operators from poly_int_pod (again, no C++11,
so no "using" to inherit base-class implementations).

All that goes away if we switch to using default constructors.

The main complication is ensuring that braced initialisation still
gives a constexpr, so that static variables can be initialised without
runtime code.  The two problems here are:

(1) When initialising a poly_int<N, wide_int> with fewer than N
    coefficients, the other coefficients need to be a zero of
    the same precision as the explicit coefficients.  This was
    previously done in a for loop using wi::ints_for<...>::zero,
    but C++11 constexpr constructors can't have function bodies.
    The patch instead uses a series of delegated initialisers to
    fill in the implicit coefficients.

(2) The initialisation in:

      void f(int x) {
        unsigned int foo {x};
      }

    produces the warning:

      warning: narrowing conversion of 'x' from 'int' to 'unsigned int' [-Wnarrowing]

    whereas:

      void f(int x) {
        unsigned int foo = x;
      }

    does not.  So switching to direct initialisation of the coeffs array
    would mean that:

      poly_uin64_t x = 0;

    would trigger a warning for using 0 rather than 0u.  That seemed
    overly pedantic, so the patch adds explicit casts to the constructor.
    The complication is to do that without adding extra code to
    wide-int versions.  The patch uses a new init_cast type for that.

gcc/
	* poly-int.h (poly_int_pod): Delete.
	(poly_coeff_traits::init_cast): New type.
	(poly_int_full, poly_int_hungry, poly_int_fullness): New structures.
	(poly_int): Replace constructors that take 1 and 2 coefficients with
	a general one that takes an arbitrary number of coefficients.
	Delegate initialization to two new private constructors, one of
	which uses the coefficients as-is and one of which adds an extra
	zero of the appropriate type (and precision, where applicable).
	(gt_ggc_mx, gt_pch_nx): Operate on poly_ints rather than poly_int_pods.
	* poly-int-types.h (poly_uint16_pod, poly_int64_pod, poly_uint64_pod)
	(poly_offset_int_pod, poly_wide_int_pod, poly_widest_int_pod): Delete.
	* gengtype.cc (main): Don't register poly_int64_pod.
	* calls.cc (initialize_argument_information): Use poly_int rather
	than poly_int_pod.
	(combine_pending_stack_adjustment_and_call): Likewise.
	* config/aarch64/aarch64.cc (pure_scalable_type_info): Likewise.
	* data-streamer.h (bp_unpack_poly_value): Likewise.
	* dwarf2cfi.cc (struct dw_trace_info): Likewise.
	(struct queued_reg_save): Likewise.
	* dwarf2out.h (struct dw_cfa_location): Likewise.
	* emit-rtl.h (struct incoming_args): Likewise.
	(struct rtl_data): Likewise.
	* expr.cc (get_bit_range): Likewise.
	(get_inner_reference): Likewise.
	* expr.h (get_bit_range): Likewise.
	* fold-const.cc (split_address_to_core_and_offset): Likewise.
	(ptr_difference_const): Likewise.
	* fold-const.h (ptr_difference_const): Likewise.
	* function.cc (try_fit_stack_local): Likewise.
	(instantiate_new_reg): Likewise.
	* function.h (struct expr_status): Likewise.
	(struct args_size): Likewise.
	* genmodes.cc (ZERO_COEFFS): Likewise.
	(mode_size_inline): Likewise.
	(mode_nunits_inline): Likewise.
	(emit_mode_precision): Likewise.
	(emit_mode_size): Likewise.
	(emit_mode_nunits): Likewise.
	* gimple-fold.cc (get_base_constructor): Likewise.
	* gimple-ssa-store-merging.cc (struct symbolic_number): Likewise.
	* inchash.h (class hash): Likewise.
	* ipa-modref-tree.cc (modref_access_node::dump): Likewise.
	* ipa-modref.cc (modref_access_analysis::merge_call_side_effects):
	Likewise.
	* ira-int.h (ira_spilled_reg_stack_slot): Likewise.
	* lra-eliminations.cc (self_elim_offsets): Likewise.
	* machmode.h (mode_size, mode_precision, mode_nunits): Likewise.
	* omp-low.cc (omplow_simd_context): Likewise.
	* pretty-print.cc (pp_wide_integer): Likewise.
	* pretty-print.h (pp_wide_integer): Likewise.
	* reload.cc (struct decomposition): Likewise.
	* reload.h (struct reload): Likewise.
	* reload1.cc (spill_stack_slot_width): Likewise.
	(struct elim_table): Likewise.
	(offsets_at): Likewise.
	(init_eliminable_invariants): Likewise.
	* rtl.h (union rtunion): Likewise.
	(poly_int_rtx_p): Likewise.
	(strip_offset): Likewise.
	(strip_offset_and_add): Likewise.
	* rtlanal.cc (strip_offset): Likewise.
	* tree-dfa.cc (get_ref_base_and_extent): Likewise.
	(get_addr_base_and_unit_offset_1): Likewise.
	(get_addr_base_and_unit_offset): Likewise.
	* tree-dfa.h (get_ref_base_and_extent): Likewise.
	(get_addr_base_and_unit_offset_1): Likewise.
	(get_addr_base_and_unit_offset): Likewise.
	* tree-ssa-loop-ivopts.cc (struct iv_use): Likewise.
	(strip_offset): Likewise.
	* tree-ssa-sccvn.h (struct vn_reference_op_struct): Likewise.
	* tree.cc (ptrdiff_tree_p): Likewise.
	* tree.h (poly_int_tree_p): Likewise.
	(ptrdiff_tree_p): Likewise.
	(get_inner_reference): Likewise.

gcc/testsuite/
	* gcc.dg/plugin/poly-int-tests.h (test_num_coeffs_extra): Use
	poly_int rather than poly_int_pod.
2023-09-29 17:55:12 +01:00
Francois-Xavier Coudert
94e68ce96c Testsuite, DWARF2: adjust regexp to match darwin output
gcc/testsuite/ChangeLog:

	* gcc.dg/debug/dwarf2/inline4.c: Ajdust regexp to match darwin
	output.
2023-09-29 18:53:41 +02:00
Gaius Mulley
5f2408712a modula2: iso library SysClock.mod and wrapclock.cc fixes.
This patch corrects the C equivalent of m2 LONGINT parameters
in wrapclock.cc and corrects the SysClock.mod module.
wrapclock.cc uses a typedef long long int longint_t to match
m2 LONGINT (rather than unsigned long).  These fixes
prevent calls to SysClock hanging spinning on an (incorrect)
large day count from the epoch.

gcc/m2/ChangeLog:

	* gm2-compiler/M2Quads.mod (EndBuildFor): Improve
	block comments.
	* gm2-libs-iso/SysClock.mod (ExtractDate): Replace
	testDays with yearOfDays.  New local variable monthOfDays.

libgm2/ChangeLog:

	* libm2iso/wrapclock.cc (longint_t): New declaration.
	(GetTimespec): Replace types for sec and nano with
	longint_t.
	(SetTimespec): Replace types for sec and nano with
	longint_t.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-09-29 17:18:16 +01:00
John David Anglin
0f184b4141 Fix memory barrier patterns for pre PA8800 processors
2023-09-29  John David Anglin  <danglin@gcc.gnu.org>

	* config/pa/pa.md (memory_barrier): Revise comment.
	(memory_barrier_64, memory_barrier_32): Use ldcw,co on PA 2.0.
	* config/pa/pa.opt (coherent-ldcw): Change default to disabled.
2023-09-29 15:39:51 +00:00
Dimitrij Mijoski
a8b9c32da7 libstdc++: Fix handling of surrogate CP in codecvt [PR108976]
This patch fixes the handling of surrogate code points in all standard
facets for transcoding Unicode that are based on std::codecvt. Surrogate
code points should always be treated as error. On the other hand
surrogate code units can only appear in UTF-16 and only when they come
in a proper pair.

Additionally, it fixes a bug in std::codecvt_utf16::in() when odd number
of bytes were given in the range [from, from_end), error was returned
always. The last byte in such range does not form a full UTF-16 code
unit and we can not make any decisions for error, instead partial should
be returned.

The testsuite for testing these facets was updated in the following
order:

1. All functions that test codecvts that work with UTF-8 were refactored
   and made more generic so they accept codecvt that works with the char
   type char8_t.
2. The same functions were updated with new test cases for transcoding
   errors and now additionally test for surrogates, overlong UTF-8
   sequences, code points out of the Unicode range, and more tests for
   missing leading and trailing code units.
3. New tests were added to test codecvt_utf16 in both of its variants,
   UTF-16 <-> UTF-32/UCS-4 and UTF-16 <-> UCS-2.

libstdc++-v3/ChangeLog:

	PR libstdc++/108976
	* src/c++11/codecvt.cc (read_utf8_code_point): Fix handing of
	surrogates in UTF-8.
	(ucs4_out): Fix handling of surrogates in UCS-4 -> UTF-8.
	(ucs4_in): Fix handling of range with odd number of bytes.
	(ucs4_out): Fix handling of surrogates in UCS-4 -> UTF-16.
	(ucs2_out): Fix handling of surrogates in UCS-2 -> UTF-16.
	(ucs2_in): Fix handling of range with odd number of bytes.
	(__codecvt_utf16_base<char16_t>::do_in): Likewise.
	(__codecvt_utf16_base<char32_t>::do_in): Likewise.
	(__codecvt_utf16_base<wchar_t>::do_in): Likewise.
	* testsuite/22_locale/codecvt/codecvt_unicode.cc: Renames, add
	tests for codecvt_utf16<char16_t> and codecvt_utf16<char32_t>.
	* testsuite/22_locale/codecvt/codecvt_unicode.h: Refactor UTF-8
	testing functions for char8_t, add more test cases for errors,
	add testing functions for codecvt_utf16.
	* testsuite/22_locale/codecvt/codecvt_unicode_wchar_t.cc:
	Renames, add tests for codecvt_utf16<whchar_t>.
	* testsuite/22_locale/codecvt/codecvt_utf16/79980.cc (test06):
	Fix test.
	* testsuite/22_locale/codecvt/codecvt_unicode_char8_t.cc: New
	test.
2023-09-29 16:01:21 +01:00
Nathaniel Shead
28adad7a32 libstdc++: Ensure active union member is correctly set
This patch ensures that the union members for std::string and
std::variant are always properly set when a change occurs.

libstdc++-v3/ChangeLog:

	* include/bits/basic_string.h: (basic_string(basic_string&&)):
	Activate _M_local_buf when needed.
	(basic_string(basic_string&&, const _Alloc&)): Likewise.
	* include/bits/basic_string.tcc: (basic_string::swap): Likewise.
	* include/std/variant: (__detail::__variant::__construct_n): New.
	(__detail::__variant::__emplace): Use __construct_n.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
2023-09-29 16:01:20 +01:00
Paul Iannetta
346f599156 Harmonize headers between both dg-extract-results scripts
The header of the python version looked like:
    Target is ...
    Host   is ...
    The header of the bash version looked like:
    Test run by ... on ...
    Target is ...

    After this change both headers look like:
    Test run by ... on ...
    Target is ...
    Host   is ...

    The order of the tests is not the same but since dg-cmp-results.sh it
    does not matter much.

contrib/ChangeLog:

	* dg-extract-results.py: Print the "Test run" line.
	* dg-extract-results.sh: Print the "Host" line.
2023-09-29 08:50:28 -06:00
Jakub Jelinek
e40f330101 vec.h: Guard most of static assertions for GCC >= 5
As reported by Jonathan on IRC, my vec.h patch broke build with GCC 4.8.x
or 4.9.x as system compiler, e.g. on CFarm.
The problem is that while all of
std::is_trivially_{destructible,copyable,default_constructible} traits
are in C++, only std::is_trivially_destructible has been implemented in GCC
4.8, the latter two were added only in GCC 5.
Only std::is_trivially_destructible is the really important one though,
which is used to decide what pop returns and whether to invoke the
destructors or not.  The rest are solely used in static_asserts and as such
I think it is acceptable if we don't assert those when built with GCC 4.8
or 4.9, anybody doing bootstrap from those system compilers or doing builds
with newer GCC will catch that.

So, the following patch guards those for 5+.
If we switch to C++14 later on and start requiring newer version of system
GCC as well (do we require GCC >= 5 which claims the last C++14 language
features, or what provides all C++14 library features, or GCC >= 6 which
uses -std=c++14 by default?), this patch then can be reverted.

2023-09-29  Jakub Jelinek  <jakub@redhat.com>

	* vec.h (quick_insert, ordered_remove, unordered_remove,
	block_remove, qsort, sort, stablesort, quick_grow): Guard
	std::is_trivially_{copyable,default_constructible} and
	vec_detail::is_trivially_copyable_or_pair static assertions
	with GCC_VERSION >= 5000.
	(vec_detail::is_trivially_copyable_or_pair): Guard definition
	with GCC_VERSION >= 5000.
2023-09-29 15:14:52 +02:00
Andre Vehreschild
a680274616 Fortran: Free alloc. comp. in allocated coarrays only.
When freeing allocatable components of an allocatable coarray, add
a check that the coarray is still allocated, before accessing the
components.

This patch adds to PR fortran/37336, but does not fix it completely.

gcc/fortran/ChangeLog:
	PR fortran/37336
	* trans-array.cc (structure_alloc_comps): Deref coarray.
	(gfc_trans_deferred_array): Add freeing of components after
	check for allocated coarray.

gcc/testsuite/ChangeLog:
	PR fortran/37336
	* gfortran.dg/coarray/alloc_comp_6.f90: New test.
	* gfortran.dg/coarray/alloc_comp_7.f90: New test.
2023-09-29 14:54:42 +02:00
Manos Anagnostakis
574cec45b2 aarch64: Improve on ldp-stp policies code structure.
Improves on: 834fc2bf

This improves the code structure of the ldp-stp policies
patch introduced in 834fc2bf

Bootstrapped and regtested on aarch64-linux.

gcc/ChangeLog:
	* config/aarch64/aarch64-opts.h (enum aarch64_ldp_policy): Removed.
	(enum aarch64_ldp_stp_policy): Merged enums aarch64_ldp_policy
	and aarch64_stp_policy to aarch64_ldp_stp_policy.
	(enum aarch64_stp_policy): Removed.
	* config/aarch64/aarch64-protos.h (struct tune_params): Removed
	aarch64_ldp_policy_model and aarch64_stp_policy_model enum types
	and left only the definitions to the aarch64-opts one.
	* config/aarch64/aarch64.cc (aarch64_parse_ldp_policy): Removed.
	(aarch64_parse_stp_policy): Removed.
	(aarch64_override_options_internal): Removed calls to parsing
	functions and added obvious direct assignments.
	(aarch64_mem_ok_with_ldpstp_policy_model): Improved
	code quality based on the new changes.
	* config/aarch64/aarch64.opt: Use single enum type
	aarch64_ldp_stp_policy for both ldp and stp options.

gcc/testsuite/ChangeLog:
	* gcc.target/aarch64/ldp_aligned.c: Splitted into this and
	ldp_unaligned.
	* gcc.target/aarch64/stp_aligned.c: Splitted into this and
	stp_unaligned.
	* gcc.target/aarch64/ldp_unaligned.c: New test.
	* gcc.target/aarch64/stp_unaligned.c: New test.

Signed-off-by: Manos Anagnostakis <manos.anagnostakis@vrull.eu>
Suggested-by: Richard Sandiford <richard.sandiford@arm.com>
2023-09-29 12:45:04 +02:00
Richard Biener
962ca7149d tree-optimization/111583 - loop distribution issue
The following conservatively fixes loop distribution to only
recognize memset/memcpy and friends when at least one element
is going to be processed.  This avoids having an unconditional
builtin call in the IL that might imply the source and destination
pointers are non-NULL when originally pointers were not always
dereferenced.

With -Os loop header copying is less likely to ensure this.

	PR tree-optimization/111583
	* tree-loop-distribution.cc (find_single_drs): Ensure the
	load/store are always executed.

	* gcc.dg/tree-ssa/pr111583-1.c: New testcase.
	* gcc.dg/tree-ssa/pr111583-2.c: Likewise.
2023-09-29 11:50:14 +02:00
Jakub Jelinek
59cda1f952 use *_grow_cleared rather than *_grow on vect_unpromoted_value
vect_recog_over_widening_pattern is another spot which triggers the
right now commented out static assertion in vec.h which asserts
{quick,safe}_grow vec operations are only used with trivially default
constructible types.

I had a look at this and I think using quick_grow_cleared is best choice
here.  The nops is 2 or 1 most of the time, worst case 3, so the price of
extra initialization of 4 pointer-sized-or-less members times 1, 2 or 3
doesn't seem worth bothering, it is similar to the bitmap_head case where
we already pay the price for just one structure anytime we do
  vect_unpromoted_value unprom_diff;
(and later set_op on it) or even
  vect_unpromoted_value unprom0[2];

With this patch and Richard S's poly_int_pod removal the static_assert can
be enabled as well and gcc builds.

2023-09-29  Jakub Jelinek  <jakub@redhat.com>

	* tree-vect-patterns.cc (vect_recog_over_widening_pattern): Use
	quick_grow_cleared method on unprom rather than quick_grow.
2023-09-29 11:23:16 +02:00
Sergei Trofimovich
7525707c5f ggc: do not wipe out unrelated data via gt_ggc_rtab [PR111505]
There are 3 GC root tables:

   gt_ggc_rtab
   gt_ggc_deletable_rtab
   gt_pch_scalar_rtab

`deletable` and `scalar` tables are both simple: each element always
contains a pointer to the beginning of the object and it's size is the
full object.

`rtab` is different: it's `base` is a pointer in the middle of the
struct and `stride` points to the next GC pointer in the array.

Before the change there were 2 problems:

1. We memset()ed not just pointers but data around them.
2. We wen out of bounds of the last object described by gt_ggc_rtab
   and triggered bootstrap failures in profile and asan bootstraps.

After the change we handle only pointers themselves like the rest of
ggc-common.cc code.

gcc/
	PR middle-end/111505
	* ggc-common.cc (ggc_zero_out_root_pointers, ggc_common_finalize):
	Add new helper. Use helper instead of memset() to wipe out pointers.
2023-09-29 09:50:00 +01:00
Richard Sandiford
bcc97edf8c Simplify & expand c_readstr
c_readstr only operated on integer modes.  It worked by reading
the source string into an array of HOST_WIDE_INTs, converting
that array into a wide_int, and from there to an rtx.

It's simpler to do this by building a target memory image and
using native_decode_rtx to convert that memory image into an rtx.
It avoids all the endianness shenanigans because both the string and
native_decode_rtx follow target memory order.  It also means that the
function can handle all fixed-size modes, which simplifies callers
and allows vector modes to be used more widely.

gcc/
	* builtins.h (c_readstr): Take a fixed_size_mode rather than a
	scalar_int_mode.
	* builtins.cc (c_readstr): Likewise.  Build a local array of
	bytes and use native_decode_rtx to get the rtx image.
	(builtin_memcpy_read_str): Simplify accordingly.
	(builtin_strncpy_read_str): Likewise.
	(builtin_memset_read_str): Likewise.
	(builtin_memset_gen_str): Likewise.
	* expr.cc (string_cst_read_str): Likewise.
2023-09-29 09:24:43 +01:00
Jakub Jelinek
a561369743 use *_grow_cleared rather than *_grow on vec<bitmap_head>
The assert checking which is commented out in vec.h grow method requires
trivially default constructible types to be used with this method, but
bitmap_head has since the PR88317 r9-4642 workaround non-trivial default
constructor to catch bugs and we pay the minimum price of initializing
everything in bitmap_head twice on the common
  bitmap_head var;
  bitmap_initilize (&var, obstack);
sequence.  This patch makes us pay the same price times number of elements
on
  vec<bitmap_head> v;
  v.create (n);
  v.safe_grow_cleared (n); // previous v.safe_grow (n);
  for (int i = 0; i < n; ++i)
    bitmap_initialize (&v[i], obstack);

2023-09-29  Jakub Jelinek  <jakub@redhat.com>

	* tree-ssa-loop-im.cc (tree_ssa_lim_initialize): Use quick_grow_cleared
	instead of quick_grow on vec<bitmap_head> members.
	* cfganal.cc (control_dependences::control_dependences): Likewise.
	* rtl-ssa/blocks.cc (function_info::build_info::build_info): Likewise.
	(function_info::place_phis): Use safe_grow_cleared instead of safe_grow
	on auto_vec<bitmap_head> vars.
	* tree-ssa-live.cc (compute_live_vars): Use quick_grow_cleared instead
	of quick_grow on vec<bitmap_head> var.
2023-09-29 09:35:01 +02:00
GCC Administrator
14c363c135 Daily bump. 2023-09-29 00:17:28 +00:00
Tom Tromey
202810947c libstdc++: Use Python "not in" operator
flake8 warns about code like

    not something in "whatever"

Ordinarily in Python this should be written as:

    something not in "whatever"

This patch makes this change.

libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/printers.py (Printer.add_version)
	(add_one_template_type_printer)
	(FilteringTypePrinter.add_one_type_printer): Use Python
	"not in" operator.
2023-09-28 14:56:09 -06:00
Tom Tromey
860b284e3e libstdc++: Remove std_ratio_t_tuple
This removes the std_ratio_t_tuple function from the Python
pretty-printer code.  It is not used.  Apparently the relevant parts
were moved to StdChronoDurationPrinter._ratio at some point in the
past.

libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/printers.py (std_ratio_t_tuple):
	Remove.
2023-09-28 14:56:05 -06:00
Tom Tromey
33841921a2 libstdc++: Remove unused locals from printers.py
flake8 pointed out some unused local variables in the libstdc++
pretty-printers.  This removes them.

libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/printers.py
	(StdExpOptionalPrinter.__init__, lookup_node_type):
	Remove unused variables.
2023-09-28 14:56:00 -06:00
Tom Tromey
bed1f8498a libstdc++: Remove unused Python imports
flake8 pointed out some unused imports.

libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/printers.py: Don't import 'os'.
	* python/libstdcxx/v6/__init__.py: Don't import 'gdb'.
2023-09-28 14:55:54 -06:00
Tom Tromey
64f1210301 libstdc++: Use gdb.ValuePrinter base class
GDB 14 will add a new ValuePrinter tag class that will be used to
signal that pretty-printers will agree to the "extension protocol" --
essentially that they will follow some simple namespace rules, so that
GDB can add new methods over time.

A couple new methods have already been added to GDB, to support DAP.
While I haven't implemented these for any libstdc++ printers yet, this
patch makes the basic conversion: printers derive from
gdb.ValuePrinter if it is available, and all "non-standard" (that is,
not specified by GDB) members of the various value-printing classes
are renamed to have a leading underscore.

libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/printers.py: Use gdb.ValuePrinter
	everywhere.  Rename members to start with "_".
2023-09-28 14:55:23 -06:00
Tom Tromey
98db58eb0b libstdc++: Show full Python stack on error
This changes the libstdc++ test suite to arrange for gdb to show the
full Python stack if any sort of Python exception occurs.  This makes
debugging the printers a little simpler.

libstdc++-v3/ChangeLog:

	* testsuite/lib/gdb-test.exp (gdb-test): Enable Python
	stack traces from gdb.
2023-09-28 14:55:18 -06:00
Jonathan Wakely
17d3477fa8 libstdc++: Refactor Python Xmethods to use is_specialization_of
This copies the is_specialization_of function from printers.py (with
slight modification for versioned namespace handling) and reuses it in
xmethods.py to replace repetitive re.match calls in every class.

This fixes the problem that the regular expressions used \d without
escaping the backslash properly.

libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/xmethods.py (is_specialization_of): Define
	new function.
	(ArrayMethodsMatcher, DequeMethodsMatcher)
	(ForwardListMethodsMatcher, ListMethodsMatcher)
	(VectorMethodsMatcher, AssociativeContainerMethodsMatcher)
	(UniquePtrGetWorker, UniquePtrMethodsMatcher)
	(SharedPtrSubscriptWorker, SharedPtrMethodsMatcher): Use
	is_specialization_of instead of re.match.
2023-09-28 21:20:27 +01:00
Jonathan Wakely
6b5c3f9b81 libstdc++: Reformat Python code
Some of these changes were suggested by autopep8's --aggressive
option, others are for readability.

Break long lines by splitting strings across multiple lines, or
introducing local variables to hold results.

Use raw strings for regular expressions, so that backslashes don't need
to be escaped.

libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/printers.py: Break long lines. Use raw
	strings for regular expressions. Add whitespace around
	operators.
	(is_member_of_namespace): Use isinstance to check type.
	(is_specialization_of): Likewise. Adjust template_name
	for versioned namespace instead of duplicating the re.match
	call.
	(StdExpAnyPrinter._string_types): New static method.
	(StdExpAnyPrinter.to_string): Use _string_types.
2023-09-28 21:20:21 +01:00
Jonathan Wakely
0ef4cc8225 libstdc++: Format Python docstrings according to PEP 357
libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/printers.py: Format docstrings according
	to PEP 257.
	* python/libstdcxx/v6/xmethods.py: Likewise.
2023-09-28 20:56:44 +01:00
Gaius Mulley
918a691a39 modula2: Increase linking test timeouts for slower targets
This patch introduces missing timeout handling for
pimlib-base-run-pass.exp and increases the timeout value
for larger projects which link (necessary for slower targets).

gcc/testsuite/ChangeLog:

	* gm2/coroutines/pim/run/pass/coroutines-pim-run-pass.exp:
	Add load_lib timeout-dg.exp and increase timeout to 60
	seconds.
	* gm2/pimlib/base/run/pass/pimlib-base-run-pass.exp: Add
	load_lib timeout-dg.exp and increase timeout to 60 seconds.
	* gm2/projects/iso/run/pass/halma/projects-iso-run-pass-halma.exp:
	Increase timeout to 45 seconds.
	* gm2/switches/whole-program/pass/run/switches-whole-program-pass-run.exp:
	Add load_lib timeout-dg.exp and increase timeout to 120 seconds.
	Remove unnecessary compile of mystrlib.mod.
	* gm2/iso/run/pass/iso-run-pass.exp: Add load_lib
	timeout-dg.exp and set timeout to 60 seconds.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-09-28 19:07:04 +01:00
Tim Song
2c1e3544a9 libstdc++: Force _Hash_node_value_base methods inline to fix abi (PR111050)
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=1b6f0476837205932613ddb2b3429a55c26c409d
changed _Hash_node_value_base to no longer derive from _Hash_node_base, which means
that its member functions expect _M_storage to be at a different offset. So explosions
result if an out-of-line definition is emitted for any of the member functions (say,
in a non-optimized build) and the resulting object file is then linked with code built
using older version of GCC/libstdc++.

libstdc++-v3/ChangeLog:

	PR libstdc++/111050
	* include/bits/hashtable_policy.h
	(_Hash_node_value_base<>::_M_valptr(), _Hash_node_value_base<>::_M_v())
	Add [[__gnu__::__always_inline__]].
2023-09-28 19:14:30 +02:00
Vladimir N. Makarov
8552dcd8e4 Revert "[RA]: Improve cost calculation of pseudos with equivalences"
This reverts commit 3c834d85f2.

Although the patch improves x86-64 specfp2007, it also results in
performance and code size regression on different targets and
new GCC testsuite failures on tests expecting a specific output.
2023-09-28 11:57:45 -04:00