]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
17 months agoanalyzer: use correct format code for string literal indices [PR110483,PR111802]
David Malcolm [Tue, 27 Feb 2024 19:49:42 +0000 (14:49 -0500)] 
analyzer: use correct format code for string literal indices [PR110483,PR111802]

On e.g. gcc211 the use of "%li" with unsigned HOST_WIDE_INT led to this warning:
../../src/gcc/analyzer/access-diagram.cc: In member function ‘void ana::string_literal_spatial_item::add_column_for_byte(text_art::table&, const ana::bit_to_table_map&, text_art::style_manager&, ana::byte_offset_t, ana::byte_offset_t, int, int) const’:
../../src/gcc/analyzer/access-diagram.cc:1909:40: warning: format ‘%li’ expects argument of type ‘long int’, but argument 3 has type ‘long long unsigned int’ [-Wformat=]
          byte_idx_within_string.ulow ()));
                                        ^
and to all values being erroneously printed as "0".

Fixed thusly.

gcc/analyzer/ChangeLog:
PR analyzer/110483
PR analyzer/111802
* access-diagram.cc
(string_literal_spatial_item::add_column_for_byte): Use %wu for
printing unsigned HOST_WIDE_INT.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
17 months agoi386: psrlq is not used for PERM<a,{0},1,2,3,4> [PR113871]
Uros Bizjak [Tue, 27 Feb 2024 17:41:24 +0000 (18:41 +0100)] 
i386: psrlq is not used for PERM<a,{0},1,2,3,4> [PR113871]

Also handle V2BF mode.

PR target/113871

gcc/ChangeLog:

* config/i386/mmx.md (V248FI): Add V2BF mode.
(V24FI_32): Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr113871-5a.c: New test.
* gcc.target/i386/pr113871-5b.c: New test.

17 months agoFix internal error on non-byte-aligned reference in GIMPLE DSE
Eric Botcazou [Tue, 27 Feb 2024 17:01:00 +0000 (18:01 +0100)] 
Fix internal error on non-byte-aligned reference in GIMPLE DSE

This is a regression present on the mainline, 13 and 12 branches.  For the
attached Ada case, it's a tree checking failure on the mainline at -O:

+===========================GNAT BUG DETECTED==============================+
| 14.0.1 20240226 (experimental) [master r14-9171-g4972f97a265]  GCC error:|
| tree check: expected tree that contains 'decl common' structure,         |
| have 'component_ref' in tree_could_trap_p, at tree-eh.cc:2733        |
| Error detected around /home/eric/cvs/gcc/gcc/testsuite/gnat.dg/opt104.adb:

Time is a 10-byte record and Packed_Rec.T is placed at bit-offset 65 because
of the packing. so tree-ssa-dse.cc:setup_live_bytes_from_ref has computed a
const_size of 88 from ref->offset of 65 and ref->max_size of 80.

Then in tree-ssa-dse.cc:compute_trims:

411       int last_live = bitmap_last_set_bit (live);
(gdb) next
412       if (ref->size.is_constant (&const_size))
(gdb)
414           int last_orig = (const_size / BITS_PER_UNIT) - 1;
(gdb)
418           *trim_tail = last_orig - last_live;

(gdb) call debug_bitmap (live)
n_bits = 256, set = {0 1 2 3 4 5 6 7 8 9 10 }
(gdb) p last_live
$33 = 10
(gdb) p const_size
$34 = 80
(gdb) p last_orig
$35 = 9
(gdb) p *trim_tail
$36 = -1

In other words, compute_trims is overlooking the alignment adjustments that
setup_live_bytes_from_ref applied earlier.  Moveover it reads:

  /* We use sbitmaps biased such that ref->offset is bit zero and the bitmap
     extends through ref->size.  So we know that in the original bitmap
     bits 0..ref->size were true.  We don't actually need the bitmap, just
     the REF to compute the trims.  */

but setup_live_bytes_from_ref used ref->max_size instead of ref->size.

It appears that all the callers of compute_trims assume that ref->offset is
byte aligned and that the trimmed bytes are relative to ref->size, so the
patch simply adds an early return if either condition is not fulfilled.

gcc/
* tree-ssa-dse.cc (compute_trims): Fix description.  Return early
if either ref->offset is not byte aligned or ref->size is not known
to be equal to ref->max_size.
(maybe_trim_complex_store): Fix description.
(maybe_trim_constructor_store): Likewise.
(maybe_trim_partially_dead_store): Likewise.

gcc/testsuite/
* gnat.dg/opt104.ads, gnat.dg/opt104.adb: New test.

17 months agoOpenACC: Add Fortran routines acc_{alloc,free,hostptr,deviceptr,memcpy_{to,from}_device*}
Tobias Burnus [Tue, 27 Feb 2024 16:30:38 +0000 (17:30 +0100)] 
OpenACC: Add Fortran routines acc_{alloc,free,hostptr,deviceptr,memcpy_{to,from}_device*}

These routines map simply to the C counterpart and are meanwhile
defined in OpenACC 3.3. (There are additional routine changes,
including the Fortran addition of acc_attach/acc_detach, that
require more work than a simple addition of an interface and
are therefore excluded.)

libgomp/ChangeLog:

* libgomp.texi (OpenACC Runtime Library Routines): Document new 3.3
routines that simply map to their C counterpart.
* openacc.f90 (openacc): Add them.
* openacc_lib.h: Likewise.
* testsuite/libgomp.oacc-fortran/acc_host_device_ptr.f90: New test.
* testsuite/libgomp.oacc-fortran/acc-memcpy.f90: New test.
* testsuite/libgomp.oacc-fortran/acc-memcpy-2.f90: New test.
* testsuite/libgomp.oacc-c-c++-common/lib-59.c: Crossref to f90 test.
* testsuite/libgomp.oacc-c-c++-common/lib-60.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-95.c: Likewise.

17 months agoanalyzer: fix ICE on floating-point bounds [PR111881]
David Malcolm [Tue, 27 Feb 2024 13:36:58 +0000 (08:36 -0500)] 
analyzer: fix ICE on floating-point bounds [PR111881]

gcc/analyzer/ChangeLog:
PR analyzer/111881
* constraint-manager.cc (bound::ensure_closed): Assert that
m_constant has integral type.
(range::add_bound): Bail out on floating point constants.

gcc/testsuite/ChangeLog:
PR analyzer/111881
* c-c++-common/analyzer/conditionals-pr111881.c: New test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
17 months agoarm: warn about deprecation of iwmmx in mmintrin.h
Richard Earnshaw [Mon, 26 Feb 2024 17:20:58 +0000 (17:20 +0000)] 
arm: warn about deprecation of iwmmx in mmintrin.h

GCC 13's changes file documents that iwmmx is deprecated.  Raise the bar
by warning when the mmintrin.h header is included by users, but provide
a way to suppress the warning.

gcc:
* config/arm/mmintrin.h: Warn if this header is included without
defining __ENABLE_DEPRECATED_IWMMXT.

17 months agotree-optimization/114074 - CHREC multiplication and undefined overflow
Richard Biener [Mon, 26 Feb 2024 12:33:21 +0000 (13:33 +0100)] 
tree-optimization/114074 - CHREC multiplication and undefined overflow

When folding a multiply CHRECs are handled like {a, +, b} * c
is {a*c, +, b*c} but that isn't generally correct when overflow
invokes undefined behavior.  The following uses unsigned arithmetic
unless either a is zero or a and b have the same sign.

I've used simple early outs for INTEGER_CSTs and otherwise use
a range-query since we lack a tree_expr_nonpositive_p and
get_range_pos_neg isn't a good fit.

PR tree-optimization/114074
* tree-chrec.h (chrec_convert_rhs): Default at_stmt arg to NULL.
* tree-chrec.cc (chrec_fold_multiply): Canonicalize inputs.
Handle poly vs. non-poly multiplication correctly with respect
to undefined behavior on overflow.

* gcc.dg/torture/pr114074.c: New testcase.
* gcc.dg/pr68317.c: Adjust expected location of diagnostic.
* gcc.dg/vect/vect-early-break_119-pr114068.c: Do not expect
loop to be vectorized.

17 months agoexpand: Add trivial folding for bit query builtins at expansion time [PR114044]
Jakub Jelinek [Tue, 27 Feb 2024 08:52:07 +0000 (09:52 +0100)] 
expand: Add trivial folding for bit query builtins at expansion time [PR114044]

While it seems a lot of places in various optimization passes fold
bit query internal functions with INTEGER_CST arguments to INTEGER_CST
when there is a lhs, when lhs is missing, all the removals of such dead
stmts are guarded with -ftree-dce, so with -fno-tree-dce those unfolded
ifn calls remain in the IL until expansion.  If they have large/huge
BITINT_TYPE arguments, there is no BLKmode optab and so expansion ICEs,
and bitint lowering doesn't touch such calls because it doesn't know they
need touching, functions only containing those will not even be further
processed by the pass because there are no non-small BITINT_TYPE SSA_NAMEs
+ the 2 exceptions (stores of BITINT_TYPE INTEGER_CSTs and conversions
from BITINT_TYPE INTEGER_CSTs to floating point SSA_NAMEs) and when walking
there is no special case for calls with BITINT_TYPE INTEGER_CSTs either,
those are for normal calls normally handled at expansion time.

So, the following patch adjust the expansion of these 6 ifns, by doing
nothing if there is no lhs, and also just in case and user disabled all
possible passes that would fold this handles the case of setting lhs
to ifn call with INTEGER_CST argument.

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

PR rtl-optimization/114044
* internal-fn.def (CLRSB, CLZ, CTZ, FFS, PARITY): Use
DEF_INTERNAL_INT_EXT_FN macro rather than DEF_INTERNAL_INT_FN.
* internal-fn.h (expand_CLRSB, expand_CLZ, expand_CTZ, expand_FFS,
expand_PARITY): Declare.
* internal-fn.cc (expand_bitquery, expand_CLRSB, expand_CLZ,
expand_CTZ, expand_FFS, expand_PARITY): New functions.
(expand_POPCOUNT): Use expand_bitquery.

* gcc.dg/bitint-95.c: New test.

17 months agotree-optimization/114081 - dominator update for prologue peeling
Richard Biener [Mon, 26 Feb 2024 14:17:43 +0000 (15:17 +0100)] 
tree-optimization/114081 - dominator update for prologue peeling

The following implements manual update for multi-exit loop prologue
peeling during vectorization.

PR tree-optimization/114081
* tree-vect-loop-manip.cc (slpeel_tree_duplicate_loop_to_edge_cfg):
Perform manual dominator update for prologue peeling.
(vect_do_peeling): Properly update dominators after adding the
prologue-around guard.

* gcc.dg/vect/vect-early-break_121-pr114081.c: New testcase.

17 months agotestsuite: Fix gcc.dg/attr-weakref-1.c on Solaris/x86 with as [PR70582]
Rainer Orth [Tue, 27 Feb 2024 07:20:25 +0000 (08:20 +0100)] 
testsuite: Fix gcc.dg/attr-weakref-1.c on Solaris/x86 with as [PR70582]

gcc.dg/attr-weakref-1.c FAILs on 32 and 64-bit Solaris/x86 with the
native assembler:

FAIL: gcc.dg/attr-weakref-1.c (test for excess errors)
UNRESOLVED: gcc.dg/attr-weakref-1.c compilation failed to produce executable

Excess errors:
Assembler: attr-weakref-1.c
        "/var/tmp//ccUSaysF.s", line 171 : Multiply defined symbol: "Wv3a"

This is a bug in the native as, which isn't seeing fixes recently.

Since only a single subtest is affected, this patch omits that one.

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

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

gcc/testsuite:
PR ipa/70582
* gcc.dg/attr-weakref-1.c (dg-additional-options): Define
SOLARIS_X86_AS as appropriate.
(lv3, Wv3a, pv3a): Wrap in !SOLARIS_X86_AS.
(main): Likewise for chk (pv3a).

17 months agoDaily bump.
GCC Administrator [Tue, 27 Feb 2024 00:17:46 +0000 (00:17 +0000)] 
Daily bump.

17 months agoAVR: Tag optimization options as "Optimization".
Georg-Johann Lay [Mon, 26 Feb 2024 20:20:41 +0000 (21:20 +0100)] 
AVR: Tag optimization options as "Optimization".

Some options that are pure optimizations where not tagged as such.

gcc/
* config/avr/avr.opt (mcall-prologues, mrelax, maccumulate-args)
(mstrict-X): Tag as "Optimization".

17 months agoAVR: Dead code removal.
Georg-Johann Lay [Mon, 26 Feb 2024 18:47:33 +0000 (19:47 +0100)] 
AVR: Dead code removal.

gcc/
* config/avr/avr.cc (avr_out_compare) [AVR_TINY]: Remove code in
an "if avr_adiw_reg_p()" block that's dead for AVR_TINY.

17 months agoFortran: do not evaluate polymorphic functions twice in assignment [PR114012]
Harald Anlauf [Sun, 25 Feb 2024 20:18:23 +0000 (21:18 +0100)] 
Fortran: do not evaluate polymorphic functions twice in assignment [PR114012]

PR fortran/114012

gcc/fortran/ChangeLog:

* trans-expr.cc (gfc_conv_procedure_call): Evaluate non-trivial
arguments just once before assigning to an unlimited polymorphic
dummy variable.

gcc/testsuite/ChangeLog:

* gfortran.dg/pr114012.f90: New test.

17 months agovarasm: Handle private COMDAT function symbol reference in readonly data section...
Jakub Jelinek [Mon, 26 Feb 2024 16:55:07 +0000 (17:55 +0100)] 
varasm: Handle private COMDAT function symbol reference in readonly data section [PR113617]

If default_elf_select_rtx_section is called to put a reference to some
local symbol defined in a comdat section into memory, which happens more often
since the r14-4944 RA change, linking might fail.
default_elf_select_rtx_section puts such constants into .data.rel.ro.local
etc. sections and if linker chooses comdat sections from some other TU
and discards the one to which a relocation in .data.rel.ro.local remains,
linker diagnoses error.  References to private comdat symbols can only appear
from functions or data objects in the same comdat group, so the following
patch arranges using .data.rel.ro.local.pool.<comdat_name> and similar sections.

2024-02-26  Jakub Jelinek  <jakub@redhat.com>
    H.J. Lu  <hjl.tools@gmail.com>

PR rtl-optimization/113617
* varasm.cc (default_elf_select_rtx_section): For
references to private symbols in comdat sections
use .data.relro.local.pool.<comdat>, .data.relro.pool.<comdat>
or .rodata.<comdat> comdat sections.

* g++.dg/other/pr113617.C: New test.
* g++.dg/other/pr113617.h: New test.
* g++.dg/other/pr113617-aux.cc: New test.

17 months agoc: Improve some diagnostics for __builtin_stdc_bit_* [PR114042]
Jakub Jelinek [Mon, 26 Feb 2024 15:30:16 +0000 (16:30 +0100)] 
c: Improve some diagnostics for __builtin_stdc_bit_* [PR114042]

The PR complains that for the __builtin_stdc_bit_* "builtins" the
diagnostics doesn't mention the name of the builtin the user used, but
instead __builtin_{clz,ctz,popcount}g instead (which is what the FE
immediately lowers it to).

The following patch repeats the checks from check_builtin_function_arguments
which are there done on BUILT_IN_{CLZ,CTZ,POPCOUNT}G, such that they
diagnose it with the name of the "builtin" user actually used before it
is gone.

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

PR c/114042
* c-parser.cc (c_parser_postfix_expression): Diagnose
__builtin_stdc_bit_* argument with ENUMERAL_TYPE or BOOLEAN_TYPE
type or if signed here rather than on the replacement builtins
in check_builtin_function_arguments.

* gcc.dg/builtin-stdc-bit-2.c: Adjust testcase for actual builtin
names rather than names of builtin replacements.

17 months agoUpdate gcc sv.po, zh_CN.po
Joseph Myers [Mon, 26 Feb 2024 15:20:19 +0000 (15:20 +0000)] 
Update gcc sv.po, zh_CN.po

* sv.po, zh_CN.po: Update.

17 months agotree-optimization/114099 - virtual LC PHIs and early exit vect
Richard Biener [Mon, 26 Feb 2024 11:27:42 +0000 (12:27 +0100)] 
tree-optimization/114099 - virtual LC PHIs and early exit vect

In some cases exits can lack LC PHI nodes for the virtual operand.
We have to create them when the epilog loop requires them which also
allows us to remove some only halfway correct fixups.  This is the
variant triggering for alternate exits.

PR tree-optimization/114099
* tree-vect-loop-manip.cc (slpeel_tree_duplicate_loop_to_edge_cfg):
Create and fill in a needed virtual LC PHI for the alternate
exits.  Remove code dealing with that missing.

* gcc.dg/vect/vect-early-break_120-pr114099.c: New testcase.

17 months agotree-optimization/114068 - missed virtual LC PHI after vect peeling
Richard Biener [Mon, 26 Feb 2024 10:25:50 +0000 (11:25 +0100)] 
tree-optimization/114068 - missed virtual LC PHI after vect peeling

When we choose the IV exit to be one leading to no virtual use we
fail to have a virtual LC PHI even though we need it for the epilog
entry.  The following makes sure to create it so that later updating
works.

PR tree-optimization/114068
* tree-vect-loop-manip.cc (get_live_virtual_operand_on_edge):
New function.
(slpeel_tree_duplicate_loop_to_edge_cfg): Add a virtual LC PHI
on the main exit if needed.  Remove band-aid for the case
it was missing.

* gcc.dg/vect/vect-early-break_118-pr114068.c: New testcase.
* gcc.dg/vect/vect-early-break_119-pr114068.c: Likewise.

17 months agoAdd myself to write after approval and DCO.
Juergen Christ [Mon, 26 Feb 2024 11:34:38 +0000 (12:34 +0100)] 
Add myself to write after approval and DCO.

ChangeLog:

* MAINTAINERS: Add myself to write after approval and DCO.

Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
17 months agoFinalization of object allocated by anonymous access designating local type
Eric Botcazou [Mon, 26 Feb 2024 12:13:34 +0000 (13:13 +0100)] 
Finalization of object allocated by anonymous access designating local type

The finalization of objects dynamically allocated through an anonymous
access type is deferred to the enclosing library unit in the current
implementation and a warning is given on each of them.

However this cannot be done if the designated type is local, because this
would generate dangling references to the local finalization routine, so
the finalization needs to be dropped in this case and the warning adjusted.

gcc/ada/
PR ada/113893
* exp_ch7.adb (Build_Anonymous_Master): Do not build the master
for a local designated type.
* exp_util.adb (Build_Allocate_Deallocate_Proc): Force Needs_Fin
to false if no finalization master is attached to an access type
and assert that it is anonymous in this case.
* sem_res.adb (Resolve_Allocator): Mention that the object might
not be finalized at all in the warning given when the type is an
anonymous access-to-controlled type.

gcc/testsuite/
* gnat.dg/access10.adb: New test.

17 months agox86: Check interrupt instead of noreturn attribute
H.J. Lu [Sun, 25 Feb 2024 21:14:39 +0000 (13:14 -0800)] 
x86: Check interrupt instead of noreturn attribute

ix86_set_func_type checks noreturn attribute to avoid incompatible
attribute error in LTO1 on interrupt functions.  Since TREE_THIS_VOLATILE
is set also for _Noreturn without noreturn attribute, check interrupt
attribute for interrupt functions instead.

gcc/

PR target/114097
* config/i386/i386-options.cc (ix86_set_func_type): Check
interrupt instead of noreturn attribute.

gcc/testsuite/

PR target/114097
* gcc.target/i386/pr114097-1.c: New test.

17 months agoi386: Enable _BitInt support on ia32
Jakub Jelinek [Mon, 26 Feb 2024 10:12:39 +0000 (11:12 +0100)] 
i386: Enable _BitInt support on ia32

Given the https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113837#c9
comment, the following patch just attempts to implement what I think
is best for ia32.

Compared to https://gitlab.com/x86-psABIs/i386-ABI/-/issues/5 ,
like that patch for _BitInt(64) or smaller it uses the smallest containing
{,un}signed {char,short,int,long long} for passing/returning and
layout of variables including in structures for alignment/size, with any
extra bits unspecified.
Unlike the above proposal, for larger _BitInt (i.e. _BitInt(65)+), it uses
passing/returning/layout/alignment of structure containing minimum needed
number of 32-bit limbs, again with the extra bits unspecified.
This is because most operations (except copy or bitwise ops) on _BitInts
aren't really vectorizable and will be under the hood implemented in loops
over 32-bit limbs anyway (using 64-bit limbs under the hood would mean
often using library implementation for the basic operations) and because
ia32 doesn't align even long long/double in structures to 64-bit I think
it is better to just use 32-bit alignment for that.  And I don't see
a reason to waste 32-bit bits say for _BitInt(224) or _BitInt(288) on ia32.

So, effectively it is like the x86-64 _BitInt ABI with everything divided by
2, the only exception is that in x86-64 psABI _BitInt(128) is said to be
already a structure of 2 limbs, which happens to be passed mostly the same
as __int128 (except for alignment).

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

* config/i386/i386.cc (ix86_bitint_type_info): Add support for
!TARGET_64BIT.

17 months agotestsuite: xfail gcc.c-torture/compile/pr61159.c on Solaris/x86 with as [PR61159]
Rainer Orth [Mon, 26 Feb 2024 09:42:04 +0000 (10:42 +0100)] 
testsuite: xfail gcc.c-torture/compile/pr61159.c on Solaris/x86 with as [PR61159]

gcc.c-torture/compile/pr61159.c currently FAILs on 32 and 64-bit
Solaris/x86 with the native assembler:

FAIL: gcc.c-torture/compile/pr61159.c   -O0  (test for excess errors)
FAIL: gcc.c-torture/compile/pr61159.c   -O1  (test for excess errors)
FAIL: gcc.c-torture/compile/pr61159.c   -O2  (test for excess errors)
FAIL: gcc.c-torture/compile/pr61159.c   -O2 -flto  (test for excess errors)
FAIL: gcc.c-torture/compile/pr61159.c   -O2 -flto -flto-partition=none  (test for excess errors)
FAIL: gcc.c-torture/compile/pr61159.c   -O3 -g  (test for excess errors)
FAIL: gcc.c-torture/compile/pr61159.c   -Os  (test for excess errors)

Excess errors:
Assembler: pr61159.c
        "/var/tmp//ccRtFPva.s", line 5 : Cannot set a weak symbol to a common symbol

This is a bug/limitation in the native assembler.  Given that this
hasn't seen fixes for a long time, this patch xfails the test.

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

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

gcc/testsuite:
PR ipa/61159
* gcc.c-torture/compile/pr61159.c: xfail on Solaris/x86 with as.

17 months agomatch.pd: Guard 2 simplifications on integral TYPE_OVERFLOW_UNDEFINED [PR114090]
Jakub Jelinek [Mon, 26 Feb 2024 09:08:45 +0000 (10:08 +0100)] 
match.pd: Guard 2 simplifications on integral TYPE_OVERFLOW_UNDEFINED [PR114090]

