]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
2 years agoada: Fix internal error on loop iterator filter with -gnatVa
Eric Botcazou [Wed, 17 May 2023 15:05:14 +0000 (17:05 +0200)] 
ada: Fix internal error on loop iterator filter with -gnatVa

The problem is that the condition of the iterator filter is expanded early,
before it is integrated into an if statement of the loop body, so there is
no place to attach the actions generated by this expansion.

This happens only for simple loops, i.e. with a parameter specification, so
the fix uses the same approach for them as for loops based on iterators.

gcc/ada/

* sinfo.ads (Iterator_Filter): Document field.
* sem_ch5.adb (Analyze_Iterator_Specification): Move comment around.
(Analyze_Loop_Parameter_Specification): Only preanalyze the iterator
filter, if any.
* exp_ch5.adb (Expand_N_Loop_Statement): Analyze the new list built
when an iterator filter is present.

2 years agoLoongArch: Avoid non-returning indirect jumps through $ra [PR110136]
Lulu Cheng [Wed, 7 Jun 2023 02:21:58 +0000 (10:21 +0800)] 
LoongArch: Avoid non-returning indirect jumps through $ra [PR110136]

Micro-architecture unconditionally treats a "jr $ra" as "return from subroutine",
hence doing "jr $ra" would interfere with both subroutine return prediction and
the more general indirect branch prediction.

Therefore, a problem like PR110136 can cause a significant increase in branch error
prediction rate and affect performance. The same problem exists with "indirect_jump".

gcc/ChangeLog:

PR target/110136
* config/loongarch/loongarch.md: Modify the register constraints for template
"jumptable" and "indirect_jump" from "r" to "e".

Co-authored-by: Andrew Pinski <apinski@marvell.com>
(cherry picked from commit 5430c86e71927492399129f3df80824c6c334ddf)

2 years agoDaily bump.
GCC Administrator [Thu, 15 Jun 2023 00:21:26 +0000 (00:21 +0000)] 
Daily bump.

2 years agoi386: Fix up whitespace in assembly
Jakub Jelinek [Tue, 13 Jun 2023 16:39:45 +0000 (18:39 +0200)] 
i386: Fix up whitespace in assembly

I've noticed that standard_sse_constant_opcode emits some spurious
whitespace around tab, that isn't something which is done for
any other instruction and looks wrong.

2023-06-13  Jakub Jelinek  <jakub@redhat.com>

* config/i386/i386.cc (standard_sse_constant_opcode): Remove
superfluous spaces around \t for vpcmpeqd.

(cherry picked from commit 1c188877bfc5a4aee3f777f0d4d60500bc222b54)

2 years agoUse x instead of v for alternative 2 (v, BH) in mov<mode>_internal.
liuhongt [Tue, 13 Jun 2023 06:20:59 +0000 (14:20 +0800)] 
Use x instead of v for alternative 2 (v, BH) in mov<mode>_internal.

Since there's no evex version for vpcmpeq ymm, ymm, ymm.

gcc/ChangeLog:

PR target/110227
* config/i386/sse.md (mov<mode>_internal>): Use x instead of v
for alternative 2 since there's no evex version for vpcmpeqd
ymm, ymm, ymm.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr110227.c: New test.

2 years agoDaily bump.
GCC Administrator [Wed, 14 Jun 2023 00:21:27 +0000 (00:21 +0000)] 
Daily bump.

2 years agoFix disambiguation against .MASK_LOAD
Richard Biener [Tue, 13 Jun 2023 06:52:23 +0000 (08:52 +0200)] 
Fix disambiguation against .MASK_LOAD

Alias analysis was treating .MASK_LOAD as storing a full vector
which means we disambiguate against decls of smaller than vector size.
This complements the previous patch handling .MASK_STORE and fixes
runtime execution FAILs of gfortran.dg/matmul_3.f90 and
gfortran.dg/inline_sum_2.f90 when using AVX512 with full masked loop
vectorization on Zen4.

* tree-ssa-alias.cc (ref_maybe_used_by_call_p_1): For
.MASK_LOAD and friends set the size of the access to unknown.

(cherry picked from commit 1c3661e224e3ddfc6f773b095740c0f5a7ddf5fc)

2 years agoFix disambiguation against .MASK_STORE
Richard Biener [Mon, 12 Jun 2023 12:09:45 +0000 (14:09 +0200)] 
Fix disambiguation against .MASK_STORE

Alias analysis was treating .MASK_STORE as storing a full vector
which means we disambiguate against decls of smaller than vector size.
That's of course wrong and a similar issue was fixed for DSE already.
The following makes sure we set the size of the access to unknown
and only constrain max_size.

This fixes runtime execution FAILs of gfortran.dg/matmul_2.f90,
gfortran.dg/matmul_6.f90 and gfortran.dg/pr91577.f90 when using
AVX512 with full masked loop vectorization on Zen4.

* tree-ssa-alias.cc (call_may_clobber_ref_p_1): For
.MASK_STORE and friend set the size of the access to
unknown.

(cherry picked from commit 8d3eb3ad5388d2f523e4a6f886c4b3364f77f51f)

2 years agofix frange_nextafter odr violation
Alexandre Oliva [Tue, 13 Jun 2023 08:26:41 +0000 (05:26 -0300)] 
fix frange_nextafter odr violation

C++ requires inline functions to be declared inline and defined in
every translation unit that uses them.  frange_nextafter is used in
gimple-range-op.cc but it's only defined as inline in
range-op-float.cc.  Drop the extraneous inline specifier.

Other non-static inline functions in range-op-float.cc are not
referenced elsewhere, so I'm making them static.

for  gcc/ChangeLog

* range-op-float.cc (frange_nextafter): Drop inline.
(frelop_early_resolve): Add static.
(frange_float): Likewise.

(cherry picked from commit d438b67e005bf8fc9e4af26410bf69816c30e969)

2 years agoDaily bump.
GCC Administrator [Tue, 13 Jun 2023 00:21:51 +0000 (00:21 +0000)] 
Daily bump.

2 years agomiddle-end/110200 - genmatch force-leaf and convert interaction
Richard Biener [Mon, 12 Jun 2023 08:17:26 +0000 (10:17 +0200)] 
middle-end/110200 - genmatch force-leaf and convert interaction

The following fixes code GENERIC generation for (convert! ...)
which currently generates

  if (TREE_TYPE (_o1[0]) != type)
    _r1 = fold_build1_loc (loc, NOP_EXPR, type, _o1[0]);
    if (EXPR_P (_r1))
      goto next_after_fail867;
  else
    _r1 = _o1[0];

where obviously braces are missing.

PR middle-end/110200
* genmatch.cc (expr::gen_transform): Put braces around
the if arm for the (convert ...) short-cut.

(cherry picked from commit 820d1aec89c43dbbc70d3d0b888201878388454c)

