Commit Graph

207211 Commits

Author SHA1 Message Date
Pierre-Emmanuel Patry
7a6906c8d8 gccrs: Fix missing build dependency
Fix the missing dependency between the gcc and libgrust.

ChangeLog:

	* Makefile.def: Add a dependency to libgrust for all-gcc.
	* Makefile.in: Regenerate the file.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2024-01-16 16:23:02 +01:00
Pierre-Emmanuel Patry
fc59a3995c gccrs: Fix bootstrap build
This commit fixes bootstrapping for future additions to libgrust/

ChangeLog:

	* Makefile.def: Add libgrust target to bootstrap.
	* Makefile.in: Regenerate.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2024-01-16 16:23:02 +01:00
Daniel Cederman
ee0717da1e sparc: Char arrays are 64-bit aligned on SPARC
pr88077 fails on SPARC since char HeaderStr[1] in pr88077_1.c and
long HeaderStr in pr88077_0.c differs in alignment.

Warning printed by Binutils ld:
warning: alignment 4 of normal symbol `HeaderStr' in c_lto_pr88077_0.o is
smaller than 8 used by the common definition in c_lto_pr88077_1.o

gcc/testsuite/ChangeLog:

	* gcc.dg/lto/pr88077_0.c: Change type to match alignment for SPARC
2024-01-16 12:53:49 +01:00
Daniel Cederman
0a3e0b7623 testsuite: Skip ifcvt-4.c for SPARC V8
Conditional moves are not available in SPARC V8.

gcc/testsuite/ChangeLog:

	* gcc.dg/ifcvt-4.c: Skip for SPARC V8
2024-01-16 12:53:48 +01:00
Daniel Cederman
c528c16398 sparc: Treat instructions with length 0 as empty
This is to handle the membar_empty instruction that can be generated
when compiling for UT699.

gcc/ChangeLog:

	* config/sparc/sparc.cc (next_active_non_empty_insn): Length 0 treated as empty
2024-01-16 12:53:48 +01:00
Daniel Cederman
af59861398 sparc: Add errata workaround to membar patterns
LEON now uses the standard V8 membar patterns that contains an ldstub
instruction. This instruction needs to be aligned properly when the
GR712RC errata workaround is enabled.

gcc/ChangeLog:

	* config/sparc/sparc.cc (atomic_insn_for_leon3_p): Treat membar_storeload as atomic
	* config/sparc/sync.md (membar_storeload): Turn into named insn
	and add GR712RC errata workaround.
	(membar_v8): Add GR712RC errata workaround.
2024-01-16 12:53:48 +01:00
Andreas Larsson
13db80cb88 sparc: Revert membar optimization that is not suitable for LEON5
LEON5 has a deeper write-buffer and hence stb is not enough to flush a
write out. For compatibility, use the default V8 approach for both
LEON3 and LEON5.

This reverts commit 49cc765db3,
"sync.md (*membar_storeload_leon3): New insn."

gcc/ChangeLog:

	* config/sparc/sync.md (*membar_storeload_leon3): Remove
	(*membar_storeload): Enable for LEON
2024-01-16 12:53:48 +01:00
Eric Botcazou
cf420e7b98 Fix crash of -fdump-ada-spec in a pathological case
gcc/c-family/
	PR ada/113397
	* c-ada-spec.cc (check_type_name_conflict): Add guard for the
	presence of DECL_NAME on a TYPE_DECL.
2024-01-16 12:17:32 +01:00
Jakub Jelinek
1251d3957d cfgexpand: Workaround CSE of ADDR_EXPRs in VAR_DECL partitioning [PR113372]
The following patch adds a quick workaround to bugs in VAR_DECL
partitioning.
The problem is that there is no dependency between ADDR_EXPRs of local
decls and CLOBBERs of those vars, so VN can CSE uses of ADDR_EXPRs
(including ivopts integral variants thereof), which can break
add_scope_conflicts discovery of what variables are actually used
in certain region.
E.g. we can have
  ivtmp.40_3 = (unsigned long) &MEM <unsigned long[100]> [(void *)&bitint.6 + 8B];
...
  uses of ivtmp.40_3
...
  bitint.6 ={v} {CLOBBER(eos)};
...
  ivtmp.28_43 = (unsigned long) &MEM <unsigned long[100]> [(void *)&bitint.6 + 8B];
...
  uses of ivtmp.28_43
before VN (such as dom3), which the add_scope_conflicts code identifies as 2
independent uses of bitint.6 variable (which is correct), but then VN
determines ivtmp.28_43 is the same as ivtmp.40_3 and just uses ivtmp.40_3
even in the second region; at that point add_scope_conflict thinks the
bitint.6 variable is not used in that region anymore.

The following patch does a simple single def-stmt check for such ADDR_EXPRs
(rather than say trying to do a full propagation of what SSA_NAMEs can
contain ADDR_EXPRs of local variables), which seems to workaround all 4 PRs.

In addition to this patch I've used the attached one to gather statistics
on the total size of all variable partitions in a function and seems besides
the new testcases nothing is really affected compared to no patch (I've
actually just modified the patch to == OMP_SCAN instead of == ADDR_EXPR, so
it looks the same except that it never triggers).  The comparison wasn't
perfect because I've only gathered BITS_PER_WORD, main_input_filename (did
some replacement of build directories and /tmp/ccXXXXXX names of LTO to make
it more similar between the two bootstraps/regtests), current_function_name
and the total size of all variable partitions if any, because I didn't
record e.g. the optimization options and so e.g. torture tests which iterate
over options could have different partition sizes even in one compiler when
BITS_PER_WORD, main_input_filename and current_function_name are all equal.
So had to write an awk script to check if the first triple in the second
build appeared in the first one and the quadruple in the second build
appeared in the first one too, otherwise print result and that only
triggered in the new tests.
Also, the cc1plus binary according to objdump -dr is identical between the
two builds except for the ADDR_EXPR vs. OMP_SCAN constant in the two spots.

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

	PR tree-optimization/113372
	PR middle-end/90348
	PR middle-end/110115
	PR middle-end/111422
	* cfgexpand.cc (add_scope_conflicts_2): New function.
	(add_scope_conflicts_1): Use it.

	* gcc.dg/torture/bitint-49.c: New test.
	* gcc.c-torture/execute/pr90348.c: New test.
	* gcc.c-torture/execute/pr110115.c: New test.
	* gcc.c-torture/execute/pr111422.c: New test.
2024-01-16 11:49:34 +01:00
Georg-Johann Lay
9aaafcb342 AVR: Add AVR16EB, AVR16EA and AVR32EA devices.
gcc/
	* config/avr/avr-mcus.def (avr16eb14, avr16eb20, avr16eb28, avr16eb32)
	(avr16ea28, avr16ea32, avr16ea48, avr32ea28, avr32ea32, avr32ea48): Add.
	* doc/avr-mmcu.texi: Regenerate.
2024-01-16 11:38:50 +01:00
Feng Xue
57f611604e Do not count unused scalar use when marking STMT_VINFO_LIVE_P [PR113091]
When pattern recognition is involved, a statement whose definition is
consumed in some pattern, may not be included in the final replacement
pattern statements, and would be skipped when building SLP graph.

 * Original
  char a_c = *(char *) a;
  char b_c = *(char *) b;
  unsigned short a_s = (unsigned short) a_c;
  int a_i = (int) a_s;
  int b_i = (int) b_c;
  int r_i = a_i - b_i;

 * After pattern replacement
  a_s = (unsigned short) a_c;
  a_i = (int) a_s;

  patt_b_s = (unsigned short) b_c;    // b_i = (int) b_c
  patt_b_i = (int) patt_b_s;          // b_i = (int) b_c

  patt_r_s = widen_minus(a_c, b_c);   // r_i = a_i - b_i
  patt_r_i = (int) patt_r_s;          // r_i = a_i - b_i

The definitions of a_i(original statement) and b_i(pattern statement)
are related to, but actually not part of widen_minus pattern.
Vectorizing the pattern does not cause these definition statements to
be marked as PURE_SLP.  For this case, we need to recursively check
whether their uses are all absorbed into vectorized code.  But there
is an exception that some use may participate in an vectorized
operation via an external SLP node containing that use as an element.

gcc/ChangeLog:

	PR tree-optimization/113091
	* tree-vect-slp.cc (vect_slp_has_scalar_use): New function.
	(vect_bb_slp_mark_live_stmts): New parameter scalar_use_map, check
	scalar use with new function.
	(vect_bb_slp_mark_live_stmts): New function as entry to existing
	overriden functions with same name.
	(vect_slp_analyze_operations): Call new entry function to mark
	live statements.

gcc/testsuite/ChangeLog:

	* gcc.target/aarch64/bb-slp-pr113091.c: New test.
2024-01-16 11:36:08 +08:00
Juzhe-Zhong
5134d3074a RISC-V: Report Sorry when users enable RVV in big-endian mode [PR113404]
As PR113404 mentioned: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113404

We have ICE when we enable RVV in big-endian mode:

during RTL pass: expand
a-float-point-dynamic-frm-66.i:2:14: internal compiler error: in to_constant, at poly-int.h:588
0xab4c2c poly_int<2u, unsigned short>::to_constant() const
        /repo/gcc-trunk/gcc/poly-int.h:588
0xab4de1 poly_int<2u, unsigned short>::to_constant() const
        /repo/gcc-trunk/gcc/tree.h:4055
0xab4de1 default_function_arg_padding(machine_mode, tree_node const*)
        /repo/gcc-trunk/gcc/targhooks.cc:844
0x12e2327 locate_and_pad_parm(machine_mode, tree_node*, int, int, int, tree_node*, args_size*, locate_and_pad_arg_data*)
        /repo/gcc-trunk/gcc/function.cc:4061
0x12e2aca assign_parm_find_entry_rtl
        /repo/gcc-trunk/gcc/function.cc:2614
0x12e2c89 assign_parms
        /repo/gcc-trunk/gcc/function.cc:3693
0x12e59df expand_function_start(tree_node*)
        /repo/gcc-trunk/gcc/function.cc:5152
0x112fafb execute
        /repo/gcc-trunk/gcc/cfgexpand.cc:6739

Report users that we don't support RVV in big-endian mode for the following reasons:
1. big-endian in RISC-V is pretty rare case.
2. We didn't test RVV in big-endian and we don't have enough time to test it since it's stage 4 now.

Naive disallow RVV in big-endian.

Tested no regression, ok for trunk ?

gcc/ChangeLog:

	PR target/113404
	* config/riscv/riscv.cc (riscv_override_options_internal): Report sorry
	for RVV in big-endian mode.

gcc/testsuite/ChangeLog:

	PR target/113404
	* gcc.target/riscv/rvv/base/big_endian-1.c: New test.
	* gcc.target/riscv/rvv/base/big_endian-2.c: New test.
2024-01-16 11:20:27 +08:00
Kewen Lin
39fa71a088 testsuite: Fix vect_long_mult on Power [PR109705]
As pointed out by the discussion in PR109705, the current
vect_long_mult effective target check on Power is broken.
This patch is to fix it accordingly.

With additional change by adding a guard vect_long_mult
in gcc.dg/vect/pr25413a.c, it's tested well on Power{8,9}
LE & BE (also on Power10 LE as before).

	PR testsuite/109705

gcc/testsuite/ChangeLog:

	* lib/target-supports.exp (check_effective_target_vect_long_mult):
	Fix powerpc*-*-* checks.
2024-01-15 20:56:22 -06:00
Yanzhang Wang
04c5b9e4ab RISC-V: delete vector abi checking in all relevant tests.
gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/base/abi-call-args-1-run.c: Delete the
	-Wno-psabi.
	* gcc.target/riscv/rvv/base/abi-call-args-1.c: Ditto.
	* gcc.target/riscv/rvv/base/abi-call-args-2-run.c: Ditto.
	* gcc.target/riscv/rvv/base/abi-call-args-2.c: Ditto.
	* gcc.target/riscv/rvv/base/abi-call-args-3-run.c: Ditto.
	* gcc.target/riscv/rvv/base/abi-call-args-3.c: Ditto.
	* gcc.target/riscv/rvv/base/abi-call-args-4-run.c: Ditto.
	* gcc.target/riscv/rvv/base/abi-call-args-4.c: Ditto.
	* gcc.target/riscv/rvv/base/abi-call-error-1.c: Ditto.
	* gcc.target/riscv/rvv/base/abi-call-return-run.c: Ditto.
	* gcc.target/riscv/rvv/base/abi-call-return.c: Ditto.
	* gcc.target/riscv/rvv/base/abi-call-variant_cc.c: Ditto.
	* gcc.target/riscv/rvv/base/abi-callee-saved-1-fixed-1.c: Ditto.
	* gcc.target/riscv/rvv/base/abi-callee-saved-1-fixed-2.c: Ditto.
	* gcc.target/riscv/rvv/base/abi-callee-saved-1-save-restore.c: Ditto.
	* gcc.target/riscv/rvv/base/abi-callee-saved-1-zcmp.c: Ditto.
	* gcc.target/riscv/rvv/base/abi-callee-saved-1.c: Ditto.
	* gcc.target/riscv/rvv/base/abi-callee-saved-2-save-restore.c: Ditto.
	* gcc.target/riscv/rvv/base/abi-callee-saved-2-zcmp.c: Ditto.
	* gcc.target/riscv/rvv/base/abi-callee-saved-2.c: Ditto.
	* gcc.target/riscv/rvv/base/fixed-point-vxrm-error.c: Ditto.
	* gcc.target/riscv/rvv/base/fixed-point-vxrm.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-cvt-f.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-cvt-x.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-cvt-xu.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-1.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-10.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-11.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-12.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-13.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-14.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-15.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-16.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-17.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-18.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-19.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-2.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-20.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-21.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-22.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-23.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-24.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-25.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-26.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-27.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-28.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-29.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-3.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-30.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-31.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-32.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-33.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-34.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-35.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-36.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-37.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-38.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-39.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-4.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-40.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-41.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-42.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-43.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-44.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-45.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-46.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-47.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-48.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-49.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-5.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-50.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-51.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-52.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-53.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-54.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-55.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-56.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-57.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-58.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-59.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-6.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-60.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-61.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-62.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-63.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-64.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-65.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-66.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-67.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-68.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-69.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-7.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-70.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-71.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-72.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-73.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-74.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-75.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-76.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-77.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-8.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-dynamic-frm-9.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-frm-autovec-1.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-frm-autovec-2.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-frm-autovec-3.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-frm-autovec-4.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-frm-error.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-frm-insert-1.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-frm-insert-10.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-frm-insert-2.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-frm-insert-3.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-frm-insert-4.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-frm-insert-5.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-frm-insert-7.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-frm-insert-8.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-frm-insert-9.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-frm-run-1.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-frm-run-2.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-frm-run-3.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-frm-run-4.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-frm-run-5.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-frm.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-fwmacc.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-macc.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-madd.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-msac.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-msub.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-ncvt-f.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-ncvt-x.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-ncvt-xu.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-nmacc.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-nmadd.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-nmsac.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-nmsub.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-rec7.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-redosum.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-redusum.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-single-div.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-single-mul.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-single-rdiv.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-single-rsub.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-single-sub.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-sqrt.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-wcvt-x.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-wcvt-xu.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-widening-add.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-widening-mul.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-widening-sub.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-wmsac.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-wnmacc.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-wnmsac.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-wredosum.c: Ditto.
	* gcc.target/riscv/rvv/base/float-point-wredusum.c: Ditto.
	* gcc.target/riscv/rvv/base/intrisinc-vrgatherei16.c: Ditto.
	* gcc.target/riscv/rvv/base/no-honor-frm-1.c: Ditto.
	* gcc.target/riscv/rvv/base/overloaded_rv32_vadd.c: Ditto.
	* gcc.target/riscv/rvv/base/overloaded_rv32_vfadd.c: Ditto.
	* gcc.target/riscv/rvv/base/overloaded_rv32_vget_vset.c: Ditto.
	* gcc.target/riscv/rvv/base/overloaded_rv32_vloxseg2ei16.c: Ditto.
	* gcc.target/riscv/rvv/base/overloaded_rv32_vmv.c: Ditto.
	* gcc.target/riscv/rvv/base/overloaded_rv32_vreinterpret.c: Ditto.
	* gcc.target/riscv/rvv/base/overloaded_rv64_vadd.c: Ditto.
	* gcc.target/riscv/rvv/base/overloaded_rv64_vfadd.c: Ditto.
	* gcc.target/riscv/rvv/base/overloaded_rv64_vget_vset.c: Ditto.
	* gcc.target/riscv/rvv/base/overloaded_rv64_vloxseg2ei16.c: Ditto.
	* gcc.target/riscv/rvv/base/overloaded_rv64_vmv.c: Ditto.
	* gcc.target/riscv/rvv/base/overloaded_rv64_vreinterpret.c: Ditto.
	* gcc.target/riscv/rvv/base/pr110119-1.c: Ditto.
	* gcc.target/riscv/rvv/base/pr110119-2.c: Ditto.
	* gcc.target/riscv/rvv/base/pr110265-1.c: Ditto.
	* gcc.target/riscv/rvv/base/pr110265-2.c: Ditto.
	* gcc.target/riscv/rvv/base/pr110265-3.c: Ditto.
	* gcc.target/riscv/rvv/base/pr110277-1.c: Ditto.
	* gcc.target/riscv/rvv/base/pr110277-2.c: Ditto.
	* gcc.target/riscv/rvv/base/pr110299-1.c: Ditto.
	* gcc.target/riscv/rvv/base/pr110299-2.c: Ditto.
	* gcc.target/riscv/rvv/base/pr110299-3.c: Ditto.
	* gcc.target/riscv/rvv/base/pr110299-4.c: Ditto.
	* gcc.target/riscv/rvv/base/pr111720-0.c: Ditto.
	* gcc.target/riscv/rvv/base/pr111720-1.c: Ditto.
	* gcc.target/riscv/rvv/base/pr111720-10.c: Ditto.
	* gcc.target/riscv/rvv/base/pr111720-2.c: Ditto.
	* gcc.target/riscv/rvv/base/pr111720-3.c: Ditto.
	* gcc.target/riscv/rvv/base/pr111720-4.c: Ditto.
	* gcc.target/riscv/rvv/base/pr111720-5.c: Ditto.
	* gcc.target/riscv/rvv/base/pr111720-6.c: Ditto.
	* gcc.target/riscv/rvv/base/pr111720-7.c: Ditto.
	* gcc.target/riscv/rvv/base/pr111720-8.c: Ditto.
	* gcc.target/riscv/rvv/base/pr111720-9.c: Ditto.
	* gcc.target/riscv/rvv/base/pr111935.c: Ditto.
	* gcc.target/riscv/rvv/base/scalar-move-merged-run-1.c: Ditto.
	* gcc.target/riscv/rvv/base/simplify-vdiv.c: Ditto.
	* gcc.target/riscv/rvv/base/simplify-vrsub.c: Ditto.
	* gcc.target/riscv/rvv/base/tuple-intrinsic.c: Ditto.
	* gcc.target/riscv/rvv/base/tuple_vundefined.c: Ditto.
	* gcc.target/riscv/rvv/base/vcreate.c: Ditto.
	* gcc.target/riscv/rvv/base/vlmul_ext-2.c: Ditto.
	* gcc.target/riscv/rvv/base/vslide1down-1.c: Ditto.
	* gcc.target/riscv/rvv/base/vslide1down-2.c: Ditto.
	* gcc.target/riscv/rvv/base/vslide1down-3.c: Ditto.
	* gcc.target/riscv/rvv/base/vslide1up-1.c: Ditto.
	* gcc.target/riscv/rvv/base/vslide1up-2.c: Ditto.
	* gcc.target/riscv/rvv/base/vslide1up-3.c: Ditto.
	* gcc.target/riscv/rvv/base/zvbb-intrinsic.c: Ditto.
	* gcc.target/riscv/rvv/base/zvbb_vandn_vx_constraint.c: Ditto.
	* gcc.target/riscv/rvv/base/zvbc-intrinsic.c: Ditto.
	* gcc.target/riscv/rvv/base/zvbc_vx_constraint-1.c: Ditto.
	* gcc.target/riscv/rvv/base/zvbc_vx_constraint-2.c: Ditto.
	* gcc.target/riscv/rvv/base/zvfhmin-intrinsic.c: Ditto.
	* gcc.target/riscv/rvv/base/zvkg-intrinsic.c: Ditto.
	* gcc.target/riscv/rvv/base/zvkned-intrinsic.c: Ditto.
	* gcc.target/riscv/rvv/base/zvknha-intrinsic.c: Ditto.
	* gcc.target/riscv/rvv/base/zvknhb-intrinsic.c: Ditto.
	* gcc.target/riscv/rvv/base/zvksed-intrinsic.c: Ditto.
	* gcc.target/riscv/rvv/base/zvksh-intrinsic.c: Ditto.

Signed-off-by: Yanzhang Wang <yanzhang.wang@intel.com>
2024-01-16 10:20:19 +08:00
Yanzhang Wang
b2e06d7161 RISC-V: delete all the vector psabi checking.
Thanks the
https://hub.fgit.cf/riscv-non-isa/riscv-elf-psabi-doc/pull/389, we
need not to maintain the psabi checking any more.

gcc/ChangeLog:

	* config/riscv/riscv.cc (riscv_arg_has_vector): Delete.
	(riscv_pass_in_vector_p): Delete.
	(riscv_init_cumulative_args): Delete the checking.
	(riscv_get_arg_info): Delete the checking.
	(riscv_function_value): Delete the checking.
	* config/riscv/riscv.h: Delete the member for checking.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/base/binop_vx_constraint-120.c: Delete the -Wno-psabi.
	* gcc.target/riscv/rvv/base/integer_compare_insn_shortcut.c: Ditto.
	* gcc.target/riscv/rvv/base/mask_insn_shortcut.c: Ditto.
	* gcc.target/riscv/rvv/base/misc_vreinterpret_vbool_vint.c: Ditto.
	* gcc.target/riscv/rvv/base/pr110109-2.c: Ditto.
	* gcc.target/riscv/rvv/base/scalar_move-9.c: Ditto.
	* gcc.target/riscv/rvv/base/spill-10.c: Ditto.
	* gcc.target/riscv/rvv/base/spill-11.c: Ditto.
	* gcc.target/riscv/rvv/base/spill-9.c: Ditto.
	* gcc.target/riscv/rvv/base/vlmul_ext-1.c: Ditto.
	* gcc.target/riscv/rvv/base/zero_base_load_store_optimization.c: Ditto.
	* gcc.target/riscv/rvv/base/zvfh-intrinsic.c: Ditto.
	* gcc.target/riscv/rvv/base/zvfh-over-zvfhmin.c: Ditto.
	* gcc.target/riscv/rvv/vsetvl/vsetvl-1.c: Ditto.
	* gcc.target/riscv/rvv/base/vector-abi-1.c: Removed.
	* gcc.target/riscv/rvv/base/vector-abi-2.c: Removed.
	* gcc.target/riscv/rvv/base/vector-abi-3.c: Removed.
	* gcc.target/riscv/rvv/base/vector-abi-4.c: Removed.
	* gcc.target/riscv/rvv/base/vector-abi-5.c: Removed.
	* gcc.target/riscv/rvv/base/vector-abi-6.c: Removed.
	* gcc.target/riscv/rvv/base/vector-abi-7.c: Removed.
	* gcc.target/riscv/rvv/base/vector-abi-8.c: Removed.

Signed-off-by: Yanzhang Wang <yanzhang.wang@intel.com>
Signed-off-by: Yanzhang Wang <yanzhang.wang@intel.com>
Signed-off-by: Yanzhang Wang <yanzhang.wang@intel.com>
Signed-off-by: Yanzhang Wang <yanzhang.wang@intel.com<mailto:yanzhang.wang@intel.com>>
2024-01-16 10:19:43 +08:00
GCC Administrator
be035ec4f0 Daily bump. 2024-01-16 00:18:46 +00:00
David Malcolm
ce27b66d95 analyzer: fix false +ves from -Wanalyzer-tainted-array-index with unsigned char index [PR106229]
gcc/analyzer/ChangeLog:
	PR analyzer/106229
	* analyzer.h (compare_constants): New decl.
	* constraint-manager.cc (compare_constants): Make non-static.
	* sm-taint.cc: Add include "fold-const.h".
	(class concrete_range): New.
	(get_possible_range): New.
	(index_can_be_out_of_bounds_p): New.
	(region_model::check_region_for_taint): Reject
	-Wanalyzer-tainted-array-index if the type of the value makes it
	impossible for it to be out-of-bounds of the array.

gcc/testsuite/ChangeLog:
	PR analyzer/106229
	* c-c++-common/analyzer/taint-index-pr106229.c: New test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2024-01-15 19:01:21 -05:00
David Malcolm
d235bf2e80 analyzer: casting all zeroes should give all zeroes [PR113333]
In particular, accessing the result of *calloc (1, SZ) (if non-NULL)
should be known to be all zeroes.

gcc/analyzer/ChangeLog:
	PR analyzer/113333
	* region-model-manager.cc
	(region_model_manager::maybe_fold_unaryop): Casting all zeroes
	should give all zeroes.

gcc/testsuite/ChangeLog:
	PR analyzer/113333
	* c-c++-common/analyzer/calloc-1.c: Add tests.
	* c-c++-common/analyzer/pr96639.c: Update expected results.
	* gcc.dg/analyzer/data-model-9.c: Likewise.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2024-01-15 19:01:16 -05:00
Marek Polacek
a305448911 c++: ICE with auto in template arg [PR110065]
Here we started crashing with r14-1659 because that removed the
auto checking in cp_parser_template_type_arg which seemed like
dead code.  But the attached test shows that the code can still
be reached because cp_parser_type_id_1 checks auto only when
auto_is_implicit_function_template_parm_p is on.

Then I noticed that we're still crashing in C++20, and that ICE
started with r12-4772.  So I changed the reemerged check to use
flag_concepts_ts rather than flag_concepts on the basis that
check_auto_in_tmpl_args also checks flag_concepts_ts.

	PR c++/110065

gcc/cp/ChangeLog:

	* parser.cc (cp_parser_template_type_arg): Add auto checking.

gcc/testsuite/ChangeLog:

	* g++.dg/concepts/auto8.C: New test.
	* g++.dg/concepts/auto8a.C: New test.
2024-01-15 18:39:32 -05:00
Andrew Pinski
2e3a75f714 Add myself to the DCO section
It is time to add myself to DCO section for my quicinc email account.

ChangeLog:

	* MAINTAINERS (DCO): Add myself.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
2024-01-15 14:20:11 -08:00
Patrick Palka
f40076fa82 c++: access of class-scope partial spec
Since partial specializations can't be named directly, their access
when declared at class scope is irrelevant, so we shouldn't have to set
their TREE_PRIVATE / TREE_PROTECTED in maybe_new_partial_specialization
(which is used only for constrained partial specializations anyway).

This code was added by r10-4833-gcce3c9db9e6ffa for PR92078, but it
seems better to just disable the access consistency check for partial
specializations, which lets us accept the below testcase.

gcc/cp/ChangeLog:

	* parser.cc (cp_parser_check_access_in_redeclaration): Don't
	check access for a partial or explicit specialization.
	* pt.cc (maybe_new_partial_specialization): Don't set TREE_PRIVATE
	or TREE_PROTECTED on the newly created partial specialization.

gcc/testsuite/ChangeLog:

	* g++.dg/template/partial-specialization14.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
2024-01-15 17:01:33 -05:00
Patrick Palka
47673571b2 c++: explicit inst w/ similar constrained partial specs [PR104634]
Here we neglect to emit the definitions of A<double>::f2 and A<double*>::f4
despite the explicit instantiations ultimately because TREE_PUBLIC isn't
set on the corresponding partial specializations, whose declarations are
created from maybe_new_partial_specialization which is responsible for
disambiguating them from the first and third partial specializations (which
have the same class-head but different constraints).  This makes grokfndecl
in turn clear TREE_PUBLIC for f2 and f4 as if they have internal linkage.

This patch fixes this by setting TREE_PUBLIC appropriately for such partial
specializations.

	PR c++/104634

gcc/cp/ChangeLog:

	* pt.cc (maybe_new_partial_specialization): Propagate TREE_PUBLIC
	to the newly created partial specialization.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp2a/concepts-explicit-inst6.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
2024-01-15 16:53:28 -05:00
Patrick Palka
d33c3b5ac9 c++: non-dep array list-init w/ non-triv dtor [PR109899]
The get_target_expr call added in r12-7069-g119cea98f66476 causes us
for the below testcase to call build_vec_delete in a template context,
which builds a templated destructor call and checks expr_noexcept_p for
it, which ICEs because the call has templated form.

Much of the work of build_vec_delete however is code generation and thus
will just get discarded in a template context, and that includes the
code guarded by expr_noexcept_p.  So this patch narrowly fixes this ICE
by eliding the expr_noexcept_p call when in a template context.

	PR c++/109899

gcc/cp/ChangeLog:

	* init.cc (build_vec_delete_1): Assume expr_noexcept_p returns
	false in a template context.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/initlist-array21.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
2024-01-15 16:49:19 -05:00
Patrick Palka
2d55d94e5d libstdc++: Reduce std::variant template instantiation depth
The recursively defined constraints on _Variadic_union's user-defined
destructor (used for maintaining trivial destructibility of the variant
iff all of its alternatives are) turn out to require a template
instantiation depth of 3x the number of variants in C++20 mode, with the
instantiation stack looking like

  ...
  _Variadic_union<B, C, ...>
  std::is_trivially_destructible_v<_Variadic_union<B, C, ...>>
  _Variadic_union<A, B, C, ...>::~_Variadic_union()
  _Variadic_union<A, B, C, ...>
  ...

Ideally the template depth should be ~equal to the number of variants
(plus a constant).  Luckily it seems we don't need to compute trivial
destructibility of the alternatives at all from _Variadic_union, since
its only user _Variant_storage already has that information.  To that
end this patch removes these recursive constraints and instead passes
this information down from _Variant_storage.  After this patch, the
template instantiation depth for 87619.cc in C++20 mode is ~270 instead
of ~780.

libstdc++-v3/ChangeLog:

	* include/std/variant (__detail::__variant::_Variadic_union):
	Add bool __trivially_destructible template parameter.
	(__detail::__variant::_Variadic_union::~_Variadic_union):
	Use __trivially_destructible in constraints instead.
	(__detail::__variant::_Variant_storage): Pass
	__trivially_destructible value to _Variadic_union.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
2024-01-15 16:41:42 -05:00
Patrick Palka
731444b3c3 libstdc++: Implement P2836R1 changes to const_iterator
libstdc++-v3/ChangeLog:

	* include/bits/stl_iterator.h (const_iterator): Define conversion
	operators as per P2836R1.
	* include/bits/version.def (ranges_as_const): Update value.
	* include/bits/version.h: Regenerate.
	* testsuite/24_iterators/const_iterator/1.cc (test04): New test.
	* testsuite/std/ranges/adaptors/as_const/1.cc: Adjust expected
	value of __cpp_lib_ranges_as_const.
	* testsuite/std/ranges/version_c++23.cc: Likewise.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
2024-01-15 15:13:53 -05:00
H.J. Lu
8108c6be99 Remove --save-temps from some compile tests
--save-temps is needed to scan assembly outputs for assemble, link and
run tests.  Not all compile tests need --save-temps unless they used to
trigger GCC bugs.  Run --save-temps from compile tests if not needed.

	PR testsuite/113369
	* g++.dg/abi/ref-temp1.C: Remove --save-temps.
	* g++.target/i386/bfloat_cpp_typecheck.C: Likewise.
	* gcc.dg/debug/dwarf2/pr111080.c: Likewise.
	* gcc.dg/debug/dwarf2/pr47939-1.c: Likewise.
	* gcc.dg/debug/dwarf2/pr47939-2.c: Likewise.
	* gcc.dg/debug/dwarf2/pr47939-3.c: Likewise.
	* gcc.dg/debug/dwarf2/pr47939-4.c: Likewise.
2024-01-15 11:24:22 -08:00
Jonathan Wakely
1e88a151f8 libstdc++: Fix redefinition error in std::tuple [PR108822]
When using a compiler that doesn't define __cpp_conditional_explicit
there's a redefinition error for tuple::__nothrow_assignable. This is
because it's defined in different places for the pre-C++20 and C++20
implementations, which are controled by different preprocessor
conditions. For certain combinations of C++20 feature test macros it's
possible for both __nothrow_assignable definitions to be in scope.

Move the pre-C++20 __assignable and __nothrow_assignable definitions adjacent to
their use, so that only one set of definitions is visible for any given
set of feature test macros.

libstdc++-v3/ChangeLog:

	PR libstdc++/108822
	* include/std/tuple (__assignable, __is_nothrow_assignable):
	Move pre-C++20 definitions adjacent to their use.
2024-01-15 17:18:53 +00:00
Jonathan Wakely
6c703b4eb6 libstdc++: Use variable template to fix -fconcepts-ts error [PR113366]
There's an error for -fconcepts-ts due to using a concept where a bool
NTTP is required, which is fixed by using the vraiable template that
already exists in the class scope.

This doesn't fix the problem with -fconcepts-ts as changes to the
placement of attributes is also needed.

libstdc++-v3/ChangeLog:

	PR testsuite/113366
	* include/std/format (basic_format_arg): Use __formattable
	variable template instead of __format::__formattable_with
	concept.
2024-01-15 16:59:27 +00:00
Jonathan Wakely
4f141b051e libstdc++: Update tzdata to 2023d
Import the new 2023d tzdata.zi file. The leapseconds file was also
updated to have a new expiry (no new leap seconds were added).

libstdc++-v3/ChangeLog:

	* src/c++20/tzdata.zi: Import new file from 2023d release.
	* src/c++20/tzdb.cc (tzdb_list::_Node::_S_read_leap_seconds)
	Update expiry date for leap seconds list.
2024-01-15 16:59:27 +00:00
Jakub Jelinek
2e493b697a testsuite: Add testcase for already fixed PR [PR113048]
The ICE on this testcase was fixed by r14-7141.

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

	PR rtl-optimization/113048
	* gcc.target/i386/pr113048.c: New test.
2024-01-15 17:35:04 +01:00
Georg-Johann Lay
42503cc257 AVR: Document option -mskip-bug.
gcc/
	* doc/invoke.texi (AVR Options) [-mskip-bug]: Add documentation.
2024-01-15 17:08:15 +01:00
Liao Shihua
04f22670d3 RISC-V: Add C intrinsic for Scalar Bitmanip Extension
This patch adds C intrinsics for Bitmanip Extension.
RISCV_BUILTIN_NO_PREFIX is a new riscv_builtin_description like RISCV_BUILTIN.
But it uses CODE_FOR_##INSN rather than CODE_FOR_riscv_##INSN.
Changed orcb, clmul, brev8 pattern's mode form X to GPR because orcbsi, clmul_si,
brev8_si are both included in rv32 and rv64. Test them in scalar_bitmanip_intrinsic-64-emulated.c.

gcc/ChangeLog:

	* config.gcc: Include riscv_bitmanip.h.
	* config/riscv/bitmanip.md: Changed mode form X to GPR in orcb and clmul pattern.
	* config/riscv/crypto.md: Changed mode form X to GPR in brev8 pattern.
	* config/riscv/riscv-builtins.cc (AVAIL): Adding new bitmanip builtins.
	(RISCV_BUILTIN_NO_PREFIX): New helper macro.
	* config/riscv/riscv-cmo.def (RISCV_BUILTIN): Add '_32'/'_64' postfix to builtins.
	* config/riscv/riscv-ftypes.def (2): New ftypes.
	* config/riscv/riscv-scalar-crypto.def (RISCV_BUILTIN): New builtins.
	(RISCV_BUILTIN_NO_PREFIX): Likewise.
	* config/riscv/riscv_bitmanip.h: New file.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/scalar_bitmanip_intrinsic-32.c: New test.
	* gcc.target/riscv/scalar_bitmanip_intrinsic-64-emulated.c: New test.
	* gcc.target/riscv/scalar_bitmanip_intrinsic-64.c: New test.
2024-01-15 16:40:32 +01:00
Liao Shihua
c7ad6bf5b9 RISC-V: Add C intrinsic for Scalar Crypto Extension
This patch adds C intrinsics for Scalar Crypto Extension.

gcc/ChangeLog:

	* config.gcc: Include riscv_crypto.h.
	* config/riscv/riscv_crypto.h: New file.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/scalar_crypto_intrinsic-32.c: New test.
	* gcc.target/riscv/scalar_crypto_intrinsic-64.c: New test.
2024-01-15 16:39:53 +01:00
Liao Shihua
4d7c4288a9 RISC-V: Remove the Scalar Bitmanip and Crypto Built-In function testsuites
The serials patch provides a mapping from the RV intrinsics to the builtin names.
There are some duplicates testsuites between intrinsic and built-in function.
Remove the Scalar Bitmanip and Scalar Crypto Built-In function testsuites
that will be included in the intrinsic functions.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/zbb_32_bswap-2.c: Moved to...
	* gcc.target/riscv/zbb_bswap16.c: ...here.
	* gcc.target/riscv/zbkb32.c: Remove __builtin_riscv_(un)zip and
	zip,__builtin_riscv_brev8.
	* gcc.target/riscv/zbkb64.c: Remove __builtin_riscv_brev8.
	* gcc.target/riscv/zbb_32_bswap-1.c: Removed.
	* gcc.target/riscv/zbb_bswap-1.c: Removed.
	* gcc.target/riscv/zbb_bswap-2.c: Removed.
	* gcc.target/riscv/zbbw.c: Removed.
	* gcc.target/riscv/zbc32.c: Removed.
	* gcc.target/riscv/zbc64.c: Removed.
	* gcc.target/riscv/zbkc32.c: Removed.
	* gcc.target/riscv/zbkc64.c: Removed.
	* gcc.target/riscv/zbkx32.c: Removed.
	* gcc.target/riscv/zbkx64.c: Removed.
	* gcc.target/riscv/zknd32-2.c: Removed.
	* gcc.target/riscv/zknd64-2.c: Removed.
	* gcc.target/riscv/zkne32-2.c: Removed.
	* gcc.target/riscv/zkne64-2.c: Removed.
	* gcc.target/riscv/zknh-sha256-32.c: Removed.
	* gcc.target/riscv/zknh-sha256-64.c: Removed.
	* gcc.target/riscv/zknh-sha512-32.c: Removed.
	* gcc.target/riscv/zknh-sha512-64.c: Removed.
	* gcc.target/riscv/zksed32-2.c: Removed.
	* gcc.target/riscv/zksed64-2.c: Removed.
	* gcc.target/riscv/zksh32.c: Removed.
	* gcc.target/riscv/zksh64.c: Removed.
2024-01-15 16:38:07 +01:00
Vladimir N. Makarov
76bc70387d [PR113354][LRA]: Fixing LRA failure on building MIPS GCC
My recent patch for PR112918 triggered a hidden bug in LRA on MIPS.  A
pseudo is matched to a register constraint and assigned to a hard
registers at the first constraint sub-pass but later it is matched to
X constraint.  Keeping this pseudo in the register (MD0) prevents to
use the same register for another pseudo in the insn and this results
in LRA failure.  The patch fixes this by spilling the pseudo at the
constraint subpass when the chosen alternative constraint not require
hard register anymore.

gcc/ChangeLog:

	PR middle-end/113354
	* lra-constraints.cc (curr_insn_transform): Spill pseudo only used
	in the insn if the corresponding operand does not require hard
	register anymore.
2024-01-15 10:25:37 -05:00
Georg-Johann Lay
86fac7ee16 AVR: target/107201: Make -nodevicelib work for all devices.
driver-avr.cc contains a spec that discriminates bwtween cores
	and devices by means of a mmcu=avr* spec pattern.  This does not
	work for new devices like AVR128* which also start with mmcu=avr
	like all cores do.  The patch uses a new spec function in order to
	tell apart cores from devices.

gcc/
	PR target/107201
	* config/avr/avr.h (EXTRA_SPEC_FUNCTIONS): Add no-devlib, avr_no_devlib.
	* config/avr/driver-avr.cc (avr_no_devlib): New function.
	(avr_devicespecs_file): Use it to remove -nodevicelib from the
	options for cores only.
	* config/avr/avr-arch.h (avr_get_parch): New prototype.
	* config/avr/avr-devices.cc (avr_get_parch): New function.
2024-01-15 16:16:19 +01:00
Lipeng Zhu
8414f10ad5 libgfortran: Bugfix if not define HAVE_ATOMIC_FETCH_ADD
This patch try to fix the bug when HAVE_ATOMIC_FETCH_ADD is
not defined in dec_waiting_unlocked function. As io.h does
not include async.h, the WRLOCK and RWUNLOCK macros are
undefined.

libgfortran/ChangeLog:

	* io/io.h (dec_waiting_unlocked): Use
	__gthread_rwlock_wrlock/__gthread_rwlock_unlock or
	__gthread_mutex_lock/__gthread_mutex_unlock functions
	to replace WRLOCK and RWUNLOCK macros.

Signed-off-by: Lipeng Zhu <lipeng.zhu@intel.com>
2024-01-15 05:22:07 -08:00
Juzhe-Zhong
7be87b7d2e RISC-V: Fix regression (GCC-14 compare with GCC-13.2) of SHA256 from coremark-pro
This patch fixes -70% performance drop from GCC-13.2 to GCC-14 with -march=rv64gcv in real hardware.

The root cause is incorrect cost model cause inefficient vectorization which makes us performance drop significantly.

So this patch does:

1. Adjust vector to scalar cost by introducing v to scalar reg move.
2. Adjust vec_construct cost since we does spend NUNITS instructions to construct the vector.

Tested on both RV32/RV64 no regression, Rebase to the trunk and commit it as it is approved by Robin.

	PR target/113247

gcc/ChangeLog:

	* config/riscv/riscv-protos.h (struct regmove_vector_cost): Add vector to scalar regmove.
	* config/riscv/riscv-vector-costs.cc (adjust_stmt_cost): Ditto.
	* config/riscv/riscv.cc (riscv_builtin_vectorization_cost): Adjust vec_construct cost.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/autovec/vls/reduc-19.c: Adapt test.
	* gcc.target/riscv/rvv/autovec/vls/reduc-20.c: Ditto.
	* gcc.target/riscv/rvv/autovec/vls/reduc-21.c: Ditto.
	* gcc.dg/vect/costmodel/riscv/rvv/pr113247-1.c: New test.
	* gcc.dg/vect/costmodel/riscv/rvv/pr113247-2.c: New test.
	* gcc.dg/vect/costmodel/riscv/rvv/pr113247-3.c: New test.
	* gcc.dg/vect/costmodel/riscv/rvv/pr113247-4.c: New test.
2024-01-15 21:13:33 +08:00
Juzhe-Zhong
405096f908 RISC-V: Adjust loop len by costing 1 when NITER < VF
Rebase in v3: Rebase to the trunk and commit it as it's approved by Robin.
Update in v2: Add dynmaic lmul test.

This patch fixes the regression between GCC 13.2.0 and trunk GCC (GCC-14)

GCC 13.2.0:

	lui	a5,%hi(a)
	li	a4,19
	sb	a4,%lo(a)(a5)
	li	a0,0
	ret

Trunk GCC:

        vsetvli a5,zero,e8,mf2,ta,ma
        li      a4,-32768
        vid.v   v1
        vsetvli zero,zero,e16,m1,ta,ma
        addiw   a4,a4,104
        vmv.v.i v3,15
        lui     a1,%hi(a)
        li      a0,19
        vsetvli zero,zero,e8,mf2,ta,ma
        vadd.vi v1,v1,1
        sb      a0,%lo(a)(a1)
        vsetvli zero,zero,e16,m1,ta,ma
        vzext.vf2       v2,v1
        vmv.v.x v1,a4
        vminu.vv        v2,v2,v3
        vsrl.vv v1,v1,v2
        vslidedown.vi   v1,v1,17
        vmv.x.s a0,v1
        snez    a0,a0
        ret

The root cause we are vectorizing the codes inefficiently since we doesn't cost len when NITERS < VF.
Leverage loop control of mask targets or rs6000 fixes the regression.

Tested no regression. Ok for trunk ?

	PR target/113281

gcc/ChangeLog:

	* config/riscv/riscv-vector-costs.cc (costs::adjust_vect_cost_per_loop): New function.
	(costs::finish_cost): Adjust cost for LOOP LEN with NITERS < VF.
	* config/riscv/riscv-vector-costs.h: New function.

gcc/testsuite/ChangeLog:

	* gcc.dg/vect/costmodel/riscv/rvv/pr113281-3.c: New test.
	* gcc.dg/vect/costmodel/riscv/rvv/pr113281-4.c: New test.
	* gcc.dg/vect/costmodel/riscv/rvv/pr113281-5.c: New test.
2024-01-15 19:45:44 +08:00
Richard Biener
afac1bd336 tree-optimization/113385 - wrong loop father with early exit vectorization
The following avoids splitting an edge before redirecting it.  This
allows the loop father of the new block to be correct in the first
place.

	PR tree-optimization/113385
	* tree-vect-loop-manip.cc (slpeel_tree_duplicate_loop_to_edge_cfg):
	First redirect, then split the exit edge.
2024-01-15 12:27:11 +01:00
Juzhe-Zhong
e037a0fa04 RISC-V: Remove m_num_vector_iterations[NFC]
Notice the m_num_vector_iterations is not used, remove the redundant codes.

Committed.

gcc/ChangeLog:

	* config/riscv/riscv-vector-costs.cc (costs::analyze_loop_vinfo):
	Remove m_num_vector_iterations.
	* config/riscv/riscv-vector-costs.h: Ditto.
2024-01-15 19:02:33 +08:00
Juzhe-Zhong
baa931cc2e RISC-V: Add optimized dump check of VLS reduc tests
Add more dump check to robostify the tests.

Committed.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/autovec/vls/reduc-1.c: Add dump check.
	* gcc.target/riscv/rvv/autovec/vls/reduc-10.c: Ditto.
	* gcc.target/riscv/rvv/autovec/vls/reduc-11.c: Ditto.
	* gcc.target/riscv/rvv/autovec/vls/reduc-12.c: Ditto.
	* gcc.target/riscv/rvv/autovec/vls/reduc-13.c: Ditto.
	* gcc.target/riscv/rvv/autovec/vls/reduc-14.c: Ditto.
	* gcc.target/riscv/rvv/autovec/vls/reduc-15.c: Ditto.
	* gcc.target/riscv/rvv/autovec/vls/reduc-16.c: Ditto.
	* gcc.target/riscv/rvv/autovec/vls/reduc-17.c: Ditto.
	* gcc.target/riscv/rvv/autovec/vls/reduc-18.c: Ditto.
	* gcc.target/riscv/rvv/autovec/vls/reduc-19.c: Ditto.
	* gcc.target/riscv/rvv/autovec/vls/reduc-2.c: Ditto.
	* gcc.target/riscv/rvv/autovec/vls/reduc-20.c: Ditto.
	* gcc.target/riscv/rvv/autovec/vls/reduc-21.c: Ditto.
	* gcc.target/riscv/rvv/autovec/vls/reduc-3.c: Ditto.
	* gcc.target/riscv/rvv/autovec/vls/reduc-4.c: Ditto.
	* gcc.target/riscv/rvv/autovec/vls/reduc-5.c: Ditto.
	* gcc.target/riscv/rvv/autovec/vls/reduc-6.c: Ditto.
	* gcc.target/riscv/rvv/autovec/vls/reduc-7.c: Ditto.
	* gcc.target/riscv/rvv/autovec/vls/reduc-8.c: Ditto.
	* gcc.target/riscv/rvv/autovec/vls/reduc-9.c: Ditto.
2024-01-15 17:53:41 +08:00
Andrew Pinski
f1b0b1e445 AVR: target/113156 - Fix ICE due to missing "Save" on -m[long-]double= options.
Multilib options -mdouble= and -mlong-double= are not orthogonal:
	TARGET_HANDLE_OPTION = avr-common.cc::avr_handle_option() sets them
	such that  sizeof(double) <= sizeof(long double)  is always true.

gcc/
	PR target/113156
	* config/avr/avr.opt (-mdouble, -mlong-double): Add "Save" flag.
	(-mbranch-cost): Set "Optimization" flag.
2024-01-15 10:41:53 +01:00
Jakub Jelinek
8a1927856a lower-bitint: Fix up handling of INTEGER_CSTs in handle_operand in right shifts or comparisons [PR113370]
The INTEGER_CST code uses the remainder bits in computations whether to use
whole constant or just part of it and extend it at runtime, and furthermore
uses it to avoid using all bits even when using the (almost) whole constant.
The problem is that the prec % (2 * limb_prec) computation it uses is
appropriate only for the normal lowering of mergeable operations (where
we process 2 limbs at a time in a loop starting with least significant
limbs and process the remaining 0-2 limbs after the loop (there with
constant indexes).  For that case it is ok not to emit the upper
prec % (2 * limb_prec) bits into the constant, because those bits will be
extracted using INTEGER_CST idx and so will be used directly in the
statements as INTEGER_CSTs.
For other cases, where we either process just a single limb in a loop,
process it downwards (e.g. non-equality comparisons) or with some runtime
addends (some shifts), there is either just at most one limb lowered with
INTEGER_CST idx after the loop (e.g. for right shift) or before the loop
(e.g. non-equality comparisons), or all limbs are processed with
non-INTEGER_CST indexes (e.g. for left shift, when m_var_msb is set).
Now, the m_var_msb case is already handled through
              if (m_var_msb)
                type = TREE_TYPE (op);
              else
                /* If we have a guarantee the most significant partial limb
                   (if any) will be only accessed through handle_operand
                   with INTEGER_CST idx, we don't need to include the partial
                   limb in .rodata.  */
                type = build_bitint_type (prec - rem, 1);
but for the right shifts or comparisons the prec - rem when rem was
prec % (2 * limb_prec) was incorrect, so the following patch fixes it
to use remainder for 2 limbs only if m_upwards_2limb and remainder for
1 limb otherwise.

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

	PR tree-optimization/113370
	* gimple-lower-bitint.cc (bitint_large_huge::handle_operand): Only
	set rem to prec % (2 * limb_prec) if m_upwards_2limb, otherwise
	set it to just prec % limb_prec.

	* gcc.dg/torture/bitint-48.c: New test.
2024-01-15 09:58:37 +01:00
Juzhe-Zhong
0627d1f534 RISC-V: Fix attributes bug configuration of ternary instructions
This patch fixes the following FAILs:

Running target riscv-sim/-march=rv64gcv/-mabi=lp64d/-mcmodel=medlow/--param=riscv-autovec-preference=fixed-vlmax
FAIL: gcc.c-torture/execute/pr68532.c   -O0  execution test
FAIL: gcc.c-torture/execute/pr68532.c   -O1  execution test
FAIL: gcc.c-torture/execute/pr68532.c   -O2  execution test
FAIL: gcc.c-torture/execute/pr68532.c   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
FAIL: gcc.c-torture/execute/pr68532.c   -O3 -g  execution test
FAIL: gcc.c-torture/execute/pr68532.c   -Os  execution test
FAIL: gcc.c-torture/execute/pr68532.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  execution test

Running target riscv-sim/-march=rv64gcv/-mabi=lp64d/-mcmodel=medlow/--param=riscv-autovec-lmul=m2/--param=riscv-autovec-preference=fixed-vlmax
FAIL: gcc.dg/vect/pr60196-1.c execution test
FAIL: gcc.dg/vect/pr60196-1.c -flto -ffat-lto-objects execution test

Running target riscv-sim/-march=rv64gcv/-mabi=lp64d/-mcmodel=medlow/--param=riscv-autovec-preference=fixed-vlmax
FAIL: gcc.dg/vect/pr60196-1.c execution test
FAIL: gcc.dg/vect/pr60196-1.c -flto -ffat-lto-objects execution test

Running target riscv-sim/-march=rv64gcv_zvl256b/-mabi=lp64d/-mcmodel=medlow/--param=riscv-autovec-preference=fixed-vlmax
FAIL: gcc.dg/vect/pr60196-1.c execution test
FAIL: gcc.dg/vect/pr60196-1.c -flto -ffat-lto-objects execution test

The root cause is attributes of ternary intructions are incorrect which cause AVL prop PASS and VSETVL PASS behave
incorrectly.

Tested no regression and committed.

	PR target/113393

gcc/ChangeLog:

	* config/riscv/vector.md: Fix ternary attributes.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/autovec/pr113393-1.c: New test.
	* gcc.target/riscv/rvv/autovec/pr113393-2.c: New test.
	* gcc.target/riscv/rvv/autovec/pr113393-3.c: New test.
2024-01-15 15:55:39 +08:00
YunQiang Su
65678b2bae MIPS/testsuite: Add -mno-abicalls option to unaligned-2.c
PIC/abicalls option will generate some GOT operation, and some
`ld/sd` instructions are used.

Let's skip them.

gcc/testsuite
	* gcc.target/mips/unaligned-2.c: Add -mno-abicalls option.
2024-01-15 12:35:27 +08:00
GCC Administrator
50b5687266 Daily bump. 2024-01-15 00:16:51 +00:00
John David Anglin
5f6557b3c6 Disable tests for strdup/strndup on __hpux__
hppa*-*-hpux* doesn't have strdup or strndup.

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

gcc/testsuite/ChangeLog:

	* gcc.dg/builtin-object-size-1.c: Disable tests for strdup/strndup
	on __hpux__.
	* gcc.dg/builtin-object-size-2.c: Likewise.
	* gcc.dg/builtin-object-size-3.c: Likewise.
	* gcc.dg/builtin-object-size-4.c: Likewise.
2024-01-14 20:48:15 +00:00
John David Anglin
5129b4cde0 Skip several gcc.dg/builtin-dynamic-object-size tests on hppa*-*-hpux*
hppa*-*-hpux* doesn't have strdup or strndup.

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

gcc/testsuite/ChangeLog:

	* gcc.dg/builtin-dynamic-object-size-0.c: Skip on hppa*-*-hpux*.
	* gcc.dg/builtin-dynamic-object-size-1.c: Likewise.
	* gcc.dg/builtin-dynamic-object-size-2.c: Likewise.
	* gcc.dg/builtin-dynamic-object-size-3.c: Likewise.
	* gcc.dg/builtin-dynamic-object-size-4.c: Likewise.
2024-01-14 20:29:25 +00:00
John David Anglin
ea8bfccc40 Fix dg-warning on hppa*64*-*-*
2024-01-14  John David Anglin  <danglin@gcc.gnu.org>

gcc/testsuite/ChangeLog:

	* gcc.dg/Wattributes-6.c: Fix dg-warning on hppa*64*-*-*.
2024-01-14 18:41:54 +00:00