These 2 patterns are incorrect on floating point, or for -fwrapv, or
for -ftrapv, or the first one for unsigned types (the second one is
mathematically correct, but we ought to just fold that to 0 instead).

So, the following patch properly guards this.

I think we don't need && !TYPE_OVERFLOW_SANITIZED (type) because
in both simplifications there would be UB before and after on
signed integer minimum.

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

PR tree-optimization/114090
* match.pd ((x >= 0 ? x : 0) + (x <= 0 ? -x : 0) -> abs x):
Restrict pattern to ANY_INTEGRAL_TYPE_P and TYPE_OVERFLOW_UNDEFINED
types.
((x <= 0 ? -x : 0) -> max(-x, 0)): Likewise.

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

17 months agofold-const: Avoid infinite recursion in +-*&|^minmax reassociation [PR114084]
Jakub Jelinek [Mon, 26 Feb 2024 09:07:39 +0000 (10:07 +0100)] 
fold-const: Avoid infinite recursion in +-*&|^minmax reassociation [PR114084]

In the following testcase we infinitely recurse during BIT_IOR_EXPR
reassociation.
One operand is (unsigned _BitInt(31)) a << 4 and another operand
2147483647 >> 1 | 80 where both the right shift and the | 80
trees have TREE_CONSTANT set, but weren't folded because of delayed
folding, where some foldings are apparently done even in that case
unfortunately.
Now, the fold_binary_loc reassocation code splits both operands into
variable part, minus variable part, constant part, minus constant part,
literal part and minus literal parts, to prevent infinite recursion
punts if there are just 2 parts altogether from the 2 operands and then goes
on with reassociation, merges first the corresponding parts from both
operands and then some further merges.
The problem with the above expressions is that we get 3 different objects,
var0 (the left shift), con1 (the right shift) and lit1 (80), so the infinite
recursion prevention doesn't trigger, and we eventually merge con1 with
lit1, which effectively reconstructs the original op1 and then associate
that with var0 which is original op0, and associate_trees for that case
calls fold_binary.  There are some casts involved there too (the T typedef
type and the underlying _BitInt type which are stripped with STRIP_NOPS).

The following patch attempts to prevent this infinite recursion by tracking
the origin (if certain var comes from nothing - 0, op0 - 1, op1 - 2 or both - 3)
and propagates it through all the associate_tree calls which merge the vars.
If near the end we'd try to merge what comes solely from op0 with what comes
solely from op1 (or vice versa), the patch punts, because then it isn't any
kind of reassociation between the two operands, if anything it should be
handled when folding the suboperands.

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

PR middle-end/114084
* fold-const.cc (fold_binary_loc): Avoid the final associate_trees
if all subtrees of var0 come from one of the op0 or op1 operands
and all subtrees of con0 come from the other one.  Don't clear
variables which are never used afterwards.

* gcc.dg/bitint-94.c: New test.

17 months agomiddle-end/114070 - folding breaking VEC_COND expansion
Richard Biener [Fri, 23 Feb 2024 15:06:05 +0000 (16:06 +0100)] 
middle-end/114070 - folding breaking VEC_COND expansion

The following properly guards the simplifications that move
operations into VEC_CONDs, in particular when that changes the
type constraints on this operation.

This needed a genmatch fix which was recording spurious implicit fors
when tcc_comparison is used in a C expression.

PR middle-end/114070
* genmatch.cc (parser::parse_c_expr): Do not record operand
lists but only mark operators used.
* match.pd ((c ? a : b) op (c ? d : e)  -->  c ? (a op d) : (b op e)):
Properly guard the case of tcc_comparison changing the VEC_COND
value operand type.

* gcc.dg/torture/pr114070.c: New testcase.

17 months agoi386: Fix up x86_function_profiler -masm=intel support [PR114094]
Jakub Jelinek [Mon, 26 Feb 2024 06:30:05 +0000 (07:30 +0100)] 
i386: Fix up x86_function_profiler -masm=intel support [PR114094]

In my r14-8214 changes I apparently forgot one \n at the end of an instruction.
The corresponding AT&T line looks like:
"1:\tcall\t*%s@GOTPCREL(%%rip)\n"
but the Intel variant was
"1:\tcall\t[QWORD PTR %s@GOTPCREL[rip]]"

Fixed thusly.

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

PR target/114094
* config/i386/i386.cc (x86_function_profiler): Add missing new-line
to printed instruction.

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

17 months agox86: Properly implement AMX-TILE load/store intrinsics
H.J. Lu [Sun, 25 Feb 2024 18:21:04 +0000 (10:21 -0800)] 
x86: Properly implement AMX-TILE load/store intrinsics

ldtilecfg and sttilecfg take a 512-byte memory block.  With
_tile_loadconfig implemented as

extern __inline void
__attribute__((__gnu_inline__, __always_inline__, __artificial__))
_tile_loadconfig (const void *__config)
{
  __asm__ volatile ("ldtilecfg\t%X0" :: "m" (*((const void **)__config)));
}

GCC sees:

(parallel [
  (asm_operands/v ("ldtilecfg %X0") ("") 0
   [(mem/f/c:DI (plus:DI (reg/f:DI 77 virtual-stack-vars)
                         (const_int -64 [0xffffffffffffffc0])) [1 MEM[(const void * *)&tile_data]+0 S8 A128])]
   [(asm_input:DI ("m"))]
   (clobber (reg:CC 17 flags))])

and the memory operand size is 1 byte.  As the result, the rest of 511
bytes is ignored by GCC.  Implement ldtilecfg and sttilecfg intrinsics
with a pointer to XImode to honor the 512-byte memory block.

gcc/ChangeLog:

PR target/114098
* config/i386/amxtileintrin.h (_tile_loadconfig): Use
__builtin_ia32_ldtilecfg.
(_tile_storeconfig): Use __builtin_ia32_sttilecfg.
* config/i386/i386-builtin.def (BDESC): Add
__builtin_ia32_ldtilecfg and __builtin_ia32_sttilecfg.
* config/i386/i386-expand.cc (ix86_expand_builtin): Handle
IX86_BUILTIN_LDTILECFG and IX86_BUILTIN_STTILECFG.
* config/i386/i386.md (ldtilecfg): New pattern.
(sttilecfg): Likewise.

gcc/testsuite/ChangeLog:

PR target/114098
* gcc.target/i386/amxtile-4.c: New test.

17 months agoDaily bump.
GCC Administrator [Mon, 26 Feb 2024 00:16:54 +0000 (00:16 +0000)] 
Daily bump.

17 months agoMerge dmd, druntime ceff48bf7d, phobos dcbfbd43a
Iain Buclaw [Sat, 24 Feb 2024 09:26:09 +0000 (10:26 +0100)] 
Merge dmd, druntime ceff48bf7d, phobos dcbfbd43a

D front-end changes:

-   Import latest fixes from dmd v2.107.1-rc.1.

D runtime changes:

-   Import latest fixes from druntime v2.107.1-rc.1.

Phobos changes:

-   Import latest fixes from phobos v2.107.1-rc.1.

gcc/d/ChangeLog:

* dmd/MERGE: Merge upstream dmd ceff48bf7d.

libphobos/ChangeLog:

* libdruntime/MERGE: Merge upstream druntime ceff48bf7d.
* libdruntime/Makefile.am (DRUNTIME_DSOURCES_FREEBSD): Add
core/sys/freebsd/net/if_.d.
* libdruntime/Makefile.in: Regenerate.
* src/MERGE: Merge upstream phobos dcbfbd43a.

17 months agolibgfortran: Propagate user defined iostat and iomsg.
Jerry DeLisle [Sun, 25 Feb 2024 22:50:07 +0000 (14:50 -0800)] 
libgfortran: Propagate user defined iostat and iomsg.

PR libfortran/105456

libgfortran/ChangeLog:

* io/list_read.c (list_formatted_read_scalar): Add checks
for the case where a user defines their own error codes
and error messages and generate the runtime error.
* io/transfer.c (st_read_done): Whitespace.

gcc/testsuite/ChangeLog:

* gfortran.dg/pr105456.f90: New test.

17 months agoPR modula2/113749 m2 enabled build times out on i686-gnu-hurd
Gaius Mulley [Sun, 25 Feb 2024 11:08:37 +0000 (11:08 +0000)] 
PR modula2/113749 m2 enabled build times out on i686-gnu-hurd

The bug fix changes the FIO module to use the target O_RDONLY,
O_WRONLY, SEEK_SET and SEEK_END (now available from the module wrapc).
Also rebuilt are the bootstrap tools mc and pge as they have their
own wrapc and C translations of FIO.

gcc/m2/ChangeLog:

PR modula2/113749
* Make-lang.in (BUILD-PGE-O): Add m2/pge-boot/Gwrapc.o.
* gm2-libs-ch/wrapc.c (wrapc_SeekSet): New function.
(wrapc_SeekEnd): Ditto.
(wrapc_ReadOnly): Ditto.
(wrapc_WriteOnly): Ditto.
* gm2-libs/FIO.mod (SEEK_SET): Remove.
(SEEK_END): Remove.
(UNIXREADONLY): Remove.
(UNIXWRITEONLY): Remove.
(ConnectToUnix): Replace UNIXWRITEONLY with a call to WriteOnly.
Replace UNIXREADONLY with a call to ReadOnly.
(SetPositionFromBeginning): Replace SEEK_SET with a call to
SeekSet.
(SetPositionFromEnd): Replace SEEK_END with a call to
SeekEnd.
* gm2-libs/wrapc.def (SeekSet): New procedure function.
(SeekEnd): New procedure function.
(ReadOnly): New procedure function.
(WriteOnly): New procedure function.
* mc-boot-ch/Glibc.c (BUILD_MC_LIBC_TRACE): Undef.
(check_init): New function.
(tracedb): Ditto.
(tracedb_open): Ditto.
(tracedb_result): Ditto.
(libc_read): Ditto.
(libc_write): Ditto.
(libc_close): Ditto.
(libc_creat): Ditto.
(libc_open): Ditto.
(libc_lseek): Ditto.
* mc-boot-ch/Gwrapc.c (wrapc_SeekSet): New function.
(wrapc_SeekEnd): Ditto.
(wrapc_ReadOnly): Ditto.
(wrapc_WriteOnly): Ditto.
* mc-boot/GDynamicStrings.cc: Rebuilt.
* mc-boot/GFIO.cc: Ditto.
* mc-boot/GIndexing.cc: Ditto.
* mc-boot/GM2Dependent.cc: Ditto.
* mc-boot/GM2EXCEPTION.cc: Ditto.
* mc-boot/GPushBackInput.cc: Ditto.
* mc-boot/GRTExceptions.cc: Ditto.
* mc-boot/GRTint.cc: Ditto.
* mc-boot/GSArgs.cc: Ditto.
* mc-boot/GStdIO.cc: Ditto.
* mc-boot/GStringConvert.cc: Ditto.
* mc-boot/GSysStorage.cc: Ditto.
* mc-boot/Gdecl.cc: Ditto.
* mc-boot/Gkeyc.cc: Ditto.
* mc-boot/Glibc.h: Ditto.
* mc-boot/GmcComment.cc: Ditto.
* mc-boot/GmcComp.cc: Ditto.
* mc-boot/GmcDebug.cc: Ditto.
* mc-boot/GmcMetaError.cc: Ditto.
* mc-boot/GmcStack.cc: Ditto.
* mc-boot/GmcStream.cc: Ditto.
* mc-boot/GnameKey.cc: Ditto.
* mc-boot/GsymbolKey.cc: Ditto.
* mc-boot/Gvarargs.cc: Ditto.
* mc-boot/Gwrapc.h: Ditto.
* mc/decl.mod (getSymName): Add pointerref clause.
* mc/mcStream.mod (copy): Check for an error after every read.
* mc/varargs.mod (copy): Rewrite pointer arithmetic using INC to
avoid type incompatibility.
* pge-boot/GDynamicStrings.cc: Rebuilt.
* pge-boot/GDynamicStrings.h: Ditto.
* pge-boot/GFIO.cc: Ditto.
* pge-boot/GFIO.h: Ditto.
* pge-boot/GIO.cc: Ditto.
* pge-boot/GIndexing.cc: Ditto.
* pge-boot/GM2Dependent.cc: Ditto.
* pge-boot/GM2EXCEPTION.cc: Ditto.
* pge-boot/GNameKey.cc: Ditto.
* pge-boot/GPushBackInput.cc: Ditto.
* pge-boot/GRTExceptions.cc: Ditto.
* pge-boot/GStdIO.cc: Ditto.
* pge-boot/GSymbolKey.cc: Ditto.
* pge-boot/GSysStorage.cc: Ditto.
* pge-boot/Glibc.h: Ditto.
* pge-boot/Gwrapc.cc: Ditto.
* pge-boot/Gwrapc.h: Ditto.

libgm2/ChangeLog:

PR modula2/113749
* libm2pim/wrapc.cc: Include fcntl.h.
(SeekSet): New function.
(SeekEnd): Ditto.
(ReadOnly): Ditto.
(WriteOnly): Ditto.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
17 months agoDaily bump.
GCC Administrator [Sun, 25 Feb 2024 00:17:06 +0000 (00:17 +0000)] 
Daily bump.

17 months agovect: Tighten check for impossible SLP layouts [PR113205]
Richard Sandiford [Sat, 24 Feb 2024 11:58:22 +0000 (11:58 +0000)] 
vect: Tighten check for impossible SLP layouts [PR113205]

During its forward pass, the SLP layout code tries to calculate
the cost of a layout change on an incoming edge.  This is taken
as the minimum of two costs: one in which the source partition
keeps its current layout (chosen earlier during the pass) and
one in which the source partition switches to the new layout.
The latter can sometimes be arranged by the backward pass.

If only one of the costs is valid, the other cost was ignored.
But the PR shows that this is not safe.  If the source partition
has layout 0 (the normal layout), we have to be prepared to handle
the case in which that ends up being the only valid layout.

Other code already accounts for this restriction, e.g. see
the code starting with:

    /* Reject the layout if it would make layout 0 impossible
       for later partitions.  This amounts to testing that the
       target supports reversing the layout change on edges
       to later partitions.

gcc/
PR tree-optimization/113205
* tree-vect-slp.cc (vect_optimize_slp_pass::forward_cost): Reject
the proposed layout if it does not allow a source partition with
layout 2 to keep that layout.

gcc/testsuite/
PR tree-optimization/113205
* gcc.dg/torture/pr113205.c: New test.

17 months agoUse HOST_WIDE_INT_{C,UC,0,0U,1,1U} macros some more
Jakub Jelinek [Sat, 24 Feb 2024 11:45:40 +0000 (12:45 +0100)] 
Use HOST_WIDE_INT_{C,UC,0,0U,1,1U} macros some more

I've searched for some uses of (HOST_WIDE_INT) constant or (unsigned
HOST_WIDE_INT) constant and turned them into uses of the appropriate
macros.
THere are quite a few cases in non-i386 backends but I've left that out
for now.
The only behavior change is in build_replicated_int_cst where the
left shift was done in HOST_WIDE_INT type but assigned to unsigned
HOST_WIDE_INT, which I've changed into unsigned HOST_WIDE_INT shift.

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

gcc/
* builtins.cc (fold_builtin_isascii): Use HOST_WIDE_INT_UC macro.
* combine.cc (make_field_assignment): Use HOST_WIDE_INT_1U macro.
* double-int.cc (double_int::mask): Use HOST_WIDE_INT_UC macros.
* genattrtab.cc (attr_alt_complement): Use HOST_WIDE_INT_1 macro.
(mk_attr_alt): Use HOST_WIDE_INT_0 macro.
* genautomata.cc (bitmap_set_bit, CLEAR_BIT): Use HOST_WIDE_INT_1
macros.
* ipa-strub.cc (can_strub_internally_p): Use HOST_WIDE_INT_1 macro.
* loop-iv.cc (implies_p): Use HOST_WIDE_INT_1U macro.
* pretty-print.cc (test_pp_format): Use HOST_WIDE_INT_C and
HOST_WIDE_INT_UC macros.
* rtlanal.cc (nonzero_bits1): Use HOST_WIDE_INT_UC macro.
* tree.cc (build_replicated_int_cst): Use HOST_WIDE_INT_1U macro.
* tree.h (DECL_OFFSET_ALIGN): Use HOST_WIDE_INT_1U macro.
* tree-ssa-structalias.cc (dump_varinfo): Use ~HOST_WIDE_INT_0U
macros.
* wide-int.cc (divmod_internal_2): Use HOST_WIDE_INT_1U macro.
* config/i386/constraints.md (define_constraint "L"): Use
HOST_WIDE_INT_C macro.
* config/i386/i386.md (movabsq split peephole2): Use HOST_WIDE_INT_C
macro.
(movl + movb peephole2): Likewise.
* config/i386/predicates.md (x86_64_zext_immediate_operand): Likewise.
(const_32bit_mask): Likewise.
gcc/objc/
* objc-encoding.cc (encode_array): Use HOST_WIDE_INT_0 macros.

17 months agobitint: Handle VIEW_CONVERT_EXPRs between large/huge BITINT_TYPEs and VECTOR/COMPLEX_...
Jakub Jelinek [Sat, 24 Feb 2024 11:44:34 +0000 (12:44 +0100)] 
bitint: Handle VIEW_CONVERT_EXPRs between large/huge BITINT_TYPEs and VECTOR/COMPLEX_TYPE etc. [PR114073]

The following patch implements support for VIEW_CONVERT_EXPRs from/to
large/huge _BitInt to/from vector or complex types or anything else but
integral/pointer types which doesn't need to live in memory.

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

PR middle-end/114073
* gimple-lower-bitint.cc (bitint_large_huge::lower_stmt): Handle
VIEW_CONVERT_EXPRs between large/huge _BitInt and non-integer/pointer
types like vector or complex types.
(gimple_lower_bitint): Don't merge VIEW_CONVERT_EXPRs to non-integral
types.  Fix up VIEW_CONVERT_EXPR handling.  Allow merging
VIEW_CONVERT_EXPR from non-integral/pointer types with a store.

* gcc.dg/bitint-93.c: New test.

17 months agoRestrict gcc.dg/rtl/aarch64/pr113295-1.c to aarch64
Richard Sandiford [Sat, 24 Feb 2024 10:10:36 +0000 (10:10 +0000)] 
Restrict gcc.dg/rtl/aarch64/pr113295-1.c to aarch64

I keep forgetting that gcc.dg/rtl is the one testsuite where
tests in target-specific subdirectories aren't automatically
restricted to that target.

gcc/testsuite/
* gcc.dg/rtl/aarch64/pr113295-1.c: Restrict to aarc64*-*-*.

17 months agoDaily bump.
GCC Administrator [Sat, 24 Feb 2024 00:17:42 +0000 (00:17 +0000)] 
Daily bump.

17 months agoFortran: ALLOCATE statement, SOURCE/MOLD expressions with subrefs [PR114024]
Steve Kargl [Fri, 23 Feb 2024 21:05:04 +0000 (22:05 +0100)] 
Fortran: ALLOCATE statement, SOURCE/MOLD expressions with subrefs [PR114024]

PR fortran/114024

gcc/fortran/ChangeLog:

* trans-stmt.cc (gfc_trans_allocate): When a source expression has
substring references, part-refs, or %re/%im inquiries, wrap the
entity in parentheses to force evaluation of the expression.

gcc/testsuite/ChangeLog:

* gfortran.dg/allocate_with_source_27.f90: New test.
* gfortran.dg/allocate_with_source_28.f90: New test.

Co-Authored-By: Harald Anlauf <anlauf@gmx.de>
17 months agoRISC-V: Fix vec_init for simple sequences [PR114028].
Robin Dapp [Thu, 22 Feb 2024 12:40:55 +0000 (13:40 +0100)] 
RISC-V: Fix vec_init for simple sequences [PR114028].

For a vec_init (_a, _a, _a, _a) with _a of mode DImode we try to
construct a "superword" of two "_a"s.  This only works for modes < Pmode
when we can "shift and or" both halves into one Pmode register.
This patch disallows the optimization for inner_mode == Pmode and emits
a simple broadcast in such a case.

gcc/ChangeLog:

PR target/114028

* config/riscv/riscv-v.cc (rvv_builder::can_duplicate_repeating_sequence_p):
Return false if inner mode is already Pmode.
(rvv_builder::is_all_same_sequence): New function.
(expand_vec_init): Emit broadcast if sequence is all same.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/pr114028.c: New test.

17 months agoc++: Fix ICE due to folding a call to constructor on cdtor_returns_this arches (aka...
Jakub Jelinek [Fri, 23 Feb 2024 17:55:12 +0000 (18:55 +0100)] 
c++: Fix ICE due to folding a call to constructor on cdtor_returns_this arches (aka arm32) [PR113083]

When targetm.cxx.cdtor_returns_this () (aka on arm32 TARGET_AAPCS_BASED)
constructor is supposed to return this pointer, but when we cp_fold such
a call, we don't take that into account and just INIT_EXPR the object,
so we can later ICE during gimplification, because the expression doesn't
have the right type.

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

PR c++/113083
* cp-gimplify.cc (cp_fold): For targetm.cxx.cdtor_returns_this ()
wrap r into a COMPOUND_EXPR and return folded CALL_EXPR_ARG (x, 0).

* g++.dg/cpp0x/constexpr-113083.C: New test.

17 months agoaarch64: Spread out FPR usage between RA regions [PR113613]
Richard Sandiford [Fri, 23 Feb 2024 14:12:55 +0000 (14:12 +0000)] 
aarch64: Spread out FPR usage between RA regions [PR113613]

early-ra already had code to do regrename-style "broadening"
of the allocation, to promote scheduling freedom.  However,
the pass divides the function into allocation regions
and this broadening only worked within a single region.
This meant that if a basic block contained one subblock
of FPR use, followed by a point at which no FPRs were live,
followed by another subblock of FPR use, the two subblocks
would tend to reuse the same registers.  This in turn meant
that it wasn't possible to form LDP/STP pairs between them.

The failure to form LDPs and STPs in the testcase was a
regression from GCC 13.

The patch adds a simple heuristic to prefer less recently
used registers in the event of a tie.

gcc/
PR target/113613
* config/aarch64/aarch64-early-ra.cc
(early_ra::m_current_region): New member variable.
(early_ra::m_fpr_recency): Likewise.
(early_ra::start_new_region): Bump m_current_region.
(early_ra::allocate_colors): Prefer less recently used registers
in the event of a tie.  Add a comment to explain why we prefer(ed)
higher-numbered registers.
(early_ra::find_oldest_color): Prefer less recently used registers
here too.
(early_ra::finalize_allocation): Update recency information for
allocated registers.
(early_ra::process_blocks): Initialize m_current_region and
m_fpr_recency.

gcc/testsuite/
PR target/113613
* gcc.target/aarch64/pr113613.c: New test.

17 months agoaarch64: Tighten early-ra chain test for wide registers [PR113295]
Richard Sandiford [Fri, 23 Feb 2024 14:12:55 +0000 (14:12 +0000)] 
aarch64: Tighten early-ra chain test for wide registers [PR113295]

Most code in early-ra used is_chain_candidate to check whether we
should chain two allocnos.  This included both tests that matter
for correctness and tests for certain heuristics.

Once that test passes for one pair of allocnos, we test whether
it's safe to chain the containing groups (which might contain
multiple allocnos for x2, x3 and x4 modes).  This test used an
inline test for correctness only, deliberately skipping the
heuristics.  However, this instance of the test was missing
some handling of equivalent allocnos.

This patch fixes things by making is_chain_candidate take a
strictness parameter: correctness only, or correctness + heuristics.
It then makes the group-chaining test use the correctness version
rather than trying to replicate it inline.

gcc/
PR target/113295
* config/aarch64/aarch64-early-ra.cc
(early_ra::test_strictness): New enum.
(early_ra::is_chain_candidate): Add a strictness parameter to
control whether only correctness matters, or whether both correctness
and heuristics should be used.  Handle multiple levels of equivalence.
(early_ra::find_related_start): Update call accordingly.
(early_ra::strided_polarity_pref): Likewise.
(early_ra::form_chains): Likewise.
(early_ra::try_to_chain_allocnos): Use is_chain_candidate in
correctness mode rather than trying to inline the test.

gcc/testsuite/
PR target/113295
* gcc.target/aarch64/pr113295-2.c: New test.

17 months agoaarch64: Add missing early-ra bookkeeping [PR113295]
Richard Sandiford [Fri, 23 Feb 2024 14:12:54 +0000 (14:12 +0000)] 
aarch64: Add missing early-ra bookkeeping [PR113295]

416.gamess showed up two wrong-code bugs in early-ra.  This patch
fixes the first of them.  It was difficult to reduce the source code
to something that would meaningfully show the situation, so the
testcase uses a direct RTL sequence instead.

In the sequence:

(a) register <2> is set more than once
(b) register <2> is copied to a temporary (<4>)
(c) register <2> is the destination of an FCSEL between <4> and
    another value (<5>)
(d) <4> and <2> are equivalent for <4>'s live range
(e) <5>'s and <2>'s live ranges do not intersect, and there is
    a pseudo-copy between <5> and <2>

On its own, (d) implies that <4> can be treated as equivalent to <2>.
And on its own, (e) implies that <5> can share <2>'s register.  But
<4>'s and <5>'s live ranges conflict, meaning that they cannot both
share the register together.  A bit of missing bookkeeping meant that
the mechanism for detecting this didn't fire.  We therefore ended up
with an FCSEL in which both inputs were the same register.

gcc/
PR target/113295
* config/aarch64/aarch64-early-ra.cc
(early_ra::find_related_start): Account for definitions by shared
registers when testing for a single register definition.
(early_ra::accumulate_defs): New function.
(early_ra::record_copy): If A shares B's register, fold A's
definition information into B's.  Fold A's use information into B's.

gcc/testsuite/
PR target/113295
* gcc.dg/rtl/aarch64/pr113295-1.c: New test.

17 months agox86-64: Check R_X86_64_CODE_6_GOTTPOFF support
H.J. Lu [Sun, 4 Feb 2024 15:46:35 +0000 (07:46 -0800)] 
x86-64: Check R_X86_64_CODE_6_GOTTPOFF support

If assembler and linker supports

add %reg1, name@gottpoff(%rip), %reg2

with R_X86_64_CODE_6_GOTTPOFF, we can generate it instead of

mov name@gottpoff(%rip), %reg2
add %reg1, %reg2

gcc/

* configure.ac (HAVE_AS_R_X86_64_CODE_6_GOTTPOFF): Defined as 1
if R_X86_64_CODE_6_GOTTPOFF is supported.
* config.in: Regenerated.
* configure: Likewise.
* config/i386/predicates.md (apx_ndd_add_memory_operand): Allow
UNSPEC_GOTNTPOFF if R_X86_64_CODE_6_GOTTPOFF is supported.

gcc/testsuite/

* gcc.target/i386/apx-ndd-tls-1b.c: New test.
* lib/target-supports.exp
(check_effective_target_code_6_gottpoff_reloc): New.

17 months agoFortran/Openmp: Use OPT_Wopenmp for gfc_match_omp_depobj warning
Tobias Burnus [Fri, 23 Feb 2024 12:12:48 +0000 (13:12 +0100)] 
Fortran/Openmp: Use OPT_Wopenmp for gfc_match_omp_depobj warning

gcc/fortran/ChangeLog:

* openmp.cc (gfc_match_omp_depobj): Use OPT_Wopenmp
as warning category in gfc_warning.

17 months agoarm: fix ICE with vectorized reciprocal division [PR108120]
Richard Earnshaw [Thu, 22 Feb 2024 16:47:20 +0000 (16:47 +0000)] 
arm: fix ICE with vectorized reciprocal division [PR108120]

The expand pattern for reciprocal division was enabled for all math
optimization modes, but the patterns it was generating were not
enabled unless -funsafe-math-optimizations were enabled, this leads to
an ICE when the pattern we generate cannot be recognized.

Fixed by only enabling vector division when doing unsafe math.

gcc:

PR target/108120
* config/arm/neon.md (div<VCVTF:mode>3): Rename from div<mode>3.
Gate with ARM_HAVE_NEON_<MODE>_ARITH.

gcc/testsuite:
PR target/108120
* gcc.target/arm/neon-recip-div-1.c: New file.

17 months agoexpr: Fix REDUCE_BIT_FIELD in multiplication expansion [PR114054]
Jakub Jelinek [Fri, 23 Feb 2024 10:38:18 +0000 (11:38 +0100)] 
expr: Fix REDUCE_BIT_FIELD in multiplication expansion [PR114054]

The following testcase ICEs, because the REDUCE_BIT_FIELD macro uses
the target variable implicitly:
 #define REDUCE_BIT_FIELD(expr)  (reduce_bit_field                         \
                                  ? reduce_to_bit_field_precision ((expr), \
                                                                   target, \
                                                                   type)   \
                                  : (expr))
and so when the code below reuses the target variable, documented to be
   The value may be stored in TARGET if TARGET is nonzero.
   TARGET is just a suggestion; callers must assume that
   the rtx returned may not be the same as TARGET.
for something unrelated (the value that should be returned), this misbehaves
(in the testcase target is set to a CONST_INT, which has VOIDmode and
reduce_to_bit_field_precision assert checking doesn't like that).
Needed to say that
   If TARGET is CONST0_RTX, it means that the value will be ignored.
but in expand_expr_real_2 does at the start:
  ignore = (target == const0_rtx
            || ((CONVERT_EXPR_CODE_P (code)
                 || code == COND_EXPR || code == VIEW_CONVERT_EXPR)
                && TREE_CODE (type) == VOID_TYPE));

  /* We should be called only if we need the result.  */
  gcc_assert (!ignore);
- so such target is mainly meant for calls and the like in other routines.
Certainly doesn't expect that target changes from not being ignored
initially to ignore later on and other CONST_INT results as well as anything
which is not an object into which anything can be stored.

So, the following patch fixes that by using a more appripriate temporary
for the result, which other code is using.

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

PR rtl-optimization/114054
* expr.cc (expand_expr_real_2) <case MULT_EXPR>: Use
temp variable instead of target parameter for result.

* gcc.dg/bitint-92.c: New test.

17 months agobitintlower: Fix .{ADD,SUB}_OVERFLOW lowering [PR114040]
Jakub Jelinek [Fri, 23 Feb 2024 10:36:15 +0000 (11:36 +0100)] 
bitintlower: Fix .{ADD,SUB}_OVERFLOW lowering [PR114040]

The following testcases show 2 bugs in the .{ADD,SUB}_OVERFLOW lowering,
both related to storing of the REALPART_EXPR part of the result.
On the first testcase prec is 255, prec_limbs is 4 and for the second limb
in the loop the store of the REALPART_EXPR of .USUBC (_30) is stored through:
  if (_27 <= 3)
    goto <bb 12>; [80.00%]
  else
    goto <bb 15>; [20.00%]

  <bb 12> [local count: 1073741824]:
  if (_27 < 3)
    goto <bb 14>; [80.00%]
  else
    goto <bb 13>; [20.00%]

  <bb 13> [local count: 1073741824]:
  bitint.3[_27] = _30;
  goto <bb 15>; [100.00%]

  <bb 14> [local count: 858993464]:
  MEM[(unsigned long *)&bitint.3 + 24B] = _30;

  <bb 15> [local count: 1073741824]:
The first check is right, as prec_limbs is 4, we don't want to store
bitint.3[4] or above at all, those limbs are just computed for the overflow
checking and nothing else, so _27 > 4 leads to no store.
But the other condition is exact opposite of what should be done, if
the current index of the second limb (_27) is < 3, then it should
  bitint.3[_27] = _30;
and if it is == 3, it should
  MEM[(unsigned long *)&bitint.3 + 24B] = _30;
and (especially important for the targets which would bitinfo.extended = 1)
should actually in this case zero extend it from the 63 bits to 64, that is
the handling of the partial limb.  The if_then_if_then_else helper if
there are 2 conditions sets m_gsi to be at the start of the
edge_true_false->dest bb, i.e. when the first condition is true and second
false, and that is where we store the SSA_NAME indexed limb store, so the
condition needs to be reversed.

The following patch does that and adds the cast as well, the usual
assumption that already handle_operand has the partial limb type doesn't
have to be true here, because the source operand could have much larger
precision than the REALPART_EXPR of the lhs.

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

PR tree-optimization/114040
* gimple-lower-bitint.cc (bitint_large_huge::lower_addsub_overflow):
Use EQ_EXPR rather than LT_EXPR for g2 condition and change its
probability from likely to unlikely.  When handling the true true
store, first cast to limb_access_type and then to l's type.

* gcc.dg/torture/bitint-60.c: New test.
* gcc.dg/torture/bitint-61.c: New test.

17 months agoLoongArch: Don't falsely claim gold supported in toplevel configure
Xi Ruoyao [Wed, 21 Feb 2024 15:54:53 +0000 (23:54 +0800)] 
LoongArch: Don't falsely claim gold supported in toplevel configure

The gold linker has never been ported to LoongArch (and it seems
unlikely to be ported in the future as the new architectures are
focusing on lld and/or mold for fast linkers).

ChangeLog:

* configure.ac (ENABLE_GOLD): Remove loongarch*-*-* from target
list.
* configure: Regenerate.

17 months agoAdd ia64*-*-* to the list of obsolete targets
Richard Biener [Fri, 23 Feb 2024 07:59:12 +0000 (08:59 +0100)] 
Add ia64*-*-* to the list of obsolete targets

The following deprecates ia64*-*-* for GCC 14.  Since we plan to
force LRA for GCC 15 and the target only has slim chances of getting
updated this notifies people in advance.  Given both Linux and
glibc have axed the target further development is also made difficult.
There is no listed maintainer for ia64 either.

PR target/90785
gcc/
* config.gcc: Add ia64*-*-* to the list of obsoleted targets.

contrib/
* config-list.mk (LIST): --enable-obsolete for ia64*-*-*.

17 months agotestsuite: vect: Actually skip gcc.dg/vect/vect-bic-bitmask-12.c etc. on SPARC
Rainer Orth [Fri, 23 Feb 2024 09:14:31 +0000 (10:14 +0100)] 
testsuite: vect: Actually skip  gcc.dg/vect/vect-bic-bitmask-12.c etc. on SPARC

gcc.dg/vect/vect-bic-bitmask-12.c and gcc.dg/vect/vect-bic-bitmask-23.c
currently FAIL on 32 and 64-bit Solaris/SPARC

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

although they should be skipped since

commit 5f07095d22f58572c06997aa6d4f3bc456e1925d
Author: Tamar Christina <tamar.christina@arm.com>
Date:   Tue Mar 8 11:32:59 2022 +0000

    vect: disable bitmask tests on sparc

The problem is that dg-skip-if must come after dg-do, although this
isn't currently documented unfortunately.

Fixed by reordering the directives.

Tested on sparc-sun-solaris2.11 and i386-pc-solaris2.11.

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

gcc/testsuite:
* gcc.dg/vect/vect-bic-bitmask-12.c: Move dg-skip-if down.
* gcc.dg/vect/vect-bic-bitmask-23.c: Likewise.

17 months agotestsuite: plugin: Fix gcc.dg/plugin/crash-test-write-though-null-sarif.c on Solaris
Rainer Orth [Fri, 23 Feb 2024 09:06:41 +0000 (10:06 +0100)] 
testsuite: plugin: Fix gcc.dg/plugin/crash-test-write-though-null-sarif.c on Solaris

gcc.dg/plugin/crash-test-write-though-null-sarif.c FAILs on Solaris:

FAIL: gcc.dg/plugin/crash-test-write-though-null-sarif.c -fplugin=./crash_test_plugin.so  scan-sarif-file "text": "Segmentation fault

Comparing the sarif files between Linux and Solaris reveals

-                                                            "message": {"text": "Segmentation fault"},
+                                                            "message": {"text": "Segmentation Fault"},

This patch allows for both forms.

Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11, and
x86_64-pc-linux-gnu.

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

gcc/testsuite:
* gcc.dg/plugin/crash-test-write-though-null-sarif.c
(scan-sarif-file): Allow for "Segmentation Fault", too.

17 months agoAdd myself to write after approval
Monk Chiang [Fri, 23 Feb 2024 07:48:53 +0000 (15:48 +0800)] 
Add myself to write after approval

ChangeLog:

* MAINTAINERS: Add myself.

17 months agoRISC-V: Point our Python scripts at python3
Palmer Dabbelt [Fri, 9 Feb 2024 16:53:24 +0000 (08:53 -0800)] 
RISC-V: Point our Python scripts at python3

This builds for me, and I frequently have python-is-python3 type
packages installed so I think I've been implicitly testing it for a
while.  Looks like Kito's tested similar configurations, and the
bugzilla indicates we should be moving over.

gcc/ChangeLog:

PR other/109668
* config/riscv/arch-canonicalize: Move to python3
* config/riscv/multilib-generator: Likewise

17 months agodoc: RISC-V: Document that -mcpu doesn't override -march or -mtune
Palmer Dabbelt [Tue, 20 Feb 2024 15:45:38 +0000 (07:45 -0800)] 
doc: RISC-V: Document that -mcpu doesn't override -march or -mtune

This came up recently as Edwin was looking through the test suite.  A
few of us were talking about this during the patchwork meeting and were
surprised.  Looks like this is the desired behavior, so let's at least
document it.

gcc/ChangeLog:

* doc/invoke.texi: Document -mcpu.

Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
17 months agoLoongArch: When checking whether the assembler supports conditional branch relaxation...
Lulu Cheng [Wed, 21 Feb 2024 03:17:14 +0000 (11:17 +0800)] 
LoongArch: When checking whether the assembler supports conditional branch relaxation, add compilation parameter "--fatal-warnings" to the assembler.

In binutils 2.40 and earlier versions, only a warning will be reported
when a relocation immediate value is out of bounds. As a result,
the value of the macro HAVE_AS_COND_BRANCH_RELAXATION will also be
defined as 1 when the assembler does not support conditional branch
relaxation. Therefore, add the compilation option "--fatal-warnings"
to avoid this problem.

gcc/ChangeLog:

* configure: Regenerate.
* configure.ac: Add parameter "--fatal-warnings" to assemble
when checking whether the assemble support conditional branch
relaxation.

17 months agoDaily bump.
GCC Administrator [Fri, 23 Feb 2024 00:16:46 +0000 (00:16 +0000)] 
Daily bump.

17 months agotestsuite: fix Wmismatched-new-delete-8.C with -m32
Marek Polacek [Thu, 22 Feb 2024 23:52:32 +0000 (18:52 -0500)] 
testsuite: fix Wmismatched-new-delete-8.C with -m32

This fixes
error: 'operator new' takes type 'size_t' ('unsigned int') as first parameter [-fpermissive]

gcc/testsuite/ChangeLog:

* g++.dg/warn/Wmismatched-new-delete-8.C: Use __SIZE_TYPE__.

17 months agoc: Handle scoped attributes in __has*attribute and scoped attribute parsing changes...
Jakub Jelinek [Thu, 22 Feb 2024 18:32:02 +0000 (19:32 +0100)] 
c: Handle scoped attributes in __has*attribute and scoped attribute parsing changes in -std=c11 etc. modes [PR114007]

We aren't able to parse __has_attribute (vendor::attr) (and __has_c_attribute
and __has_cpp_attribute) in strict C < C23 modes.  While in -std=gnu* modes
or in -std=c23 there is CPP_SCOPE token, in -std=c* (except for -std=c23)
there are is just a pair of CPP_COLON tokens.
The c-lex.cc hunk adds support for that.