2 years agoDaily bump.
GCC Administrator [Mon, 12 Jun 2023 00:21:28 +0000 (00:21 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sun, 11 Jun 2023 00:21:25 +0000 (00:21 +0000)] 
Daily bump.

2 years agotarget/109650: Fix wrong code after cc0 -> CCmode transition.
Georg-Johann Lay [Sat, 10 Jun 2023 19:47:53 +0000 (21:47 +0200)] 
target/109650: Fix wrong code after cc0 -> CCmode transition.

This patch fixes a wrong-code bug in the wake of PR92729, the transition that
turned the AVR backend from cc0 to CCmode.  In cc0, the insn that uses cc0 like
a conditional branch always follows the cc0 setter, which is no more the case
with CCmode where set and use of REG_CC might be in different basic blocks.

This patch removes the machine-dependent reorg pass in avr_reorg entirely.

It is replaced by a new, AVR specific mini-pass that runs prior to split2.
Canonicalization of comparisons away from the "difficult" codes GT[U] and LE[U]
is now mostly performed by implementing TARGET_CANONICALIZE_COMPARISON.

Moreover:

* Text peephole conditions get "dead_or_set_regno_p (*, REG_CC)" as needed.

* RTL peephole conditions get "peep2_regno_dead_p (*, REG_CC)" as needed.

* Conditional branches no more clobber REG_CC.

* insn output for compares looks ahead to determine the branch mode in use.
  This needs also "dead_or_set_regno_p (*, REG_CC)".

* Add RTL peepholes for decrement-and-branch detection.

* Some of the patterns like "*cmphi.zero-extend.0" lost their
  combine-ational part wit PR92729.  Restore them.

Finally, it fixes some of the many indentation glitches left over from PR92729.

gcc/
PR target/109650
PR target/92729
Backport from 2023-05-10 master r14-1688.
* config/avr/avr-passes.def (avr_pass_ifelse): Insert new pass.
* config/avr/avr.cc (avr_pass_ifelse): New RTL pass.
(avr_pass_data_ifelse): New pass_data for it.
(make_avr_pass_ifelse, avr_redundant_compare, avr_cbranch_cost)
(avr_canonicalize_comparison, avr_out_plus_set_ZN)
(avr_out_cmp_ext): New functions.
(compare_condtition): Make sure REG_CC dies in the branch insn.
(avr_rtx_costs_1): Add computation of cbranch costs.
(avr_adjust_insn_length) [ADJUST_LEN_ADD_SET_ZN, ADJUST_LEN_CMP_ZEXT]:
[ADJUST_LEN_CMP_SEXT]Handle them.
(TARGET_CANONICALIZE_COMPARISON): New define.
(avr_simplify_comparison_p, compare_diff_p, avr_compare_pattern)
(avr_reorg_remove_redundant_compare, avr_reorg): Remove functions.
(TARGET_MACHINE_DEPENDENT_REORG): Remove define.
* config/avr/avr-protos.h (avr_simplify_comparison_p): Remove proto.
(make_avr_pass_ifelse, avr_out_plus_set_ZN, cc_reg_rtx)
(avr_out_cmp_zext): New Protos
* config/avr/avr.md (branch, difficult_branch): Don't split insns.
(*cbranchhi.zero-extend.0", *cbranchhi.zero-extend.1")
(*swapped_tst<mode>, *add.for.eqne.<mode>): New insns.
(*cbranch<mode>4): Rename to cbranch<mode>4_insn.
(define_peephole): Add dead_or_set_regno_p(insn,REG_CC) as needed.
(define_deephole2): Add peep2_regno_dead_p(*,REG_CC) as needed.
Add new RTL peepholes for decrement-and-branch and *swapped_tst<mode>.
Rework signtest-and-branch peepholes for *sbrx_branch<mode>.
(adjust_len) [add_set_ZN, cmp_zext]: New.
(QIPSI): New mode iterator.
(ALLs1, ALLs2, ALLs4, ALLs234): New mode iterators.
(gelt): New code iterator.
(gelt_eqne): New code attribute.
(rvbranch, *rvbranch, difficult_rvbranch, *difficult_rvbranch)
(branch_unspec, *negated_tst<mode>, *reversed_tst<mode>)
(*cmpqi_sign_extend): Remove insns.
(define_c_enum "unspec") [UNSPEC_IDENTITY]: Remove.
* config/avr/avr-dimode.md (cbranch<mode>4): Canonicalize comparisons.
* config/avr/predicates.md (scratch_or_d_register_operand): New.
* config/avr/constraints.md (Yxx): New constraint.

gcc/testsuite/
PR target/109650
Backport from 2023-05-10 master r14-1688.
* gcc.target/avr/torture/pr109650-1.c: New test.
* gcc.target/avr/torture/pr109650-2.c: New test.

2 years agoDaily bump.
GCC Administrator [Sat, 10 Jun 2023 00:21:45 +0000 (00:21 +0000)] 
Daily bump.

2 years agoMATCH: Fix zero_one_valued_p not to match signed 1 bit integers
Andrew Pinski [Thu, 8 Jun 2023 21:25:51 +0000 (14:25 -0700)] 
MATCH: Fix zero_one_valued_p not to match signed 1 bit integers

So for the attached testcase, we assumed that zero_one_valued_p would
be the value [0,1] but currently zero_one_valued_p matches also
signed 1 bit integers.
This changes that not to match that and fixes the 2 new testcases at
all optimization levels.

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

PR tree-optimization/110165
PR tree-optimization/110166

gcc/ChangeLog:

* match.pd (zero_one_valued_p): Don't accept
signed 1-bit integers.

gcc/testsuite/ChangeLog:

* gcc.c-torture/execute/pr110165-1.c: New test.
* gcc.c-torture/execute/pr110166-1.c: New test.

(cherry picked from commit 72e652f3425079259faa4edefe1dc571f72f91e0)

2 years agomiddle-end/110182 - TYPE_PRECISION on VECTOR_TYPE causes wrong-code
Richard Biener [Fri, 9 Jun 2023 07:29:09 +0000 (09:29 +0200)] 
middle-end/110182 - TYPE_PRECISION on VECTOR_TYPE causes wrong-code

When folding two conversions in a row we use TYPE_PRECISION but
that's invalid for VECTOR_TYPE.  The following fixes this by
using element_precision instead.

middle-end/110182
* match.pd (two conversions in a row): Use element_precision
to DTRT for VECTOR_TYPE.

(cherry picked from commit 3e12669a0eb968cfcbe9242b382fd8020935edf8)

2 years agoDarwin, PPC: Fix struct layout with pragma pack [PR110044].
Iain Sandoe [Thu, 1 Jun 2023 12:43:35 +0000 (13:43 +0100)] 
Darwin, PPC: Fix struct layout with pragma pack [PR110044].

This bug was essentially that darwin_rs6000_special_round_type_align()
was ignoring externally-imposed capping of field alignment.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
PR target/110044

gcc/ChangeLog:

* config/rs6000/rs6000.cc (darwin_rs6000_special_round_type_align):
Make sure that we do not have a cap on field alignment before altering
the struct layout based on the type alignment of the first entry.

gcc/testsuite/ChangeLog:

* gcc.target/powerpc/darwin-abi-13-0.c: New test.
* gcc.target/powerpc/darwin-abi-13-1.c: New test.
* gcc.target/powerpc/darwin-abi-13-2.c: New test.
* gcc.target/powerpc/darwin-structs-0.h: New test.

(cherry picked from commit 84d080a29a780973bef47171ba708ae2f7b4ee47)

2 years agofortran: Fix ICE on pr96024.f90 on big-endian hosts [PR96024]
Jakub Jelinek [Fri, 9 Jun 2023 07:10:29 +0000 (09:10 +0200)] 
fortran: Fix ICE on pr96024.f90 on big-endian hosts [PR96024]

The pr96024.f90 testcase ICEs on big-endian hosts.  The problem is
that length->val.integer is accessed after checking
length->expr_type == EXPR_CONSTANT, but it is a CHARACTER constant
which uses length->val.character union member instead and on big-endian
we end up reading constant 0x100000000 rather than some small number
on little-endian and if target doesn't have enough memory for 4 times
that (i.e. 16GB allocation), it ICEs.

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

PR fortran/96024
* primary.cc (gfc_convert_to_structure_constructor): Only do
constant string ctor length verification and truncation/padding
if constant length has INTEGER type.

(cherry picked from commit 4cf6e322adc19f927859e0a5edfa93cec4b8c844)

2 years agoExplicitly view_convert_expr mask to signed type when folding pblendvb builtins.
liuhongt [Mon, 5 Jun 2023 04:38:41 +0000 (12:38 +0800)] 
Explicitly view_convert_expr mask to signed type when folding pblendvb builtins.

Since mask < 0 will be always false for vector char when
-funsigned-char, but vpblendvb needs to check the most significant
bit. The patch explicitly VCE to vector signed char.

gcc/ChangeLog:

PR target/110108
* config/i386/i386.cc (ix86_gimple_fold_builtin): Explicitly
view_convert_expr mask to signed type when folding pblendvb
builtins.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr110108-2.c: New test.

2 years agoDaily bump.
GCC Administrator [Fri, 9 Jun 2023 00:21:12 +0000 (00:21 +0000)] 
Daily bump.

2 years agoarm: PR target/109939 Correct signedness of return type of __ssat intrinsics
Kyrylo Tkachov [Wed, 24 May 2023 08:33:04 +0000 (09:33 +0100)] 
arm: PR target/109939 Correct signedness of return type of __ssat intrinsics

As the PR says we shouldn't be using qualifier_unsigned for the return type of the __ssat intrinsics.
UNSIGNED_SAT_BINOP_UNSIGNED_IMM_QUALIFIERS already exists for that.
This was just a thinko.
This patch fixes this and the warning with -Wconversion goes away.

Bootstrapped and tested on arm-none-linux-gnueabihf.

gcc/ChangeLog:

PR target/109939
* config/arm/arm-builtins.cc (SAT_BINOP_UNSIGNED_IMM_QUALIFIERS): Use
qualifier_none for the return operand.

gcc/testsuite/ChangeLog:

PR target/109939
* gcc.target/arm/pr109939.c: New test.

(cherry picked from commit 95542a6ec4b350c653b793b7c36a8210b0e9a89d)

2 years agoDaily bump.
GCC Administrator [Thu, 8 Jun 2023 00:21:33 +0000 (00:21 +0000)] 
Daily bump.

2 years agors6000: Remove duplicate expression [PR106907]
Jeevitha Palanisamy [Tue, 6 Jun 2023 11:19:02 +0000 (06:19 -0500)] 
rs6000: Remove duplicate expression [PR106907]

PR106907 has few warnings spotted from cppcheck. In that addressing duplicate
expression issue here. Here the same expression is used twice in logical
AND(&&) operation which result in same result so removing that.

2023-06-06  Jeevitha Palanisamy  <jeevitha@linux.ibm.com>

gcc/
PR target/106907
* config/rs6000/rs6000.cc (vec_const_128bit_to_bytes): Remove
duplicate expression.

(cherry picked from commit c4deccd44655c5d748dfed200a37f2b678c32fe8)

2 years agoarm: Fix ICE due to infinite splitting [PR109800]
Alex Coplan [Thu, 25 May 2023 12:34:46 +0000 (13:34 +0100)] 
arm: Fix ICE due to infinite splitting [PR109800]

In r11-966-g9a182ef9ee011935d827ab5c6c9a7cd8e22257d8 we introduce a
simplification to emit_move_insn that attempts to simplify moves of the form:

(set (subreg:M1 (reg:M2 ...)) (constant C))

where M1 and M2 are of equal mode size. That is problematic for the splitter
vfp.md:no_literal_pool_df_immediate in the arm backend, which tries to pun an
lvalue DFmode pseudo into DImode and assign a constant to it with
emit_move_insn, as the new transformation simply undoes this, and we end up
splitting indefinitely.

This patch changes things around in the arm backend so that we use a
DImode temporary (instead of DFmode) and first load the DImode constant
into the pseudo, and then pun the pseudo into DFmode as an rvalue in a
reg -> reg move. I believe this should be semantically equivalent but
avoids the pathalogical behaviour seen in the PR.

gcc/ChangeLog:

PR target/109800
* config/arm/arm.md (movdf): Generate temporary pseudo in DImode
instead of DFmode.
* config/arm/vfp.md (no_literal_pool_df_immediate): Rather than punning an
lvalue DFmode pseudo into DImode, use a DImode pseudo and pun it into
DFmode as an rvalue.

gcc/testsuite/ChangeLog:

PR target/109800
* gcc.target/arm/pure-code/pr109800.c: New test.

(cherry picked from commit f5298d9969b4fa34ff3aecd54b9630e22b2984a5)

2 years agoDaily bump.
GCC Administrator [Wed, 7 Jun 2023 00:22:21 +0000 (00:22 +0000)] 
Daily bump.

2 years agolibstdc++: Do not use std::expected::value() in monadic ops (LWG 3938)
Jonathan Wakely [Thu, 1 Jun 2023 10:16:49 +0000 (11:16 +0100)] 
libstdc++: Do not use std::expected::value() in monadic ops (LWG 3938)

The monadic operations in std::expected always check has_value() so we
can avoid the execptional path in value() and the assertions in error()
by accessing _M_val and _M_unex directly. This means that the monadic
operations no longer require _M_unex to be copyable so that it can be
thrown from value(), as modified by LWG 3938.

This also fixes two incorrect uses of std::move in transform(F&&)& and
transform(F&&) const& which I found while making these changes.

Now that move-only error types are supported, it's possible to properly
test the constraints that LWG 3877 added to and_then and transform. The
lwg3877.cc test now does that.

libstdc++-v3/ChangeLog:

* include/std/expected (expected::and_then, expected::or_else)
(expected::transform_error): Use _M_val and _M_unex instead of
calling value() and error(), as per LWG 3938.
(expected::transform): Likewise. Remove incorrect std::move
calls from lvalue overloads.
(expected<void, E>::and_then, expected<void, E>::or_else)
(expected<void, E>::transform): Use _M_unex instead of calling
error().
* testsuite/20_util/expected/lwg3877.cc: Add checks for and_then
and transform, and for std::expected<void, E>.
* testsuite/20_util/expected/lwg3938.cc: New test.

(cherry picked from commit fe94f8b7e022b7e154f6c47cc292d4463bddac5e)

2 years agolibstdc++: Implement LWG 3877 for std::expected monadic ops
Jonathan Wakely [Tue, 16 May 2023 21:40:42 +0000 (22:40 +0100)] 
libstdc++: Implement LWG 3877 for std::expected monadic ops

This was approved in Issaquah 2023. As well as fixing the value
categories, this fixes the fact that we were incorrectly testing E
instead of T in the or_else constraints.

libstdc++-v3/ChangeLog:

* include/std/expected (expected::and_then, expected::or_else)
(expected::transform, expected::transform_error): Fix exception
specifications as per LWG 3877.
(expected<void, E>::and_then, expected<void, E>::transform):
Likewise.
* testsuite/20_util/expected/lwg3877.cc: New test.

(cherry picked from commit ba490492e51834db645a3165d14f2ba0af62a8c7)

2 years agoFix PR 110085: `make clean` in GCC directory on sh target causes a failure
Andrew Pinski [Mon, 5 Jun 2023 04:32:00 +0000 (04:32 +0000)] 
Fix PR 110085: `make clean` in GCC directory on sh target causes a failure

On sh target, there is a MULTILIB_DIRNAMES (or is it MULTILIB_OPTIONS) named m2,
this conflicts with the langauge m2. So when you do a `make clean`, it will remove
the m2 directory and then a build will fail. Now since r0-78222-gfa9585134f6f58,
the multilib directories are no longer created in the gcc directory as libgcc
was moved to the toplevel. So we can remove the part of clean that removes those
directories.

Tested on x86_64-linux-gnu and a cross to sh-elf that `make clean` followed by
`make` works again.

Committed as approved.

gcc/ChangeLog:

PR bootstrap/110085
* Makefile.in (clean): Remove the removing of
MULTILIB_DIR/MULTILIB_OPTIONS directories.

(cherry picked from commit afd87299cefd021daf0158d5b6276c37013996b9)

2 years agolibstdc++: Make std::filesystem::copy_file work for procfs [PR108178]
Jonathan Wakely [Tue, 21 Mar 2023 12:29:08 +0000 (12:29 +0000)] 
libstdc++: Make std::filesystem::copy_file work for procfs [PR108178]

The size reported by stat is always zero for some special files such as
those under /proc, which means the current copy_file implementation
thinks there is nothing to copy. Instead of trusting the stat value, try
to read a character from a streambuf and check for EOF.

For the backport, we also need to avoid trying to use sendfile when stat
reports a zero size, so that we use streambufs to copy the file.

libstdc++-v3/ChangeLog:

PR libstdc++/108178
* src/filesystem/ops-common.h (do_copy_file): Check for empty
files by trying to read a character.
* testsuite/27_io/filesystem/operations/copy_file_108178.cc:
New test.

(cherry picked from commit 07a0e108247f23fcb919c61595adae143f1ea02a)

2 years agolibstdc++: Use close-on-exec for file descriptors in filesystem::copy_file
Jonathan Wakely [Mon, 5 Jun 2023 16:45:37 +0000 (17:45 +0100)] 
libstdc++: Use close-on-exec for file descriptors in filesystem::copy_file

libstdc++-v3/ChangeLog:

* src/filesystem/ops-common.h (do_copy_file) [O_CLOEXEC]: Set
close-on-exec flag on file descriptors.

(cherry picked from commit 7e8e071c4b64f1b6ea5ddf528724fc793a0f0e36)

2 years agolibstdc++: Fix ambiguous expression in std::array<T, 0>::front() [PR110139]
Jonathan Wakely [Tue, 6 Jun 2023 10:38:42 +0000 (11:38 +0100)] 
libstdc++: Fix ambiguous expression in std::array<T, 0>::front() [PR110139]

For 32-bit targets using -pedantic (or using Clang) makes the expression
_M_elems[0] ambiguous.  The overloaded operator[] that we want to call
has a size_t parameter, but 0 is type ptrdiff_t for many ILP32 targets,
so using the implicit conversion from _M_elems to T* and then
subscripting that is also viable.

Change the 0 to (size_type)0 and also make the conversion to T*
explicit, so that's it's not viable here. The latter change requires a
static_cast in data() where we really do want to convert _M_elems to a
pointer.

libstdc++-v3/ChangeLog:

PR libstdc++/110139
* include/std/array (__array_traits<T, 0>::operator T*()): Make
conversion operator explicit.
(array::front): Use size_type as subscript operand.
(array::data): Use static_cast to make conversion explicit.
* testsuite/23_containers/array/element_access/110139.cc: New
test.

(cherry picked from commit 56001fad4ecc32396beead6644906e3846244b67)

2 years agolibstdc++: Do not assume existence of char8_t codecvt facet
Joseph Faulls [Fri, 2 Jun 2023 15:44:48 +0000 (15:44 +0000)] 
libstdc++: Do not assume existence of char8_t codecvt facet

It is not required that codecvt<char8_t, char, mbstate_t> facet be
supported by the locale, nor is it added as part of the default locale.
This can lead to dangerous behaviour when static_cast.

libstdc++-v3/ChangeLog:

* include/bits/locale_classes.tcc: Remove check for
codecvt<char8_t, char, mbstate_t> facet.

(cherry picked from commit 3d9b3ddb5fc9087c17645d53e6bcb1881e1955a4)

2 years agoDaily bump.
GCC Administrator [Tue, 6 Jun 2023 00:22:05 +0000 (00:22 +0000)] 
Daily bump.

2 years agod: Warn when declared size of a special enum does not match its intrinsic type.
Iain Buclaw [Mon, 5 Jun 2023 16:30:12 +0000 (18:30 +0200)] 
d: Warn when declared size of a special enum does not match its intrinsic type.

All special enums have declarations in the D runtime library, but the
compiler will recognize and treat them specially if declared in any
module.  When the underlying base type of a special enum is a different
size to its matched intrinsic, then this can cause undefined behavior at
runtime.  Detect and warn about when such a mismatch occurs.

gcc/d/ChangeLog:

* gdc.texi (Warnings): Document -Wextra and -Wmismatched-special-enum.
* implement-d.texi (Special Enums): Add reference to warning option
-Wmismatched-special-enum.
* lang.opt: Add -Wextra and -Wmismatched-special-enum.
* types.cc (TypeVisitor::visit (TypeEnum *)): Warn when declared
special enum size mismatches its intrinsic type.

gcc/testsuite/ChangeLog:

* gdc.dg/Wmismatched_enum.d: New test.

(cherry picked from commit 3ad9313a2e28287aa350d9dc3ea7746d8302662d)

2 years agoDaily bump.
GCC Administrator [Mon, 5 Jun 2023 00:21:10 +0000 (00:21 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sun, 4 Jun 2023 00:20:45 +0000 (00:20 +0000)] 
Daily bump.

2 years agoFortran: fix diagnostics for SELECT RANK [PR100607]
Steve Kargl [Fri, 2 Jun 2023 17:44:11 +0000 (19:44 +0200)] 
Fortran: fix diagnostics for SELECT RANK [PR100607]

gcc/fortran/ChangeLog:

PR fortran/100607
* resolve.cc (resolve_select_rank): Remove duplicate error.
(resolve_fl_var_and_proc): Prevent NULL pointer dereference and
suppress error message for temporary.

gcc/testsuite/ChangeLog:

PR fortran/100607
* gfortran.dg/select_rank_6.f90: New test.

(cherry picked from commit fae09dfc0e6bf4cfe35d817558827aea78c6426f)

2 years agofix radix sort on 32bit platforms [PR109670]
Thomas Neumann [Wed, 10 May 2023 10:33:49 +0000 (12:33 +0200)] 
fix radix sort on 32bit platforms [PR109670]

The radix sort uses two buffers, a1 for input and a2 for output.
After every digit the role of the two buffers is swapped.
When terminating the sort early the code made sure the output
was in a2.  However, when we run out of bits, as can happen on
32bit platforms, the sorted result was in a1, as we had just
swapped a1 and a2.
This patch fixes the problem by unconditionally having a1 as
output after every loop iteration.

This bug manifested itself only on 32bit platforms and even then
only in some circumstances, as it needs frames where a swap
is required due to differences in the top-most byte, which is
affected by ASLR. The new logic was validated by exhaustive
search over 32bit input values.

libgcc/ChangeLog:
PR libgcc/109670
* unwind-dw2-fde.c: Fix radix sort buffer management.

2 years agorelease the sorted FDE array when deregistering a frame [PR109685]
Thomas Neumann [Tue, 2 May 2023 14:21:09 +0000 (16:21 +0200)] 
release the sorted FDE array when deregistering a frame [PR109685]

The atomic fastpath bypasses the code that releases the sort
array which was lazily allocated during unwinding. We now
check after deregistering if there is an array to free.

libgcc/ChangeLog:
PR libgcc/109685
* unwind-dw2-fde.c: Free sort array in atomic fast path.

2 years agoDaily bump.
GCC Administrator [Sat, 3 Jun 2023 00:21:17 +0000 (00:21 +0000)] 
Daily bump.

2 years agotarget/110088: Improve operation of l-reg with const after move from d-reg.
Georg-Johann Lay [Fri, 2 Jun 2023 10:41:07 +0000 (12:41 +0200)] 
target/110088: Improve operation of l-reg with const after move from d-reg.

After reload, there may be sequences like
   lreg = dreg
   lreg = lreg <op> const
with an LD_REGS dreg, non-LD_REGS lreg, and <op> in PLUS, IOR, AND.
If dreg dies after the first insn, it is possible to use
   dreg = dreg <op> const
   lreg = dreg
instead which is more efficient.

gcc/
PR target/110088
* config/avr/avr.md: Add an RTL peephole to optimize operations on
non-LD_REGS after a move from LD_REGS.
(piaop): New code iterator.

2 years agoDaily bump.
GCC Administrator [Fri, 2 Jun 2023 00:21:53 +0000 (00:21 +0000)] 
Daily bump.

2 years agolibstdc++: Fix std::abs(__float128) for -NaN and -0.0 [PR109758]
Jonathan Wakely [Wed, 10 May 2023 11:20:58 +0000 (12:20 +0100)] 
libstdc++: Fix std::abs(__float128) for -NaN and -0.0 [PR109758]

The current implementation of this non-standard overload of std::abs
incorrectly returns a negative value for negative NaNs and negative
zero, because x < 0 is false in both cases.

Use fabsl(long double) or fabsf128(_Float128) if those do the right
thing.  Otherwise, use __builtin_signbit(x) instead of x < 0 to detect
negative inputs. This assumes that __builtin_signbit handles __float128
correctly, but that seems to be true for all of GCC, clang and icc.

libstdc++-v3/ChangeLog:

PR libstdc++/109758
* include/bits/std_abs.h (abs(__float128)): Handle negative NaN
and negative zero correctly.
* testsuite/26_numerics/headers/cmath/109758.cc: New test.

(cherry picked from commit af595613acbd9863198ae69c7b1c9e856bca9e4f)

2 years agolibstdc++: Remove test dependency on _GLIBCXX_USE_C99_STDINT_TR1
Jonathan Wakely [Fri, 12 May 2023 12:44:21 +0000 (13:44 +0100)] 
libstdc++: Remove test dependency on _GLIBCXX_USE_C99_STDINT_TR1

This should have been done in r9-2028-g8ba7f29e3dd064 when
std::shared_mutex was changed to be defined without depending on
_GLIBCXX_USE_C99_STDINT_TR1.

libstdc++-v3/ChangeLog:

* testsuite/experimental/feat-cxx14.cc: Remove dependency on
_GLIBCXX_USE_C99_STDINT_TR1.

(cherry picked from commit 2c04284abe5d5f1148c709a769f3b83bee2485d0)

2 years agolibstdc++: Remove test dependencies on _GLIBCXX_USE_C99_STDINT_TR1
Jonathan Wakely [Fri, 12 May 2023 12:34:37 +0000 (13:34 +0100)] 
libstdc++: Remove test dependencies on _GLIBCXX_USE_C99_STDINT_TR1

These #ifdef checks should have been removed in r9-2029-g612c9c702e2c9e
when the u16string_view and u32string_view aliases were changed to be
defined unconditionally.

libstdc++-v3/ChangeLog:

* testsuite/21_strings/basic_string_view/typedefs.cc: Remove
dependency on _GLIBCXX_USE_C99_STDINT_TR1.
* testsuite/experimental/string_view/typedefs.cc: Likewise.

(cherry picked from commit fe0e3df6f3751a0164c8e92a0d6519f2e10527a8)

2 years agolibstdc++: Fix PSTL test that fails in C++20
Jonathan Wakely [Thu, 1 Jun 2023 15:49:53 +0000 (16:49 +0100)] 
libstdc++: Fix PSTL test that fails in C++20

This test fails in C++20 and later due to a warning:

warning: C++20 says that these are ambiguous, even though the second is reversed:
note: candidate 1: 'bool MyClass::operator==(const MyClass&)'
note: candidate 2: 'bool MyClass::operator==(const MyClass&)' (reversed)
note: try making the operator a 'const' member function
FAIL: 26_numerics/pstl/numeric_ops/transform_reduce.cc (test for excess errors)

libstdc++-v3/ChangeLog:

* testsuite/26_numerics/pstl/numeric_ops/transform_reduce.cc:
Add const to equality operator.

(cherry picked from commit f8403c43045cd56b5f775e1cf12a3f22feca4b58)

2 years agolibstdc++: Document removal of implicit allocator rebinding extensions
Jonathan Wakely [Mon, 15 May 2023 20:41:56 +0000 (21:41 +0100)] 
libstdc++: Document removal of implicit allocator rebinding extensions

Traditionally libstdc++ allowed containers to be
instantiated with allocator's that have the wrong value type, implicitly
rebinding the allocator to the container's value type. Since C++20 that
has been explicitly ill-formed, so the extension is no longer supported
in strict modes (e.g. -std=c++17) and in C++20 and later.

libstdc++-v3/ChangeLog:

* doc/xml/manual/evolution.xml: Document removal of implicit
allocator rebinding extensions in strict mode and for C++20.
* doc/html/*: Regenerate.

(cherry picked from commit 8cbaf679a3c1875c5475bd1cb0fb86fb9d03b2d4)

2 years agolibstdc++: Fix -Wnonnull warnings during configure
Jonathan Wakely [Fri, 12 May 2023 11:17:08 +0000 (12:17 +0100)] 
libstdc++: Fix -Wnonnull warnings during configure

We should not test for nan by passing it a null pointer, as this can
trigger -Wnonnull warnings.

Also fix an outdated comment about the default -std mode.

libstdc++-v3/ChangeLog:

* acinclude.m4 (GLIBCXX_CHECK_C99_TR1): Use a non-null pointer
to check for nan, nanf, and nanl.
* configure: Regenerate.

(cherry picked from commit 6190a74ebee69415b501996821c92f60d892fb81)

2 years agolibstdc++: Require tzdb support for chrono::zoned_time printer test
Jonathan Wakely [Mon, 15 May 2023 19:36:03 +0000 (20:36 +0100)] 
libstdc++: Require tzdb support for chrono::zoned_time printer test

libstdc++-v3/ChangeLog:

* testsuite/libstdc++-prettyprinters/chrono.cc: Only test
printer for chrono::zoned_time for cx11 ABI and tzdb effective
target.

(cherry picked from commit 151bad410218d266e16b90da0147d57f9d661c1a)

2 years agolibstdc++: Fix <chrono> pretty printers and add tests
Jonathan Wakely [Tue, 9 May 2023 17:18:01 +0000 (18:18 +0100)] 
libstdc++: Fix <chrono> pretty printers and add tests

This fixes a couple of errors in the printers for chrono types, and adds
tests to ensure they keep working.

libstdc++-v3/ChangeLog:

* python/libstdcxx/v6/printers.py (StdChronoDurationPrinter):
Print floating-point durations correctly.
(StdChronoTimePointPrinter): Support printing only the value,
not the type name. Uncomment handling for known clocks.
(StdChronoZonedTimePrinter): Remove type names from output.
(StdChronoCalendarPrinter): Fix hh_mm_ss member access.
(StdChronoTimeZonePrinter): Add equals sign to output.
* testsuite/libstdc++-prettyprinters/chrono.cc: New test.

(cherry picked from commit 7bd251ca751317385f7e2e4e031736a99f376012)

2 years agodoc: Fix description of x86 -m32 option [PR109954]
Jonathan Wakely [Thu, 1 Jun 2023 10:30:10 +0000 (11:30 +0100)] 
doc: Fix description of x86 -m32 option [PR109954]

This option does not imply -march=i386 so it's incorrect to say it
generates code that will run on "any i386 system".

gcc/ChangeLog:

PR target/109954
* doc/invoke.texi (x86 Options): Fix description of -m32 option.

(cherry picked from commit eeb92704967875411416b0b9508aa6f49e8192fd)

2 years agoDaily bump.
GCC Administrator [Thu, 1 Jun 2023 00:21:18 +0000 (00:21 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Wed, 31 May 2023 00:21:11 +0000 (00:21 +0000)] 
Daily bump.

2 years ago[libstdc++] [testsuite] xfail double-prec from_chars for x86_64 ldbl
Alexandre Oliva [Tue, 30 May 2023 21:46:26 +0000 (18:46 -0300)] 
[libstdc++] [testsuite] xfail double-prec from_chars for x86_64 ldbl

When long double is wider than double, but from_chars is implemented
in terms of double, tests that involve the full precision of long
double are expected to fail.  Mark them as such on x86_64-*-vxworks*.

for  libstdc++-v3/ChangeLog

* testsuite/20_util/from_chars/4.cc: Skip long double test06
on x86_64-vxworks.
* testsuite/20_util/to_chars/long_double.cc: Xfail run on
x86_64-vxworks.

(cherry picked from commit 282e4e745981c5c6e3edaae315e1f499a45402df)

2 years agotestsuite: make mve_intrinsic_type_overloads-int.c libc-agnostic
Christophe Lyon [Tue, 23 May 2023 14:30:53 +0000 (14:30 +0000)] 
testsuite: make mve_intrinsic_type_overloads-int.c libc-agnostic

Glibc defines int32_t as 'int' while newlib defines it as 'long int'.

Although these correspond to the same size, g++ complains when using the
'wrong' version:
  invalid conversion from 'long int*' to 'int32_t*' {aka 'int*'} [-fpermissive]
or
  invalid conversion from 'int*' to 'int32_t*' {aka 'long int*'} [-fpermissive]

when calling vst1q(int32*, int32x4_t) with a first parameter of type
'long int *' (resp. 'int *')

To make this test pass with any type of toolchain, this patch defines
'word_type' according to which libc is in use.

2023-05-23  Christophe Lyon  <christophe.lyon@linaro.org>

gcc/testsuite/
* gcc.target/arm/mve/intrinsics/mve_intrinsic_type_overloads-int.c:
Support both definitions of int32_t.

(cherry picked from commit d12d2aa4fccc76a9a08c8120c5e37d9cab8683e8)

2 years agolibstdc++: Correct NTTP and simd_mask ctor call
Matthias Kretz [Fri, 26 May 2023 10:23:44 +0000 (12:23 +0200)] 
libstdc++: Correct NTTP and simd_mask ctor call

Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
libstdc++-v3/ChangeLog:

PR libstdc++/109822
* include/experimental/bits/simd.h (to_native): Use int NTTP
as specified in PTS2.
(to_compatible): Likewise. Add missing tag to call mask
generator ctor.
* testsuite/experimental/simd/pr109822_cast_functions.cc: New
test.

(cherry picked from commit 668d43502f465d48adbc1fe2956b979f36657e5f)

2 years agolibstdc++: Simplify calculation of expected value in simd test
Matthias Kretz [Thu, 25 May 2023 10:53:06 +0000 (12:53 +0200)] 
libstdc++: Simplify calculation of expected value in simd test

This avoids a failure on PR109964.

Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
libstdc++-v3/ChangeLog:

* testsuite/experimental/simd/tests/integer_operators.cc:
Compute expected value differently to avoid getting turned into
a vector shift.

(cherry picked from commit 3e2689e568425f14d6728504ad6f5d32b90320ad)

2 years agolibstdc++: Fix test assumptions on long and long double
Matthias Kretz [Thu, 25 May 2023 10:07:45 +0000 (12:07 +0200)] 
libstdc++: Fix test assumptions on long and long double

Expect that long might not fit into the long double mantissa bits.

Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
libstdc++-v3/ChangeLog:

* testsuite/experimental/simd/tests/operator_cvt.cc: Make long
double <-> (u)long conversion tests conditional on sizeof(long
double) and sizeof(long).

(cherry picked from commit 291549d43e823f163fa9961e42a751b5ce0d57fb)

2 years agolibstdc++: Resolve -Wsign-compare issue
Matthias Kretz [Thu, 25 May 2023 08:45:21 +0000 (10:45 +0200)] 
libstdc++: Resolve -Wsign-compare issue

Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
libstdc++-v3/ChangeLog:

* include/experimental/bits/simd_ppc.h (_S_bit_shift_left):
Negative __y is UB, so prefer signed compare.

(cherry picked from commit 1a1abec1d618cde709c585fcce89330bb33b07ac)

2 years agoriscv: update riscv_asan_shadow_offset
Andreas Schwab [Sun, 28 May 2023 10:08:22 +0000 (12:08 +0200)] 
riscv: update riscv_asan_shadow_offset

gcc/
PR target/110036
* config/riscv/riscv.cc (riscv_asan_shadow_offset): Update to
match libsanitizer.

2 years agoDaily bump.
GCC Administrator [Tue, 30 May 2023 00:20:44 +0000 (00:20 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Mon, 29 May 2023 11:18:40 +0000 (11:18 +0000)] 
Daily bump.

2 years agoRISC-V: Add local user vsetvl instruction elimination [PR109547]
Juzhe-Zhong [Fri, 7 Apr 2023 01:34:13 +0000 (09:34 +0800)] 
RISC-V: Add local user vsetvl instruction elimination [PR109547]

This patch is to enhance optimization for auto-vectorization.

Before this patch:

Loop:
vsetvl a5,a2...
vsetvl zero,a5...
vle

After this patch:

Loop:
vsetvl a5,a2
vle

gcc/ChangeLog:

PR target/109547
* config/riscv/riscv-vsetvl.cc (local_eliminate_vsetvl_insn): New function.
(vector_insn_info::skip_avl_compatible_p): Ditto.
(vector_insn_info::merge): Remove default value.
(pass_vsetvl::compute_local_backward_infos): Ditto.
(pass_vsetvl::cleanup_insns): Add local vsetvl elimination.
* config/riscv/riscv-vsetvl.h: Ditto.

gcc/testsuite/ChangeLog:

PR target/109547
* gcc.target/riscv/rvv/vsetvl/pr109547.c: New.
* gcc.target/riscv/rvv/vsetvl/vsetvl-17.c: Update scan
condition.

(cherry picked from commit d51f2456ee51bd59a79b4725ca0e488c25260bbf)

2 years agoRISC-V: Fix wrong select_kind in riscv_compute_multilib
Kito Cheng [Mon, 15 May 2023 07:23:31 +0000 (15:23 +0800)] 
RISC-V: Fix wrong select_kind in riscv_compute_multilib

Seems like I screw up bare-metal toolchian multi lib selection during
finxing linux multi-lib selction...

gcc/ChangeLog:

* common/config/riscv/riscv-common.cc (riscv_compute_multilib):
Fix wrong select_kind...

(cherry picked from commit 008cbecf622a413ebcc8b41a737f30fd7e2a1abf)

2 years agoRISC-V: Suppress unused parameter warning in riscv-common.cc
Kito Cheng [Fri, 12 May 2023 08:54:57 +0000 (16:54 +0800)] 
RISC-V: Suppress unused parameter warning in riscv-common.cc

gcc/ChangeLog:

* common/config/riscv/riscv-common.cc (riscv_select_multilib_by_abi):
Drop unused parameter.
(riscv_select_multilib): Ditto.
(riscv_compute_multilib): Update call site of
riscv_select_multilib_by_abi and riscv_select_multilib_by_abi.

(cherry picked from commit 7a7f6b26259d22115ee4813ce130622ad1073d16)

2 years agoRISC-V: Handle multi-lib path correclty for linux
Kito Cheng [Thu, 4 May 2023 07:12:27 +0000 (15:12 +0800)] 
RISC-V: Handle multi-lib path correclty for linux

RISC-V Linux encodes the ABI into the path, so in theory, we can only use that
to select multi-lib paths, and no way to use different multi-lib paths between
`rv32i/ilp32` and `rv32ima/ilp32`, we'll mapping both to `/lib/ilp32`.

It's hard to do that with GCC's builtin multi-lib selection mechanism; builtin
mechanism did the option string compare and then enumerate all possible reuse
rules during the build time. However, it's impossible to RISC-V; we have a huge
number of combinations of `-march`, so implementing a customized multi-lib
selection becomes the only solution.

Multi-lib configuration is only used for determines which ISA should be used
when compiling the corresponding ABI variant after this patch.

During the multi-lib selection stage, only consider -mabi as the only key to
select the multi-lib path.

gcc/ChangeLog:

* common/config/riscv/riscv-common.cc (riscv_select_multilib_by_abi): New.
(riscv_select_multilib): New.
(riscv_compute_multilib): Extract logic to riscv_select_multilib and
also handle select_by_abi.
* config/riscv/elf.h (RISCV_USE_CUSTOMISED_MULTI_LIB): Change it
to select_by_abi_arch_cmodel from 1.
* config/riscv/linux.h (RISCV_USE_CUSTOMISED_MULTI_LIB): Define.
* config/riscv/riscv-opts.h (enum riscv_multilib_select_kind): New.

(cherry picked from commit 17d683d4d3dc95d13096ec52ad9937a2b011f9a4)

2 years agoRISC-V: Fix ternary instruction attribute bug
Juzhe-Zhong [Mon, 29 May 2023 04:21:48 +0000 (12:21 +0800)] 
RISC-V: Fix ternary instruction attribute bug

Fix bug of vector.md which generate incorrect information to
VSETVL PASS when testing FMA auto vectorization ternop-3.c.

Signed-off-by: Juzhe-Zhong <juzhe.zhong@rivai.ai>
gcc/ChangeLog:

* config/riscv/vector.md: Fix vimuladd instruction bug.

(cherry picked from commit f8af48d8755018272cdb0cf2f250cf278829d7be)

2 years agoDaily bump.
GCC Administrator [Sun, 28 May 2023 00:20:01 +0000 (00:20 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sat, 27 May 2023 00:20:17 +0000 (00:20 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Fri, 26 May 2023 00:20:46 +0000 (00:20 +0000)] 
Daily bump.

2 years agotarget/104327: Allow more inlining between different optimization levels.
Georg-Johann Lay [Tue, 23 May 2023 12:54:12 +0000 (14:54 +0200)] 
target/104327: Allow more inlining between different optimization levels.

avr-common.cc introduces the following options that are set depending
on optimization level: -mgas-isr-prologues, -mmain-is-OS-task and
-fsplit-wide-types-early.  The inliner thinks that different options
disallow cross-optimization inlining, so provide can_inline_p.

gcc/
PR target/104327
* config/avr/avr.cc (avr_can_inline_p): New static function.
(TARGET_CAN_INLINE_P): Define to that function.

2 years agotarget/82931: Make a pattern more generic to match more bit-transfers.
Georg-Johann Lay [Thu, 25 May 2023 17:02:34 +0000 (19:02 +0200)] 
target/82931: Make a pattern more generic to match more bit-transfers.

There is already a pattern in avr.md that matches single-bit transfers
from one register to another one, but it only handled bit 0 of 8-bit
registers.  This change makes that pattern more generic so it matches
more of similar single-bit transfers.

gcc/
PR target/82931
* config/avr/avr.md (*movbitqi.0): Rename to *movbit<mode>.0-6.
Handle any bit position and use mode QISI.
* config/avr/avr.cc (avr_rtx_costs_1) [IOR]: Return a cost
of 2 insns for bit-transfer of respective style.

gcc/testsuite/
PR target/82931
* gcc.target/avr/pr82931.c: New test.

2 years ago[libstdc++] [testsuite] xfail to_chars/long_double on x86-vxworks
Alexandre Oliva [Thu, 25 May 2023 08:57:11 +0000 (05:57 -0300)] 
[libstdc++] [testsuite] xfail to_chars/long_double on x86-vxworks

Just as on aarch64, x86's wider long double experiences loss of
precision with from_chars implemented in terms of double.  Expect the
execution fail.

for  libstdc++-v3/ChangeLog

* testsuite/20_util/to_chars/long_double.cc: Expect execution
fail on x86-vxworks.

(cherry picked from commit 7daa166fe89fca4ff1baa063c00a5a690f7e462f)

2 years agolibstdc++: Add missing constexpr to simd
Matthias Kretz [Thu, 23 Mar 2023 08:32:58 +0000 (09:32 +0100)] 
libstdc++: Add missing constexpr to simd

The constexpr API is only available with -std=gnu++XX (and proposed for
C++26). The proposal is to have the complete simd API usable in constant
expressions.

This patch resolves several issues with using simd in constant
expressions.

Issues why constant_evaluated branches are necessary:
* subscripting vector builtins is not allowed in constant expressions
* if the implementation needs/uses memcpy
* if the implementation would otherwise call SIMD intrinsics/builtins

Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
libstdc++-v3/ChangeLog:

PR libstdc++/109261
* include/experimental/bits/simd.h (_SimdWrapper::_M_set):
Avoid vector builtin subscripting in constant expressions.
(resizing_simd_cast): Avoid memcpy if constant_evaluated.
(const_where_expression, where_expression, where)
(__extract_part, simd_mask, _SimdIntOperators, simd): Add either
_GLIBCXX_SIMD_CONSTEXPR (on public APIs), or constexpr (on
internal APIs).
* include/experimental/bits/simd_builtin.h (__vector_permute)
(__vector_shuffle, __extract_part, _GnuTraits::_SimdCastType1)
(_GnuTraits::_SimdCastType2, _SimdImplBuiltin)
(_MaskImplBuiltin::_S_store): Add constexpr.
(_CommonImplBuiltin::_S_store_bool_array)
(_SimdImplBuiltin::_S_load, _SimdImplBuiltin::_S_store)
(_SimdImplBuiltin::_S_reduce, _MaskImplBuiltin::_S_load): Add
constant_evaluated case.
* include/experimental/bits/simd_fixed_size.h
(_S_masked_load): Reword comment.
(__tuple_element_meta, __make_meta, _SimdTuple::_M_apply_r)
(_SimdTuple::_M_subscript_read, _SimdTuple::_M_subscript_write)
(__make_simd_tuple, __optimize_simd_tuple, __extract_part)
(__autocvt_to_simd, _Fixed::__traits::_SimdBase)
(_Fixed::__traits::_SimdCastType, _SimdImplFixedSize): Add
constexpr.
(_SimdTuple::operator[], _M_set): Add constexpr and add
constant_evaluated case.
(_MaskImplFixedSize::_S_load): Add constant_evaluated case.
* include/experimental/bits/simd_scalar.h: Add constexpr.

* include/experimental/bits/simd_x86.h (_CommonImplX86): Add
constexpr and add constant_evaluated case.
(_SimdImplX86::_S_equal_to, _S_not_equal_to, _S_less)
(_S_less_equal): Value-initialize to satisfy constexpr
evaluation.
(_MaskImplX86::_S_load): Add constant_evaluated case.
(_MaskImplX86::_S_store): Add constexpr and constant_evaluated
case. Value-initialize local variables.
(_MaskImplX86::_S_logical_and, _S_logical_or, _S_bit_not)
(_S_bit_and, _S_bit_or, _S_bit_xor): Add constant_evaluated
case.
* testsuite/experimental/simd/pr109261_constexpr_simd.cc: New
test.

(cherry picked from commit da579188807ede4ee9466d0b5bf51559c96a0b51)

2 years agolibstdc++: Fix type of first argument to vec_cntm call
Matthias Kretz [Wed, 24 May 2023 14:43:07 +0000 (16:43 +0200)] 
libstdc++: Fix type of first argument to vec_cntm call

Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
libstdc++-v3/ChangeLog:

PR libstdc++/109949
* include/experimental/bits/simd.h (__intrinsic_type): If
__ALTIVEC__ is defined, map gnu::vector_size types to their
corresponding __vector T types without losing unsignedness of
integer types. Also prefer long long over long.
* include/experimental/bits/simd_ppc.h (_S_popcount): Cast mask
object to the expected unsigned vector type.

(cherry picked from commit efd2b55d8562c6e80cb7ee8b9b1f9418f0c00cd9)

2 years agolibstdc++: Add missing constexpr to simd_neon
Matthias Kretz [Tue, 23 May 2023 21:48:49 +0000 (23:48 +0200)] 
libstdc++: Add missing constexpr to simd_neon

Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
libstdc++-v3/ChangeLog:

PR libstdc++/109261
* include/experimental/bits/simd_neon.h (_S_reduce): Add
constexpr and make NEON implementation conditional on
not __builtin_is_constant_evaluated.

(cherry picked from commit b0a483b0a011f9cbc8b25053eae809c77dae2a12)

2 years agolibstdc++: Fix SFINAE for __is_intrinsic_type on ARM
Matthias Kretz [Wed, 24 May 2023 10:50:46 +0000 (12:50 +0200)] 
libstdc++: Fix SFINAE for __is_intrinsic_type on ARM

On ARM NEON doesn't support double, so __is_intrinsic_type_v<double,
whatever> should say false (instead of being ill-formed).

Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
libstdc++-v3/ChangeLog:

PR libstdc++/109261
* include/experimental/bits/simd.h (__intrinsic_type):
Specialize __intrinsic_type<double, 8> and
__intrinsic_type<double, 16> in any case, but provide the member
type only with __aarch64__.

(cherry picked from commit aa8b363171a95b8f867a74f29c75f9577e9087e1)

2 years agolibstdc++: Resolve -Wunused-variable warnings in stdx::simd and tests
Matthias Kretz [Mon, 22 May 2023 14:58:30 +0000 (16:58 +0200)] 
libstdc++: Resolve -Wunused-variable warnings in stdx::simd and tests

Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
libstdc++-v3/ChangeLog:

* include/experimental/bits/simd_builtin.h (_S_fpclassify): Move
__infn into #ifdef'ed block.
* testsuite/experimental/simd/tests/fpclassify.cc: Declare
constants only when used.
* testsuite/experimental/simd/tests/frexp.cc: Likewise.
* testsuite/experimental/simd/tests/logarithm.cc: Likewise.
* testsuite/experimental/simd/tests/trunc_ceil_floor.cc:
Likewise.
* testsuite/experimental/simd/tests/ldexp_scalbn_scalbln_modf.cc:
Move totest and expect1 into #ifdef'ed block.

(cherry picked from commit a7129e82bed1bd4f513fc3c3f401721e2c96a865)

2 years agoDaily bump.
GCC Administrator [Thu, 25 May 2023 00:21:02 +0000 (00:21 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Wed, 24 May 2023 00:21:56 +0000 (00:21 +0000)] 
Daily bump.

2 years agoImprove cost computation for single-bit bit insertions.
Georg-Johann Lay [Tue, 23 May 2023 16:49:19 +0000 (18:49 +0200)] 
Improve cost computation for single-bit bit insertions.

Some miscomputation of rtx_costs lead to sub-optimal code for
single-bit bit insertions.  This patch implements TARGET_INSN_COST,
which has a chance to see the whole insn during insn combination;
in particular the SET_DEST of (set (zero_extract (...) ...)).

gcc/
* config/avr/avr.cc (avr_insn_cost): New static function.
(TARGET_INSN_COST): Define to that function.

2 years agoFix handling of non-integral bit-fields in native_encode_initializer
Eric Botcazou [Tue, 23 May 2023 08:15:35 +0000 (10:15 +0200)] 
Fix handling of non-integral bit-fields in native_encode_initializer

The encoder for CONSTRUCTORs assumes that all bit-fields (DECL_BIT_FIELD)
have integral types, but that's not the case in Ada where they may have
pretty much any type, resulting in a wrong encoding for them

gcc/
* fold-const.cc (native_encode_initializer) <CONSTRUCTOR>: Apply the
specific treatment for bit-fields only if they have an integral type
and filter out non-integral bit-fields that do not start and end on
a byte boundary.

gcc/testsuite/
* gnat.dg/opt101.adb: New test.
* gnat.dg/opt101_pkg.ads: New helper.

2 years agoDaily bump.
GCC Administrator [Tue, 23 May 2023 00:20:28 +0000 (00:20 +0000)] 
Daily bump.

2 years agoatch.pd: Ensure (op CONSTANT_CLASS_P CONSTANT_CLASS_P) is simplified [PR109505]
Jakub Jelinek [Sun, 21 May 2023 11:36:56 +0000 (13:36 +0200)] 
atch.pd: Ensure (op CONSTANT_CLASS_P CONSTANT_CLASS_P) is simplified [PR109505]

On the following testcase we hang, because POLY_INT_CST is CONSTANT_CLASS_P,
but BIT_AND_EXPR with it and INTEGER_CST doesn't simplify and the
(x | CST1) & CST2 -> (x & CST2) | (CST1 & CST2)
simplification actually relies on the (CST1 & CST2) simplification,
otherwise it is a deoptimization, trading 2 ops for 3 and furthermore
running into
/* Given a bit-wise operation CODE applied to ARG0 and ARG1, see if both
   operands are another bit-wise operation with a common input.  If so,
   distribute the bit operations to save an operation and possibly two if
   constants are involved.  For example, convert
     (A | B) & (A | C) into A | (B & C)
   Further simplification will occur if B and C are constants.  */
simplification which simplifies that
(x & CST2) | (CST1 & CST2) back to
CST2 & (x | CST1).
I went through all other places I could find where we have a simplification
with 2 CONSTANT_CLASS_P operands and perform some operation on those two,
while the other spots aren't that severe (just trade 2 operations for
another 2 if the two constants don't simplify, rather than as in the above
case trading 2 ops for 3), I still think all those spots really intend
to optimize only if the 2 constants simplify.

So, the following patch adds to those a ! modifier to ensure that,
even at GENERIC that modifier means !EXPR_P which is exactly what we want
IMHO.

2023-05-21  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/109505
* match.pd ((x | CST1) & CST2 -> (x & CST2) | (CST1 & CST2),
Combine successive equal operations with constants,
(A +- CST1) +- CST2 -> A + CST3, (CST1 - A) +- CST2 -> CST3 - A,
CST1 - (CST2 - A) -> CST3 + A): Use ! on ops with 2 CONSTANT_CLASS_P
operands.

* gcc.target/aarch64/sve/pr109505.c: New test.

(cherry picked from commit f211757f6fa9515e3fd1a4f66f1a8b48e500c9de)

2 years agovect: Don't retry if the previous analysis fails
Kewen Lin [Wed, 17 May 2023 07:48:40 +0000 (02:48 -0500)] 
vect: Don't retry if the previous analysis fails

When working on a cost tweaking patch, I found that a newly
added test case has different dumpings with stage-1 and
bootstrapped gcc.  By looking into it, the apparent reason
is vect_analyze_loop_2 doesn't get slp_done_for_suggested_uf
set expectedly, the following retrying will use the garbage
slp_done_for_suggested_uf instead.  In fact, the setting of
slp_done_for_suggested_uf only happens when the previous
analysis succeeds, for the mentioned test case, its previous
analysis does fail, it's unexpected to use the value of
slp_done_for_suggested_uf any more.

In function vect_analyze_loop_1, we only return success when
res is true, which is the result of 1st analysis.  It means
we never try to vectorize with unroll_vinfo if the previous
analysis fails.  So this patch shouldn't break anything, and
just stop some useless analysis early.

gcc/ChangeLog:

* tree-vect-loop.cc (vect_analyze_loop_1): Don't retry analysis with
suggested unroll factor once the previous analysis fails.

(cherry picked from commit a04bf39f61ce7814d197d712760f08c206daf4f1)

2 years agoDaily bump.
GCC Administrator [Mon, 22 May 2023 00:21:07 +0000 (00:21 +0000)] 
Daily bump.

2 years agoDarwin, libgcc : Adjust min version supported for the OS.
Iain Sandoe [Thu, 11 May 2023 22:24:02 +0000 (23:24 +0100)] 
Darwin, libgcc : Adjust min version supported for the OS.

Tools from later versions of the OS deprecate or fail to support
earlier OS revisions.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
libgcc/ChangeLog:

* config.host: Arrange to set min Darwin OS versions from
the configured host version.
* config/darwin10-unwind-find-enc-func.c: Do not use current
headers, but declare the nexessary structures locally to the
versions in use for Mac OSX 10.6.
* config/t-darwin: Amend to handle configured min OS
versions.
* config/t-darwin-min-1: New.
* config/t-darwin-min-5: New.
* config/t-darwin-min-8: New.

(cherry picked from commit 20b8779ea9bd82b26eeb195b30f695168cd7ae1d)

2 years agoDaily bump.
GCC Administrator [Sun, 21 May 2023 00:20:33 +0000 (00:20 +0000)] 
Daily bump.

2 years agotarget/105753: Fix ICE in add_clobbers due to extra PARALLEL in insn.
Triffid Hunter [Sat, 20 May 2023 05:50:00 +0000 (07:50 +0200)] 
target/105753: Fix ICE in add_clobbers due to extra PARALLEL in insn.

This patch removes the superfluous parallel in [u]divmod patterns in
the AVR backend.  Effect of extra parallel is that add_clobbers reaches
gcc_unreachable() because the clobbers for [u]divmod are missing.
If an insn has multiple parts like clobbers, the parallel around the
parts of the insn pattern is implicit.

gcc/
PR target/105753
Backport from 2023-05-20 https://gcc.gnu.org/r14-1016
* config/avr/avr.md (divmodpsi, udivmodpsi, divmodsi, udivmodsi):
Remove superfluous "parallel" in insn pattern.
([u]divmod<mode>4): Tidy code.  Use gcc_unreachable() instead of
printing error text to assembly.

gcc/testsuite/
PR target/105753
Backport from 2023-05-20 https://gcc.gnu.org/r14-1016
* gcc.target/avr/torture/pr105753.c: New test.

2 years agoDaily bump.
GCC Administrator [Sat, 20 May 2023 00:20:40 +0000 (00:20 +0000)] 
Daily bump.

2 years agoriscv/linux: Don't add -latomic with -pthread
Andreas Schwab [Sat, 23 Apr 2022 13:48:42 +0000 (15:48 +0200)] 
riscv/linux: Don't add -latomic with -pthread

Now that we have support for inline subword atomic operations, it is no
longer necessary to link against libatomic.  This also fixes testsuite
failures because the framework does not properly set up the linker flags
for finding libatomic.
The use of atomic operations is also independent of the use of libpthread.

gcc/
* config/riscv/linux.h (LIB_SPEC): Don't redefine.

2 years agoc++: desig init in presence of list ctor [PR109871]
Patrick Palka [Tue, 16 May 2023 16:39:16 +0000 (12:39 -0400)] 
c++: desig init in presence of list ctor [PR109871]

add_list_candidates has logic to reject designated initialization of a
non-aggregate type, but this is inadvertently being suppressed if the type
has a list constructor due to the order of case analysis, which in the
below testcase leads to us incorrectly treating the initializer list as if
it's non-designated.  This patch fixes this by making us check for invalid
designated initialization sooner.

PR c++/109871

gcc/cp/ChangeLog:

* call.cc (add_list_candidates): Check for invalid designated
initialization sooner and even for types that have a list
constructor.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/desig27.C: New test.

(cherry picked from commit d5e5007c4b534391c0a97be56f6024fde1a88682)

2 years agoc++: add feature-test macro for auto(x)
Patrick Palka [Mon, 15 May 2023 16:01:07 +0000 (12:01 -0400)] 
c++: add feature-test macro for auto(x)

This adds the feature-test macro for PR0849R8, as per
https://github.com/cplusplus/CWG/issues/281.

gcc/c-family/ChangeLog:

* c-cppbuiltin.cc (c_cpp_builtins): Predefine __cpp_auto_cast
for C++23.

gcc/testsuite/ChangeLog:

* g++.dg/cpp23/feat-cxx2b.C: Test __cpp_auto_cast.

(cherry picked from commit 32b81d897629b6c3bd9e2780831a1c45b38b5ac3)

2 years agoDaily bump.
GCC Administrator [Fri, 19 May 2023 00:22:23 +0000 (00:22 +0000)] 
Daily bump.

2 years agoFortran: CLASS pointer function result in variable definition context [PR109846]
Harald Anlauf [Sun, 14 May 2023 19:53:51 +0000 (21:53 +0200)] 
Fortran: CLASS pointer function result in variable definition context [PR109846]

gcc/fortran/ChangeLog:

PR fortran/109846
* expr.cc (gfc_check_vardef_context): Check appropriate pointer
attribute for CLASS vs. non-CLASS function result in variable
definition context.

gcc/testsuite/ChangeLog:

PR fortran/109846
* gfortran.dg/ptr-func-5.f90: New test.

(cherry picked from commit fa0569e90efe8a5cb895a3f50dd502f849940828)

2 years agoFortran: overloading of intrinsic binary operators [PR109641]
Harald Anlauf [Fri, 5 May 2023 19:22:12 +0000 (21:22 +0200)] 
Fortran: overloading of intrinsic binary operators [PR109641]

Fortran allows overloading of intrinsic operators also for operands of
numeric intrinsic types.  The intrinsic operator versions are used
according to the rules of F2018 table 10.2 and imply type conversion as
long as the operand ranks are conformable.  Otherwise no type conversion
shall be performed to allow the resolution of a matching user-defined
operator.

gcc/fortran/ChangeLog:

PR fortran/109641
* arith.cc (eval_intrinsic): Check conformability of ranks of operands
for intrinsic binary operators before performing type conversions.
* gfortran.h (gfc_op_rank_conformable): Add prototype.
* resolve.cc (resolve_operator): Check conformability of ranks of
operands for intrinsic binary operators before performing type
conversions.
(gfc_op_rank_conformable): New helper function to compare ranks of
operands of binary operator.

gcc/testsuite/ChangeLog:

PR fortran/109641
* gfortran.dg/overload_5.f90: New test.

(cherry picked from commit 185da7c2014ba41f38dd62cc719873ebf020b076)

2 years agoarm testsuite: Shifts and get_FPSCR ACLE optimisation fixes
Stam Markianos-Wright [Thu, 27 Apr 2023 14:55:24 +0000 (15:55 +0100)] 
arm testsuite: Shifts and get_FPSCR ACLE optimisation fixes

These newly updated tests were rewritten by Andrea. Some of them
needed further manual fixing as follows:

* The #shift immediate value not in the check-function-bodies as expected
* The ACLE was specifying sub-optimal code: lsr+and instead of ubfx. In
  this case the test rewritten from the ACLE had the lsr+and pattern,
  but the compiler was able to optimise to ubfx. Hence I've changed the
  test to now match on ubfx.
* Added a separate test to check shift on constants being optimised to
  movs.

gcc/testsuite/ChangeLog:

* gcc.target/arm/mve/intrinsics/srshr.c: Update shift value.
* gcc.target/arm/mve/intrinsics/srshrl.c: Update shift value.
* gcc.target/arm/mve/intrinsics/uqshl.c: Update shift value.
* gcc.target/arm/mve/intrinsics/uqshll.c: Update shift value.
* gcc.target/arm/mve/intrinsics/urshr.c: Update shift value.
* gcc.target/arm/mve/intrinsics/urshrl.c: Update shift value.
* gcc.target/arm/mve/intrinsics/vadciq_m_s32.c: Update to ubfx.
* gcc.target/arm/mve/intrinsics/vadciq_m_u32.c: Update to ubfx.
* gcc.target/arm/mve/intrinsics/vadciq_s32.c: Update to ubfx.
* gcc.target/arm/mve/intrinsics/vadciq_u32.c: Update to ubfx.
* gcc.target/arm/mve/intrinsics/vadcq_m_s32.c: Update to ubfx.
* gcc.target/arm/mve/intrinsics/vadcq_m_u32.c: Update to ubfx.
* gcc.target/arm/mve/intrinsics/vadcq_s32.c: Update to ubfx.
* gcc.target/arm/mve/intrinsics/vadcq_u32.c: Update to ubfx.
* gcc.target/arm/mve/intrinsics/vsbciq_m_s32.c: Update to ubfx.
* gcc.target/arm/mve/intrinsics/vsbciq_m_u32.c: Update to ubfx.
* gcc.target/arm/mve/intrinsics/vsbciq_s32.c: Update to ubfx.
* gcc.target/arm/mve/intrinsics/vsbciq_u32.c: Update to ubfx.
* gcc.target/arm/mve/intrinsics/vsbcq_m_s32.c: Update to ubfx.
* gcc.target/arm/mve/intrinsics/vsbcq_m_u32.c: Update to ubfx.
* gcc.target/arm/mve/intrinsics/vsbcq_s32.c: Update to ubfx.
* gcc.target/arm/mve/intrinsics/vsbcq_u32.c: Update to ubfx.
* gcc.target/arm/mve/mve_const_shifts.c: New test.

2 years agoarm testsuite: XFAIL or relax registers in some tests [PR109697]
Stam Markianos-Wright [Thu, 27 Apr 2023 14:54:16 +0000 (15:54 +0100)] 
arm testsuite: XFAIL or relax registers in some tests [PR109697]

This is a simple testsuite tidy-up patch, addressing to types of errors:

* The vcmp vector-scalar tests failing due to the compiler's preference
of vector-vector comparisons, over vector-scalar comparisons. This is
due to the lack of cost model for MVE and the compiler not knowing that
the RTL vec_duplicate is free in those instructions. For now, we simply
XFAIL these checks.
* The tests for pr108177 had strict usage of q0 and r0 registers,
meaning that they would FAIL with -mfloat-abi=softf. The register checks
have now been relaxed. A couple of these run-tests also had incosistent
use of integer MVE with floating point vectors, so I've now changed
these to use FP MVE.

gcc/testsuite/ChangeLog:
PR target/109697
* gcc.target/arm/mve/intrinsics/vcmpcsq_n_u16.c: XFAIL check.
* gcc.target/arm/mve/intrinsics/vcmpcsq_n_u32.c: XFAIL check.
* gcc.target/arm/mve/intrinsics/vcmpcsq_n_u8.c: XFAIL check.
* gcc.target/arm/mve/intrinsics/vcmpeqq_n_f16.c: XFAIL check.
* gcc.target/arm/mve/intrinsics/vcmpeqq_n_f32.c: XFAIL check.
* gcc.target/arm/mve/intrinsics/vcmpeqq_n_u16.c: XFAIL check.
* gcc.target/arm/mve/intrinsics/vcmpeqq_n_u32.c: XFAIL check.
* gcc.target/arm/mve/intrinsics/vcmpeqq_n_u8.c: XFAIL check.
* gcc.target/arm/mve/intrinsics/vcmpgeq_n_f16.c: XFAIL check.
* gcc.target/arm/mve/intrinsics/vcmpgeq_n_f32.c: XFAIL check.
* gcc.target/arm/mve/intrinsics/vcmpgtq_n_f16.c: XFAIL check.
* gcc.target/arm/mve/intrinsics/vcmpgtq_n_f32.c: XFAIL check.
* gcc.target/arm/mve/intrinsics/vcmphiq_n_u16.c: XFAIL check.
* gcc.target/arm/mve/intrinsics/vcmphiq_n_u32.c: XFAIL check.
* gcc.target/arm/mve/intrinsics/vcmphiq_n_u8.c: XFAIL check.
* gcc.target/arm/mve/intrinsics/vcmpleq_n_f16.c: XFAIL check.
* gcc.target/arm/mve/intrinsics/vcmpleq_n_f32.c: XFAIL check.
* gcc.target/arm/mve/intrinsics/vcmpltq_n_f16.c: XFAIL check.
* gcc.target/arm/mve/intrinsics/vcmpltq_n_f32.c: XFAIL check.
* gcc.target/arm/mve/intrinsics/vcmpneq_n_f16.c: XFAIL check.
* gcc.target/arm/mve/intrinsics/vcmpneq_n_f32.c: XFAIL check.
* gcc.target/arm/mve/intrinsics/vcmpneq_n_u16.c: XFAIL check.
* gcc.target/arm/mve/intrinsics/vcmpneq_n_u32.c: XFAIL check.
* gcc.target/arm/mve/intrinsics/vcmpneq_n_u8.c: XFAIL check.
* gcc.target/arm/mve/pr108177-1.c: Relax registers.
* gcc.target/arm/mve/pr108177-10.c: Relax registers.
* gcc.target/arm/mve/pr108177-11.c: Relax registers.
* gcc.target/arm/mve/pr108177-12.c: Relax registers.
* gcc.target/arm/mve/pr108177-13.c: Relax registers.
* gcc.target/arm/mve/pr108177-13-run.c: use mve_fp
* gcc.target/arm/mve/pr108177-14.c: Relax registers.
* gcc.target/arm/mve/pr108177-14-run.c: use mve_fp
* gcc.target/arm/mve/pr108177-2.c: Relax registers.
* gcc.target/arm/mve/pr108177-3.c: Relax registers.
* gcc.target/arm/mve/pr108177-4.c: Relax registers.
* gcc.target/arm/mve/pr108177-5.c: Relax registers.
* gcc.target/arm/mve/pr108177-6.c: Relax registers.
* gcc.target/arm/mve/pr108177-7.c: Relax registers.
* gcc.target/arm/mve/pr108177-8.c: Relax registers.
* gcc.target/arm/mve/pr108177-9.c: Relax registers.

2 years agoarm testsuite: Remove reduntant tests
Stam Markianos-Wright [Thu, 27 Apr 2023 14:53:45 +0000 (15:53 +0100)] 
arm testsuite: Remove reduntant tests

Following Andrea's overhaul of the MVE testsuite, these tests are now
reduntant, as equivalent checks have been added to the each intrinsic's
<intrinsic name>.c test.

gcc/testsuite/ChangeLog:

* gcc.target/arm/mve/intrinsics/mve_fp_vaddq_n.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vaddq_m.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vaddq_n.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vddupq_m_n_u16.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vddupq_m_n_u32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vddupq_m_n_u8.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vddupq_n_u16.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vddupq_n_u32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vddupq_n_u8.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vddupq_x_n_u16.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vddupq_x_n_u32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vddupq_x_n_u8.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vdwdupq_x_n_u16.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vdwdupq_x_n_u32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vdwdupq_x_n_u8.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vidupq_m_n_u16.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vidupq_m_n_u32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vidupq_m_n_u8.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vidupq_n_u16.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vidupq_n_u32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vidupq_n_u8.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vidupq_x_n_u16.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vidupq_x_n_u32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vidupq_x_n_u8.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_viwdupq_x_n_u16.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_viwdupq_x_n_u32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_viwdupq_x_n_u8.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrdq_gather_offset_s64.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrdq_gather_offset_u64.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrdq_gather_offset_z_s64.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrdq_gather_offset_z_u64.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrdq_gather_shifted_offset_s64.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrdq_gather_shifted_offset_u64.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrdq_gather_shifted_offset_z_s64.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrdq_gather_shifted_offset_z_u64.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_offset_f16.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_offset_s16.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_offset_s32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_offset_u16.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_offset_u32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_offset_z_f16.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_offset_z_s16.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_offset_z_s32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_offset_z_u16.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_offset_z_u32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_shifted_offset_f16.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_shifted_offset_s16.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_shifted_offset_s32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_shifted_offset_u16.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_shifted_offset_u32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_shifted_offset_z_f16.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_shifted_offset_z_s16.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_shifted_offset_z_s32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_shifted_offset_z_u16.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_shifted_offset_z_u32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrwq_gather_offset_f32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrwq_gather_offset_s32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrwq_gather_offset_u32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrwq_gather_offset_z_f32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrwq_gather_offset_z_s32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrwq_gather_offset_z_u32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrwq_gather_shifted_offset_f32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrwq_gather_shifted_offset_s32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrwq_gather_shifted_offset_u32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrwq_gather_shifted_offset_z_f32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrwq_gather_shifted_offset_z_s32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vldrwq_gather_shifted_offset_z_u32.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vstore_scatter_shifted_offset.c: Removed.
* gcc.target/arm/mve/intrinsics/mve_vstore_scatter_shifted_offset_p.c: Removed.
* gcc.target/arm/mve/intrinsics/vaddq_m_n_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vaddq_m_n_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vaddq_x_n_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vaddq_x_n_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vcmpeqq_m_n_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vcmpeqq_m_n_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vcmpeqq_n_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vcmpeqq_n_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vcmpgeq_m_n_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vcmpgeq_m_n_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vcmpgeq_n_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vcmpgeq_n_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vcmpgtq_m_n_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vcmpgtq_m_n_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vcmpgtq_n_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vcmpgtq_n_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vcmpleq_m_n_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vcmpleq_m_n_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vcmpleq_n_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vcmpleq_n_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vcmpltq_m_n_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vcmpltq_m_n_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vcmpltq_n_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vcmpltq_n_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vcmpneq_m_n_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vcmpneq_m_n_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vcmpneq_n_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vcmpneq_n_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vfmaq_m_n_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vfmaq_m_n_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vfmaq_n_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vfmaq_n_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vfmasq_m_n_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vfmasq_m_n_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vfmasq_n_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vfmasq_n_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vmaxnmavq_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vmaxnmavq_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vmaxnmavq_p_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vmaxnmavq_p_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vmaxnmvq_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vmaxnmvq_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vmaxnmvq_p_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vmaxnmvq_p_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vminnmavq_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vminnmavq_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vminnmavq_p_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vminnmavq_p_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vminnmvq_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vminnmvq_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vminnmvq_p_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vminnmvq_p_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vmulq_m_n_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vmulq_m_n_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vmulq_n_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vmulq_n_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vmulq_x_n_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vmulq_x_n_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vsetq_lane_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vsetq_lane_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vsubq_m_n_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vsubq_m_n_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vsubq_n_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vsubq_n_f32-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vsubq_x_n_f16-1.c: Removed.
* gcc.target/arm/mve/intrinsics/vsubq_x_n_f32-1.c: Removed.