That leads to a question if we should return 1 or 0 from
__has_attribute (gnu::unused) or not, because while
[[gnu::unused]] is parsed fine in -std=gnu*/-std=c23 modes (sure, with
pedwarn for < C23), we do not parse it at all in -std=c* (except for
-std=c23), we only parse [[__extension__ gnu::unused]] there.  While
the __extension__ in there helps to avoid the pedwarn, I think it is
better to be consistent between GNU and strict C < C23 modes and
parse [[gnu::unused]] too; on the other side, I think parsing
[[__extension__ gnu : : unused]] is too weird and undesirable.

So, the following patch adds a flag during preprocessing at the point
where we normally create CPP_SCOPE tokens out of 2 consecutive colons
on the first CPP_COLON to mark the consecutive case (as we are tight
on the bits, I've reused the PURE_ZERO flag, which is used just by the
C++ FE and only ever set (both C and C++) on CPP_NUMBER tokens, this
new flag has the same value and is only ever used on CPP_COLON tokens)
and instead of checking loose_scope_p argument (i.e. whether it is
[[__extension__ ...]] or not), it just parses CPP_SCOPE or CPP_COLON
with CLONE_SCOPE flag followed by another CPP_COLON the same.
The latter will never appear in >= C23 or -std=gnu* modes, though
guarding its use say with flag_iso && !flag_isoc23 && doesn't really
work because the __extension__ case temporarily clears flag_iso flag.

This makes the -std=c11 etc. behavior more similar to -std=gnu11 or
-std=c23, the only difference I'm aware of are the
 #define JOIN2(A, B) A##B
 [[vendor JOIN2(:,:) attr]]
 [[__extension__ vendor JOIN2(:,:) attr]]
cases, which are accepted in the latter modes, but results in error
in -std=c11; but the error is during preprocessing that :: doesn't
form a valid preprocessing token, which is true, so just don't do that if
you try to have __STRICT_ANSI__ && __STDC_VERSION__ <= 201710L
compatibility.

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

PR c/114007
gcc/
* doc/extend.texi: (__extension__): Remove comments about scope
tokens vs. two colons.
gcc/c-family/
* c-lex.cc (c_common_has_attribute): Parse 2 CPP_COLONs with
the first one with COLON_SCOPE flag the same as CPP_SCOPE.
gcc/c/
* c-parser.cc (c_parser_std_attribute): Remove loose_scope_p argument.
Instead of checking it, parse 2 CPP_COLONs with the first one with
COLON_SCOPE flag the same as CPP_SCOPE.
(c_parser_std_attribute_list): Remove loose_scope_p argument, don't
pass it to c_parser_std_attribute.
(c_parser_std_attribute_specifier): Adjust c_parser_std_attribute_list
caller.
gcc/testsuite/
* gcc.dg/c23-attr-syntax-6.c: Adjust testcase for :: being valid
even in -std=c11 even without __extension__ and : : etc. not being
valid anymore even with __extension__.
* gcc.dg/c23-attr-syntax-7.c: Likewise.
* gcc.dg/c23-attr-syntax-8.c: New test.
libcpp/
* include/cpplib.h (COLON_SCOPE): Define to PURE_ZERO.
* lex.cc (_cpp_lex_direct): When lexing CPP_COLON with another
colon after it, if !CPP_OPTION (pfile, scope) set COLON_SCOPE
flag on the first CPP_COLON token.

17 months agowarn-access: Fix handling of unnamed types [PR109804]
Andrew Pinski [Thu, 22 Feb 2024 04:12:21 +0000 (20:12 -0800)] 
warn-access: Fix handling of unnamed types [PR109804]

This looks like an oversight of handling DEMANGLE_COMPONENT_UNNAMED_TYPE.
DEMANGLE_COMPONENT_UNNAMED_TYPE only has the u.s_number.number set while
the code expected newc.u.s_binary.left would be valid.
So this treats DEMANGLE_COMPONENT_UNNAMED_TYPE like we treat function paramaters
(DEMANGLE_COMPONENT_FUNCTION_PARAM) and template paramaters (DEMANGLE_COMPONENT_TEMPLATE_PARAM).

Note the code in the demangler does this when it sets DEMANGLE_COMPONENT_UNNAMED_TYPE:
      ret->type = DEMANGLE_COMPONENT_UNNAMED_TYPE;
      ret->u.s_number.number = num;

Committed as obvious after bootstrap/test on x86_64-linux-gnu

PR tree-optimization/109804

gcc/ChangeLog:

* gimple-ssa-warn-access.cc (new_delete_mismatch_p): Handle
DEMANGLE_COMPONENT_UNNAMED_TYPE.

gcc/testsuite/ChangeLog:

* g++.dg/warn/Wmismatched-new-delete-8.C: New test.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
17 months agoAArch64: update vget_set_lane_1.c test output
Tamar Christina [Thu, 22 Feb 2024 15:32:08 +0000 (15:32 +0000)] 
AArch64: update vget_set_lane_1.c test output

In the vget_set_lane_1.c test the following entries now generate a zip1 instead of an INS

BUILD_TEST (float32x2_t, float32x2_t, , , f32, 1, 0)
BUILD_TEST (int32x2_t,   int32x2_t,   , , s32, 1, 0)
BUILD_TEST (uint32x2_t,  uint32x2_t,  , , u32, 1, 0)

This is because the non-Q variant for indices 0 and 1 are just shuffling values.
There is no perf difference between INS SIMD to SIMD and ZIP on Arm uArches but
preferring the INS alternative has a drawback on all uArches as ZIP being a three
operand instruction can be used to tie the result to the return register whereas
INS would require an fmov.

As such just update the test file for now.

gcc/testsuite/ChangeLog:

PR target/112375
* gcc.target/aarch64/vget_set_lane_1.c: Update test output.

17 months agoPR modula2/114055 improve error message when checking the BY constant
Gaius Mulley [Thu, 22 Feb 2024 15:02:19 +0000 (15:02 +0000)] 
PR modula2/114055 improve error message when checking the BY constant

The fix marks a constant created during the default BY clause of the
FOR loop as internal.  The type checker will always return true if
checking against an internal const.

gcc/m2/ChangeLog:

PR modula2/114055
* gm2-compiler/M2Check.mod (Import): IsConstLitInternal and
IsConstLit.
(isInternal): New procedure function.
(doCheck): Test for isInternal in either operand and early
return true.
* gm2-compiler/M2Quads.mod (PushOne): Rewrite with extra
parameter internal.
(BuildPseudoBy): Add TRUE parameter to PushOne call.
(BuildIncProcedure): Add FALSE parameter to PushOne call.
(BuildDecProcedure): Add FALSE parameter to PushOne call.
* gm2-compiler/M2Range.mod (ForLoopBeginTypeCompatible):
Uncomment code and tidy up error string.
* gm2-compiler/SymbolTable.def (PutConstLitInternal):
New procedure.
(IsConstLitInternal): New procedure function.
* gm2-compiler/SymbolTable.mod (PutConstLitInternal):
New procedure.
(IsConstLitInternal): New procedure function.
(SymConstLit): New field IsInternal.
(CreateConstLit): Initialize IsInternal to FALSE.

gcc/testsuite/ChangeLog:

PR modula2/114055
* gm2/pim/fail/forloopby.mod: New test.
* gm2/pim/pass/forloopby2.mod: New test.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
17 months agotree-optimization/114048 - ICE in copy_reference_ops_from_ref
Richard Biener [Thu, 22 Feb 2024 13:22:29 +0000 (14:22 +0100)] 
tree-optimization/114048 - ICE in copy_reference_ops_from_ref

The following adds another omission to the assert verifying we're
not running into spurious off == -1.

PR tree-optimization/114048
* tree-ssa-sccvn.cc (copy_reference_ops_from_ref): MEM_REF
can also produce -1 off.

* gcc.dg/torture/pr114048.c: New testcase.

17 months agotree-optimization/114027 - conditional reduction chain
Richard Biener [Thu, 22 Feb 2024 09:50:12 +0000 (10:50 +0100)] 
tree-optimization/114027 - conditional reduction chain

When we classify a conditional reduction chain as CONST_COND_REDUCTION
we fail to verify all involved conditionals have the same constant.
That's a quite unlikely situation so the following simply disables
such classification when there's more than one reduction statement.

PR tree-optimization/114027
* tree-vect-loop.cc (vecctorizable_reduction): Use optimized
condition reduction classification only for single-element
chains.

* gcc.dg/vect/pr114027.c: New testcase.

17 months agoprofile-count: Don't dump through a temporary buffer [PR111960]
Jakub Jelinek [Thu, 22 Feb 2024 12:07:25 +0000 (13:07 +0100)] 
profile-count: Don't dump through a temporary buffer [PR111960]

The profile_count::dump (char *, struct function * = NULL) const;
method has a single caller, the
profile_count::dump (FILE *f, struct function *fun) const;
method and for that going through a temporary buffer is just slower
and opens doors for buffer overflows, which is exactly why this P1
was filed.
The buffer size is 64 bytes, the previous maximum
"%" PRId64 " (%s)"
would print up to 61 bytes in there (19 bytes for arbitrary uint64_t:61
bitfield printed as signed, "estimated locally, globally 0 adjusted"
i.e. 38 bytes longest %s and 4 other characters).
Now, after the r14-2389 changes, it can be
19 + 38 plus 11 other characters + %.4f, which is worst case
309 chars before decimal point, decimal point and 4 digits after it,
so total 382 bytes.

So, either we could bump the buffer[64] to buffer[400], or the following
patch just drops the indirection through buffer and prints it directly to
stream.  After all, having APIs which fill in some buffer without passing
down the size of the buffer is just asking for buffer overflows over time.

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

PR ipa/111960
* profile-count.h (profile_count::dump): Remove overload with
char * first argument.
* profile-count.cc (profile_count::dump): Change overload with char *
first argument which uses sprintf into the overfload with FILE *
first argument and use fprintf instead.  Remove overload which wrapped
it.

17 months agocall-cdce: Add missing BUILT_IN_*F{32,64}X handling and improve BUILT_IN_*L [PR113993]
Jakub Jelinek [Thu, 22 Feb 2024 09:19:15 +0000 (10:19 +0100)] 
call-cdce: Add missing BUILT_IN_*F{32,64}X handling and improve BUILT_IN_*L [PR113993]

The following testcase ICEs, because can_test_argument_range
returns true for BUILT_IN_{COSH,SINH,EXP{,M1,2}}{F32X,F64X}
among many other builtins, but get_no_error_domain doesn't handle
those.

float32x_type_node when supported in GCC always has DFmode, so that
case is easy (and call-cdce assumes that SFmode is IEEE float and DFmode
is IEEE double).  So *F32X is simply handled by adding those cases
next to *F64.
float64x_type_node when supported in GCC by definition has a mode
with larger precision and exponent range than DFmode, so it can be XFmode,
TFmode or KFmode.  I went through all the l/f128 suffixed builtins and
verified that the float128x_type_node no error domain range is actually
identical to the Intel extended long double no error domain range; it isn't
that surprising, both IEEE quad and Intel/Motorola extended have the same
exponent range [-16381, 16384] (well, Motorola -16382 probably because of
different behavior for denormals, but that has nothing to do with
get_no_error_domain which is about large inputs overflowing into +-Inf
or triggering NaN, denormals could in theory do something solely for sqrt
and even that is fine).  In theory some target could have different larger
type, so for *F64X the code verifies that
REAL_MODE_FORMAT (TYPE_MODE (float64x_type_node))->emax == 16384
and if so, uses the *F128 domains, otherwise falls back to the non-suffixed
ones (aka *F64), that is certainly the conservative minimum.
While at it, the patch also changes the *L suffixed cases to do pretty much
the same, the comment said that the function just assumes for *L
the *F64 ranges, but that is unnecessarily conservative.
All we currently have for long double is:
1) IEEE quad (emax 16384, *F128 ranges)
2) XFmode Intel/Motorola extended (emax 16384, same as *F128 ranges)
3) IBM extended (double double, emax 1024, the extra precision doesn't
   really help and the domains are the same as for *F64)
4) same as double (*F64 again)
So, the patch uses also for *L
REAL_MODE_FORMAT (TYPE_MODE (long_double_type_node))->emax == 16384
checks and either tail recurses into the *F128 case for that or to
non-suffixed (aka *F64) case otherwise.
BUILT_IN_*F128X not handled because no target has those and it doesn't
seem something is on the horizon and who knows what would be used for that.
Thus, all we get this wrong for are probably VAX floats or something
similar, no intent from me to look at that, that is preexisting issue.

BTW, I'm surprised we don't have BUILT_IN_EXP10F{16,32,64,128,32X,64X,128X}
builtins, seems glibc has those (sure, I think except *16 and *128x).

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

PR tree-optimization/113993
* tree-call-cdce.cc (get_no_error_domain): Handle
BUILT_IN_{COSH,SINH,EXP{,M1,2}}{F32X,F64X}.  Handle
BUILT_IN_{COSH,SINH,EXP{,M1,2}}L for
REAL_MODE_FORMAT (TYPE_MODE (long_double_type_node))->emax == 16384
the as the F128 suffixed cases, otherwise as non-suffixed ones.
Handle BUILT_IN_{EXP,POW}10L for
REAL_MODE_FORMAT (TYPE_MODE (long_double_type_node))->emax == 16384
as (-inf, 4932).

* gcc.dg/tree-ssa/pr113993.c: New test.

17 months agobitintlower: Fix .MUL_OVERFLOW overflow checking [PR114038]
Jakub Jelinek [Thu, 22 Feb 2024 09:14:00 +0000 (10:14 +0100)] 
bitintlower: Fix .MUL_OVERFLOW overflow checking [PR114038]

Currently, bitint_large_huge::lower_mul_overflow uses cnt 1 only if
startlimb == endlimb and in that case doesn't use a loop and handles
everything in a special if:
      unsigned cnt;
      bool use_loop = false;
      if (startlimb == endlimb)
        cnt = 1;
      else if (startlimb + 1 == endlimb)
        cnt = 2;
      else if ((end % limb_prec) == 0)
        {
          cnt = 2;
          use_loop = true;
        }
      else
        {
          cnt = 3;
          use_loop = startlimb + 2 < endlimb;
        }
      if (cnt == 1)
        {
          ...
        }
      else
The loop handling for the loop exit condition wants to compare if the
incremented index is equal to endlimb, but that is correct only if
end is not divisible by limb_prec and there will be a straight line
check after the loop as well for the most significant limb.  The code
used endlimb + (cnt == 1) for that, but cnt == 1 is never true here,
because cnt is either 2 or 3, so the right check is (cnt == 2).

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

PR tree-optimization/114038
* gimple-lower-bitint.cc (bitint_large_huge::lower_mul_overflow): Fix
loop exit condition if end is divisible by limb_prec.

* gcc.dg/torture/bitint-59.c: New test.

17 months agoinvoke.texi: Fix some skipping UrlSuffix problem for MIPS
YunQiang Su [Thu, 22 Feb 2024 05:05:06 +0000 (13:05 +0800)] 
invoke.texi: Fix some skipping UrlSuffix problem for MIPS

The problem is that, there are these lines in mips.opt.urls:
  ; skipping UrlSuffix for 'mabi=' due to finding no URLs
  ; skipping UrlSuffix for 'mno-flush-func' due to finding no URLs
  ; skipping UrlSuffix for 'mexplicit-relocs' due to finding no URLs

These lines is not fixed by this patch due to that we don't
document these options:
  ; skipping UrlSuffix for 'mlra' due to finding no URLs
  ; skipping UrlSuffix for 'mdebug' due to finding no URLs
  ; skipping UrlSuffix for 'meb' due to finding no URLs
  ; skipping UrlSuffix for 'mel' due to finding no URLs

gcc
* doc/invoke.texi(MIPS Options): Fix skipping UrlSuffix
problem of mabi=, mno-flush-func, mexplicit-relocs;
add missing leading - of mbranch-cost option.
* config/mips/mips.opt.urls: Regenerate.

17 months agors6000: Neuter option -mpower{8,9}-vector [PR109987]
Kewen Lin [Thu, 22 Feb 2024 02:41:18 +0000 (20:41 -0600)] 
rs6000: Neuter option -mpower{8,9}-vector [PR109987]

As PR109987 and its duplicated bugs show, -mno-power8-vector
(and -mno-power9-vector) cause some problems and as Segher
pointed out in [1] they are workaround options, so this patch
is to remove -m{no,}-power{8,9}-options.  Like what we did
for option -mdirect-move before, this patch still keep the
corresponding internal flags and they are automatically set
based on -mcpu.  The test suite update takes some efforts,
it consists of some aspects:
  - effective target powerpc_p{8,9}vector_ok are removed
    and replaced with powerpc_vsx_ok.
  - Some cases having -mpower{8,9}-vector are updated with
    -mvsx, some of them already have -mdejagnu-cpu.  For
    those that don't have -mdejagnu-cpu, if -mdejagnu-cpu
    is needed for the test point, then it's appended;
    otherwise, add additional-options -mdejagnu-cpu=power{8,9}
    if has_arch_pwr{8,9} isn't satisfied.
  - Some test cases are updated with explicit -mvsx.
  - Some test cases with those two option mixed are adjusted
    to keep the test points, like -mpower8-vector
    -mno-power9-vector are updated with -mdejagnu-cpu=power8
    -mvsx etc.
  - Some test cases with -mno-power{8,9}-vector are updated
    by replacing -mno-power{8,9}-vector with -mno-vsx, or
    just removing it.
  - For some cases, we don't always specify -mdejagnu-cpu to
    avoid to restrict the testing coverage, it would check
    has_arch_pwr{8,9} and appended that as need.
  - For vect test cases run, it doesn't specify -mcpu=power9
    for power10 and up.

Bootstrapped and regtested on:
  - powerpc64-linux-gnu P7/P8/P9 {-m32,-m64}
  - powerpc64le-linux-gnu P8/P9/P10

Although it's stage4 now, as the discussion in PR113115 we
are still eager to neuter these two options, so is it ok
for trunk?

[1] https://gcc.gnu.org/pipermail/gcc-patches/2022-January/589303.html

PR target/109987

gcc/ChangeLog:

* config/rs6000/constraints.md (we): Update internal doc without
referring to option -mpower9-vector.
* config/rs6000/driver-rs6000.cc (asm_names): Remove mpower9-vector
special handlings.
* config/rs6000/rs6000-cpus.def (OTHER_P9_VECTOR_MASKS,
OTHER_P8_VECTOR_MASKS): Merge to ...
(OTHER_VSX_VECTOR_MASKS): ... here.
* config/rs6000/rs6000.cc (rs6000_option_override_internal): Remove
some error message handlings and explicit option mask adjustments on
explicit option power{8,9}-vector conflicting with other options.
(rs6000_print_isa_options): Update comments.
(rs6000_disable_incompatible_switches): Remove power{8,9}-vector
related array items and handlings.
* config/rs6000/rs6000.h (ASM_CPU_SPEC): Remove mpower9-vector
special handlings.
* config/rs6000/rs6000.opt: Make option power{8,9}-vector as
WarnRemoved.
* doc/extend.texi: Remove documentation referring to option
-mpower8-vector.
* doc/invoke.texi: Remove documentation for option
-mpower{8,9}-vector and adjust some documentation referring to them.
* doc/md.texi: Update documentation for constraint we.
* doc/sourcebuild.texi: Remove documentation for powerpc_p8vector_ok.

libgcc/ChangeLog:

* config/rs6000/t-float128-hw: Replace options -mpower{8,9}-vector
with -mcpu=power9.
* configure.ac: Update use of option -mpower9-vector with
-mcpu=power9.
* configure: Regenerate.

gcc/testsuite/ChangeLog:

* lib/target-supports.exp
(check_effective_target_powerpc_p8vector_ok): Remove.
(check_effective_target_powerpc_p9vector_ok): Remove.
(check_p8vector_hw_available): Replace -mpower8-vector with
-mcpu=power8.
(check_p9vector_hw_available): Replace -mpower9-vector with
-mcpu=power9.
(check_ppc_float128_hw_available): Likewise.
(check_vect_support_and_set_flags): Replace -mpower8-vector with
-mcpu=power8, replace -mpower9-vector with -mcpu=power9 or
nothing if check_power10_hw_available and place -mcpu=970 first
if needed to avoid possible overriding.
* g++.target/powerpc/altivec-19.C: Replace powerpc_p9vector_ok with
powerpc_vsx_ok and append -mvsx to dg-options.
* gcc.target/powerpc/bfp/scalar-cmp-exp-eq-0.c: Likewise.
* gcc.target/powerpc/bfp/scalar-cmp-exp-eq-1.c: Likewise.
* gcc.target/powerpc/bfp/scalar-cmp-exp-eq-2.c: Likewise.
* gcc.target/powerpc/bfp/scalar-cmp-exp-gt-0.c: Likewise.
* gcc.target/powerpc/bfp/scalar-cmp-exp-gt-1.c: Likewise.
* gcc.target/powerpc/bfp/scalar-cmp-exp-gt-2.c: Likewise.
* gcc.target/powerpc/bfp/scalar-cmp-exp-lt-0.c: Likewise.
* gcc.target/powerpc/bfp/scalar-cmp-exp-lt-1.c: Likewise.
* gcc.target/powerpc/bfp/scalar-cmp-exp-lt-2.c: Likewise.
* gcc.target/powerpc/bfp/scalar-cmp-exp-unordered-0.c: Likewise.
* gcc.target/powerpc/bfp/scalar-cmp-exp-unordered-1.c: Likewise.
* gcc.target/powerpc/bfp/scalar-cmp-exp-unordered-2.c: Likewise.
* gcc.target/powerpc/bfp/scalar-extract-exp-0.c: Likewise.
* gcc.target/powerpc/bfp/scalar-extract-exp-1.c: Likewise.
* gcc.target/powerpc/bfp/scalar-extract-exp-3.c: Likewise.
* gcc.target/powerpc/bfp/scalar-extract-exp-4.c: Likewise.
* gcc.target/powerpc/bfp/scalar-extract-exp-5.c: Likewise.
* gcc.target/powerpc/bfp/scalar-extract-sig-0.c: Likewise.
* gcc.target/powerpc/bfp/scalar-extract-sig-1.c: Likewise.
* gcc.target/powerpc/bfp/scalar-extract-sig-2.c: Likewise.
* gcc.target/powerpc/bfp/scalar-extract-sig-3.c: Likewise.
* gcc.target/powerpc/bfp/scalar-extract-sig-4.c: Likewise.
* gcc.target/powerpc/bfp/scalar-extract-sig-5.c: Likewise.
* gcc.target/powerpc/bfp/scalar-insert-exp-0.c: Likewise.
* gcc.target/powerpc/bfp/scalar-insert-exp-1.c: Likewise.
* gcc.target/powerpc/bfp/scalar-insert-exp-10.c: Likewise.
* gcc.target/powerpc/bfp/scalar-insert-exp-11.c: Likewise.
* gcc.target/powerpc/bfp/scalar-insert-exp-2.c: Likewise.
* gcc.target/powerpc/bfp/scalar-insert-exp-3.c: Likewise.
* gcc.target/powerpc/bfp/scalar-insert-exp-4.c: Likewise.
* gcc.target/powerpc/bfp/scalar-insert-exp-5.c: Likewise.
* gcc.target/powerpc/bfp/scalar-insert-exp-6.c: Likewise.
* gcc.target/powerpc/bfp/scalar-insert-exp-7.c: Likewise.
* gcc.target/powerpc/bfp/scalar-insert-exp-8.c: Likewise.
* gcc.target/powerpc/bfp/scalar-insert-exp-9.c: Likewise.
* gcc.target/powerpc/bfp/scalar-test-data-class-0.c: Likewise.
* gcc.target/powerpc/bfp/scalar-test-data-class-1.c: Likewise.
* gcc.target/powerpc/bfp/scalar-test-data-class-10.c: Likewise.
* gcc.target/powerpc/bfp/scalar-test-data-class-11.c: Likewise.
* gcc.target/powerpc/bfp/scalar-test-data-class-2.c: Likewise.
* gcc.target/powerpc/bfp/scalar-test-data-class-3.c: Likewise.
* gcc.target/powerpc/bfp/scalar-test-data-class-4.c: Likewise.
* gcc.target/powerpc/bfp/scalar-test-data-class-5.c: Likewise.
* gcc.target/powerpc/bfp/scalar-test-data-class-6.c: Likewise.
* gcc.target/powerpc/bfp/scalar-test-data-class-7.c: Likewise.
* gcc.target/powerpc/bfp/scalar-test-data-class-8.c: Likewise.
* gcc.target/powerpc/bfp/scalar-test-data-class-9.c: Likewise.
* gcc.target/powerpc/bfp/scalar-test-neg-0.c: Likewise.
* gcc.target/powerpc/bfp/scalar-test-neg-1.c: Likewise.
* gcc.target/powerpc/bfp/scalar-test-neg-2.c: Likewise.
* gcc.target/powerpc/bfp/scalar-test-neg-3.c: Likewise.
* gcc.target/powerpc/bfp/scalar-test-neg-4.c: Likewise.
* gcc.target/powerpc/bfp/scalar-test-neg-5.c: Likewise.
* gcc.target/powerpc/bfp/vec-extract-exp-0.c: Likewise.
* gcc.target/powerpc/bfp/vec-extract-exp-1.c: Likewise.
* gcc.target/powerpc/bfp/vec-extract-exp-2.c: Likewise.
* gcc.target/powerpc/bfp/vec-extract-exp-3.c: Likewise.
* gcc.target/powerpc/bfp/vec-extract-sig-0.c: Likewise.
* gcc.target/powerpc/bfp/vec-extract-sig-1.c: Likewise.
* gcc.target/powerpc/bfp/vec-extract-sig-2.c: Likewise.
* gcc.target/powerpc/bfp/vec-extract-sig-3.c: Likewise.
* gcc.target/powerpc/bfp/vec-insert-exp-0.c: Likewise.
* gcc.target/powerpc/bfp/vec-insert-exp-1.c: Likewise.
* gcc.target/powerpc/bfp/vec-insert-exp-2.c: Likewise.
* gcc.target/powerpc/bfp/vec-insert-exp-3.c: Likewise.
* gcc.target/powerpc/bfp/vec-insert-exp-4.c: Likewise.
* gcc.target/powerpc/bfp/vec-insert-exp-5.c: Likewise.
* gcc.target/powerpc/bfp/vec-insert-exp-6.c: Likewise.
* gcc.target/powerpc/bfp/vec-insert-exp-7.c: Likewise.
* gcc.target/powerpc/bfp/vec-test-data-class-0.c: Likewise.
* gcc.target/powerpc/bfp/vec-test-data-class-1.c: Likewise.
* gcc.target/powerpc/bfp/vec-test-data-class-2.c: Likewise.
* gcc.target/powerpc/bfp/vec-test-data-class-3.c: Likewise.
* gcc.target/powerpc/bfp/vec-test-data-class-4.c: Likewise.
* gcc.target/powerpc/bfp/vec-test-data-class-5.c: Likewise.
* gcc.target/powerpc/bfp/vec-test-data-class-6.c: Likewise.
* gcc.target/powerpc/bfp/vec-test-data-class-7.c: Likewise.
* gcc.target/powerpc/builtins-3-p9.c: Likewise.
* gcc.target/powerpc/byte-in-either-range-0.c: Likewise.
* gcc.target/powerpc/byte-in-either-range-1.c: Likewise.
* gcc.target/powerpc/byte-in-range-0.c: Likewise.
* gcc.target/powerpc/byte-in-range-1.c: Likewise.
* gcc.target/powerpc/byte-in-set-0.c: Likewise.
* gcc.target/powerpc/byte-in-set-1.c: Likewise.
* gcc.target/powerpc/byte-in-set-2.c: Likewise.
* gcc.target/powerpc/clone1.c: Likewise.
* gcc.target/powerpc/ctz-3.c: Likewise.
* gcc.target/powerpc/ctz-4.c: Likewise.
* gcc.target/powerpc/darn-0.c: Likewise.
* gcc.target/powerpc/darn-1.c: Likewise.
* gcc.target/powerpc/darn-2.c: Likewise.
* gcc.target/powerpc/dform-3.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-0.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-1.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-10.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-11.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-12.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-13.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-14.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-15.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-16.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-17.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-18.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-19.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-2.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-20.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-21.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-22.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-23.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-24.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-25.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-26.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-27.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-28.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-29.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-3.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-30.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-31.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-32.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-33.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-34.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-35.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-36.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-37.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-38.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-39.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-4.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-40.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-41.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-42.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-43.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-44.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-45.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-46.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-47.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-48.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-49.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-5.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-50.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-51.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-52.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-53.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-54.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-55.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-56.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-57.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-58.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-59.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-6.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-60.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-61.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-62.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-63.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-64.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-65.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-66.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-67.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-68.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-69.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-7.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-70.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-71.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-72.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-73.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-74.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-75.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-76.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-77.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-78.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-79.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-8.c: Likewise.
* gcc.target/powerpc/dfp/dtstsfi-9.c: Likewise.
* gcc.target/powerpc/direct-move-vector.c: Likewise.
* gcc.target/powerpc/float128-type-2.c: Likewise.
* gcc.target/powerpc/fold-vec-abs-int-fwrapv.p9.c: Likewise.
* gcc.target/powerpc/fold-vec-abs-int.p9.c: Likewise.
* gcc.target/powerpc/fold-vec-abs-longlong-fwrapv.p9.c: Likewise.
* gcc.target/powerpc/fold-vec-abs-longlong.p9.c: Likewise.
* gcc.target/powerpc/fold-vec-cmp-char.p9.c: Likewise.
* gcc.target/powerpc/fold-vec-cmp-short.p9.c: Likewise.
* gcc.target/powerpc/fold-vec-extract-char.p9.c: Likewise.
* gcc.target/powerpc/fold-vec-extract-float.p9.c: Likewise.
* gcc.target/powerpc/fold-vec-extract-int.p9.c: Likewise.
* gcc.target/powerpc/fold-vec-extract-longlong.p9.c: Likewise.
* gcc.target/powerpc/fold-vec-extract-short.p9.c: Likewise.
* gcc.target/powerpc/fold-vec-insert-char-p9.c: Likewise.
* gcc.target/powerpc/fold-vec-insert-float-p9.c: Likewise.
* gcc.target/powerpc/fold-vec-insert-int-p9.c: Likewise.
* gcc.target/powerpc/fold-vec-insert-short-p9.c: Likewise.
* gcc.target/powerpc/fold-vec-mult-int128-p9.c: Likewise.
* gcc.target/powerpc/fold-vec-neg-int.p9.c: Likewise.
* gcc.target/powerpc/fold-vec-neg-longlong.p9.c: Likewise.
* gcc.target/powerpc/p9-dimode1.c: Likewise.
* gcc.target/powerpc/p9-dimode2.c: Likewise.
* gcc.target/powerpc/p9-extract-1.c: Likewise.
* gcc.target/powerpc/p9-extract-2.c: Likewise.
* gcc.target/powerpc/p9-extract-3.c: Likewise.
* gcc.target/powerpc/p9-extract-4.c: Likewise.
* gcc.target/powerpc/p9-fpcvt-1.c: Likewise.
* gcc.target/powerpc/p9-fpcvt-2.c: Likewise.
* gcc.target/powerpc/p9-fpcvt-3.c: Likewise.
* gcc.target/powerpc/p9-lxvx-stxvx-1.c: Likewise.
* gcc.target/powerpc/p9-lxvx-stxvx-2.c: Likewise.
* gcc.target/powerpc/p9-lxvx-stxvx-3.c: Likewise.
* gcc.target/powerpc/p9-minmax-1.c: Likewise.
* gcc.target/powerpc/p9-minmax-2.c: Likewise.
* gcc.target/powerpc/p9-minmax-3.c: Likewise.
* gcc.target/powerpc/p9-novsx.c: Likewise.
* gcc.target/powerpc/p9-permute.c: Likewise.
* gcc.target/powerpc/p9-sign_extend-runnable.c: Likewise.
* gcc.target/powerpc/p9-splat-1.c: Likewise.
* gcc.target/powerpc/p9-splat-2.c: Likewise.
* gcc.target/powerpc/p9-splat-3.c: Likewise.
* gcc.target/powerpc/p9-splat-4.c: Likewise.
* gcc.target/powerpc/p9-splat-5.c: Likewise.
* gcc.target/powerpc/p9-vbpermd.c: Likewise.
* gcc.target/powerpc/p9-vec-length-epil-1.c: Likewise.
* gcc.target/powerpc/p9-vec-length-epil-2.c: Likewise.
* gcc.target/powerpc/p9-vec-length-epil-3.c: Likewise.
* gcc.target/powerpc/p9-vec-length-epil-4.c: Likewise.
* gcc.target/powerpc/p9-vec-length-epil-5.c: Likewise.
* gcc.target/powerpc/p9-vec-length-epil-6.c: Likewise.
* gcc.target/powerpc/p9-vec-length-epil-7.c: Likewise.
* gcc.target/powerpc/p9-vec-length-epil-8.c: Likewise.
* gcc.target/powerpc/p9-vec-length-full-1.c: Likewise.
* gcc.target/powerpc/p9-vec-length-full-2.c: Likewise.
* gcc.target/powerpc/p9-vec-length-full-3.c: Likewise.
* gcc.target/powerpc/p9-vec-length-full-4.c: Likewise.
* gcc.target/powerpc/p9-vec-length-full-5.c: Likewise.
* gcc.target/powerpc/p9-vec-length-full-6.c: Likewise.
* gcc.target/powerpc/p9-vec-length-full-7.c: Likewise.
* gcc.target/powerpc/p9-vec-length-full-8.c: Likewise.
* gcc.target/powerpc/p9-vneg.c: Likewise.
* gcc.target/powerpc/p9-vparity.c: Likewise.
* gcc.target/powerpc/p9-vpermr.c: Likewise.
* gcc.target/powerpc/p9-xxbr-1.c: Likewise.
* gcc.target/powerpc/p9-xxbr-2.c: Likewise.
* gcc.target/powerpc/p9-xxbr-3.c: Likewise.
* gcc.target/powerpc/ppc-fortran/pr80108-1.f90: Likewise.
* gcc.target/powerpc/ppc-round3.c: Likewise.
* gcc.target/powerpc/pr103124.c: Likewise.
* gcc.target/powerpc/pr104015-1.c: Likewise.
* gcc.target/powerpc/pr106769-p9.c: Likewise.
* gcc.target/powerpc/pr107412.c: Likewise.
* gcc.target/powerpc/pr110429.c: Likewise.
* gcc.target/powerpc/pr66144-1.c: Likewise.
* gcc.target/powerpc/pr71186.c: Likewise.
* gcc.target/powerpc/pr71309.c: Likewise.
* gcc.target/powerpc/pr71670.c: Likewise.
* gcc.target/powerpc/pr71698.c: Likewise.
* gcc.target/powerpc/pr71720.c: Likewise.
* gcc.target/powerpc/pr72853.c: Likewise.
* gcc.target/powerpc/pr78056-1.c: Likewise.
* gcc.target/powerpc/pr78658.c: Likewise.
* gcc.target/powerpc/pr78953.c: Likewise.
* gcc.target/powerpc/pr79004.c: Likewise.
* gcc.target/powerpc/pr79038-1.c: Likewise.
* gcc.target/powerpc/pr79179.c: Likewise.
* gcc.target/powerpc/pr79251.p9.c: Likewise.
* gcc.target/powerpc/pr79799-1.c: Likewise.
* gcc.target/powerpc/pr79799-2.c: Likewise.
* gcc.target/powerpc/pr79799-3.c: Likewise.
* gcc.target/powerpc/pr79799-5.c: Likewise.
* gcc.target/powerpc/pr80695-p9.c: Likewise.
* gcc.target/powerpc/pr81348.c: Likewise.
* gcc.target/powerpc/pr81622.c: Likewise.
* gcc.target/powerpc/pr84154-3.c: Likewise.
* gcc.target/powerpc/pr90763.c: Likewise.
* gcc.target/powerpc/pr96933-1.c: Likewise.
* gcc.target/powerpc/sad-vectorize-1.c: Likewise.
* gcc.target/powerpc/sad-vectorize-2.c: Likewise.
* gcc.target/powerpc/signbit-2.c: Likewise.
* gcc.target/powerpc/vadsdu-0.c: Likewise.
* gcc.target/powerpc/vadsdu-1.c: Likewise.
* gcc.target/powerpc/vadsdu-2.c: Likewise.
* gcc.target/powerpc/vadsdu-3.c: Likewise.
* gcc.target/powerpc/vadsdu-4.c: Likewise.
* gcc.target/powerpc/vadsdu-5.c: Likewise.
* gcc.target/powerpc/vadsdub-1.c: Likewise.
* gcc.target/powerpc/vadsdub-2.c: Likewise.
* gcc.target/powerpc/vadsduh-1.c: Likewise.
* gcc.target/powerpc/vadsduh-2.c: Likewise.
* gcc.target/powerpc/vadsduw-1.c: Likewise.
* gcc.target/powerpc/vadsduw-2.c: Likewise.
* gcc.target/powerpc/vec-extract-4.c: Likewise.
* gcc.target/powerpc/vec-init-3.c: Likewise.
* gcc.target/powerpc/vec-minmax-1.c: Likewise.
* gcc.target/powerpc/vec-minmax-2.c: Likewise.
* gcc.target/powerpc/vec-set-char.c: Likewise.
* gcc.target/powerpc/vec-set-int.c: Likewise.
* gcc.target/powerpc/vec-set-short.c: Likewise.
* gcc.target/powerpc/vec_reve_2.c: Likewise.
* gcc.target/powerpc/vector_float.c: Likewise.
* gcc.target/powerpc/vslv-0.c: Likewise.
* gcc.target/powerpc/vslv-1.c: Likewise.
* gcc.target/powerpc/vsrv-0.c: Likewise.
* gcc.target/powerpc/vsrv-1.c: Likewise.
* gcc.target/powerpc/vsu/vec-all-ne-0.c: Likewise.
* gcc.target/powerpc/vsu/vec-all-ne-1.c: Likewise.
* gcc.target/powerpc/vsu/vec-all-ne-10.c: Likewise.
* gcc.target/powerpc/vsu/vec-all-ne-11.c: Likewise.
* gcc.target/powerpc/vsu/vec-all-ne-12.c: Likewise.
* gcc.target/powerpc/vsu/vec-all-ne-13.c: Likewise.
* gcc.target/powerpc/vsu/vec-all-ne-14.c: Likewise.
* gcc.target/powerpc/vsu/vec-all-ne-2.c: Likewise.
* gcc.target/powerpc/vsu/vec-all-ne-3.c: Likewise.
* gcc.target/powerpc/vsu/vec-all-ne-4.c: Likewise.
* gcc.target/powerpc/vsu/vec-all-ne-5.c: Likewise.
* gcc.target/powerpc/vsu/vec-all-ne-6.c: Likewise.
* gcc.target/powerpc/vsu/vec-all-ne-7.c: Likewise.
* gcc.target/powerpc/vsu/vec-all-ne-8.c: Likewise.
* gcc.target/powerpc/vsu/vec-all-ne-9.c: Likewise.
* gcc.target/powerpc/vsu/vec-all-nez-1.c: Likewise.
* gcc.target/powerpc/vsu/vec-all-nez-2.c: Likewise.
* gcc.target/powerpc/vsu/vec-all-nez-3.c: Likewise.
* gcc.target/powerpc/vsu/vec-all-nez-4.c: Likewise.
* gcc.target/powerpc/vsu/vec-all-nez-5.c: Likewise.
* gcc.target/powerpc/vsu/vec-all-nez-6.c: Likewise.
* gcc.target/powerpc/vsu/vec-all-nez-7.c: Likewise.
* gcc.target/powerpc/vsu/vec-any-eq-0.c: Likewise.
* gcc.target/powerpc/vsu/vec-any-eq-1.c: Likewise.
* gcc.target/powerpc/vsu/vec-any-eq-10.c: Likewise.
* gcc.target/powerpc/vsu/vec-any-eq-11.c: Likewise.
* gcc.target/powerpc/vsu/vec-any-eq-12.c: Likewise.
* gcc.target/powerpc/vsu/vec-any-eq-13.c: Likewise.
* gcc.target/powerpc/vsu/vec-any-eq-14.c: Likewise.
* gcc.target/powerpc/vsu/vec-any-eq-2.c: Likewise.
* gcc.target/powerpc/vsu/vec-any-eq-3.c: Likewise.
* gcc.target/powerpc/vsu/vec-any-eq-4.c: Likewise.
* gcc.target/powerpc/vsu/vec-any-eq-5.c: Likewise.
* gcc.target/powerpc/vsu/vec-any-eq-6.c: Likewise.
* gcc.target/powerpc/vsu/vec-any-eq-7.c: Likewise.
* gcc.target/powerpc/vsu/vec-any-eq-8.c: Likewise.
* gcc.target/powerpc/vsu/vec-any-eq-9.c: Likewise.
* gcc.target/powerpc/vsu/vec-any-eqz-1.c: Likewise.
* gcc.target/powerpc/vsu/vec-any-eqz-2.c: Likewise.
* gcc.target/powerpc/vsu/vec-any-eqz-3.c: Likewise.
* gcc.target/powerpc/vsu/vec-any-eqz-4.c: Likewise.
* gcc.target/powerpc/vsu/vec-any-eqz-5.c: Likewise.
* gcc.target/powerpc/vsu/vec-any-eqz-6.c: Likewise.
* gcc.target/powerpc/vsu/vec-any-eqz-7.c: Likewise.
* gcc.target/powerpc/vsu/vec-cmpne-0.c: Likewise.
* gcc.target/powerpc/vsu/vec-cmpne-1.c: Likewise.
* gcc.target/powerpc/vsu/vec-cmpne-2.c: Likewise.
* gcc.target/powerpc/vsu/vec-cmpne-3.c: Likewise.
* gcc.target/powerpc/vsu/vec-cmpne-4.c: Likewise.
* gcc.target/powerpc/vsu/vec-cmpne-5.c: Likewise.
* gcc.target/powerpc/vsu/vec-cmpne-6.c: Likewise.
* gcc.target/powerpc/vsu/vec-cmpne-8.c: Likewise.
* gcc.target/powerpc/vsu/vec-cmpne-9.c: Likewise.
* gcc.target/powerpc/vsu/vec-cmpnez-1.c: Likewise.
* gcc.target/powerpc/vsu/vec-cmpnez-2.c: Likewise.
* gcc.target/powerpc/vsu/vec-cmpnez-3.c: Likewise.
* gcc.target/powerpc/vsu/vec-cmpnez-4.c: Likewise.
* gcc.target/powerpc/vsu/vec-cmpnez-5.c: Likewise.
* gcc.target/powerpc/vsu/vec-cmpnez-6.c: Likewise.
* gcc.target/powerpc/vsu/vec-cmpnez-7.c: Likewise.
* gcc.target/powerpc/vsu/vec-cntlz-lsbb-0.c: Likewise.
* gcc.target/powerpc/vsu/vec-cntlz-lsbb-1.c: Likewise.
* gcc.target/powerpc/vsu/vec-cntlz-lsbb-2.c: Likewise.
* gcc.target/powerpc/vsu/vec-cntlz-lsbb-3.c: Likewise.
* gcc.target/powerpc/vsu/vec-cntlz-lsbb-4.c: Likewise.
* gcc.target/powerpc/vsu/vec-cnttz-lsbb-0.c: Likewise.
* gcc.target/powerpc/vsu/vec-cnttz-lsbb-1.c: Likewise.
* gcc.target/powerpc/vsu/vec-cnttz-lsbb-2.c: Likewise.
* gcc.target/powerpc/vsu/vec-cnttz-lsbb-3.c: Likewise.
* gcc.target/powerpc/vsu/vec-cnttz-lsbb-4.c: Likewise.
* gcc.target/powerpc/vsu/vec-xl-len-0.c: Likewise.
* gcc.target/powerpc/vsu/vec-xl-len-1.c: Likewise.
* gcc.target/powerpc/vsu/vec-xl-len-10.c: Likewise.
* gcc.target/powerpc/vsu/vec-xl-len-11.c: Likewise.
* gcc.target/powerpc/vsu/vec-xl-len-12.c: Likewise.
* gcc.target/powerpc/vsu/vec-xl-len-13.c: Likewise.
* gcc.target/powerpc/vsu/vec-xl-len-2.c: Likewise.
* gcc.target/powerpc/vsu/vec-xl-len-3.c: Likewise.
* gcc.target/powerpc/vsu/vec-xl-len-4.c: Likewise.
* gcc.target/powerpc/vsu/vec-xl-len-5.c: Likewise.
* gcc.target/powerpc/vsu/vec-xl-len-6.c: Likewise.
* gcc.target/powerpc/vsu/vec-xl-len-7.c: Likewise.
* gcc.target/powerpc/vsu/vec-xl-len-8.c: Likewise.
* gcc.target/powerpc/vsu/vec-xl-len-9.c: Likewise.
* gcc.target/powerpc/vsu/vec-xlx-0.c: Likewise.
* gcc.target/powerpc/vsu/vec-xlx-1.c: Likewise.
* gcc.target/powerpc/vsu/vec-xlx-2.c: Likewise.
* gcc.target/powerpc/vsu/vec-xlx-3.c: Likewise.
* gcc.target/powerpc/vsu/vec-xlx-4.c: Likewise.
* gcc.target/powerpc/vsu/vec-xlx-5.c: Likewise.
* gcc.target/powerpc/vsu/vec-xlx-6.c: Likewise.
* gcc.target/powerpc/vsu/vec-xlx-7.c: Likewise.
* gcc.target/powerpc/vsu/vec-xrx-0.c: Likewise.
* gcc.target/powerpc/vsu/vec-xrx-1.c: Likewise.
* gcc.target/powerpc/vsu/vec-xrx-2.c: Likewise.
* gcc.target/powerpc/vsu/vec-xrx-3.c: Likewise.
* gcc.target/powerpc/vsu/vec-xrx-4.c: Likewise.
* gcc.target/powerpc/vsu/vec-xrx-5.c: Likewise.
* gcc.target/powerpc/vsu/vec-xrx-6.c: Likewise.
* gcc.target/powerpc/vsu/vec-xrx-7.c: Likewise.
* gcc.target/powerpc/vsu/vec-xst-len-0.c: Likewise.
* gcc.target/powerpc/vsu/vec-xst-len-1.c: Likewise.
* gcc.target/powerpc/vsu/vec-xst-len-10.c: Likewise.
* gcc.target/powerpc/vsu/vec-xst-len-11.c: Likewise.
* gcc.target/powerpc/vsu/vec-xst-len-12.c: Likewise.
* gcc.target/powerpc/vsu/vec-xst-len-13.c: Likewise.
* gcc.target/powerpc/vsu/vec-xst-len-2.c: Likewise.
* gcc.target/powerpc/vsu/vec-xst-len-3.c: Likewise.
* gcc.target/powerpc/vsu/vec-xst-len-4.c: Likewise.
* gcc.target/powerpc/vsu/vec-xst-len-5.c: Likewise.
* gcc.target/powerpc/vsu/vec-xst-len-6.c: Likewise.
* gcc.target/powerpc/vsu/vec-xst-len-7.c: Likewise.
* gcc.target/powerpc/vsu/vec-xst-len-8.c: Likewise.
* gcc.target/powerpc/vsu/vec-xst-len-9.c: Likewise.
* gcc.target/powerpc/vsx-builtin-msum.c: Likewise.
* gcc.target/powerpc/vsx-himode.c: Likewise.
* gcc.target/powerpc/vsx-himode2.c: Likewise.
* gcc.target/powerpc/vsx-himode3.c: Likewise.
* gcc.target/powerpc/vsx-qimode.c: Likewise.
* gcc.target/powerpc/vsx-qimode2.c: Likewise.
* gcc.target/powerpc/vsx-qimode3.c: Likewise.
* g++.target/powerpc/pr65240-1.C: Replace powerpc_p8vector_ok with
powerpc_vsx_ok and append -mvsx to dg-options.
* g++.target/powerpc/pr65240-2.C: Likewise.
* g++.target/powerpc/pr65240-3.C: Likewise.
* g++.target/powerpc/pr65242.C: Likewise.
* g++.target/powerpc/pr67211.C: Likewise.
* g++.target/powerpc/pr71294.C: Likewise.
* g++.target/powerpc/pr84279.C: Likewise.
* g++.target/powerpc/pr93974.C: Likewise.
* gcc.target/powerpc/atomic-p8.c: Likewise.
* gcc.target/powerpc/atomic_load_store-p8.c: Likewise.
* gcc.target/powerpc/bcd-2.c: Likewise.
* gcc.target/powerpc/bcd-3.c: Likewise.
* gcc.target/powerpc/bool2-p8.c: Likewise.
* gcc.target/powerpc/bool3-p8.c: Likewise.
* gcc.target/powerpc/builtins-1.c: Likewise.
* gcc.target/powerpc/builtins-3-p8.c: Likewise.
* gcc.target/powerpc/builtins-5.c: Likewise.
* gcc.target/powerpc/builtins-9.c: Likewise.
* gcc.target/powerpc/crypto-builtin-1.c: Likewise.
* gcc.target/powerpc/crypto-builtin-2.c: Likewise.
* gcc.target/powerpc/direct-move-double1.c: Likewise.
* gcc.target/powerpc/direct-move-float1.c: Likewise.
* gcc.target/powerpc/direct-move-long1.c: Likewise.
* gcc.target/powerpc/direct-move-vint1.c: Likewise.
* gcc.target/powerpc/float128-type-1.c: Likewise.
* gcc.target/powerpc/fold-vec-extract-char.p8.c: Likewise.
* gcc.target/powerpc/fold-vec-extract-double.p8.c: Likewise.
* gcc.target/powerpc/fold-vec-extract-float.p8.c: Likewise.
* gcc.target/powerpc/fold-vec-extract-int.p8.c: Likewise.
* gcc.target/powerpc/fold-vec-extract-longlong.p8.c: Likewise.
* gcc.target/powerpc/fold-vec-extract-short.p8.c: Likewise.
* gcc.target/powerpc/fold-vec-insert-char-p8.c: Likewise.
* gcc.target/powerpc/fold-vec-insert-float-p8.c: Likewise.
* gcc.target/powerpc/fold-vec-insert-int-p8.c: Likewise.
* gcc.target/powerpc/fold-vec-insert-longlong.c: Likewise.
* gcc.target/powerpc/fold-vec-insert-short-p8.c: Likewise.
* gcc.target/powerpc/fold-vec-neg-char.c: Likewise.
* gcc.target/powerpc/fold-vec-neg-floatdouble.c: Likewise.
* gcc.target/powerpc/fold-vec-neg-int.p8.c: Likewise.
* gcc.target/powerpc/fold-vec-neg-short.c: Likewise.
* gcc.target/powerpc/fold-vec-select-double.c: Likewise.
* gcc.target/powerpc/fold-vec-store-builtin_vec_xst-longlong.c: Likewise.
* gcc.target/powerpc/fusion.c: Likewise.
* gcc.target/powerpc/fusion2.c: Likewise.
* gcc.target/powerpc/mul-vectorize-1.c: Likewise.
* gcc.target/powerpc/p8-vec-xl-xst-v2.c: Likewise.
* gcc.target/powerpc/p8-vec-xl-xst.c: Likewise.
* gcc.target/powerpc/p8vector-builtin-1.c: Likewise.
* gcc.target/powerpc/p8vector-builtin-2.c: Likewise.
* gcc.target/powerpc/p8vector-builtin-3.c: Likewise.
* gcc.target/powerpc/p8vector-builtin-4.c: Likewise.
* gcc.target/powerpc/p8vector-builtin-5.c: Likewise.
* gcc.target/powerpc/p8vector-builtin-6.c: Likewise.
* gcc.target/powerpc/p8vector-builtin-7.c: Likewise.
* gcc.target/powerpc/p8vector-fp.c: Likewise.
* gcc.target/powerpc/p8vector-int128-1.c: Likewise.
* gcc.target/powerpc/p8vector-ldst.c: Likewise.
* gcc.target/powerpc/p8vector-vbpermq.c: Likewise.
* gcc.target/powerpc/p8vector-vectorize-1.c: Likewise.
* gcc.target/powerpc/p8vector-vectorize-2.c: Likewise.
* gcc.target/powerpc/p8vector-vectorize-3.c: Likewise.
* gcc.target/powerpc/p8vector-vectorize-4.c: Likewise.
* gcc.target/powerpc/p8vector-vectorize-5.c: Likewise.
* gcc.target/powerpc/ppc-round2.c: Likewise.
* gcc.target/powerpc/pr100866-1.c: Likewise.
* gcc.target/powerpc/pr100866-2.c: Likewise.
* gcc.target/powerpc/pr104239-1.c: Likewise.
* gcc.target/powerpc/pr104239-2.c: Likewise.
* gcc.target/powerpc/pr104239-3.c: Likewise.
* gcc.target/powerpc/pr106769-p8.c: Likewise.
* gcc.target/powerpc/pr108396.c: Likewise.
* gcc.target/powerpc/pr111449-1.c: Likewise.
* gcc.target/powerpc/pr57744.c: Likewise.
* gcc.target/powerpc/pr58673-1.c: Likewise.
* gcc.target/powerpc/pr58673-2.c: Likewise.
* gcc.target/powerpc/pr60137.c: Likewise.
* gcc.target/powerpc/pr60203.c: Likewise.
* gcc.target/powerpc/pr66144-2.c: Likewise.
* gcc.target/powerpc/pr66144-3.c: Likewise.
* gcc.target/powerpc/pr68163.c: Likewise.
* gcc.target/powerpc/pr69548.c: Likewise.
* gcc.target/powerpc/pr70669.c: Likewise.
* gcc.target/powerpc/pr71977-1.c: Likewise.
* gcc.target/powerpc/pr71977-2.c: Likewise.
* gcc.target/powerpc/pr72717.c: Likewise.
* gcc.target/powerpc/pr78056-3.c: Likewise.
* gcc.target/powerpc/pr78056-4.c: Likewise.
* gcc.target/powerpc/pr78102.c: Likewise.
* gcc.target/powerpc/pr78543.c: Likewise.
* gcc.target/powerpc/pr78604.c: Likewise.
* gcc.target/powerpc/pr79251.p8.c: Likewise.
* gcc.target/powerpc/pr79354.c: Likewise.
* gcc.target/powerpc/pr79544.c: Likewise.
* gcc.target/powerpc/pr79907.c: Likewise.
* gcc.target/powerpc/pr79951.c: Likewise.
* gcc.target/powerpc/pr80315-1.c: Likewise.
* gcc.target/powerpc/pr80315-2.c: Likewise.
* gcc.target/powerpc/pr80315-3.c: Likewise.
* gcc.target/powerpc/pr80315-4.c: Likewise.
* gcc.target/powerpc/pr80510-2.c: Likewise.
* gcc.target/powerpc/pr80695-p8.c: Likewise.
* gcc.target/powerpc/pr80718.c: Likewise.
* gcc.target/powerpc/pr84154-2.c: Likewise.
* gcc.target/powerpc/pr88558-p8.c: Likewise.
* gcc.target/powerpc/pr88845.c: Likewise.
* gcc.target/powerpc/pr91903.c: Likewise.
* gcc.target/powerpc/pr92923-2.c: Likewise.
* gcc.target/powerpc/pr96933-2.c: Likewise.
* gcc.target/powerpc/pr97019.c: Likewise.
* gcc.target/powerpc/pragma_power8.c: Likewise.
* gcc.target/powerpc/signbit-1.c: Likewise.
* gcc.target/powerpc/swaps-p8-1.c: Likewise.
* gcc.target/powerpc/swaps-p8-12.c: Likewise.
* gcc.target/powerpc/swaps-p8-14.c: Likewise.
* gcc.target/powerpc/swaps-p8-15.c: Likewise.
* gcc.target/powerpc/swaps-p8-16.c: Likewise.
* gcc.target/powerpc/swaps-p8-17.c: Likewise.
* gcc.target/powerpc/swaps-p8-18.c: Likewise.
* gcc.target/powerpc/swaps-p8-19.c: Likewise.
* gcc.target/powerpc/swaps-p8-2.c: Likewise.
* gcc.target/powerpc/swaps-p8-22.c: Likewise.
* gcc.target/powerpc/swaps-p8-23.c: Likewise.
* gcc.target/powerpc/swaps-p8-24.c: Likewise.
* gcc.target/powerpc/swaps-p8-25.c: Likewise.
* gcc.target/powerpc/swaps-p8-26.c: Likewise.
* gcc.target/powerpc/swaps-p8-27.c: Likewise.
* gcc.target/powerpc/swaps-p8-3.c: Likewise.
* gcc.target/powerpc/swaps-p8-30.c: Likewise.
* gcc.target/powerpc/swaps-p8-33.c: Likewise.
* gcc.target/powerpc/swaps-p8-36.c: Likewise.
* gcc.target/powerpc/swaps-p8-39.c: Likewise.
* gcc.target/powerpc/swaps-p8-4.c: Likewise.
* gcc.target/powerpc/swaps-p8-42.c: Likewise.
* gcc.target/powerpc/swaps-p8-45.c: Likewise.
* gcc.target/powerpc/swaps-p8-46.c: Likewise.
* gcc.target/powerpc/swaps-p8-5.c: Likewise.
* gcc.target/powerpc/unpack-vectorize-3.c: Likewise.
* gcc.target/powerpc/upper-regs-sf.c: Likewise.
* gcc.target/powerpc/vec-cmp.c: Likewise.
* gcc.target/powerpc/vec-extract-1.c: Likewise.
* gcc.target/powerpc/vec-extract-3.c: Likewise.
* gcc.target/powerpc/vec-extract-5.c: Likewise.
* gcc.target/powerpc/vec-extract-6.c: Likewise.
* gcc.target/powerpc/vec-extract-7.c: Likewise.
* gcc.target/powerpc/vec-extract-8.c: Likewise.
* gcc.target/powerpc/vec-extract-9.c: Likewise.
* gcc.target/powerpc/vec-init-10.c: Likewise.
* gcc.target/powerpc/vec-init-6.c: Likewise.
* gcc.target/powerpc/vec-init-7.c: Likewise.
* gcc.target/powerpc/vsx-extract-3.c: Likewise.
* gcc.target/powerpc/vsx-extract-4.c: Likewise.
* gcc.target/powerpc/vsx-extract-5.c: Likewise.
* gcc.target/powerpc/vsx-simode.c: Likewise.
* gcc.target/powerpc/vsx-simode2.c: Likewise.
* gcc.target/powerpc/vsx-simode3.c: Likewise.
* gcc.target/powerpc/builtins-4-int128-runnable.c: Replace
powerpc_p8vector_ok with powerpc_vsx_ok, replace -mpower8-vector
with -mvsx, and add dg-additional-options -mdejagnu-cpu=power8
if !has_arch_pwr8.
* gcc.target/powerpc/builtins-mergew-mergow.c: Likewise.
* gcc.target/powerpc/direct-move-float3.c: Likewise.
* gcc.target/powerpc/divkc3-2.c: Likewise.
* gcc.target/powerpc/divkc3-3.c: Likewise.
* gcc.target/powerpc/fold-vec-abs-longlong-fwrapv.c: Likewise.
* gcc.target/powerpc/fold-vec-abs-longlong.c: Likewise.
* gcc.target/powerpc/fold-vec-add-4.c: Likewise.
* gcc.target/powerpc/fold-vec-add-7.c: Likewise.
* gcc.target/powerpc/fold-vec-cmp-int.h: Likewise.
* gcc.target/powerpc/fold-vec-cmp-longlong.c: Likewise.
* gcc.target/powerpc/fold-vec-cmp-short.h: Likewise.
* gcc.target/powerpc/fold-vec-cntlz-char.c: Likewise.
* gcc.target/powerpc/fold-vec-cntlz-int.c: Likewise.
* gcc.target/powerpc/fold-vec-cntlz-longlong.c: Likewise.
* gcc.target/powerpc/fold-vec-cntlz-short.c: Likewise.
* gcc.target/powerpc/fold-vec-ld-longlong.c: Likewise.
* gcc.target/powerpc/fold-vec-logical-eqv-char.c: Likewise.
* gcc.target/powerpc/fold-vec-logical-eqv-float.c: Likewise.
* gcc.target/powerpc/fold-vec-logical-eqv-floatdouble.c: Likewise.
* gcc.target/powerpc/fold-vec-logical-eqv-int.c: Likewise.
* gcc.target/powerpc/fold-vec-logical-eqv-longlong.c: Likewise.
* gcc.target/powerpc/fold-vec-logical-eqv-short.c: Likewise.
* gcc.target/powerpc/fold-vec-logical-ors-longlong.c: Likewise.
* gcc.target/powerpc/fold-vec-logical-other-char.c: Likewise.
* gcc.target/powerpc/fold-vec-logical-other-int.c: Likewise.
* gcc.target/powerpc/fold-vec-logical-other-longlong.c: Likewise.
* gcc.target/powerpc/fold-vec-logical-other-short.c: Likewise.
* gcc.target/powerpc/fold-vec-mergehl-longlong.c: Likewise.
* gcc.target/powerpc/fold-vec-minmax-longlong.c: Likewise.
* gcc.target/powerpc/fold-vec-mult-int.c: Likewise.
* gcc.target/powerpc/fold-vec-mult-longlong.c: Likewise.
* gcc.target/powerpc/fold-vec-neg-int.c: Likewise.
* gcc.target/powerpc/fold-vec-neg-longlong.h: Likewise.
* gcc.target/powerpc/fold-vec-pack-double.c: Likewise.
* gcc.target/powerpc/fold-vec-pack-longlong.c: Likewise.
* gcc.target/powerpc/fold-vec-shift-left-longlong-fwrapv.c: Likewise.
* gcc.target/powerpc/fold-vec-shift-left-longlong.c: Likewise.
* gcc.target/powerpc/fold-vec-shift-longlong.c: Likewise.
* gcc.target/powerpc/fold-vec-st-longlong.c: Likewise.
* gcc.target/powerpc/fold-vec-sub-int128.c: Likewise.
* gcc.target/powerpc/fold-vec-sub-longlong.c: Likewise.
* gcc.target/powerpc/fold-vec-unpack-float.c: Likewise.
* gcc.target/powerpc/fold-vec-unpack-int.c: Likewise.
* gcc.target/powerpc/mmx-packs.c: Likewise.
* gcc.target/powerpc/mmx-packssdw-1.c: Likewise.
* gcc.target/powerpc/mmx-packsswb-1.c: Likewise.
* gcc.target/powerpc/mmx-packuswb-1.c: Likewise.
* gcc.target/powerpc/mmx-paddb-1.c: Likewise.
* gcc.target/powerpc/mmx-paddd-1.c: Likewise.
* gcc.target/powerpc/mmx-paddsb-1.c: Likewise.
* gcc.target/powerpc/mmx-paddsw-1.c: Likewise.
* gcc.target/powerpc/mmx-paddusb-1.c: Likewise.
* gcc.target/powerpc/mmx-paddusw-1.c: Likewise.
* gcc.target/powerpc/mmx-paddw-1.c: Likewise.
* gcc.target/powerpc/mmx-pcmpeqb-1.c: Likewise.
* gcc.target/powerpc/mmx-pcmpeqd-1.c: Likewise.
* gcc.target/powerpc/mmx-pcmpeqw-1.c: Likewise.
* gcc.target/powerpc/mmx-pcmpgtb-1.c: Likewise.
* gcc.target/powerpc/mmx-pcmpgtd-1.c: Likewise.
* gcc.target/powerpc/mmx-pcmpgtw-1.c: Likewise.
* gcc.target/powerpc/mmx-pmaddwd-1.c: Likewise.
* gcc.target/powerpc/mmx-pmulhw-1.c: Likewise.
* gcc.target/powerpc/mmx-pmullw-1.c: Likewise.
* gcc.target/powerpc/mmx-pslld-1.c: Likewise.
* gcc.target/powerpc/mmx-psllw-1.c: Likewise.
* gcc.target/powerpc/mmx-psrad-1.c: Likewise.
* gcc.target/powerpc/mmx-psraw-1.c: Likewise.
* gcc.target/powerpc/mmx-psrld-1.c: Likewise.
* gcc.target/powerpc/mmx-psrlw-1.c: Likewise.
* gcc.target/powerpc/mmx-psubb-2.c: Likewise.
* gcc.target/powerpc/mmx-psubd-2.c: Likewise.
* gcc.target/powerpc/mmx-psubsb-1.c: Likewise.
* gcc.target/powerpc/mmx-psubsw-1.c: Likewise.
* gcc.target/powerpc/mmx-psubusb-1.c: Likewise.
* gcc.target/powerpc/mmx-psubusw-1.c: Likewise.
* gcc.target/powerpc/mmx-psubw-2.c: Likewise.
* gcc.target/powerpc/mmx-punpckhbw-1.c: Likewise.
* gcc.target/powerpc/mmx-punpckhdq-1.c: Likewise.
* gcc.target/powerpc/mmx-punpckhwd-1.c: Likewise.
* gcc.target/powerpc/mmx-punpcklbw-1.c: Likewise.
* gcc.target/powerpc/mmx-punpckldq-1.c: Likewise.
* gcc.target/powerpc/mmx-punpcklwd-1.c: Likewise.
* gcc.target/powerpc/mulkc3-2.c: Likewise.
* gcc.target/powerpc/mulkc3-3.c: Likewise.
* gcc.target/powerpc/p8vector-builtin-8.c: Likewise.
* gcc.target/powerpc/pr37191.c: Likewise.
* gcc.target/powerpc/pr83862.c: Likewise.
* gcc.target/powerpc/pr84154-1.c: Likewise.
* gcc.target/powerpc/pr84220-sld2.c: Likewise.
* gcc.target/powerpc/pr85456.c: Likewise.
* gcc.target/powerpc/pr86731-longlong.c: Likewise.
* gcc.target/powerpc/sse-addps-1.c: Likewise.
* gcc.target/powerpc/sse-addss-1.c: Likewise.
* gcc.target/powerpc/sse-andnps-1.c: Likewise.
* gcc.target/powerpc/sse-andps-1.c: Likewise.
* gcc.target/powerpc/sse-cmpss-1.c: Likewise.
* gcc.target/powerpc/sse-cvtpi16ps-1.c: Likewise.
* gcc.target/powerpc/sse-cvtpi32ps-1.c: Likewise.
* gcc.target/powerpc/sse-cvtpi32x2ps-1.c: Likewise.
* gcc.target/powerpc/sse-cvtpi8ps-1.c: Likewise.
* gcc.target/powerpc/sse-cvtpspi16-1.c: Likewise.
* gcc.target/powerpc/sse-cvtpspi8-1.c: Likewise.
* gcc.target/powerpc/sse-cvtpu16ps-1.c: Likewise.
* gcc.target/powerpc/sse-cvtpu8ps-1.c: Likewise.
* gcc.target/powerpc/sse-cvtsi2ss-1.c: Likewise.
* gcc.target/powerpc/sse-cvtsi2ss-2.c: Likewise.
* gcc.target/powerpc/sse-cvtss2si-1.c: Likewise.
* gcc.target/powerpc/sse-cvtss2si-2.c: Likewise.
* gcc.target/powerpc/sse-cvttss2si-1.c: Likewise.
* gcc.target/powerpc/sse-cvttss2si-2.c: Likewise.
* gcc.target/powerpc/sse-divps-1.c: Likewise.
* gcc.target/powerpc/sse-divss-1.c: Likewise.
* gcc.target/powerpc/sse-maxps-1.c: Likewise.
* gcc.target/powerpc/sse-maxps-2.c: Likewise.
* gcc.target/powerpc/sse-maxss-1.c: Likewise.
* gcc.target/powerpc/sse-minps-1.c: Likewise.
* gcc.target/powerpc/sse-minps-2.c: Likewise.
* gcc.target/powerpc/sse-minss-1.c: Likewise.
* gcc.target/powerpc/sse-movaps-1.c: Likewise.
* gcc.target/powerpc/sse-movaps-2.c: Likewise.
* gcc.target/powerpc/sse-movhlps-1.c: Likewise.
* gcc.target/powerpc/sse-movhps-1.c: Likewise.
* gcc.target/powerpc/sse-movhps-2.c: Likewise.
* gcc.target/powerpc/sse-movlhps-1.c: Likewise.
* gcc.target/powerpc/sse-movlps-1.c: Likewise.
* gcc.target/powerpc/sse-movlps-2.c: Likewise.
* gcc.target/powerpc/sse-movmskb-1.c: Likewise.
* gcc.target/powerpc/sse-movmskps-1.c: Likewise.
* gcc.target/powerpc/sse-movss-1.c: Likewise.
* gcc.target/powerpc/sse-movss-2.c: Likewise.
* gcc.target/powerpc/sse-movss-3.c: Likewise.
* gcc.target/powerpc/sse-mulps-1.c: Likewise.
* gcc.target/powerpc/sse-mulss-1.c: Likewise.
* gcc.target/powerpc/sse-orps-1.c: Likewise.
* gcc.target/powerpc/sse-pavgw-1.c: Likewise.
* gcc.target/powerpc/sse-pmaxsw-1.c: Likewise.
* gcc.target/powerpc/sse-pmaxub-1.c: Likewise.
* gcc.target/powerpc/sse-pminsw-1.c: Likewise.
* gcc.target/powerpc/sse-pminub-1.c: Likewise.
* gcc.target/powerpc/sse-pmulhuw-1.c: Likewise.
* gcc.target/powerpc/sse-psadbw-1.c: Likewise.
* gcc.target/powerpc/sse-rcpps-1.c: Likewise.
* gcc.target/powerpc/sse-rsqrtps-1.c: Likewise.
* gcc.target/powerpc/sse-shufps-1.c: Likewise.
* gcc.target/powerpc/sse-sqrtps-1.c: Likewise.
* gcc.target/powerpc/sse-subps-1.c: Likewise.
* gcc.target/powerpc/sse-subss-1.c: Likewise.
* gcc.target/powerpc/sse-ucomiss-1.c: Likewise.
* gcc.target/powerpc/sse-ucomiss-2.c: Likewise.
* gcc.target/powerpc/sse-ucomiss-3.c: Likewise.
* gcc.target/powerpc/sse-ucomiss-4.c: Likewise.
* gcc.target/powerpc/sse-ucomiss-5.c: Likewise.
* gcc.target/powerpc/sse-ucomiss-6.c: Likewise.
* gcc.target/powerpc/sse-unpckhps-1.c: Likewise.
* gcc.target/powerpc/sse-unpcklps-1.c: Likewise.
* gcc.target/powerpc/sse-xorps-1.c: Likewise.
* gcc.target/powerpc/sse2-addpd-1.c: Likewise.
* gcc.target/powerpc/sse2-addsd-1.c: Likewise.
* gcc.target/powerpc/sse2-andnpd-1.c: Likewise.
* gcc.target/powerpc/sse2-andpd-1.c: Likewise.
* gcc.target/powerpc/sse2-cmppd-1.c: Likewise.
* gcc.target/powerpc/sse2-cmpsd-1.c: Likewise.
* gcc.target/powerpc/sse2-comisd-1.c: Likewise.
* gcc.target/powerpc/sse2-comisd-2.c: Likewise.
* gcc.target/powerpc/sse2-comisd-3.c: Likewise.
* gcc.target/powerpc/sse2-comisd-4.c: Likewise.
* gcc.target/powerpc/sse2-comisd-5.c: Likewise.
* gcc.target/powerpc/sse2-comisd-6.c: Likewise.
* gcc.target/powerpc/sse2-cvtdq2pd-1.c: Likewise.
* gcc.target/powerpc/sse2-cvtdq2ps-1.c: Likewise.
* gcc.target/powerpc/sse2-cvtpd2dq-1.c: Likewise.
* gcc.target/powerpc/sse2-cvtpd2ps-1.c: Likewise.
* gcc.target/powerpc/sse2-cvtps2dq-1.c: Likewise.
* gcc.target/powerpc/sse2-cvtps2pd-1.c: Likewise.
* gcc.target/powerpc/sse2-cvtsd2si-1.c: Likewise.
* gcc.target/powerpc/sse2-cvtsd2si-2.c: Likewise.
* gcc.target/powerpc/sse2-cvtsd2ss-1.c: Likewise.
* gcc.target/powerpc/sse2-cvtsi2sd-1.c: Likewise.
* gcc.target/powerpc/sse2-cvtsi2sd-2.c: Likewise.
* gcc.target/powerpc/sse2-cvtss2sd-1.c: Likewise.
* gcc.target/powerpc/sse2-cvttpd2dq-1.c: Likewise.
* gcc.target/powerpc/sse2-cvttps2dq-1.c: Likewise.
* gcc.target/powerpc/sse2-cvttsd2si-1.c: Likewise.
* gcc.target/powerpc/sse2-cvttsd2si-2.c: Likewise.
* gcc.target/powerpc/sse2-divpd-1.c: Likewise.
* gcc.target/powerpc/sse2-divsd-1.c: Likewise.
* gcc.target/powerpc/sse2-maxpd-1.c: Likewise.
* gcc.target/powerpc/sse2-maxsd-1.c: Likewise.
* gcc.target/powerpc/sse2-minpd-1.c: Likewise.
* gcc.target/powerpc/sse2-minsd-1.c: Likewise.
* gcc.target/powerpc/sse2-mmx.c: Likewise.
* gcc.target/powerpc/sse2-movhpd-1.c: Likewise.
* gcc.target/powerpc/sse2-movhpd-2.c: Likewise.
* gcc.target/powerpc/sse2-movlpd-1.c: Likewise.
* gcc.target/powerpc/sse2-movlpd-2.c: Likewise.
* gcc.target/powerpc/sse2-movmskpd-1.c: Likewise.
* gcc.target/powerpc/sse2-movq-1.c: Likewise.
* gcc.target/powerpc/sse2-movq-2.c: Likewise.
* gcc.target/powerpc/sse2-movq-3.c: Likewise.
* gcc.target/powerpc/sse2-movsd-1.c: Likewise.
* gcc.target/powerpc/sse2-movsd-2.c: Likewise.
* gcc.target/powerpc/sse2-movsd-3.c: Likewise.
* gcc.target/powerpc/sse2-mulpd-1.c: Likewise.
* gcc.target/powerpc/sse2-mulsd-1.c: Likewise.
* gcc.target/powerpc/sse2-orpd-1.c: Likewise.
* gcc.target/powerpc/sse2-packssdw-1.c: Likewise.
* gcc.target/powerpc/sse2-packsswb-1.c: Likewise.
* gcc.target/powerpc/sse2-packuswb-1.c: Likewise.
* gcc.target/powerpc/sse2-paddb-1.c: Likewise.
* gcc.target/powerpc/sse2-paddd-1.c: Likewise.
* gcc.target/powerpc/sse2-paddq-1.c: Likewise.
* gcc.target/powerpc/sse2-paddsb-1.c: Likewise.
* gcc.target/powerpc/sse2-paddsw-1.c: Likewise.
* gcc.target/powerpc/sse2-paddusb-1.c: Likewise.
* gcc.target/powerpc/sse2-paddusw-1.c: Likewise.
* gcc.target/powerpc/sse2-paddw-1.c: Likewise.
* gcc.target/powerpc/sse2-pand-1.c: Likewise.
* gcc.target/powerpc/sse2-pandn-1.c: Likewise.
* gcc.target/powerpc/sse2-pavgb-1.c: Likewise.
* gcc.target/powerpc/sse2-pavgw-1.c: Likewise.
* gcc.target/powerpc/sse2-pcmpeqb-1.c: Likewise.
* gcc.target/powerpc/sse2-pcmpeqd-1.c: Likewise.
* gcc.target/powerpc/sse2-pcmpeqw-1.c: Likewise.
* gcc.target/powerpc/sse2-pcmpgtb-1.c: Likewise.
* gcc.target/powerpc/sse2-pcmpgtd-1.c: Likewise.
* gcc.target/powerpc/sse2-pcmpgtw-1.c: Likewise.
* gcc.target/powerpc/sse2-pextrw.c: Likewise.
* gcc.target/powerpc/sse2-pinsrw.c: Likewise.
* gcc.target/powerpc/sse2-pmaddwd-1.c: Likewise.
* gcc.target/powerpc/sse2-pmaxsw-1.c: Likewise.
* gcc.target/powerpc/sse2-pmaxub-1.c: Likewise.
* gcc.target/powerpc/sse2-pminsw-1.c: Likewise.
* gcc.target/powerpc/sse2-pminub-1.c: Likewise.
* gcc.target/powerpc/sse2-pmovmskb-1.c: Likewise.
* gcc.target/powerpc/sse2-pmulhuw-1.c: Likewise.
* gcc.target/powerpc/sse2-pmulhw-1.c: Likewise.
* gcc.target/powerpc/sse2-pmullw-1.c: Likewise.
* gcc.target/powerpc/sse2-pmuludq-1.c: Likewise.
* gcc.target/powerpc/sse2-por-1.c: Likewise.
* gcc.target/powerpc/sse2-psadbw-1.c: Likewise.
* gcc.target/powerpc/sse2-pshufd-1.c: Likewise.
* gcc.target/powerpc/sse2-pshufhw-1.c: Likewise.
* gcc.target/powerpc/sse2-pshuflw-1.c: Likewise.
* gcc.target/powerpc/sse2-pslld-1.c: Likewise.
* gcc.target/powerpc/sse2-pslld-2.c: Likewise.
* gcc.target/powerpc/sse2-pslldq-1.c: Likewise.
* gcc.target/powerpc/sse2-psllq-1.c: Likewise.
* gcc.target/powerpc/sse2-psllq-2.c: Likewise.
* gcc.target/powerpc/sse2-psllw-1.c: Likewise.
* gcc.target/powerpc/sse2-psllw-2.c: Likewise.
* gcc.target/powerpc/sse2-psrad-1.c: Likewise.
* gcc.target/powerpc/sse2-psrad-2.c: Likewise.
* gcc.target/powerpc/sse2-psraw-1.c: Likewise.
* gcc.target/powerpc/sse2-psraw-2.c: Likewise.
* gcc.target/powerpc/sse2-psrld-1.c: Likewise.
* gcc.target/powerpc/sse2-psrld-2.c: Likewise.
* gcc.target/powerpc/sse2-psrldq-1.c: Likewise.
* gcc.target/powerpc/sse2-psrlq-1.c: Likewise.
* gcc.target/powerpc/sse2-psrlq-2.c: Likewise.
* gcc.target/powerpc/sse2-psrlw-1.c: Likewise.
* gcc.target/powerpc/sse2-psrlw-2.c: Likewise.
* gcc.target/powerpc/sse2-psubb-1.c: Likewise.
* gcc.target/powerpc/sse2-psubd-1.c: Likewise.
* gcc.target/powerpc/sse2-psubq-1.c: Likewise.
* gcc.target/powerpc/sse2-psubsb-1.c: Likewise.
* gcc.target/powerpc/sse2-psubsw-1.c: Likewise.
* gcc.target/powerpc/sse2-psubusb-1.c: Likewise.
* gcc.target/powerpc/sse2-psubusw-1.c: Likewise.
* gcc.target/powerpc/sse2-psubw-1.c: Likewise.
* gcc.target/powerpc/sse2-punpckhbw-1.c: Likewise.
* gcc.target/powerpc/sse2-punpckhdq-1.c: Likewise.
* gcc.target/powerpc/sse2-punpckhqdq-1.c: Likewise.
* gcc.target/powerpc/sse2-punpckhwd-1.c: Likewise.
* gcc.target/powerpc/sse2-punpcklbw-1.c: Likewise.
* gcc.target/powerpc/sse2-punpckldq-1.c: Likewise.
* gcc.target/powerpc/sse2-punpcklqdq-1.c: Likewise.
* gcc.target/powerpc/sse2-punpcklwd-1.c: Likewise.
* gcc.target/powerpc/sse2-pxor-1.c: Likewise.
* gcc.target/powerpc/sse2-shufpd-1.c: Likewise.
* gcc.target/powerpc/sse2-sqrtpd-1.c: Likewise.
* gcc.target/powerpc/sse2-subpd-1.c: Likewise.
* gcc.target/powerpc/sse2-subsd-1.c: Likewise.
* gcc.target/powerpc/sse2-ucomisd-1.c: Likewise.
* gcc.target/powerpc/sse2-ucomisd-2.c: Likewise.
* gcc.target/powerpc/sse2-ucomisd-3.c: Likewise.
* gcc.target/powerpc/sse2-ucomisd-4.c: Likewise.
* gcc.target/powerpc/sse2-ucomisd-5.c: Likewise.
* gcc.target/powerpc/sse2-ucomisd-6.c: Likewise.
* gcc.target/powerpc/sse2-unpckhpd-1.c: Likewise.
* gcc.target/powerpc/sse2-unpcklpd-1.c: Likewise.
* gcc.target/powerpc/sse2-xorpd-1.c: Likewise.
* gcc.target/powerpc/sse3-addsubpd.c: Likewise.
* gcc.target/powerpc/sse3-addsubps.c: Likewise.
* gcc.target/powerpc/sse3-haddpd.c: Likewise.
* gcc.target/powerpc/sse3-haddps.c: Likewise.
* gcc.target/powerpc/sse3-hsubpd.c: Likewise.
* gcc.target/powerpc/sse3-hsubps.c: Likewise.
* gcc.target/powerpc/sse3-lddqu.c: Likewise.
* gcc.target/powerpc/sse3-movddup.c: Likewise.
* gcc.target/powerpc/sse3-movshdup.c: Likewise.
* gcc.target/powerpc/sse3-movsldup.c: Likewise.
* gcc.target/powerpc/sse4_1-blendpd.c: Likewise.
* gcc.target/powerpc/sse4_1-blendps-2.c: Likewise.
* gcc.target/powerpc/sse4_1-blendps.c: Likewise.
* gcc.target/powerpc/sse4_1-blendvpd.c: Likewise.
* gcc.target/powerpc/sse4_1-blendvps.c: Likewise.
* gcc.target/powerpc/sse4_1-ceilpd.c: Likewise.
* gcc.target/powerpc/sse4_1-ceilps.c: Likewise.
* gcc.target/powerpc/sse4_1-ceilsd.c: Likewise.
* gcc.target/powerpc/sse4_1-ceilss.c: Likewise.
* gcc.target/powerpc/sse4_1-floorpd.c: Likewise.
* gcc.target/powerpc/sse4_1-floorps.c: Likewise.
* gcc.target/powerpc/sse4_1-floorsd.c: Likewise.
* gcc.target/powerpc/sse4_1-floorss.c: Likewise.
* gcc.target/powerpc/sse4_1-pblendvb.c: Likewise.
* gcc.target/powerpc/sse4_1-pblendw-2.c: Likewise.
* gcc.target/powerpc/sse4_1-pblendw.c: Likewise.
* gcc.target/powerpc/sse4_1-pcmpeqq.c: Likewise.
* gcc.target/powerpc/sse4_1-pinsrb.c: Likewise.
* gcc.target/powerpc/sse4_1-pinsrd.c: Likewise.
* gcc.target/powerpc/sse4_1-pinsrq.c: Likewise.
* gcc.target/powerpc/sse4_1-pmovsxbq.c: Likewise.
* gcc.target/powerpc/sse4_1-pmovsxdq.c: Likewise.
* gcc.target/powerpc/sse4_1-pmovsxwq.c: Likewise.
* gcc.target/powerpc/sse4_1-pmuldq.c: Likewise.
* gcc.target/powerpc/sse4_1-ptest-1.c: Likewise.
* gcc.target/powerpc/sse4_1-roundpd-2.c: Likewise.
* gcc.target/powerpc/sse4_1-roundpd-3.c: Likewise.
* gcc.target/powerpc/sse4_2-pcmpgtq.c: Likewise.
* gcc.target/powerpc/ssse3-pabsb.c: Likewise.
* gcc.target/powerpc/ssse3-pabsd.c: Likewise.
* gcc.target/powerpc/ssse3-pabsw.c: Likewise.
* gcc.target/powerpc/ssse3-palignr.c: Likewise.
* gcc.target/powerpc/ssse3-phaddd.c: Likewise.
* gcc.target/powerpc/ssse3-phaddsw.c: Likewise.
* gcc.target/powerpc/ssse3-phaddw.c: Likewise.
* gcc.target/powerpc/ssse3-phsubd.c: Likewise.
* gcc.target/powerpc/ssse3-phsubsw.c: Likewise.
* gcc.target/powerpc/ssse3-phsubw.c: Likewise.
* gcc.target/powerpc/ssse3-pmaddubsw.c: Likewise.
* gcc.target/powerpc/ssse3-pmulhrsw.c: Likewise.
* gcc.target/powerpc/ssse3-pshufb.c: Likewise.
* gcc.target/powerpc/ssse3-psignb.c: Likewise.
* gcc.target/powerpc/ssse3-psignd.c: Likewise.
* gcc.target/powerpc/ssse3-psignw.c: Likewise.
* gcc.target/powerpc/vec-cmp-sel.c: Likewise.
* gcc.target/powerpc/vec-sld-modulo.c: Likewise.
* gcc.target/powerpc/vec-srad-modulo.c: Likewise.
* gcc.target/powerpc/vec-srd-modulo.c: Likewise.
* gcc.target/powerpc/amo1.c: Replace powerpc_p9vector_ok with
powerpc_vsx_ok, replace -mpower9-vector with -mvsx, and add
dg-additional-options -mdejagnu-cpu=power9 if !has_arch_pwr9.
* gcc.target/powerpc/amo2.c: Likewise.
* gcc.target/powerpc/dform-1.c: Likewise.
* gcc.target/powerpc/dform-2.c: Likewise.
* gcc.target/powerpc/float128-5.c: Likewise.
* gcc.target/powerpc/float128-complex-2.c: Likewise.
* gcc.target/powerpc/float128-fma1.c: Likewise.
* gcc.target/powerpc/float128-hw.c: Likewise.
* gcc.target/powerpc/float128-hw10.c: Likewise.
* gcc.target/powerpc/float128-hw11.c: Likewise.
* gcc.target/powerpc/float128-hw2.c: Likewise.
* gcc.target/powerpc/float128-hw3.c: Likewise.
* gcc.target/powerpc/float128-hw4.c: Likewise.
* gcc.target/powerpc/float128-hw5.c: Likewise.
* gcc.target/powerpc/float128-hw6.c: Likewise.
* gcc.target/powerpc/float128-hw7.c: Likewise.
* gcc.target/powerpc/float128-hw8.c: Likewise.
* gcc.target/powerpc/float128-hw9.c: Likewise.
* gcc.target/powerpc/float128-minmax.c: Likewise.
* gcc.target/powerpc/float128-odd.c: Likewise.
* gcc.target/powerpc/float128-sqrt1.c: Likewise.
* gcc.target/powerpc/fold-vec-cmp-int.p9.c: Likewise.
* gcc.target/powerpc/gnuattr2.c: Likewise.
* gcc.target/powerpc/pr71656-1.c: Likewise.
* gcc.target/powerpc/pr71656-2.c: Likewise.
* gcc.target/powerpc/pr81959.c: Likewise.
* gcc.target/powerpc/pr82748-1.c: Likewise.
* gcc.target/powerpc/pr82748-2.c: Likewise.
* gcc.target/powerpc/pr111449-2.c: Replace powerpc_p8vector_ok
with powerpc_vsx_ok.
* gcc.target/powerpc/pr98914.c: Likewise.
* gcc.target/powerpc/versioned-copy-loop.c: Replace
powerpc_p8vector_ok with powerpc_vsx_ok and append -mvsx to
dg-options.
* gcc.target/powerpc/clone2.c: Replace powerpc_p9vector_ok with
powerpc_vsx_ok.
* gcc.target/powerpc/p9-options-1.c: Replace powerpc_p9vector_ok
with powerpc_vsx_ok, replace -mno-power9-vector with -mno-vsx.
* gcc.target/powerpc/pr84226.c: Replace powerpc_p9vector_ok with
powerpc_vsx_ok and append -mvsx to dg-options.
* g++.dg/pr69667.C: Replace powerpc_p8vector_ok with
powerpc_vsx_ok and append -mvsx to dg-options.
* gcc.dg/vect/costmodel/ppc/costmodel-slp-perm.c: Replace
powerpc_p9vector_ok with powerpc_vsx_ok and replace
-mpower9-vector with -mvsx.
* gcc.dg/vect/pr109011-1.c: Replace powerpc_p8vector_ok with
powerpc_vsx_ok, and replace -mpower8-vector with
-mdejagnu-cpu=power8 -mvsx or -mvsx under different conditions.
* gcc.dg/vect/pr109011-2.c: Replace powerpc_p9vector_ok
with powerpc_vsx_ok, and replace -mpower9-vector with
-mdejagnu-cpu=power9 -mvsx or -mvsx under different conditions.
* gcc.dg/vect/pr109011-4.c: Likewise.
* gcc.dg/vect/pr109011-3.c: Replace powerpc_p8vector_ok with
powerpc_vsx_ok, and replace -mpower8-vector -mno-power9-vector
with -mdejagnu-cpu=power8 -mvsx.
* gcc.dg/vect/pr109011-5.c: Likewise.
* gcc.target/powerpc/altivec-35.c: Remove -mno-power8-vector.
* gcc.target/powerpc/vsx-vector-7.c: Replace -mno-power8-vector
with -mdejagnu-cpu=power7.
* gcc.dg/vect/O3-pr70130.c: Replace -mcpu=power7 with options
-mdejagnu-cpu=power7 -mvsx and remove option -mno-power9-vector
-mno-power8-vector.
* gfortran.dg/vect/pr45714-b.f: Likewise.
* gcc.dg/vect/pr48765.c: Remove dg-skip-if and replace -mcpu=power7
with option -mdejagnu-cpu=power6.
* gcc.target/powerpc/pr78056-2.c: Likewise.
* gcc.target/powerpc/altivec-2-runnable.c: Replace
powerpc_p8vector_ok with powerpc_vsx_ok, remove -mpower8-vector
and add dg-additional-options -mdejagnu-cpu=power8 if !has_arch_pwr8.
* gcc.target/powerpc/altivec-37.c: Likewise.
* gcc.target/powerpc/fold-vec-abs-longlong-fwrapv.p8.c: Replace
powerpc_p8vector_ok with powerpc_vsx_ok and replace -mpower8-vector
with -mvsx.
* gcc.target/powerpc/fold-vec-abs-longlong.p8.c: Likewise.
* gcc.target/powerpc/fold-vec-cmp-char.p8.c: Likewise.
* gcc.target/powerpc/fold-vec-cmp-int.p8.c: Likewise.
* gcc.target/powerpc/fold-vec-cmp-short.p8.c: Likewise.
* gcc.target/powerpc/fold-vec-mergeeo-floatdouble.c: Likewise.
* gcc.target/powerpc/fold-vec-mergeeo-int.c: Likewise.
* gcc.target/powerpc/fold-vec-mergeeo-longlong.c: Likewise.
* gcc.target/powerpc/fold-vec-mult-int128-p8.c: Likewise.
* gcc.target/powerpc/fold-vec-neg-longlong.p8.c: Likewise.
* gcc.target/powerpc/pr104124.c: Likewise.
* gcc.target/powerpc/vec-cmpne-long.c: Likewise.
* gcc.target/powerpc/pr86731-fwrapv-longlong.c: Replace
powerpc_p8vector_ok with powerpc_vsx_ok, replace -mpower8-vector with
-mvsx and add dg-additional-options -mdejagnu-cpu=power8 if
!has_arch_pwr8.
* gcc.target/powerpc/pr80098-1.c: Replace powerpc_p9vector_ok with
powerpc_vsx_ok and replace -mno-power9-vector with -mno-vsx.
* gcc.target/powerpc/pr80098-2.c: Replace powerpc_p8vector_ok with
powerpc_vsx_ok and replace -mno-power8-vector with -mno-vsx.
* gcc.target/powerpc/pragma_misc9.c: Replace powerpc_p9vector_ok
with powerpc_vsx_ok.

17 months agoRISC-V: Upgrade RVV intrinsic version to 0.12
Pan Li [Wed, 21 Feb 2024 04:06:22 +0000 (12:06 +0800)] 
RISC-V: Upgrade RVV intrinsic version to 0.12

Upgrade the version of RVV intrinsic from 0.11 to 0.12.

PR target/114017

gcc/ChangeLog:

* config/riscv/riscv-c.cc (riscv_cpu_cpp_builtins): Upgrade
the version to 0.12.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/predef-__riscv_v_intrinsic.c: Update the
version to 0.12.
* gcc.target/riscv/rvv/base/pr114017-1.c: New test.

Signed-off-by: Pan Li <pan2.li@intel.com>
17 months agoRISC-V: Add tests for constraints "i" and "s"
Fangrui Song [Wed, 31 Jan 2024 04:41:12 +0000 (20:41 -0800)] 
RISC-V: Add tests for constraints "i" and "s"

The constraints "i" and "s" can be used with a symbol that binds
externally, e.g.
```
namespace ns { extern int var, a[4]; }
void foo() {
  asm(".pushsection .xxx,\"aw\"; .dc.a %0; .popsection" :: "s"(&ns::var));
  asm(".reloc ., BFD_RELOC_NONE, %0" :: "s"(&ns::a[3]));
}
```

gcc/testsuite/ChangeLog:

* gcc.target/riscv/asm-raw-symbol.c: New test.

17 months agoDaily bump.
GCC Administrator [Thu, 22 Feb 2024 00:18:58 +0000 (00:18 +0000)] 
Daily bump.

17 months agoUpdate cpplib de.po
Joseph Myers [Wed, 21 Feb 2024 23:26:15 +0000 (23:26 +0000)] 
Update cpplib de.po

* de.po: Update.

17 months agoRISC-V: Enable assert for insn_has_dfa_reservation
Edwin Lu [Wed, 14 Feb 2024 20:09:43 +0000 (12:09 -0800)] 
RISC-V: Enable assert for insn_has_dfa_reservation

Enables assert that every typed instruction is associated with a
dfa reservation

gcc/ChangeLog:

* config/riscv/riscv.cc (riscv_sched_variable_issue): Enable assert

Signed-off-by: Edwin Lu <ewlu@rivosinc.com>
17 months agoRISC-V: Quick and simple fixes to testcases that break due to reordering
Edwin Lu [Wed, 14 Feb 2024 20:06:38 +0000 (12:06 -0800)] 
RISC-V: Quick and simple fixes to testcases that break due to reordering

The following test cases are easily fixed with small updates to the expected
assembly order. Additionally make calling-convention testcases more robust

PR target/113249

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/vls/calling-convention-1.c:
Rearrange and adjust asm-checker times
* gcc.target/riscv/rvv/autovec/vls/calling-convention-2.c: Ditto
* gcc.target/riscv/rvv/autovec/vls/calling-convention-3.c: Ditto
* gcc.target/riscv/rvv/autovec/vls/calling-convention-4.c: Ditto
* gcc.target/riscv/rvv/autovec/vls/calling-convention-5.c: Ditto
* gcc.target/riscv/rvv/autovec/vls/calling-convention-6.c: Ditto
* gcc.target/riscv/rvv/autovec/vls/calling-convention-7.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-12.c:
Rearrange assembly
* gcc.target/riscv/rvv/base/binop_vx_constraint-16.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-17.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-19.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-21.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-23.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-25.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-27.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-29.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-31.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-33.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-35.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-4.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-40.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-44.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-8.c: Ditto
* gcc.target/riscv/rvv/base/shift_vx_constraint-1.c: Ditto
* gcc.target/riscv/rvv/vsetvl/avl_single-107.c: Change expected vsetvl

Signed-off-by: Edwin Lu <ewlu@rivosinc.com>
17 months agoRISC-V: Use default cost model for insn scheduling
Edwin Lu [Wed, 14 Feb 2024 20:04:59 +0000 (12:04 -0800)] 
RISC-V: Use default cost model for insn scheduling

Use default cost model scheduling on these test cases. All these tests
introduce scan dump failures with -mtune generic-ooo. Since the vector
cost models are the same across all three tunes, some of the tests
in PR113249 will be fixed with this patch series.

PR target/113249

gcc/testsuite/ChangeLog:

* g++.target/riscv/rvv/base/bug-1.C: Use default scheduling
* gcc.target/riscv/rvv/autovec/reduc/reduc_call-2.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-102.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-108.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-114.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-119.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-12.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-16.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-17.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-19.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-21.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-23.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-25.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-27.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-29.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-31.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-33.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-35.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-4.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-40.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-44.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-50.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-56.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-62.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-68.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-74.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-79.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-8.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-84.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-90.c: Ditto
* gcc.target/riscv/rvv/base/binop_vx_constraint-96.c: Ditto
* gcc.target/riscv/rvv/base/float-point-dynamic-frm-30.c: Ditto
* gcc.target/riscv/rvv/base/pr108185-1.c: Ditto
* gcc.target/riscv/rvv/base/pr108185-2.c: Ditto
* gcc.target/riscv/rvv/base/pr108185-3.c: Ditto
* gcc.target/riscv/rvv/base/pr108185-4.c: Ditto
* gcc.target/riscv/rvv/base/pr108185-5.c: Ditto
* gcc.target/riscv/rvv/base/pr108185-6.c: Ditto
* gcc.target/riscv/rvv/base/pr108185-7.c: Ditto
* gcc.target/riscv/rvv/base/shift_vx_constraint-1.c: Ditto
* gcc.target/riscv/rvv/vsetvl/pr111037-3.c: Ditto
* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-28.c: Ditto
* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-29.c: Ditto
* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-32.c: Ditto
* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-33.c: Ditto
* gcc.target/riscv/rvv/vsetvl/vlmax_single_block-17.c: Ditto
* gcc.target/riscv/rvv/vsetvl/vlmax_single_block-18.c: Ditto
* gcc.target/riscv/rvv/vsetvl/vlmax_single_block-19.c: Ditto
* gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-10.c: Ditto
* gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-11.c: Ditto
* gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-12.c: Ditto
* gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-4.c: Ditto
* gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-5.c: Ditto
* gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-6.c: Ditto
* gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-7.c: Ditto
* gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-8.c: Ditto
* gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-9.c: Ditto
* gfortran.dg/vect/vect-8.f90: Ditto

Signed-off-by: Edwin Lu <ewlu@rivosinc.com>
17 months agoRISC-V: Add vector related pipelines
Edwin Lu [Wed, 14 Feb 2024 20:03:37 +0000 (12:03 -0800)] 
RISC-V: Add vector related pipelines

Creates new generic vector pipeline file common to all cpu tunes.
Moves all vector related pipelines from generic-ooo to generic-vector-ooo.
Creates new vector crypto related insn reservations.

gcc/ChangeLog:

* config/riscv/generic-ooo.md (generic_ooo): Move reservation
(generic_ooo_vec_load): Ditto
(generic_ooo_vec_store): Ditto
(generic_ooo_vec_loadstore_seg): Ditto
(generic_ooo_vec_alu): Ditto
(generic_ooo_vec_fcmp): Ditto
(generic_ooo_vec_imul): Ditto
(generic_ooo_vec_fadd): Ditto
(generic_ooo_vec_fmul): Ditto
(generic_ooo_crypto): Ditto
(generic_ooo_perm): Ditto
(generic_ooo_vec_reduction): Ditto
(generic_ooo_vec_ordered_reduction): Ditto
(generic_ooo_vec_idiv): Ditto
(generic_ooo_vec_float_divsqrt): Ditto
(generic_ooo_vec_mask): Ditto
(generic_ooo_vec_vesetvl): Ditto
(generic_ooo_vec_setrm): Ditto
(generic_ooo_vec_readlen): Ditto
* config/riscv/riscv.md: Include generic-vector-ooo
* config/riscv/generic-vector-ooo.md: New file. To here

Signed-off-by: Edwin Lu <ewlu@rivosinc.com>
Co-authored-by: Robin Dapp <rdapp.gcc@gmail.com>
17 months agoRISC-V: Add non-vector types to dfa pipelines
Edwin Lu [Wed, 14 Feb 2024 20:01:22 +0000 (12:01 -0800)] 
RISC-V: Add non-vector types to dfa pipelines

This patch adds non-vector related insn reservations and updates/creates
new insn reservations so all non-vector typed instructions have a reservation.

gcc/ChangeLog:

* config/riscv/generic-ooo.md (generic_ooo_sfb_alu): Add reservation
(generic_ooo_branch): Ditto
* config/riscv/generic.md (generic_sfb_alu): Ditto
(generic_fmul_half): Ditto
* config/riscv/riscv.md: Remove cbo, pushpop, and rdfrm types
* config/riscv/sifive-7.md (sifive_7_hfma): Add reservation
(sifive_7_popcount): Ditto
* config/riscv/sifive-p400.md (sifive_p400_clmul): Ditto
* config/riscv/sifive-p600.md (sifive_p600_clmul): Ditto
* config/riscv/vector.md: Change rdfrm to fmove
* config/riscv/zc.md: Change pushpop to load/store

Signed-off-by: Edwin Lu <ewlu@rivosinc.com>
17 months agodoc: Fix typos in -Wmismatched-dealloc docs
Jonathan Wakely [Wed, 21 Feb 2024 18:01:09 +0000 (18:01 +0000)] 
doc: Fix typos in -Wmismatched-dealloc docs

gcc/ChangeLog:

* doc/invoke.texi (Warning Options): Fix typos.

17 months agoRISC-V: Specify mtune and march for PR113742
Edwin Lu [Tue, 20 Feb 2024 21:53:40 +0000 (13:53 -0800)] 
RISC-V: Specify mtune and march for PR113742

The testcase pr113742.c is failing for 32 bit targets due to the following cc1
error:
cc1: error: ABI requries '-march=rv64'

Specify '-march=rv64gc' with '-mtune=sifive-p600-series'

PR target/113742

gcc/testsuite/ChangeLog:

* gcc.target/riscv/pr113742.c: change mcpu to mtune and add march

Signed-off-by: Edwin Lu <ewlu@rivosinc.com>
17 months agobpf: add inline memmove and memcpy expansion
David Faust [Tue, 20 Feb 2024 22:48:33 +0000 (14:48 -0800)] 
bpf: add inline memmove and memcpy expansion

BPF programs are not typically linked, which means we cannot fall back
on library calls to implement __builtin_{memmove,memcpy} and should
always expand them inline if possible.

GCC already successfully expands these builtins inline in many cases,
but failed to do so for a few for simple cases involving overlapping
memmove in the kernel BPF selftests and was instead emitting a libcall.

This patch implements a simple inline expansion of memcpy and memmove in
the BPF backend in a verifier-friendly way, with the caveat that the
size must be an integer constant, which is also required by clang.

gcc/

* config/bpf/bpf-protos.h (bpf_expand_cpymem): New.
* config/bpf/bpf.cc: (emit_move_loop, bpf_expand_cpymem): New.
* config/bpf/bpf.md: (cpymemdi, movmemdi): New define_expands.

gcc/testsuite/

* gcc.target/bpf/memcpy-1.c: New test.
* gcc.target/bpf/memmove-1.c: New test.
* gcc.target/bpf/memmove-2.c: New test.

17 months agoPR modula2/114026 Incorrect location during for loop type checking
Gaius Mulley [Wed, 21 Feb 2024 16:21:05 +0000 (16:21 +0000)] 
PR modula2/114026 Incorrect location during for loop type checking

If a for loop contains an incompatible type expression between the
designator and the second expression then the location
used when generating the error message is set to token 0.
The bug is fixed by extending the range checking
InitForLoopBeginRangeCheck.  The range checking is processed after
all types, constants have been resolved (and converted into gcc
trees).  The range check will check for assignment compatibility
between des and expr1, expression compatibility between des and expr2.
Separate token positions for des, exp1, expr2 and by are stored in the
Range record and used to create virtual tokens if they are on the same
source line.

gcc/m2/ChangeLog:

PR modula2/114026
* gm2-compiler/M2GenGCC.mod (Import): Remove DisplayQuadruples.
Remove DisplayQuadList.
(MixTypesBinary): Replace check with overflowCheck.
New variable typeChecking.
Use GenQuadOTypetok to retrieve typeChecking.
Use typeChecking to suppress error message.
* gm2-compiler/M2LexBuf.def (MakeVirtual2Tok): New procedure
function.
* gm2-compiler/M2LexBuf.mod (MakeVirtualTok): Improve comment.
(MakeVirtual2Tok): New procedure function.
* gm2-compiler/M2Quads.def (GetQuadOTypetok): New procedure.
* gm2-compiler/M2Quads.mod (QuadFrame): New field CheckType.
(PutQuadO): Rewrite using PutQuadOType.
(PutQuadOType): New procedure.
(GetQuadOTypetok): New procedure.
(BuildPseudoBy): Rewrite.
(BuildForToByDo): Remove type checking.
Add parameters e2, e2tok, BySym, bytok to
InitForLoopBeginRange.
Push the RangeId.
(BuildEndFor): Pop the RangeId.
Use GenQuadOTypetok to generate AddOp without type checking.
Call PutRangeForIncrement with the RangeId and IncQuad.
(GenQuadOtok): Rewrite using GenQuadOTypetok.
(GenQuadOTypetok): New procedure.
* gm2-compiler/M2Range.def (InitForLoopBeginRangeCheck):
Rename d as des, e as expr.
Add expr1, expr1tok, expr2, expr2tok, byconst, byconsttok
parameters.
(PutRangeForIncrement): New procedure.
* gm2-compiler/M2Range.mod (Import): MakeVirtual2Tok.
(Range): Add expr2, byconst, destok, exprtok, expr2tok,
incrementquad.
(InitRange): Initialize expr2 to NulSym.
Initialize byconst to NulSym.
Initialize tokenNo, destok, exprtok, expr2tok, byconst to
UnknownTokenNo.
Initialize incrementquad to 0.
(PutRangeForIncrement): New procedure.
(PutRangeDesExpr2): New procedure.
(InitForLoopBeginRangeCheck): Rewrite.
(ForLoopBeginTypeCompatible): New procedure function.
(CodeForLoopBegin): Call ForLoopBeginTypeCompatible and
only code the for loop assignment if all the type checks
succeed.

gcc/testsuite/ChangeLog:

PR modula2/114026
* gm2/extensions/run/pass/callingc10.mod: New test.
* gm2/extensions/run/pass/callingc11.mod: New test.
* gm2/extensions/run/pass/callingc9.mod: New test.
* gm2/extensions/run/pass/strconst.def: New test.
* gm2/pim/fail/forloop.mod: New test.
* gm2/pim/pass/forloop2.mod: New test.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
17 months agoipa: Convert lattices from pure array to vector (PR 113476)
Martin Jambor [Wed, 21 Feb 2024 14:43:13 +0000 (15:43 +0100)] 
ipa: Convert lattices from pure array to vector (PR 113476)

In PR 113476 we have discovered that ipcp_param_lattices is no longer
a POD and should be destructed.  In a follow-up discussion it
transpired that their initialization done by memsetting their backing
memory to zero is also invalid because now any write there before
construction can be considered dead.  Plus that having them in an
array is a little bit old-school and does not get the extra checking
offered by vector along with automatic construction and destruction
when necessary.

So this patch converts the array to a vector.  That however means that
ipcp_param_lattices cannot be just a forward declared type but must be
known to all code that deals with ipa_node_params and thus to all code
that includes ipa-prop.h.  Therefore I have moved ipcp_param_lattices
and the type it depends on to a new header ipa-cp.h which now
ipa-prop.h depends on.  Because we have the (IMHO not a very wise)
rule that headers don't include what they need themselves, I had to
add inclusions of ipa-cp.h and sreal.h (on which it depends) to very
many files, which made the patch rather ugly.

gcc/lto/ChangeLog:

2024-02-16  Martin Jambor  <mjambor@suse.cz>

PR ipa/113476
* lto-common.cc: Include sreal.h and ipa-cp.h.
* lto-partition.cc: Include ipa-cp.h, move inclusion of sreal higher.
* lto.cc: Include sreal.h and ipa-cp.h.

gcc/ChangeLog:

2024-02-16  Martin Jambor  <mjambor@suse.cz>

PR ipa/113476
* ipa-prop.h (ipa_node_params): Convert lattices to a vector, adjust
initializers in the contructor.
(ipa_node_params::~ipa_node_params): Release lattices as a vector.
* ipa-cp.h: New file.
* ipa-cp.cc: Include sreal.h and ipa-cp.h.
(ipcp_value_source): Move to ipa-cp.h.
(ipcp_value_base): Likewise.
(ipcp_value): Likewise.
(ipcp_lattice): Likewise.
(ipcp_agg_lattice): Likewise.
(ipcp_bits_lattice): Likewise.
(ipcp_vr_lattice): Likewise.
(ipcp_param_lattices): Likewise.
(ipa_get_parm_lattices): Remove assert latticess is non-NULL.
(ipa_value_from_jfunc): Adjust a check for empty lattices.
(ipa_context_from_jfunc): Likewise.
(ipa_agg_value_from_jfunc): Likewise.
(merge_agg_lats_step): Do not memset new aggregate lattices to zero.
(ipcp_propagate_stage): Allocate lattices in a vector as opposed to
just in contiguous memory.
(ipcp_store_vr_results): Adjust a check for empty lattices.
* auto-profile.cc: Include sreal.h and ipa-cp.h.
* cgraph.cc: Likewise.
* cgraphclones.cc: Likewise.
* cgraphunit.cc: Likewise.
* config/aarch64/aarch64.cc: Likewise.
* config/i386/i386-builtins.cc: Likewise.
* config/i386/i386-expand.cc: Likewise.
* config/i386/i386-features.cc: Likewise.
* config/i386/i386-options.cc: Likewise.
* config/i386/i386.cc: Likewise.
* config/rs6000/rs6000.cc: Likewise.
* config/s390/s390.cc: Likewise.
* gengtype.cc (open_base_files): Added sreal.h and ipa-cp.h to the
files to be included in gtype-desc.cc.
* gimple-range-fold.cc: Include sreal.h and ipa-cp.h.
* ipa-devirt.cc: Likewise.
* ipa-fnsummary.cc: Likewise.
* ipa-icf.cc: Likewise.
* ipa-inline-analysis.cc: Likewise.
* ipa-inline-transform.cc: Likewise.
* ipa-inline.cc: Include ipa-cp.h, move inclusion of sreal.h higher.
* ipa-modref.cc: Include sreal.h and ipa-cp.h.
* ipa-param-manipulation.cc: Likewise.
* ipa-predicate.cc: Likewise.
* ipa-profile.cc: Likewise.
* ipa-prop.cc: Likewise.
(ipa_node_params_t::duplicate): Assert new lattices remain empty
instead of setting them to NULL.
* ipa-pure-const.cc: Include sreal.h and ipa-cp.h.
* ipa-split.cc: Likewise.
* ipa-sra.cc: Likewise.
* ipa-strub.cc: Likewise.
* ipa-utils.cc: Likewise.
* ipa.cc: Likewise.
* toplev.cc: Likewise.
* tree-ssa-ccp.cc: Likewise.
* tree-ssa-sccvn.cc: Likewise.
* tree-vrp.cc: Likewise.

17 months agoUpdate copyright years.
Sahil Yeole [Thu, 15 Feb 2024 20:48:44 +0000 (02:18 +0530)] 
Update copyright years.

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>
17 months agogccrs: Add variadic check on function params
0xn4utilus [Wed, 14 Feb 2024 16:49:15 +0000 (22:19 +0530)] 
gccrs: Add variadic check on function params

gcc/rust/ChangeLog:

* checks/errors/rust-ast-validation.cc (ASTValidation::visit):
Add variadic check on all parameters.

gcc/testsuite/ChangeLog:

* rust/compile/issue-2850.rs: New test.

Signed-off-by: 0xn4utilus <gyanendrabanjare8@gmail.com>
17 months agogccrs: Fix lookup of TuplePattern sub-pattern types
Owen Avery [Mon, 12 Feb 2024 23:20:19 +0000 (18:20 -0500)] 
gccrs: Fix lookup of TuplePattern sub-pattern types

gcc/rust/ChangeLog:

* backend/rust-compile-pattern.cc
(CompilePatternLet::visit):
Lookup type of sub-pattern, not tuple pattern itself.

gcc/testsuite/ChangeLog:

* rust/compile/issue-2847-b.rs: New test.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
17 months agogccrs: add powi intrinsics
Marc Poulhiès [Sun, 22 Oct 2023 16:52:22 +0000 (18:52 +0200)] 
gccrs: add powi intrinsics

gcc/rust/ChangeLog:

* backend/rust-builtins.cc
(BuiltinsContext::register_rust_mappings): Add powi and reformat.
* backend/rust-builtins.h: Add missing copyright header.

gcc/testsuite/ChangeLog:

* rust/compile/torture/intrinsics-math.rs: Adjust pow test, add
test for powi.

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
17 months agogccrs: Add testcase for #[rustc_const_stable]
Arthur Cohen [Wed, 7 Feb 2024 08:27:11 +0000 (09:27 +0100)] 
gccrs: Add testcase for #[rustc_const_stable]

To ensure we don't introduce regressions back to issue #2314

gcc/testsuite/ChangeLog:

* rust/compile/rustc_const_stable.rs: New test.

17 months agogccrs: expand: Fix formatting for "macro not found" error
Arthur Cohen [Tue, 6 Feb 2024 16:26:23 +0000 (17:26 +0100)] 
gccrs: expand: Fix formatting for "macro not found" error

gcc/rust/ChangeLog:

* expand/rust-macro-expand.h (struct MacroExpander): Nitpick: fix
formatting of emitted error.

17 months agogccrs: Fix rebinding imports
Owen Avery [Wed, 21 Jun 2023 14:26:30 +0000 (10:26 -0400)] 
gccrs: Fix rebinding imports

gcc/rust/ChangeLog:

* resolve/rust-ast-resolve-item.cc
(flatten_glob): Use Import class.
(flatten_rebind): Likewise.
(flatten_list): Likewise.
(flatten): Likewise.
(flatten_use_dec_to_paths): Likewise.
(flatten_use_dec_to_imports): Likewise.
(ResolveItem::visit): Likewise.
(Import::add_prefix): New.
(rust_flatten_nested_glob): Adjust test.
(rust_flatten_glob): Likewise.
(rust_flatten_rebind_none): Likewise.
(rust_flatten_rebind): Likewise.
(rust_flatten_rebind_nested): Likewise.
(rust_flatten_list): Likewise.
* resolve/rust-ast-resolve-item.h
(class Import): New.

gcc/testsuite/ChangeLog:

* rust/compile/use_2.rs: New test.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
17 months agogccrs: Add testcase for matches!() macro
Arthur Cohen [Tue, 6 Feb 2024 16:01:46 +0000 (17:01 +0100)] 
gccrs: Add testcase for matches!() macro

This adds a testcase for issue #2129.

gcc/testsuite/ChangeLog:

* rust/execute/torture/matches_macro.rs: New test.

17 months agogccrs: Fix typo in RegionConstraints instance
Arthur Cohen [Wed, 7 Feb 2024 14:42:18 +0000 (15:42 +0100)] 
gccrs: Fix typo in RegionConstraints instance

gcc/rust/ChangeLog:

* typecheck/rust-hir-type-check-implitem.h: Fix typo in field
(region_costraints -> region_constraints).

17 months agoAArch64: remove ls64 from being mandatory on armv8.7-a..
Tamar Christina [Wed, 21 Feb 2024 11:42:53 +0000 (11:42 +0000)] 
AArch64: remove ls64 from being mandatory on armv8.7-a..

The Arm Architectural Reference Manual (Version J.a, section A2.9 on FEAT_LS64)
shows that ls64 is an optional extensions and should not be enabled by default
for Armv8.7-a.

This drops it from the mandatory bits for the architecture and brings GCC inline
with LLVM and the achitecture.

Note that we will not be changing binutils to preserve compatibility with older
released compilers.

gcc/ChangeLog:

* config/aarch64/aarch64-arches.def (AARCH64_ARCH): Remove LS64 from
Armv8.7-a.

gcc/testsuite/ChangeLog:

* g++.target/aarch64/acle/ls64.C: Add +ls64.
* g++.target/aarch64/acle/ls64_lto.C: Likewise.
* gcc.target/aarch64/acle/ls64_lto.c: Likewise.
* gcc.target/aarch64/acle/pr110100.c: Likewise.
* gcc.target/aarch64/acle/pr110132.c: Likewise.
* gcc.target/aarch64/options_set_28.c: Drop check for nols64.
* gcc.target/aarch64/pragma_cpp_predefs_2.c: Correct header checks.

17 months agoAArch64: skip modes_1.f90 [PR107071]
Tamar Christina [Wed, 21 Feb 2024 11:42:13 +0000 (11:42 +0000)] 
AArch64: skip modes_1.f90 [PR107071]

This test has never worked on AArch64 since the day it was committed.  It has
a number of issues that prevent it from working on AArch64:

The testfailures seem to be known and triaged, so until that's fixed there's
no point in running this test.

gcc/testsuite/ChangeLog:

PR fortran/107071
* gfortran.dg/ieee/modes_1.f90: skip aarch64, arm.

17 months agoaarch64: More SME vs -mtrack-speculation
Richard Sandiford [Wed, 21 Feb 2024 11:12:29 +0000 (11:12 +0000)] 
aarch64: More SME vs -mtrack-speculation

The sequence to commit a lazy save includes a branch based on
whether TPIDR2_EL0 is zero.  The code assumed that CBZ could
be used for this, but that instruction is forbidden when
-mtrack-speculation is being used.

gcc/
* config/aarch64/aarch64.cc (aarch64_mode_emit_local_sme_state):
Use aarch64_gen_compare_zero_and_branch rather than emitting
a CBZ directly.

gcc/testsuite/
* gcc.target/aarch64/sme/locally_streaming_1_ts.c: New test.
* gcc.target/aarch64/sme/sibcall_7_ts.c: Likewise.

17 months agoaarch64: Remove duplicated call
Richard Sandiford [Wed, 21 Feb 2024 11:12:29 +0000 (11:12 +0000)] 
aarch64: Remove duplicated call

I noticed while working on another patch that we had a duplicated
call to aarch64_process_target_attr.

gcc/
* config/aarch64/aarch64.cc (aarch64_option_valid_attribute_p):
Remove duplicated call.

17 months agoaarch64: Fix sibcalls involving shared-ZT0 functions
Richard Sandiford [Wed, 21 Feb 2024 11:12:28 +0000 (11:12 +0000)] 
aarch64: Fix sibcalls involving shared-ZT0 functions

In:

  void bar() __arm_inout("za");
  void foo() __arm_inout("za", "zt0") { bar(); }

foo cannot tail-call bar because foo needs to restore ZT0 after
the call.  I'd forgotten to update the ok_for_sibcall rules
to handle this when adding SME2.

Thanks to Sander de Smalen for the spot.

gcc/
* config/aarch64/aarch64.cc (aarch64_function_ok_for_sibcall):
Check that each individual piece of state is shared in the same
way, rather than using an aggregate check for PSTATE.ZA.

gcc/testsuite/
* gcc.target/aarch64/sme/sibcall_9.c: New test.

17 months agoaarch64: Ensure ZT0 is zeroed in a new-ZT0 function
Richard Sandiford [Wed, 21 Feb 2024 11:12:28 +0000 (11:12 +0000)] 
aarch64: Ensure ZT0 is zeroed in a new-ZT0 function

ACLE guarantees that a function like:

  __arm_new("zt0") foo() { ... }

will start with ZT0 equal to zero.  I'd forgotten to enforce that
after commiting a lazy save.  After such a save, we should zero
ZA iff the function has ZA state and zero ZT0 iff the function
has ZT0 state.

gcc/
* config/aarch64/aarch64.cc (aarch64_mode_emit_local_sme_state):
In the code that commits a lazy save, only zero ZA if the function
has ZA state.  Similarly zero ZT0 if the function has ZT0 state.

gcc/testsuite/
* gcc.target/aarch64/sme/zt0_state_5.c (test3): Expect ZT0 rather
than ZA to be zeroed.
(test5): Remove zeroing of ZA.