]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
8 months agolibcpp: add .c++-header-unit target
Jason Merrill [Wed, 5 Jun 2024 01:15:02 +0000 (21:15 -0400)] 
libcpp: add .c++-header-unit target

The dependency output for header unit modules is based on the absolute
pathname of the header file, but that's not something that a makefile can
portably refer to.  This patch adds a .c++-header-unit target based on the
header name relative to an element of the include path.

libcpp/ChangeLog:

* internal.h (_cpp_get_file_dir): Declare.
* files.cc (_cpp_get_file_dir): New fn.
* mkdeps.cc (make_write): Use it.

gcc/testsuite/ChangeLog:

* g++.dg/modules/dep-4.H: New test.

8 months agotestsuite: Fix pr101145inf*.c testcases [PR117494]
Andrew Pinski [Sun, 17 Nov 2024 21:40:22 +0000 (13:40 -0800)] 
testsuite: Fix pr101145inf*.c testcases [PR117494]

Instead of doing a dg-run with a specific target check for linux.
Use signal as the effective-target since this requires the use
of ALARM signal to do the testing.
Also use check_vect in the main and renames main to main1 to make sure
we don't use the registers.

Tested on x86_64-linux-gnu.

PR testsuite/117494
gcc/testsuite/ChangeLog:

* gcc.dg/vect/pr101145inf.c: Remove dg-do and replace
with dg-require-effective-target of signal.
* gcc.dg/vect/pr101145inf_1.c: Likewise.
* gcc.dg/vect/pr101145inf.inc: Rename main to main1
and mark as noinline.
Include tree-vect.h. Have main call check_vect and main1.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
8 months agolibstdc++: Update reference to Angelika Langer's article
Gerald Pfeifer [Mon, 18 Nov 2024 07:33:49 +0000 (08:33 +0100)] 
libstdc++: Update reference to Angelika Langer's article

libstdc++-v3:
* doc/xml/manual/allocator.xml: Update reference to Angelika
Langer's article.
* doc/html/manual/memory.html: Regenerate.

8 months agoImprove ext-dce's ability to eliminate more extensions
Jeff Law [Sun, 17 Nov 2024 23:44:09 +0000 (16:44 -0700)] 
Improve ext-dce's ability to eliminate more extensions

I was looking at a regression in ext-dce's behavior just before Cauldron.
Essentially a bugfix in ext-dce ended up causing us to fail to eliminate some
useless extensions.

When we have a SUBREG object with SUBREG_PROMOTED_VAR* flags set, we generally
have to be more conservative in how we process bit group liveness, making bits
live that wouldn't obviously be live otherwise.

That's not always necessary though. For example, if we're storing a promoted
subreg into memory, we may not care about those extra live bits on this
instance of the subreg object (remember subregs are not shared!).  Essentially
if the mode of the memory reference is not wider than the mode of the inner
REG, then we can clear the promoted state which in turn may allow more
extension elimination.

So at the start of ext-dce we do a simple pass over the IL and remove promoted
subreg state when it's obviously safe to do so (memory stores when the modes
allow it).  That prevents extra bits from being live and ultimately allows us
to remove more useless extensions.

The testcase is in theory generic, but many targets won't have an opportunity
to optimize this case.  So rather then build out a large inclusion/exclusion
list, I've just made the test risc-v specific.

Bootstrapped and regression tested on aarch64, riscv64, s390x, etc in my tester.

gcc/
* ext-dce.cc (maybe_clear_subreg_promoted_p): New function.
(ext_dce_execute): Call it.

gcc/testsuite
* gcc.target/riscv/ext-dce-1.c: New test.

8 months agoAlpha: Remove leftover `;;' for "unaligned_store<mode>"
Maciej W. Rozycki [Mon, 18 Nov 2024 03:02:59 +0000 (03:02 +0000)] 
Alpha: Remove leftover `;;' for "unaligned_store<mode>"

Remove stray `;;' from the middle of the introductory comment for the
"unaligned_store<mode>" expander, clearly a leftover from a previous
edition.

gcc/
* config/alpha/alpha.md (unaligned_store<mode>): Remove stray
`;;'.

8 months agohppa: Update install documentation
John David Anglin [Mon, 18 Nov 2024 01:37:53 +0000 (20:37 -0500)] 
hppa: Update install documentation

2024-11-17  John David Anglin  <danglin@gcc.gnu.org>

gcc/ChangeLog:

PR target/69374
* doc/install.texi (Specific) <hppa*-hp-hpux11>: Update anchor
and heading to reflect removal of 32-bit hppa support on HP-UX.
Trim 32-bit related text.

8 months agoDaily bump.
GCC Administrator [Mon, 18 Nov 2024 00:17:28 +0000 (00:17 +0000)] 
Daily bump.

8 months agoc++: regenerate opt urls
Jason Merrill [Sun, 17 Nov 2024 19:42:09 +0000 (20:42 +0100)] 
c++: regenerate opt urls

This should have been part of r15-5367.  One day I'll remember to do this
before buildbot sends me hate mail.

gcc/c-family/ChangeLog:

* c.opt.urls: Regenerate.

8 months agohppa: Remove typedef for bool type
John David Anglin [Sun, 17 Nov 2024 19:42:39 +0000 (14:42 -0500)] 
hppa: Remove typedef for bool type

In C23, bool is now a keyword.  So, doing a typedef for it is invalid.

2024-11-17  John David Anglin  <danglin@gcc.gnu.org>

libgcc/ChangeLog:

PR target/117627
* config/pa/linux-atomic.c: Remove typedef for bool type.

8 months agoc: Implement -Wdeprecated-non-prototype
Florian Weimer [Sun, 17 Nov 2024 18:42:33 +0000 (19:42 +0100)] 
c: Implement -Wdeprecated-non-prototype

This warning covers the C23 incompibilities resulting from using
() as parameter lists in function declarations.

The warning name comes from Clang.  The implementation is not
perfect because GCC treats these two declarations as equivalent:

  void f ();
  void f (not_a_type);

This is a bit confusing because they are clearly visually distinct.
However, as of GCC 14, the second form is an error by default, so
treating both the same as far as  -Wdeprecated-non-prototype does
not seem so bad from a user experience view.

gcc/c-family/

PR c/95445
* c-opts.cc (c_common_post_options): Initialize
warn_deprecated_non_prototype.
* c.opt (Wdeprecated-non-prototype): New option.
* c.opt.urls: Regenerate.

gcc/c/

PR c/95445
* c-decl.cc (start_function): Warn about parameters
after parameter-less declaration.
* c-typeck.cc (build_function_call_vec): Pass fntype
to convert_arguments.
(convert_arguments): Change argument to fntype and
compute typelist.  Warn about parameter list mismatches
on first parameter.

gcc/

PR c/95445
* doc/invoke.texi: Document -Wdeprecated-non-prototype.

gcc/testsuite/

PR c/95445
* gcc.dg/Wdeprecated-non-prototype-1.c: New test.
* gcc.dg/Wdeprecated-non-prototype-2.c: New test.
* gcc.dg/Wdeprecated-non-prototype-3.c: New test.
* gcc.dg/Wdeprecated-non-prototype-4.c: New test.

8 months agoc++: -M and modules again
Jason Merrill [Sat, 16 Nov 2024 20:25:04 +0000 (15:25 -0500)] 
c++: -M and modules again

While experimenting with testing module std I noticed that gcc -M broke on
it; it seems I need to set directives_only even sooner than I did in
r15-4219.

gcc/c-family/ChangeLog:

* c-ppoutput.cc (preprocess_file): Don't set directives_only here.

gcc/cp/ChangeLog:

* module.cc (module_preprocess_options): Set directives_only here.

8 months agoc-family: add -fsearch-include-path
Jason Merrill [Fri, 17 May 2024 01:43:20 +0000 (21:43 -0400)] 
c-family: add -fsearch-include-path

The C++ modules code has a -fmodule-header (or -x c++-{user,system}-header)
option to specify looking up headers to compile to header units on the usual
include paths.  I'd like to have the same functionality for full C++20
modules such as module std, which I proposed to live on the include path at
bits/std.cc.  But this behavior doesn't seem necessarily connected to
modules, so I'm proposing a general C/C++ option to specify the behavior of
looking in the include path for the input files specified on the command
line.

Other ideas for the name of the option are very welcome.

The libcpp change is to allow -fsearch-include-path{,=user} to find files in
the current working directory, like -include.  This can be handy for a quick
compile of both std.cc and a file that imports it, e.g.

g++ -std=c++20 -fmodules -fsearch-include-path bits/std.cc importer.cc

gcc/ChangeLog:

* doc/cppopts.texi: Document -fsearch-include-path.
* doc/invoke.texi: Mention it for modules.

gcc/c-family/ChangeLog:

* c.opt: Add -fsearch-include-path.
* c-opts.cc (c_common_post_options): Handle it.

gcc/cp/ChangeLog:

* module.cc (module_preprocess_options): Don't override it.

libcpp/ChangeLog:

* internal.h (search_path_head): Declare.
* files.cc (search_path_head): No longer static.
* init.cc (cpp_read_main_file): Use it.

8 months agolibstdc++: add module std [PR106852]
Jason Merrill [Thu, 10 Oct 2024 21:27:50 +0000 (17:27 -0400)] 
libstdc++: add module std [PR106852]

This patch introduces an installed source form of module std and std.compat.
To help a build system find them, we install a libstdc++.modules.json file
alongside libstdc++.so, which tells the build system where the files are and
any special flags it should use when compiling them (none, in this case).
The format is from a proposal in SG15.  The build system can find this file
with 'gcc -print-file-name=libstdc++.modules.json'.

It seems preferable to use a relative path from this file to the sources so
that moving the installation doesn't break the reference, but I didn't see
any obvious way to compute that without relying on coreutils, perl, or
python, so I wrote a POSIX shell script for it.  The .. canonicalization
bits aren't necessary since I discovered $(abspath), but I guess I might as
well leave them in.

Currently this installs the sources under $(gxx_include_dir)/bits/,
i.e. /usr/include/c++/15/bits.  So with my -fsearch-include-path change,
std.cc can be compiled with g++ -fsearch-include-path bits/std.cc.  Note
that if someone actually tries to #include <bits/std.cc> it will fail with
"error: module control-line cannot be in included file".

Any ideas about a more user-friendly way to express "compile module std" are
welcome.

The sources currently have the extension .cc, like other source files.

std.cc started with m.cencora's implementation in PR114600.  I've made some
adjustments, but more is probably desirable, e.g. of the <algorithm>
handling of namespace ranges, and to remove exports of templates that are
only specialized in a particular header.  I've filled in a bunch of missing
exports, and added some FIXMEs where I noticed bits that are not implemented
yet.

Since bits/stdc++.h also intends to include the whole standard library, I
include it rather than duplicate it.  But stdc++.h comments out <execution>,
due to TBB issues; I include it separately and suppress TBB usage, so module
std won't currently provide parallel execution.

It seemed most convenient for the two files to be monolithic so we don't
need to worry about include paths.  So the C library names that module
std.compat exports in both namespace std and :: are a block of code that is
appended to both files, adjusted based on whether the macro STD_COMPAT is
defined before the block.

In this implementation std.compat imports std; it would also be valid for it
to duplicate everything in std.  I see the libc++ std.compat also imports
std.

As discussed in the PR, module std is supported in C++20 mode even though it
was added in C++23.

Changes to test module std will follow in a separate patch.  In my testing
I've noticed a few compiler bugs that break various testcases, so I don't
expect to enable module std testing by default at first.

PR libstdc++/106852

libstdc++-v3/ChangeLog:

* include/bits/version.def: Add __cpp_lib_modules.
* include/bits/version.h: Regenerate.
* src/c++23/Makefile.am: Add modules std and std.compat.
* src/c++23/Makefile.in: Regenerate.
* src/c++23/std-clib.cc.in: New file.
* src/c++23/std.cc.in: New file.
* src/c++23/std.compat.cc.in: New file.
* src/c++23/libstdc++.modules.json.in: New file.

contrib/ChangeLog:

* relpath.sh: New file.

8 months agoMark asm statements as necessary in ipa-fnsummary
Jan Hubicka [Sun, 17 Nov 2024 14:48:29 +0000 (15:48 +0100)] 
Mark asm statements as necessary in ipa-fnsummary

I forgot to mark asm statements as necessary in ipa-fnsummary. This should
mask failure of gcc.dg/guality/pr36728-2.c where the patch enabled
cloning which breaks debug info.

gcc/ChangeLog:

* ipa-fnsummary.cc (find_necessary_statements): ASM statements are
necessary.

8 months agolibstdc++: Move a gcc.gnu.org link to https
Gerald Pfeifer [Sun, 17 Nov 2024 11:36:29 +0000 (12:36 +0100)] 
libstdc++: Move a gcc.gnu.org link to https

libstdc++-v3:
* doc/xml/manual/intro.xml: Move a gcc.gnu.org link to https.
* doc/html/manual/license.html: Regenerate.

8 months agolibstdc++: Update link to Angelika Langer's book
Gerald Pfeifer [Sun, 17 Nov 2024 11:05:36 +0000 (12:05 +0100)] 
libstdc++: Update link to Angelika Langer's book

libstdc++-v3:
* doc/xml/manual/io.xml: Update link to Angelika Langer's book.
* doc/html/manual/streambufs.html: Regenerate.

8 months agoipa-modref bits for unsequenced and reproducible
Jan Hubicka [Sun, 17 Nov 2024 10:54:10 +0000 (11:54 +0100)] 
ipa-modref bits for unsequenced and reproducible

C attributes reproducible and unsequenced implies that calling function twice
leads to same effect if parameters are otherwise unchanged (function call
itself does not count).  This is bit bit stronger that modref's notion of
nondeterminism that says that same inputs will yield same outputs (function
call itself does count).

This patch makes reproducible/unsequenced imply determinism and cleans up
determinism handling.  By itself it is not useful, since we can not make use of it
unless we know what are the inputs/outputs of the function which I plan to handle
by the "fn spec" attribute.

gcc/ChangeLog:

* ipa-modref.cc (modref_summary::useful_p): const/pure implies
determinism.
(modref_summary_lto::useful_p): Likewise.
(ignore_nondeterminism_p): Add CALLEE_FNTYPE parameter; check for
reproducible/unsequenced
(modref_access_analysis::record_access_p): Use ignore_nondeterminism_p
when handling volatile accesses.
(modref_access_analysis::get_access_for_fnspec): Update.
(modref_access_analysis::process_fnspec): Cleanup handling of NOVOPS.
(modref_access_analysis::analyze_call): Use ignore_nondeterminism_p
when handling asm statements.
(modref_access_analysis::analyze_stmt): Update.
(propagate_unknown_call): Update.
(modref_propagate_in_scc): Update.
(ipa_merge_modref_summary_after_inlining): Update.

8 months agoAdd __builtion_unreachable to vector::size(), vector::capacity()
Jan Hubicka [Sun, 17 Nov 2024 00:21:04 +0000 (01:21 +0100)] 
Add __builtion_unreachable to vector::size(), vector::capacity()

This patch makes it clear that vector sizes and capacities are not
negative.  With recent change to ipa-fnsummary this should not affect
inlining and improves codegen of some vector manipulation functions.

I tested clang build.  Looking for throw_bad calls there are only 3
called considerably often (bad_allloc, bad_array_new_length and
function_callv).
The patch seems to reduce bad_alloc and bad_array_new_length calls
considerably:

bad_alloc 380->147
bad_array_new_length 832->128

libstdc++-v3/ChangeLog:

PR tree-optimization/109442
* include/bits/stl_vector.h: (vector::size(),
vector::capacity()): Add __builtin_unreachable call to announce
that size and capacity are non-negative.

gcc/testsuite/ChangeLog:

PR tree-optimization/109442
* g++.dg/tree-ssa/pr109442.C: New test.

8 months agoDaily bump.
GCC Administrator [Sun, 17 Nov 2024 00:21:19 +0000 (00:21 +0000)] 
Daily bump.

8 months agoAvoid expicit builtion list in tree-ssa-dce
Jan Hubicka [Sat, 16 Nov 2024 22:45:57 +0000 (23:45 +0100)] 
Avoid expicit builtion list in tree-ssa-dce

while working on -fmalloc-dce I noticed that tree-ssa-dce.cc still has an
outdated list of builtions that are known to not read memory that can be
replaced by query to fnspec and modref.

If I get things right, dce does some dead store removal, but only on those
memory object that are non-aliased (automatic variabels with no address taken)
and for all other memory addresses it resorts to
mark_all_reaching_defs_necessary expecting DSE to do the rest.  So we really
want to only check if there are no memory reads at all rather then trying to
understand them by parsing fnspec or modref summary.

I did run testsuite ensuring that all builtins matched previously are
still matched.  There are few testcases where this check fails, due to
type incompatibility.  New code uses gimple_call_builtin while other
just checked callee_decl.

We test things like calling free() without parmeter which I don't think
we want to care about, but there is also testase declaring

void * calloc (long, long)

where builtin declaration expects unsigned long.  I am not sure if this
case should not be allowed by gimple_call_builtin?

Bootstrappe/regtested x86_64-linux. OK?

gcc/ChangeLog:

* ipa-modref.cc (ipa_modref_callee_reads_no_memory_p): New function.
* ipa-modref.h (ipa_modref_callee_reads_no_memory_p): Declare
* tree-ssa-dce.cc (propagate_necessity): Use it.

8 months agoMinor cleanup to cxx_init_decl_processing
Jan Hubicka [Sat, 16 Nov 2024 22:44:13 +0000 (23:44 +0100)] 
Minor cleanup to cxx_init_decl_processing

gcc/cp/ChangeLog:

* decl.cc (cxx_build_operator_new): Break out from ...
(cxx_build_operator_delete): Break out from ...
(cxx_init_operator_new_delete_decls): Break out from ...
(cxx_init_decl_processing): ... here.

8 months agoAVR: Fix building LibF7 after switching to C23.
Georg-Johann Lay [Sat, 16 Nov 2024 21:12:05 +0000 (22:12 +0100)] 
AVR: Fix building LibF7 after switching to C23.

Since r15-5327, GNU-C23 is being used as C language default.
libf7.h doesn't assume headers like stdbool.h are present
and defines bool, true and false on its own.

libgcc/config/avr/libf7/
* libf7.h (bool, true, false): Don't define in C23 or higher.

8 months agomatch: Optimize `max(a,b) == 0` to `(a|b) == 0` for unsigned [PR115275]
Andrew Pinski [Sat, 16 Nov 2024 07:20:42 +0000 (23:20 -0800)] 
match: Optimize `max(a,b) == 0` to `(a|b) == 0` for unsigned [PR115275]

For unsigned types, you can optimize `max<a,b> == 0` into
`(a|b) == 0` (that is both have to be zero). A similar thing happens for `!= 0`.
This optimization fixes the missed optimization (g++.dg/tree-ssa/pr115275.C)
that was reported exposed by adding phiprop early.

Bootstrapped and tested on x86_64-linux-gnu.

PR tree-optimization/115275

gcc/ChangeLog:

* match.pd (umax(a,b) ==/!= 0): New pattern.

gcc/testsuite/ChangeLog:

* g++.dg/tree-ssa/pr115275.C: New test.
* gcc.dg/tree-ssa/max_eqne-1.c: New test.
* gcc.dg/tree-ssa/max_eqne-2.c: New test.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
8 months agoMATCH: Simplify `min(a, b) op max(a, b)` to `a op b` [PR109401]
Eikansh Gupta [Mon, 11 Nov 2024 11:55:45 +0000 (17:25 +0530)] 
MATCH: Simplify `min(a, b) op max(a, b)` to `a op b` [PR109401]

This patch simplify `min(a,b) op max(a,b)` to `a op b`. This optimization
will work for all the binary commutative operations. So, the `op` here can
be one of {plus, mult, bit_and, bit_xor, bit_ior, eq, ne, min, max}.

PR tree-optimization/109401

gcc/ChangeLog:

* match.pd (min(a,b) op max(a,b) -> a op b): New pattern.

gcc/testsuite/ChangeLog:

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

Signed-off-by: Eikansh Gupta <quic_eikagupt@quicinc.com>
8 months agolibiberity: ANSIfy test-demangle.c
Andrew Pinski [Sat, 16 Nov 2024 18:52:23 +0000 (10:52 -0800)] 
libiberity: ANSIfy test-demangle.c

Some of the function definitions used K&R style definitions (but not all).
This just moves them all to be ANSI C

Bootstrapped and tested on x86_64-linux-gnu.

libiberty/ChangeLog:

* testsuite/test-demangle.c (get_line): Change K&R style
definition into ANSI C90 definitions.
(fail): Likewise.
(main): Likewise.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
8 months agoAVR: target/116781 - Fix ICE due to (clobber (match_dup)) in tablejump.
Georg-Johann Lay [Sat, 16 Nov 2024 13:26:02 +0000 (14:26 +0100)] 
AVR: target/116781 - Fix ICE due to (clobber (match_dup)) in tablejump.

This patch avoids (clobber (match_dup)) in insn patterns for tablejump.
The machine description now uses a scratch_operand instead which is
possible since the clobbered entity is known in advance:

3-byte PC        : REG_Z
2-byte PC + JMP  : REG_Z
2-byte PC + RJMP : None, hence scratch:HI is used.

The avr-casesi pass and optimization has to be adjusted to the new patterns.

PR target/116781
gcc/
* config/avr/avr.md (*tablejump_split, *tablejump): Add
operand 2 as a "scratch_operand" instead of a match_dup.
(casesi): Adjust expander operands accordingly.  Use a scratch:HI
when the jump address is not clobbered.  This is the case for a
2-byte PC + has no JMP instruction.  In all the other cases, the
affected operand is REG_Z (reg:HI 30).
(casesi_<mode>_sequence): Adjust matcher to new anatomy.
* config/avr/avr-passes.cc (avr_is_casesi_sequence)
(avr_is_casesi_sequence, avr_optimize_casesi)
(avr_casei_sequence_check_operands): Adjust to new anatomy.

8 months agoAVR: target/117500 - Use output_operand_lossage in avr_print_operand.
Georg-Johann Lay [Sat, 9 Nov 2024 11:40:48 +0000 (12:40 +0100)] 
AVR: target/117500 - Use output_operand_lossage in avr_print_operand.

PR target/117500
gcc/
* config/avr/avr.cc (avr_print_operand) [code = 'i']: Use
output_operand_lossage on bad operands instead of fatal_insn.

8 months agoAVR: Add an RTL peephole to tweak lower_reg:QI o= cst.
Georg-Johann Lay [Wed, 6 Nov 2024 08:46:40 +0000 (09:46 +0100)] 
AVR: Add an RTL peephole to tweak lower_reg:QI o= cst.

For operations like  X o= CST, regalloc may spill l-reg X to a d-reg:
   D =  X
   D o= CST
   X =  D
where it is better to instead
   D =  CST
   X o= D
This patch adds an according RTL peephole.

gcc/
* config/avr/avr.md: Add a peephole2 that improves bit operations
with a lower register and a constant.

8 months ago[committed] RISC-V testsuite adjustments for c23
Jeff Law [Sat, 16 Nov 2024 18:30:04 +0000 (11:30 -0700)] 
[committed] RISC-V testsuite adjustments for c23

Mix of fixes and workarounds by passing in -std=gnu17.  The former is the
preferred approach, but occasionally we have code that's just fugly to fix.

gcc/testsuite/
* gcc.target/riscv/cmo-32.c: Pass in -std=gnu17.
* gcc.target/riscv/cmo-64.c: Likewise.
* gcc.target/riscv/pr98777.c: Likewise.
* gcc.target/riscv/rvv/vsetvl/pr115214.c: Likewise.
* gcc.target/riscv/rvv/autovec/pr113469.c: Likewise.
* gcc.target/riscv/rvv/autovec/pr111391-1.c: Fix prototype for c23.
* gcc.target/riscv/rvv/vsetvl/vsetvl_bug-1.c: Likewise.
* gcc.target/riscv/sum-of-two-s12-const-2.c: Likewise.
* gcc.target/riscv/target-attr-01.c: Likewise.
* gcc.target/riscv/target-attr-02.c: Likewise.
* gcc.target/riscv/target-attr-03.c: Likewise.
* gcc.target/riscv/target-attr-04.c: Likewise.
* gcc.target/riscv/target-attr-05.c: Likewise.
* gcc.target/riscv/target-attr-06.c: Likewise.
* gcc.target/riscv/target-attr-07.c: Likewise.
* gcc.target/riscv/target-attr-08.c: Likewise.
* gcc.target/riscv/target-attr-09.c: Likewise.
* gcc.target/riscv/target-attr-10.c: Likewise.
* gcc.target/riscv/target-attr-11.c: Likewise.
* gcc.target/riscv/target-attr-12.c: Likewise.
* gcc.target/riscv/target-attr-13.c: Likewise.
* gcc.target/riscv/target-attr-14.c: Likewise.
* gcc.target/riscv/target-attr-15.c: Likewise.
* gcc.target/riscv/target-attr-bad-01.c: Likewise.
* gcc.target/riscv/target-attr-bad-02.c: Likewise.
* gcc.target/riscv/target-attr-bad-03.c: Likewise.
* gcc.target/riscv/target-attr-bad-04.c: Likewise.
* gcc.target/riscv/target-attr-bad-05.c: Likewise.
* gcc.target/riscv/target-attr-bad-06.c: Likewise.
* gcc.target/riscv/target-attr-bad-07.c: Likewise.
* gcc.target/riscv/target-attr-bad-08.c: Likewise.
* gcc.target/riscv/target-attr-bad-09.c: Likewise.
* gcc.target/riscv/target-attr-bad-10.c: Likewise.

8 months ago[committed] Adjust ARC tests after c23 changes
Jeff Law [Sat, 16 Nov 2024 18:26:21 +0000 (11:26 -0700)] 
[committed] Adjust ARC tests after c23 changes

This test passes different kinds of objects to the underlying function.  So
just pass in -std=gnu17.

gcc/testsuite
* gcc.target/arc/add_n-combine.c: Pass in -std=gnu17.

8 months agolibgcc: Fix a warning/error in libgcc2.c [PR117624]
Jakub Jelinek [Sat, 16 Nov 2024 16:04:38 +0000 (17:04 +0100)] 
libgcc: Fix a warning/error in libgcc2.c [PR117624]

Since the switch to -std=gnu23 by default, float.h (included from
tsystem.h) defines INFINITY macro (to __builtin_inff ()), which now
results in a warning when compiling libgcc2.c which defines it
to something else (and, worse aarch64 compiles it with -Werror and
build fails).
libgcc2.c asserts INFINITY has the expected type which depends on
the macros with which libgcc2.c is being compiled, so guarding
the define with #ifndef INFINITY wouldn't work.
So this patch instead #undefs the macro before defining it.

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

PR libgcc/117624
* libgcc2.c (INFINITY): Add #undef before #define.

8 months agoFortran: Fix segmentation fault in defined assignment [PR109066]
Paul Thomas [Sat, 16 Nov 2024 15:56:10 +0000 (15:56 +0000)] 
Fortran: Fix segmentation fault in defined assignment [PR109066]

2024-11-16  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/109066
* resolve.cc (generate_component_assignments): If the temporary
for 'var' is a pointer and 'expr' is neither a constant or
a variable, change its attribute from pointer to allocatable.
This avoids assignment to a temporary point that has neither
been allocated or associated.

gcc/testsuite/
PR fortran/109066
* gfortran.dg/defined_assignment_12.f90: New test.

8 months agodoc: Streamline hppa*-hp-hpux11 installation instructions
Gerald Pfeifer [Sat, 16 Nov 2024 15:46:50 +0000 (16:46 +0100)] 
doc: Streamline hppa*-hp-hpux11 installation instructions

A HP/UX linker patch from the GCC 3.3 era and Binutils 2.14
no longer should require special mention.

These originally came in via commit c51244972206 in April 2004 as
  * doc/install.texi: Update HP-UX 11 installation procedure.

gcc:
PR target/69374
* doc/install.texi (Specific) <hppa*-hp-hpux11>: Remove references
to HP/UX linker patch from 2004 and Binutils 2.14.

8 months agoFix various sh tests to work with c23
Jeff Law [Sat, 16 Nov 2024 15:42:01 +0000 (08:42 -0700)] 
Fix various sh tests to work with c23

A few SH tests want to create a bool typedef which doesn't work for c23.
Easiest fix which should have no impact on the test behavior would be to just
change the name of the typedef so that doesn't conflict.

One test has a crazy function signature (similar to the PRU test someone just
fixed up).  For that I'm using -std=gnu17.

Pushing to the trunk.

testsuite/
* gcc.target/sh/pr51244-15.c: Use "mybool" rather than "bool".
* gcc.target/sh/pr52933-1.c: Similarly.
* gcc.target/sh/pr54089-1.c: Similarly.
* gcc.target/sh/pr54089-7.c: Similarly.
* gcc.target/sh/pr54089-8.c: Similarly.
* gcc.target/sh/pr54089-9.c: Similarly.
* gcc.target/sh/pr64366.c: Use -std=gnu17.

8 months agoDocument that SELECT CASE works for unsigned.
Thomas Koenig [Sat, 16 Nov 2024 15:20:32 +0000 (16:20 +0100)] 
Document that SELECT CASE works for unsigned.

gcc/fortran/ChangeLog:

* gfortran.texi: Document that SELECT CASE works for UNSIGNED.

8 months ago[committed] Fix compilation of testglue wrapper after c23 changes
Jeff Law [Sat, 16 Nov 2024 15:24:20 +0000 (08:24 -0700)] 
[committed] Fix compilation of testglue wrapper after c23 changes

testglue.c (which is used for exit/abort wrappers in the testsuite) isn't c23
compatible.   The testing harness tries to build testglue.c and use it, but
doesn't report a failure if the build fails, instead it's just not used.  As a
result we get all kinds of failures on targets which depend on testglue to
report back simulator status -- like tens of thousands of execution failures.

This patch just adds -std=gnu17 to the command line to build testglue.c.

There's other fallout from the c23 change..  My tester is chewing through
things right now...

Installing on the trunk.

testsuite
* lib/wrapper.exp (${tool}_maybe_build_wrapper): Pass -std=gnu17 flag
to build testglue wrapper.

8 months agotestsuite: pru: Fix pr64366.c for new -std=gnu23 default
Dimitar Dimitrov [Sat, 16 Nov 2024 14:29:48 +0000 (16:29 +0200)] 
testsuite: pru: Fix pr64366.c for new -std=gnu23 default

Provide function declaration in order to fix the test case build with
the new -std=gnu23 default.

gcc/testsuite/ChangeLog:

* gcc.target/pru/pr64366.c (foobar): Provide full function
delaration.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
8 months agoHandle unsigned constants for module I/O.
Thomas Koenig [Sat, 16 Nov 2024 13:49:25 +0000 (14:49 +0100)] 
Handle unsigned constants for module I/O.

gcc/fortran/ChangeLog:

* module.cc (mio_expr): Handle BT_UNSIGNED.

gcc/testsuite/ChangeLog:

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

8 months agoFlip vectorization to forced SLP
Richard Biener [Fri, 15 Nov 2024 09:08:11 +0000 (10:08 +0100)] 
Flip vectorization to forced SLP

The following flips the vectorizer to forced SLP, there is almost
no expected fallout at this point, the remains should be target
specific cost modeling issues.

* params.opt (vect-force-slp): Default to 1.

8 months agotree-optimization/117606 - SLP and single element interleaving
Richard Biener [Fri, 15 Nov 2024 09:04:23 +0000 (10:04 +0100)] 
tree-optimization/117606 - SLP and single element interleaving

The following tries to reduce the amount of difference between
SLP and non-SLP for single-element interleaving load classification.

This fixes another fallout of --param vect-force-slp=1

PR tree-optimization/117606
* tree-vect-stmts.cc (get_group_load_store_type): For single
element interleaving also fall back to VMAT_ELEMENTWISE if
a left-over permutation isn't supported.

8 months agotree-optimization/117605 - SLP with large negative single-element interleaving
Richard Biener [Fri, 15 Nov 2024 08:22:37 +0000 (09:22 +0100)] 
tree-optimization/117605 - SLP with large negative single-element interleaving

We fail to demote this to VMAT_ELEMENTWISE and thus run into the three
vector permutation limit (and would not consider to use strided loads
or gathers).

This resolves another bunch of SVE regressions with --param
vect-force-slp=1

PR tree-optimization/117605
* tree-vect-stmts.cc (get_group_load_store_type): Also
apply group size limit for single-element interleaving
to VMAT_CONTIGUOUS_REVERSE.

8 months agotree-optimization/117558 - peeling for gaps and VL vectors
Richard Biener [Fri, 15 Nov 2024 07:42:04 +0000 (08:42 +0100)] 
tree-optimization/117558 - peeling for gaps and VL vectors

The following ensures that peeling a single iteration for gaps is
sufficient by enforcing niter masking (partial vector use) given
we cannot (always) statically decide when the vector size isn't known.
The condition guarding this and thus statically giving a pass in
some cases for VL vectors is questionable, the patch doesn't address
this.

This fixes a set of known failout from enabling
--param vect-force-slp=1 by default.

PR tree-optimization/117558
* tree-vectorizer.h (_loop_vec_info::must_use_partial_vectors_p): New.
(LOOP_VINFO_MUST_USE_PARTIAL_VECTORS_P): Likewise.
* tree-vect-loop.cc (_loop_vec_info::_loop_vec_info): Initialize
must_use_partial_vectors_p.
(vect_determine_partial_vectors_and_peeling): Enforce it.
(vect_analyze_loop_2): Reset before restarting.
* tree-vect-stmts.cc (get_group_load_store_type): When peeling
a single gap iteration cannot be determined safe statically
enforce the use of partial vectors.

8 months agoIgnore conditions guarding __builtin_unreachable in inliner metrics
Jan Hubicka [Sat, 16 Nov 2024 13:04:32 +0000 (14:04 +0100)] 
Ignore conditions guarding __builtin_unreachable in inliner metrics

This extends my last year attempt to make inliner metric ignore
conditionals guarding __builtin_unreachable.  Compared to previous
patch, this one implements a "mini-dce" in ipa-fnsummary to avoid
accounting all statements that are only used to determine conditionals
guarding __builtin_unnecesary.  These will be removed later once value
ranges are determined.

While working on this, I noticed that we do have a lot of dead code while
computing fnsummary for early inline. Those are only used to apply
large-function growth, but it seems there is enough dead code to make this
valud kind of irrelevant.  Also there seems to be quite a lot of const/pure
calls that can be cheaply removed before we inline them.  So I wonder if we
want to run one DCE before early inlining.

gcc/ChangeLog:

PR tree-optimization/109442
* ipa-fnsummary.cc (builtin_unreachable_bb_p): New function.
(guards_builtin_unreachable): New function.
(STMT_NECESSARY): New macro.
(mark_stmt_necessary): New function.
(mark_operand_necessary): New function.
(find_necessary_statements): New function.
(analyze_function_body): Use it.

gcc/testsuite/ChangeLog:

* gcc.dg/ipa/fnsummary-1.c: New test.

8 months agoc++: adjust some tests for modules
Jason Merrill [Sat, 16 Nov 2024 03:18:27 +0000 (22:18 -0500)] 
c++: adjust some tests for modules

We aren't enabling modules by default yet, but let's fix these tests now so
they won't fail when that happens.

gcc/testsuite/ChangeLog:

* g++.dg/template/error25.C: Adjust export diagnostic.
* g++.old-deja/g++.benjamin/tem05.C: Likewise.
* g++.old-deja/g++.pt/export1.C: Likewise.
* g++.dg/pch/pch.exp: Specify -fno-modules.

8 months agoc: fix ICE when forming composite type for two structures / unions [PR117548]
Martin Uecker [Thu, 14 Nov 2024 19:54:33 +0000 (20:54 +0100)] 
c: fix ICE when forming composite type for two structures / unions [PR117548]

When forming the composite type from two tagged type, we need to find the
original type for a typedecl to get the correct tag.

PR c/117548

gcc/c/ChangeLog:
* c-decl.cc (finish_struct): Add checking assertion.
* c-typeck.cc (c_type_original): New function.
(composite_types_internal): Get tag from original type.

gcc/testsuite/ChangeLog:
* gcc.dg/pr117548.c: New test.

8 months agotestsuite: i386: adapt to -std=gnu23 default change
Sam James [Sat, 16 Nov 2024 03:14:19 +0000 (03:14 +0000)] 
testsuite: i386: adapt to -std=gnu23 default change

r15-5327-g55e3bd376b2214 changes the default to -std=gnu23 but this
test relies on unprototyped functions. Follow Joseph's advice
in that commit and tweak the test accordingly.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr66891.c: Pass -std=gnu17.

8 months agotestsuite: graphite: adapt to -std=gnu23 default change
Sam James [Sat, 16 Nov 2024 03:12:33 +0000 (03:12 +0000)] 
testsuite: graphite: adapt to -std=gnu23 default change

r15-5327-g55e3bd376b2214 changes the default to -std=gnu23 but these
tests now trigger -Wold-style-definition. Follow Joseph's advice
in that commit and tweak the tests accordingly.

gcc/testsuite/ChangeLog:

* gcc.dg/graphite/id-15.c: Pass -Wno-old-style-definition.
* gcc.dg/graphite/pr38413.c: Ditto.
* gcc.dg/graphite/pr38510.c: Ditto.

8 months agoPR modula2/117555: Add missing return statement after raise
Gaius Mulley [Sat, 16 Nov 2024 02:32:56 +0000 (02:32 +0000)] 
PR modula2/117555: Add missing return statement after raise

This patch adds missing return statements after a call to RAISE.  Four
of the modules in libgm2 have procedure functions with missing return
statements.  These errors were exposed after the reimplementation of
parameter declaration patch and triggered by -Wreturn-type.  The patch
also adds exit statements to the M2RTS noreturn functions.

gcc/m2/ChangeLog:

PR modula2/117555
* gm2-libs-iso/EXCEPTIONS.mod (CurrentNumber): Add return
statement.
* gm2-libs-iso/IOChan.mod (ReadResult): Ditto.
(CurrentFlags): Ditto.
(DeviceError): Ditto.
* gm2-libs-iso/IOLink.mod (DeviceTablePtrValue): Ditto.
* gm2-libs-iso/LongConv.mod (ValueReal): Ditto.
* gm2-libs/M2RTS.mod (Halt): Add noreturn attribute.
Add exit (1).
(HaltC): Add exit (1).
* pge-boot/GM2RTS.cc (M2RTS_Halt): Add exit (1).
(M2RTS_HaltC): Ditto.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
8 months agolibstdc++: Use -C option to run recursive make in sub-directories
Jonathan Wakely [Thu, 14 Nov 2024 18:25:50 +0000 (18:25 +0000)] 
libstdc++: Use -C option to run recursive make in sub-directories

libstdc++-v3/ChangeLog:

* Makefile.am: Use $(MAKE) -C dir instead of cd dir && $(MAKE).
* Makefile.in: Regenerate.

8 months agoRISC-V: Remove unnecessary option for scalar SAT_SUB testcase
Pan Li [Sat, 16 Nov 2024 00:31:56 +0000 (08:31 +0800)] 
RISC-V: Remove unnecessary option for scalar SAT_SUB testcase

After we create a isolated folder to hold all SAT scalar test,
we have fully control of what optimization options passing to
the testcase.  Thus, it is better to remove the unnecessary
work around for flto option, as well as the -O3 option for
each cases.  The riscv.exp will pass sorts of different optimization
options for each case.

The below test suites are passed for this patch.
* The rv64gcv fully regression test.

It is test only patch and obvious up to a point, will commit it
directly if no comments in next 48H.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/sat/sat_u_sub-1-u16.c: Remove flto dg-skip
workaround and -O3 option.
* gcc.target/riscv/sat/sat_u_sub-1-u32.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-1-u64.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-1-u8.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-10-u16.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-10-u32.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-10-u64.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-10-u8.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-11-u16.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-11-u32.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-11-u64.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-11-u8.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-12-u16.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-12-u32.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-12-u64.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-12-u8.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-2-u16.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-2-u32.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-2-u64.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-2-u8.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-3-u16.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-3-u32.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-3-u64.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-3-u8.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-4-u16.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-4-u32.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-4-u64.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-4-u8.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-5-u16.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-5-u32.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-5-u64.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-5-u8.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-6-u16.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-6-u32.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-6-u64.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-6-u8.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-7-u16.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-7-u32.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-7-u64.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-7-u8.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-8-u16.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-8-u32.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-8-u64.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-8-u8.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-9-u16.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-9-u32.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-9-u64.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub-9-u8.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-1-u16-1.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-1-u16-2.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-1-u16-3.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-1-u16-4.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-1-u16.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-1-u32-1.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-1-u32-2.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-1-u32-3.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-1-u32-4.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-1-u32.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-1-u64-1.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-1-u64-2.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-1-u64.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-1-u8-1.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-1-u8-2.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-1-u8-3.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-1-u8-4.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-1-u8.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-2-u16-1.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-2-u16-2.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-2-u16-3.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-2-u16.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-2-u32-1.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-2-u32-2.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-2-u32-3.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-2-u32.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-2-u64-1.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-2-u64.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-2-u8-1.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-2-u8-2.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-2-u8-3.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-2-u8.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-3-u16-1.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-3-u16-2.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-3-u16.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-3-u32-1.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-3-u32-2.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-3-u32.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-3-u64.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-3-u8-1.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-3-u8-2.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-3-u8.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-4-u16-1.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-4-u16-2.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-4-u16.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-4-u32-1.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-4-u32-2.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-4-u32.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-4-u64.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-4-u8-1.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-4-u8-2.c: Ditto.
* gcc.target/riscv/sat/sat_u_sub_imm-4-u8.c: Ditto.

Signed-off-by: Pan Li <pan2.li@intel.com>
8 months agoDaily bump.
GCC Administrator [Sat, 16 Nov 2024 00:18:47 +0000 (00:18 +0000)] 
Daily bump.

8 months agoc: Default to -std=gnu23
Joseph Myers [Fri, 15 Nov 2024 23:42:59 +0000 (23:42 +0000)] 
c: Default to -std=gnu23

Change the default language version for C compilation from -std=gnu17
to -std=gnu23.  A few tests are updated to remove local definitions of
bool, true and false (where making such an unconditional test change
seemed to make more sense than changing the test conditionally earlier
or building it with -std=gnu17); most test issues were already
addressed in previous patches.  In the case of
ctf-function-pointers-2.c, it was agreed in bug 117289 that it would
be OK to put -std=gnu17 in the test and leave more optimal BTF / CTF
output for this test as a potential future improvement.

Since the original test fixes, more such fixes have become necessary
and so are included in this patch.  More noinline attributes are added
to simulate-thread tests where () meaning a prototype affected test
results, while gcc.dg/torture/pr117496-1.c (a test declaring a
function with () then calling it with arguments) gets -std=gnu17
added.

Bootstrapped with no regressions for x86_64-pc-linux-gnu.

NOTE: it's likely there are target-specific tests for non-x86 targets
that need updating as a result of this change.  See commit
9fb5348e3021021e82d75e4ca4e6f8d51a34c24f ("testsuite: Prepare for
-std=gnu23 default") for examples of changes to prepare the testsuite
to work with a -std=gnu23 default.  In most cases, adding
-Wno-old-style-definition (for warnings for old-style function
definitions) or -std=gnu17 (for other issues such as unprototyped
function declarations with ()) is appropriate, but watch out for cases
that indicate bugs with -std=gnu23 (in particular, any ICEs - there
was only the one nested function test where I had to fix an ICE on
x86_64).

gcc/
* doc/invoke.texi (-std=gnu17, -std=gnu23): Document -std=gnu23 as
default for C code.

gcc/c-family/
* c-opts.cc (c_common_init_options): Default to C23.

gcc/testsuite/
* c-c++-common/analyzer/asm-x86-dyndbg-2.c,
c-c++-common/analyzer/asm-x86-lp64-2.c,
c-c++-common/analyzer/attr-malloc-CVE-2019-19078-usb-leak.c,
c-c++-common/analyzer/coreutils-cksum-pr108664.c,
c-c++-common/analyzer/feasibility-3.c,
c-c++-common/analyzer/pr105783.c, c-c++-common/analyzer/sock-1.c,
c-c++-common/attributes-4.c, gcc.dg/Warray-bounds-78.c,
gcc.dg/analyzer/asm-x86-dyndbg-1.c: Do not define bool, true or
false.
* gcc.dg/debug/ctf/ctf-function-pointers-2.c: Use -std-gnu17.
* gcc.dg/gnu23-version-2.c: New test.
* gcc.dg/simulate-thread/atomic-load-int.c,
gcc.dg/simulate-thread/atomic-load-longlong.c,
gcc.dg/simulate-thread/atomic-load-short.c: Add more noinline
attributes.
* gcc.dg/torture/pr117496-1.c: Use -std=gnu17.

8 months agoPR modula2/117371: type incompatibility between INTEGER and CARDINAL
Gaius Mulley [Fri, 15 Nov 2024 21:12:37 +0000 (21:12 +0000)] 
PR modula2/117371: type incompatibility between INTEGER and CARDINAL

This patch enforces a const expression increment in a FOR loop.
It also fixes missing error locations.  The FOR loop last iterator
value is now calculated during M2GenGCC after all types and constants have
been resolved.  This results in fewer quadruples (as there is no need to
build two paths for step > 0 and step < 0).

gcc/m2/ChangeLog:

PR modula2/117371
* gm2-compiler/M2Base.mod (MixMetaTypes): Add parameter TRUE to
MetaErrorDecl.
(IsUserType): Test against ZType.
(MixTypesDecl): Test for ZType.
* gm2-compiler/M2GenGCC.mod (ErrorMessageDecl): Add parameter TRUE to
MetaErrorDecl.
(CodeLastForIterator): New procedure.
(FoldLastForIterator): Ditto.
(PerformLastForIterator): Ditto.
(CodeStatement): Add case clause for LastForIteratorOp.
(ErrorMessageDecl): Add iserror parameter.
Call MetaErrorDecl with iserror parameter.
(checkIncorrectMeta): Call MetaErrorDecl with TRUE parameter.
(CheckBinaryExpressionTypes): Ditto.
(CheckElementSetTypes): Ditto.
* gm2-compiler/M2LexBuf.def (MakeVirtualTok): Update comment
detailing the fall back when UnknownTokenNo is encountered.
(MakeVirtual2Tok): Ditto.
* gm2-compiler/M2LexBuf.mod (MakeVirtualTok): Check against
UnknownTokenNo.
(MakeVirtual2Tok): Ditto.
* gm2-compiler/M2MetaError.def (MetaErrorDecl): Add error parameter.
* gm2-compiler/M2MetaError.mod (MetaErrorDecl): Add error
parameter.
Issue warning if error is FALSE.
* gm2-compiler/M2Quads.def (QuadOperator): Add LastForIteratorOp.
* gm2-compiler/M2Quads.mod (AddQuadInformation): New case clause
LastForIteratorOp.
(CheckAddTuple2Read): New procedure.
(BuildForLoopToRangeCheck): Remove.
(ForLoopLastIteratorVariable): Ditto.
(ForLoopLastIteratorConstant): Ditto.
(ForLoopLastIterator): Reimplement.
(BuildForToByDo): Remove ByType from call to ForLoopLastIterator.
(WriteQuad): New case clause LastForIteratorOp.
(WriteOperator): Ditto.
* gm2-compiler/M2Students.def
(CheckForVariableThatLooksLikeKeyword): Replace with ...
(CheckVariableAgainstKeyword): ... this.
* gm2-compiler/M2Students.mod
(CheckForVariableThatLooksLikeKeyword): Replace with ...
(CheckVariableAgainstKeyword): ... this.
* gm2-compiler/M2SymInit.mod (CheckLastForIterator): New
procedure.
(CheckReadBeforeInitQuad): New case clause to call
CheckLastForIterator.
* gm2-compiler/P2SymBuild.mod: Replace
CheckForVariableThatLooksLikeKeyword with CheckVariableAgainstKeyword.

gcc/testsuite/ChangeLog:

PR modula2/117371
* gm2/iso/fail/forloopbyvar.mod: New test.
* gm2/iso/fail/forloopbyvar4.mod: New test.
* gm2/iso/fail/forloopbyvar5.mod: New test.
* gm2/iso/pass/forloopbyvar3.mod: New test.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
8 months agomodula2: Add dependencies for generated sources
Gaius Mulley [Fri, 15 Nov 2024 21:11:27 +0000 (21:11 +0000)] 
modula2: Add dependencies for generated sources

This patch adds rules and dependencies for the automatically
generated grammar sources.  Bootstrapped using make -j 160.

gcc/m2/ChangeLog:

* Make-lang.in (m2/gm2-compiler-boot/P0SyntaxCheck.c):
New rule.
(m2/gm2-compiler-boot/P0SyntaxCheck.o): Ditto.
(m2/gm2-compiler-boot/P1Build.c): Ditto.
(m2/gm2-compiler-boot/P1Build.o): Ditto.
(m2/gm2-compiler-boot/P2Build.c): Ditto.
(m2/gm2-compiler-boot/P2Build.o): Ditto.
(m2/gm2-compiler-boot/P3Build.c): Ditto.
(m2/gm2-compiler-boot/P3Build.o): Ditto.
(m2/gm2-compiler-boot/PCBuild.c): Ditto.
(m2/gm2-compiler-boot/PCBuild.o): Ditto.
(m2/gm2-compiler-boot/PHBuild.c): Ditto.
(m2/gm2-compiler-boot/PHBuild.o): Ditto.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
8 months agomatch.pd: Fold vec_perm with view_convert
Jennifer Schmitz [Mon, 4 Nov 2024 15:56:09 +0000 (07:56 -0800)] 
match.pd: Fold vec_perm with view_convert

This patch improves the codegen for the following test case:
uint64x2_t foo (uint64x2_t r) {
    uint32x4_t a = vreinterpretq_u32_u64 (r);
    uint32_t t;
    t = a[0]; a[0] = a[1]; a[1] = t;
    t = a[2]; a[2] = a[3]; a[3] = t;
    return vreinterpretq_u64_u32 (a);
}
from (-O1):
foo:
        mov     v31.16b, v0.16b
        ins     v0.s[0], v0.s[1]
        ins     v0.s[1], v31.s[0]
        ins     v0.s[2], v31.s[3]
        ins     v0.s[3], v31.s[2]
        ret
to:
foo:
rev64   v0.4s, v0.4s
        ret

This is achieved by extending the following match.pd pattern to account
for type differences between @0 and @1 due to view converts.
/* Simplify vector inserts of other vector extracts to a permute.  */
(simplify
 (bit_insert @0 (BIT_FIELD_REF@2 @1 @rsize @rpos) @ipos)

The patch was bootstrapped and regtested on aarch64-linux-gnu and
x86_64-linux-gnu, no regression.
OK for mainline?

Signed-off-by: Jennifer Schmitz <jschmitz@nvidia.com>
Co-authored-by: Richard Biener <rguenther@suse.de>
gcc/
PR tree-optimization/117093
* match.pd: Extend
(bit_insert @0 (BIT_FIELD_REF@2 @1 @rsize @rpos) @ipos) to allow
type differences between @0 and @1 due to view converts.

gcc/testsuite/
PR tree-optimization/117093
* gcc.dg/tree-ssa/pr117093.c: New test.

8 months agohppa: Fix typos in 32-bit SFmode peephole2 patterns
John David Anglin [Fri, 15 Nov 2024 16:05:58 +0000 (11:05 -0500)] 
hppa: Fix typos in 32-bit SFmode peephole2 patterns

2024-11-15  John David Anglin  <danglin@gcc.gnu.org>

gcc/ChangeLog:

PR target/117564
* config/pa/pa.md: Fix typos in 32-bit SFmode peephole2 patterns.

8 months agoFix type of malloc parameter in trans-expr.cc
Jan Hubicka [Fri, 15 Nov 2024 14:51:14 +0000 (15:51 +0100)] 
Fix type of malloc parameter in trans-expr.cc

gcc/fortran/ChangeLog:

* trans-expr.cc (gfc_trans_subcomponent_assign): Fix type of malloc
parameter.

8 months agotree-nested: Do not inline or clone functions with nested functions with VM return...
Joseph Myers [Fri, 15 Nov 2024 14:08:42 +0000 (14:08 +0000)] 
tree-nested: Do not inline or clone functions with nested functions with VM return type [PR117164]

Bug 117164 is an ICE on an existing test with -std=gnu23 involving a
nested function returning a variable-size structure (and I think the
last bug needing to be resolved before switching to -std=gnu23 as the
default, as without fixing this would be a clear regression from a
change in default).

The problem is a GIMPLE verification failure where (after type
remapping from inlining / cloning) the return type of the function no
longer exactly matches the type to which it is assigned (these types
use structural equality, which means GIMPLE verification can't use
TYPE_CANONICAL and expects an exact match).  Specifically, the nested
function itself is *not* inlined (the -fno-inline-small-functions in
the original test nested-func-12.c, I think, or the noinline attribute
in some of my variant tests), but the function containing it is either
cloned (the --param ipa-cp-eval-threshold=0 in the original test) or
inlined.  (I'm not sure what role -fno-guess-branch-probability plays
in getting the right situation for the ICE; maybe affecting when
inlining or cloning is considered profitable?)

There is in fact existing code in tree-nested.cc to prevent inlining
of a function containing a nested function with variably modified
*argument* types.  I think the same issue of ensuring consistency of
types means such prevention should also apply for a variably modified
return type.  Furthermore, exactly the same problem applies for
cloning for other reasons as it does for inlining.  Thus, change the
logic to include variably modified return types for nested functions
alongside those for arguments of those functions as a reason not to
inline, and also add the noclone attribute in these cases.

Bootstrapped with no regressions for x86-64-pc-linux-gnu.

PR c/117164

gcc/
* tree-nested.cc: Include "attribs.h".
(check_for_nested_with_variably_modified): Also return true for
variably modified return type.
(create_nesting_tree): If check_for_nested_with_variably_modified
returns true, also add noclone attribute.

gcc/testsuite/
* gcc.dg/nested-func-13.c, gcc.dg/nested-func-14.c:
gcc.dg/nested-func-15.c, gcc.dg/nested-func-16.c,
gcc.dg/nested-func-17.c: New tests.

8 months agoRemove unused vcond{,u,eq} expander infrastructure
Richard Biener [Fri, 15 Nov 2024 12:59:02 +0000 (13:59 +0100)] 
Remove unused vcond{,u,eq} expander infrastructure

Now that we no longer exercise vcond{,u,eq} patterns remove unused
infrastructure.

* optabs-query.h (get_vcond_icode): Remove.
(get_vcond_eq_icode): Likewise.
* optabs-tree.h (expand_vec_cond_expr_p): Remove code
argument.
* optabs-tree.cc (expand_vec_cond_expr_p): Likewise.
(vcond_icode_p): Remove.
(vcond_eq_icode_p): Likewise.
* optabs.h (can_vcond_compare_p): Remove.
* optabs.cc (can_vcond_compare_p): Likewise.

8 months agotestsuite: Fix tail_call and musttail effective targets [PR116080]
Christophe Lyon [Thu, 3 Oct 2024 13:37:16 +0000 (13:37 +0000)] 
testsuite: Fix tail_call and musttail effective targets [PR116080]

Some of the musttail tests (eg musttail7.c) fail on arm-eabi because
check_effective_target_musttail pass, but the actual code in the test
is rejected.

The reason is that on arm-eabi with the default configuration, the
compiler targets armv4t for which TARGET_INTERWORK is true, making
arm_function_ok_for_sibcall reject a tail-call candidate if
TREE_ASM_WRITTEN (decl) is false.

For more recent architecture versions, TARGET_INTERWORK is false,
hence the problem was not seen on all arm configurations.

musttail7.c is in turn rejected because f2 is recursive, so
TREE_ASM_WRITTEN is false.

However, the same code used in check_effective_target_musttail is not
recursive and the function body for foo has TREE_ASM_WRITTEN == true.

The simplest fix is to remove the (empty) body for foo () in
check_effective_target_musttail.  For consistency, do the same with
check_effective_target_tail_call.

gcc/testsuite/ChangeLog:
PR testsuite/116080
* lib/target-supports.exp (check_effective_target_tail_call):
Remove foo's body.
(check_effective_target_musttail): Likewise.

8 months agoRemove dead code related to VEC_COND_EXPR expansion from ISEL
Richard Biener [Tue, 12 Nov 2024 13:48:23 +0000 (14:48 +0100)] 
Remove dead code related to VEC_COND_EXPR expansion from ISEL

ISEL was introduced to translate vector comparison and vector
condition combinations back to internal function calls mapping to
one of the vcond[u][_eq][_mask] and vec_cmp[_eq] optabs.  With
removing the legacy non-mask vcond expanders we now rely on all
vector comparisons and vector conditions to be directly expandable.
The following keeps the intermediate internal function rewrite
given gimple_expand_vec_cond_expr still performs some optimizations
which eventually should move to vector lowering or match.pd, but
simplifies it down to always expand VEC_COND_EXPR to .VCOND_MASK.

* gimple-isel.cc (gimple_expand_vec_cond_expr): If not
simplifying or lowering, always expand to .VCOND_MASK.
(pass_gimple_isel::execute): Simplify.

8 months agoStreamline vector lowering of VEC_COND_EXPR and vector comparisons
Richard Biener [Tue, 12 Nov 2024 14:07:34 +0000 (15:07 +0100)] 
Streamline vector lowering of VEC_COND_EXPR and vector comparisons

The following makes sure to lower all VEC_COND_EXPRs that we cannot
trivially expand, likewise for comparisons.  In particular no longer
try to combine both in fancy ways.

* tree-vect-generic.cc (expand_vector_comparison): Lower
vector comparisons that we cannot trivially expand.  Remove
code dealing with uses in VEC_COND_EXPRs.
(expand_vector_condition): Lower vector conditions that we
cannot trivially expand.  Remove code dealing with comparison
mask definitions.
(expand_vector_operation): Drop dce_ssa_names.
(expand_vector_operations_1): Likewise.

8 months agoRegenerate gcc/c-family/c.opt.urls
Florian Weimer [Fri, 15 Nov 2024 12:37:54 +0000 (13:37 +0100)] 
Regenerate gcc/c-family/c.opt.urls

After commit 8833389e90d676baabb35c3e7a021a4f5444a5ba.

gcc/c-family/

* c.opt.urls: Regenerate.

8 months agoRISC-V: Rearrange the test files for scalar SAT_SUB [NFC]
Pan Li [Fri, 15 Nov 2024 10:43:36 +0000 (18:43 +0800)] 
RISC-V: Rearrange the test files for scalar SAT_SUB [NFC]

The test files of scalar SAT_SUB only has numbers as the suffix.
Rearrange the file name to -{form number}-{target-type}.  For example,
test form 3 for uint32_t SAT_SUB will have -3-u32.c for asm check and
-run-3-u32.c for the run test.

Meanwhile, all related test files moved to riscv/sat/.

The below test suites are passed for this patch.
* The rv64gcv fully regression test.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/sat_u_sub-2.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-1-u16.c: ...here.
* gcc.target/riscv/sat_u_sub-3.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-1-u32.c: ...here.
* gcc.target/riscv/sat_u_sub-4.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-1-u64.c: ...here.
* gcc.target/riscv/sat_u_sub-1.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-1-u8.c: ...here.
* gcc.target/riscv/sat_u_sub-38.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-10-u16.c: ...here.
* gcc.target/riscv/sat_u_sub-39.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-10-u32.c: ...here.
* gcc.target/riscv/sat_u_sub-40.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-10-u64.c: ...here.
* gcc.target/riscv/sat_u_sub-37.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-10-u8.c: ...here.
* gcc.target/riscv/sat_u_sub-42.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-11-u16.c: ...here.
* gcc.target/riscv/sat_u_sub-43.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-11-u32.c: ...here.
* gcc.target/riscv/sat_u_sub-44.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-11-u64.c: ...here.
* gcc.target/riscv/sat_u_sub-41.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-11-u8.c: ...here.
* gcc.target/riscv/sat_u_sub-46.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-12-u16.c: ...here.
* gcc.target/riscv/sat_u_sub-47.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-12-u32.c: ...here.
* gcc.target/riscv/sat_u_sub-48.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-12-u64.c: ...here.
* gcc.target/riscv/sat_u_sub-45.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-12-u8.c: ...here.
* gcc.target/riscv/sat_u_sub-6.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-2-u16.c: ...here.
* gcc.target/riscv/sat_u_sub-7.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-2-u32.c: ...here.
* gcc.target/riscv/sat_u_sub-8.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-2-u64.c: ...here.
* gcc.target/riscv/sat_u_sub-5.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-2-u8.c: ...here.
* gcc.target/riscv/sat_u_sub-10.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-3-u16.c: ...here.
* gcc.target/riscv/sat_u_sub-11.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-3-u32.c: ...here.
* gcc.target/riscv/sat_u_sub-12.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-3-u64.c: ...here.
* gcc.target/riscv/sat_u_sub-9.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-3-u8.c: ...here.
* gcc.target/riscv/sat_u_sub-14.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-4-u16.c: ...here.
* gcc.target/riscv/sat_u_sub-15.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-4-u32.c: ...here.
* gcc.target/riscv/sat_u_sub-16.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-4-u64.c: ...here.
* gcc.target/riscv/sat_u_sub-13.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-4-u8.c: ...here.
* gcc.target/riscv/sat_u_sub-18.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-5-u16.c: ...here.
* gcc.target/riscv/sat_u_sub-19.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-5-u32.c: ...here.
* gcc.target/riscv/sat_u_sub-20.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-5-u64.c: ...here.
* gcc.target/riscv/sat_u_sub-17.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-5-u8.c: ...here.
* gcc.target/riscv/sat_u_sub-22.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-6-u16.c: ...here.
* gcc.target/riscv/sat_u_sub-23.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-6-u32.c: ...here.
* gcc.target/riscv/sat_u_sub-24.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-6-u64.c: ...here.
* gcc.target/riscv/sat_u_sub-21.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-6-u8.c: ...here.
* gcc.target/riscv/sat_u_sub-26.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-7-u16.c: ...here.
* gcc.target/riscv/sat_u_sub-27.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-7-u32.c: ...here.
* gcc.target/riscv/sat_u_sub-28.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-7-u64.c: ...here.
* gcc.target/riscv/sat_u_sub-25.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-7-u8.c: ...here.
* gcc.target/riscv/sat_u_sub-30.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-8-u16.c: ...here.
* gcc.target/riscv/sat_u_sub-31.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-8-u32.c: ...here.
* gcc.target/riscv/sat_u_sub-32.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-8-u64.c: ...here.
* gcc.target/riscv/sat_u_sub-29.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-8-u8.c: ...here.
* gcc.target/riscv/sat_u_sub-34.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-9-u16.c: ...here.
* gcc.target/riscv/sat_u_sub-35.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-9-u32.c: ...here.
* gcc.target/riscv/sat_u_sub-36.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-9-u64.c: ...here.
* gcc.target/riscv/sat_u_sub-33.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-9-u8.c: ...here.
* gcc.target/riscv/sat_u_sub-run-2.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-1-u16.c: ...here.
* gcc.target/riscv/sat_u_sub-run-3.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-1-u32.c: ...here.
* gcc.target/riscv/sat_u_sub-run-4.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-1-u64.c: ...here.
* gcc.target/riscv/sat_u_sub-run-1.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-1-u8.c: ...here.
* gcc.target/riscv/sat_u_sub-run-38.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-10-u16.c: ...here.
* gcc.target/riscv/sat_u_sub-run-39.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-10-u32.c: ...here.
* gcc.target/riscv/sat_u_sub-run-40.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-10-u64.c: ...here.
* gcc.target/riscv/sat_u_sub-run-37.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-10-u8.c: ...here.
* gcc.target/riscv/sat_u_sub-run-42.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-11-u16.c: ...here.
* gcc.target/riscv/sat_u_sub-run-43.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-11-u32.c: ...here.
* gcc.target/riscv/sat_u_sub-run-44.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-11-u64.c: ...here.
* gcc.target/riscv/sat_u_sub-run-41.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-11-u8.c: ...here.
* gcc.target/riscv/sat_u_sub-run-46.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-12-u16.c: ...here.
* gcc.target/riscv/sat_u_sub-run-47.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-12-u32.c: ...here.
* gcc.target/riscv/sat_u_sub-run-48.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-12-u64.c: ...here.
* gcc.target/riscv/sat_u_sub-run-45.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-12-u8.c: ...here.
* gcc.target/riscv/sat_u_sub-run-6.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-2-u16.c: ...here.
* gcc.target/riscv/sat_u_sub-run-7.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-2-u32.c: ...here.
* gcc.target/riscv/sat_u_sub-run-8.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-2-u64.c: ...here.
* gcc.target/riscv/sat_u_sub-run-5.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-2-u8.c: ...here.
* gcc.target/riscv/sat_u_sub-run-10.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-3-u16.c: ...here.
* gcc.target/riscv/sat_u_sub-run-11.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-3-u32.c: ...here.
* gcc.target/riscv/sat_u_sub-run-12.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-3-u64.c: ...here.
* gcc.target/riscv/sat_u_sub-run-9.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-3-u8.c: ...here.
* gcc.target/riscv/sat_u_sub-run-14.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-4-u16.c: ...here.
* gcc.target/riscv/sat_u_sub-run-15.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-4-u32.c: ...here.
* gcc.target/riscv/sat_u_sub-run-16.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-4-u64.c: ...here.
* gcc.target/riscv/sat_u_sub-run-13.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-4-u8.c: ...here.
* gcc.target/riscv/sat_u_sub-run-18.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-5-u16.c: ...here.
* gcc.target/riscv/sat_u_sub-run-19.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-5-u32.c: ...here.
* gcc.target/riscv/sat_u_sub-run-20.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-5-u64.c: ...here.
* gcc.target/riscv/sat_u_sub-run-17.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-5-u8.c: ...here.
* gcc.target/riscv/sat_u_sub-run-22.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-6-u16.c: ...here.
* gcc.target/riscv/sat_u_sub-run-23.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-6-u32.c: ...here.
* gcc.target/riscv/sat_u_sub-run-24.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-6-u64.c: ...here.
* gcc.target/riscv/sat_u_sub-run-21.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-6-u8.c: ...here.
* gcc.target/riscv/sat_u_sub-run-26.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-7-u16.c: ...here.
* gcc.target/riscv/sat_u_sub-run-27.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-7-u32.c: ...here.
* gcc.target/riscv/sat_u_sub-run-28.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-7-u64.c: ...here.
* gcc.target/riscv/sat_u_sub-run-25.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-7-u8.c: ...here.
* gcc.target/riscv/sat_u_sub-run-30.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-8-u16.c: ...here.
* gcc.target/riscv/sat_u_sub-run-31.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-8-u32.c: ...here.
* gcc.target/riscv/sat_u_sub-run-32.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-8-u64.c: ...here.
* gcc.target/riscv/sat_u_sub-run-29.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-8-u8.c: ...here.
* gcc.target/riscv/sat_u_sub-run-34.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-9-u16.c: ...here.
* gcc.target/riscv/sat_u_sub-run-35.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-9-u32.c: ...here.
* gcc.target/riscv/sat_u_sub-run-36.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-9-u64.c: ...here.
* gcc.target/riscv/sat_u_sub-run-33.c: Move to...
* gcc.target/riscv/sat/sat_u_sub-run-9-u8.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-2_1.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-1-u16-1.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-2_2.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-1-u16-2.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-2_3.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-1-u16-3.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-2_4.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-1-u16-4.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-2.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-1-u16.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-3_1.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-1-u32-1.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-3_2.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-1-u32-2.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-3_3.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-1-u32-3.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-3_4.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-1-u32-4.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-3.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-1-u32.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-4_1.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-1-u64-1.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-4_2.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-1-u64-2.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-4.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-1-u64.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-1_1.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-1-u8-1.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-1_2.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-1-u8-2.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-1_3.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-1-u8-3.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-1_4.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-1-u8-4.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-1.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-1-u8.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-6_1.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-2-u16-1.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-6_2.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-2-u16-2.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-6_3.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-2-u16-3.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-6.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-2-u16.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-15_1.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-2-u32-1.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-15_2.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-2-u32-2.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-7_3.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-2-u32-3.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-7.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-2-u32.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-8_1.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-2-u64-1.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-16.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-2-u64.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-5_1.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-2-u8-1.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-5_2.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-2-u8-2.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-5_3.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-2-u8-3.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-5.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-2-u8.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-10_1.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-3-u16-1.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-10_2.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-3-u16-2.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-10.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-3-u16.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-11_1.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-3-u32-1.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-11_2.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-3-u32-2.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-11.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-3-u32.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-12.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-3-u64.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-9_1.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-3-u8-1.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-9_2.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-3-u8-2.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-9.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-3-u8.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-14_1.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-4-u16-1.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-14_2.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-4-u16-2.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-14.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-4-u16.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-7_1.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-4-u32-1.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-7_2.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-4-u32-2.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-15.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-4-u32.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-8.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-4-u64.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-13_1.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-4-u8-1.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-13_2.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-4-u8-2.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-13.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-4-u8.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-run-2.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-run-1-u16.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-run-3.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-run-1-u32.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-run-4.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-run-1-u64.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-run-1.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-run-1-u8.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-run-6.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-run-2-u16.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-run-7.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-run-2-u32.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-run-8.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-run-2-u64.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-run-5.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-run-2-u8.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-run-10.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-run-3-u16.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-run-11.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-run-3-u32.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-run-12.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-run-3-u64.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-run-9.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-run-3-u8.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-run-14.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-run-4-u16.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-run-15.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-run-4-u32.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-run-16.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-run-4-u64.c: ...here.
* gcc.target/riscv/sat_u_sub_imm-run-13.c: Move to...
* gcc.target/riscv/sat/sat_u_sub_imm-run-4-u8.c: ...here.

Signed-off-by: Pan Li <pan2.li@intel.com>
8 months agoc: Introduce -Wmissing-parameter-name
Florian Weimer [Thu, 14 Nov 2024 11:42:25 +0000 (12:42 +0100)] 
c: Introduce -Wmissing-parameter-name

Empirically, omitted parameter names are difficult to catch in code
review.  With this change, projects can build with
-Werror=missing-parameter-name, to avoid this unnecessary
incompatibility with older GCC versions.  The existing
-pedantic-errors option is too broad for that because it also flags
widely used and widely available GCC extensions.  Likewise for
-Werror=c11-c23-compat.

gcc/c-family/

* c-opts.cc (c_common_post_options): Initialize
warn_missing_parameter_name.
* c.opt (Wmissing-parameter-name): New.

gcc/c/
* c-decl.cc (store_parm_decls_newstyle): Use
OPT_Wmissing_parameter_name for missing parameter name
warning.
* c-errors.cc (pedwarn_c11): Enable fine-grained warning
control via the option_id argument.

gcc/

* doc/invoke.texi: Document Wmissing-parameter-name.

gcc/testsuite/

* gcc.dg/Wmissing-parameter-name-1.c: New test.
* gcc.dg/Wmissing-parameter-name-2.c: New test.
* gcc.dg/Wmissing-parameter-name-3.c: New test.

8 months agoReport the section name in case of section type conflicts
Florian Weimer [Fri, 15 Nov 2024 11:00:47 +0000 (12:00 +0100)] 
Report the section name in case of section type conflicts

The section name might the user a hint of what is going on.

gcc/

* varasm.cc (get_section): Include name of section in
diagnostic messages.

8 months agoRISC-V: Remove unnecessary option for scalar SAT_ADD testcase
Pan Li [Fri, 15 Nov 2024 07:05:58 +0000 (15:05 +0800)] 
RISC-V: Remove unnecessary option for scalar SAT_ADD testcase

After we create a isolated folder to hold all SAT scalar test,
we have fully control of what optimization options passing to
the testcase.  Thus, it is better to remove the unnecessary
work around for flto option, as well as the -O3 option for
each cases.  The riscv.exp will pass sorts of different optimization
options for each case.

The below test suites are passed for this patch.
* The rv64gcv fully regression test.

It is test only patch and obvious up to a point, will commit it
directly if no comments in next 48H.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/sat/sat_s_add-1-i16.c: Remove flto
dg-skip workaround and -O3 option.
* gcc.target/riscv/sat/sat_s_add-1-i32.c: Ditto.
* gcc.target/riscv/sat/sat_s_add-1-i64.c: Ditto.
* gcc.target/riscv/sat/sat_s_add-1-i8.c: Ditto.
* gcc.target/riscv/sat/sat_s_add-2-i16.c: Ditto.
* gcc.target/riscv/sat/sat_s_add-2-i32.c: Ditto.
* gcc.target/riscv/sat/sat_s_add-2-i64.c: Ditto.
* gcc.target/riscv/sat/sat_s_add-2-i8.c: Ditto.
* gcc.target/riscv/sat/sat_s_add-3-i16.c: Ditto.
* gcc.target/riscv/sat/sat_s_add-3-i32.c: Ditto.
* gcc.target/riscv/sat/sat_s_add-3-i64.c: Ditto.
* gcc.target/riscv/sat/sat_s_add-3-i8.c: Ditto.
* gcc.target/riscv/sat/sat_s_add-4-i16.c: Ditto.
* gcc.target/riscv/sat/sat_s_add-4-i32.c: Ditto.
* gcc.target/riscv/sat/sat_s_add-4-i64.c: Ditto.
* gcc.target/riscv/sat/sat_s_add-4-i8.c: Ditto.
* gcc.target/riscv/sat/sat_s_add_imm-1-1.c: Ditto.
* gcc.target/riscv/sat/sat_s_add_imm-1.c: Ditto.
* gcc.target/riscv/sat/sat_s_add_imm-2-1.c: Ditto.
* gcc.target/riscv/sat/sat_s_add_imm-2.c: Ditto.
* gcc.target/riscv/sat/sat_s_add_imm-3-1.c: Ditto.
* gcc.target/riscv/sat/sat_s_add_imm-3.c: Ditto.
* gcc.target/riscv/sat/sat_s_add_imm-4.c: Ditto.
* gcc.target/riscv/sat/sat_u_add-1-u16.c: Ditto.
* gcc.target/riscv/sat/sat_u_add-1-u32.c: Ditto.
* gcc.target/riscv/sat/sat_u_add-1-u64.c: Ditto.
* gcc.target/riscv/sat/sat_u_add-1-u8.c: Ditto.
* gcc.target/riscv/sat/sat_u_add-2-u16.c: Ditto.
* gcc.target/riscv/sat/sat_u_add-2-u32.c: Ditto.
* gcc.target/riscv/sat/sat_u_add-2-u64.c: Ditto.
* gcc.target/riscv/sat/sat_u_add-2-u8.c: Ditto.
* gcc.target/riscv/sat/sat_u_add-3-u16.c: Ditto.
* gcc.target/riscv/sat/sat_u_add-3-u32.c: Ditto.
* gcc.target/riscv/sat/sat_u_add-3-u64.c: Ditto.
* gcc.target/riscv/sat/sat_u_add-3-u8.c: Ditto.
* gcc.target/riscv/sat/sat_u_add-4-u16.c: Ditto.
* gcc.target/riscv/sat/sat_u_add-4-u32.c: Ditto.
* gcc.target/riscv/sat/sat_u_add-4-u64.c: Ditto.
* gcc.target/riscv/sat/sat_u_add-4-u8.c: Ditto.
* gcc.target/riscv/sat/sat_u_add-5-u16.c: Ditto.
* gcc.target/riscv/sat/sat_u_add-5-u32.c: Ditto.
* gcc.target/riscv/sat/sat_u_add-5-u64.c: Ditto.
* gcc.target/riscv/sat/sat_u_add-5-u8.c: Ditto.
* gcc.target/riscv/sat/sat_u_add-6-u16.c: Ditto.
* gcc.target/riscv/sat/sat_u_add-6-u32.c: Ditto.
* gcc.target/riscv/sat/sat_u_add-6-u64.c: Ditto.
* gcc.target/riscv/sat/sat_u_add-6-u8.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm-1-u16.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm-1-u32.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm-1-u64.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm-1-u8.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm-2-u16.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm-2-u32.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm-2-u64.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm-2-u8.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm-3-u16.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm-3-u32.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm-3-u64.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm-3-u8.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm-4-u16.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm-4-u32.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm-4-u64.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm-4-u8.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-1.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-10.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-11.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-12.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-13.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-14.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-15.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-16.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-17.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-18.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-19.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-2.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-20.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-21.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-22.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-23.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-24.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-25.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-26.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-27.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-28.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-29.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-3.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-30.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-31.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-32.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-33.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-34.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-35.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-36.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-37.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-38.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-39.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-4.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-40.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-41.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-42.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-43.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-44.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-45.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-46.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-47.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-48.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-49.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-5.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-50.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-51.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-52.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-53.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-54.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-55.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-56.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-57.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-58.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-59.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-6.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-60.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-7.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-8.c: Ditto.
* gcc.target/riscv/sat/sat_u_add_imm_type_check-9.c: Ditto.

Signed-off-by: Pan Li <pan2.li@intel.com>
Signed-off-by: Pan Li <pan2.li@intel.com>
8 months agotestsuite: Change 3 tests from c++14 to c++11
Jakub Jelinek [Fri, 15 Nov 2024 08:05:25 +0000 (09:05 +0100)] 
testsuite: Change 3 tests from c++14 to c++11

These tests are valid C++11, so we can run them in C++11 too.

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

* g++.dg/tree-ssa/pr116868.C: Change effective target from c++14 to
c++11.
* g++.dg/tree-ssa/pr96945.C: Likewise.
* g++.dg/tree-ssa/pr110819.C: Likewise.

8 months agoc: Add _Decimal64x support
Jakub Jelinek [Fri, 15 Nov 2024 07:43:48 +0000 (08:43 +0100)] 
c: Add _Decimal64x support

The following patch adds _Decimal64x type support.  Our dfp libraries (dpd &
libbid) can only handle decimal32, decimal64 and decimal128 formats and I
don't see that changing any time soon, so the following patch just hardcodes
that _Decimal64x has the same mode as _Decimal128 (but is a distinct type).
In the unlikely event some target would introduce something different that
can be of course changed with target hooks but would be an ABI change.
_Decimal128x is optional and we don't have a wider decimal type, so that
type isn't added.

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

gcc/
* tree-core.h (enum tree_index): Add TI_DFLOAT64X_TYPE.
* tree.h (dfloat64x_type_node): Define.
* tree.cc (build_common_tree_nodes): Initialize dfloat64x_type_node.
* builtin-types.def (BT_DFLOAT64X): New DEF_PRIMITIVE_TYPE.
(BT_FN_DFLOAT64X): New DEF_FUNCTION_TYPE_0.
(BT_FN_DFLOAT64X_CONST_STRING, BT_FN_DFLOAT64X_DFLOAT64X): New
DEF_FUNCTION_TYPE_1.
* builtins.def (BUILT_IN_FABSD64X, BUILT_IN_INFD64X, BUILT_IN_NAND64X,
BUILT_IN_NANSD64X): New builtins.
* builtins.cc (expand_builtin): Handle BUILT_IN_FABSD64X.
(fold_builtin_0): Handle BUILT_IN_INFD64X.
(fold_builtin_1): Handle BUILT_IN_FABSD64X.
* fold-const-call.cc (fold_const_call): Handle CFN_BUILT_IN_NAND64X
and CFN_BUILT_IN_NANSD64X.
* ginclude/float.h (DEC64X_MANT_DIG, DEC64X_MIN_EXP, DEC64X_MAX_EXP,
DEC64X_MAX, DEC64X_EPSILON, DEC64X_MIN, DEC64X_TRUE_MIN,
DEC64X_SNAN): Redefine.
gcc/c-family/
* c-common.h (enum rid): Add RID_DFLOAT64X.
* c-common.cc (c_global_trees): Fix comment typo.  Add
dfloat64x_type_node.
(c_common_nodes_and_builtins): Handle RID_DFLOAT64X.
* c-cppbuiltin.cc (c_cpp_builtins): Call
builtin_define_decimal_float_constants also for dfloat64x_type_node
if non-NULL.
* c-lex.cc (interpret_float): Handle d64x suffixes.
* c-pretty-print.cc (pp_c_floating_constant): Print d64x suffixes
on dfloat64x_type_node typed constants.
gcc/c/
* c-tree.h (enum c_typespec_keyword): Add cts_dfloat64x and adjust
comment.
* c-parser.cc (c_keyword_starts_typename, c_token_starts_declspecs,
c_parser_declspecs, c_parser_gnu_attribute_any_word): Handle
RID_DFLOAT64X.
(c_parser_postfix_expression): Handle _Decimal64x arguments in
__builtin_tgmath.
(warn_for_abs): Handle BUILT_IN_FABSD64X.
* c-decl.cc (declspecs_add_type): Handle cts_dfloat64x and
RID_DFLOAT64X.
(finish_declspecs): Handle cts_dfloat64x.
* c-typeck.cc (c_common_type): Handle dfloat64x_type_node.
gcc/testsuite/
* gcc.dg/dfp/c11-decimal64x-1.c: New test.
* gcc.dg/dfp/c11-decimal64x-2.c: New test.
* gcc.dg/dfp/c23-decimal64x-1.c: New test.
* gcc.dg/dfp/c23-decimal64x-2.c: New test.
* gcc.dg/dfp/c23-decimal64x-3.c: New test.
* gcc.dg/dfp/c23-decimal64x-4.c: New test.
libcpp/
* expr.cc (interpret_float_suffix): Handle d64x and D64x
suffixes, adjust comment.

8 months agotestsuite: fix g++.dg/tree-ssa/pr58483.C
Marek Polacek [Fri, 15 Nov 2024 05:02:44 +0000 (00:02 -0500)] 
testsuite: fix g++.dg/tree-ssa/pr58483.C

This test mistakenly used two dg-do compile.  Since it passes
in C++11 as well, we can run it in C++11 and up.

gcc/testsuite/ChangeLog:

* g++.dg/tree-ssa/pr58483.C: Run in C++11 and up.

8 months agoRISC-V: Move scalar SAT_ADD test cases to a isolated folder
Pan Li [Fri, 15 Nov 2024 03:42:13 +0000 (11:42 +0800)] 
RISC-V: Move scalar SAT_ADD test cases to a isolated folder

Move the scalar SAT_ADD includes both the signed and unsigned
integer to the folder gcc.target/riscv/sat.  According to the
implementation the below options will be appended for each
test cases.

* -O2
* -O3
* -Ofast
* -Os
* -Oz

Then we can see the test log similar as below:

Executing on host: .../sat_s_add-1-i8.c ...  -O2 -march=rv64gc -S -o sat_s_add-1-i8.s
Executing on host: .../sat_s_add-1-i8.c ...  -O3 -march=rv64gc -S -o sat_s_add-1-i8.s
Executing on host: .../sat_s_add-1-i8.c ...  -Ofast -march=rv64gc -S -o sat_s_add-1-i8.s
Executing on host: .../sat_s_add-1-i8.c ...  -Oz -march=rv64gc -S -o sat_s_add-1-i8.s
Executing on host: .../sat_s_add-1-i8.c ...  -Os -march=rv64gc -S -o sat_s_add-1-i8.s

The below test suites are passed for this patch.
* The rv64gcv fully regression test.

Committed as pre-approved by kito.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/riscv.exp: Add new folder sat under riscv
and add 5 options for each sat test.
* gcc.target/riscv/sat_s_add-1-i16.c: Move to...
* gcc.target/riscv/sat/sat_s_add-1-i16.c: ...here.
* gcc.target/riscv/sat_s_add-1-i32.c: Move to...
* gcc.target/riscv/sat/sat_s_add-1-i32.c: ...here.
* gcc.target/riscv/sat_s_add-1-i64.c: Move to...
* gcc.target/riscv/sat/sat_s_add-1-i64.c: ...here.
* gcc.target/riscv/sat_s_add-1-i8.c: Move to...
* gcc.target/riscv/sat/sat_s_add-1-i8.c: ...here.
* gcc.target/riscv/sat_s_add-2-i16.c: Move to...
* gcc.target/riscv/sat/sat_s_add-2-i16.c: ...here.
* gcc.target/riscv/sat_s_add-2-i32.c: Move to...
* gcc.target/riscv/sat/sat_s_add-2-i32.c: ...here.
* gcc.target/riscv/sat_s_add-2-i64.c: Move to...
* gcc.target/riscv/sat/sat_s_add-2-i64.c: ...here.
* gcc.target/riscv/sat_s_add-2-i8.c: Move to...
* gcc.target/riscv/sat/sat_s_add-2-i8.c: ...here.
* gcc.target/riscv/sat_s_add-3-i16.c: Move to...
* gcc.target/riscv/sat/sat_s_add-3-i16.c: ...here.
* gcc.target/riscv/sat_s_add-3-i32.c: Move to...
* gcc.target/riscv/sat/sat_s_add-3-i32.c: ...here.
* gcc.target/riscv/sat_s_add-3-i64.c: Move to...
* gcc.target/riscv/sat/sat_s_add-3-i64.c: ...here.
* gcc.target/riscv/sat_s_add-3-i8.c: Move to...
* gcc.target/riscv/sat/sat_s_add-3-i8.c: ...here.
* gcc.target/riscv/sat_s_add-4-i16.c: Move to...
* gcc.target/riscv/sat/sat_s_add-4-i16.c: ...here.
* gcc.target/riscv/sat_s_add-4-i32.c: Move to...
* gcc.target/riscv/sat/sat_s_add-4-i32.c: ...here.
* gcc.target/riscv/sat_s_add-4-i64.c: Move to...
* gcc.target/riscv/sat/sat_s_add-4-i64.c: ...here.
* gcc.target/riscv/sat_s_add-4-i8.c: Move to...
* gcc.target/riscv/sat/sat_s_add-4-i8.c: ...here.
* gcc.target/riscv/sat_s_add-run-1-i16.c: Move to...
* gcc.target/riscv/sat/sat_s_add-run-1-i16.c: ...here.
* gcc.target/riscv/sat_s_add-run-1-i32.c: Move to...
* gcc.target/riscv/sat/sat_s_add-run-1-i32.c: ...here.
* gcc.target/riscv/sat_s_add-run-1-i64.c: Move to...
* gcc.target/riscv/sat/sat_s_add-run-1-i64.c: ...here.
* gcc.target/riscv/sat_s_add-run-1-i8.c: Move to...
* gcc.target/riscv/sat/sat_s_add-run-1-i8.c: ...here.
* gcc.target/riscv/sat_s_add-run-2-i16.c: Move to...
* gcc.target/riscv/sat/sat_s_add-run-2-i16.c: ...here.
* gcc.target/riscv/sat_s_add-run-2-i32.c: Move to...
* gcc.target/riscv/sat/sat_s_add-run-2-i32.c: ...here.
* gcc.target/riscv/sat_s_add-run-2-i64.c: Move to...
* gcc.target/riscv/sat/sat_s_add-run-2-i64.c: ...here.
* gcc.target/riscv/sat_s_add-run-2-i8.c: Move to...
* gcc.target/riscv/sat/sat_s_add-run-2-i8.c: ...here.
* gcc.target/riscv/sat_s_add-run-3-i16.c: Move to...
* gcc.target/riscv/sat/sat_s_add-run-3-i16.c: ...here.
* gcc.target/riscv/sat_s_add-run-3-i32.c: Move to...
* gcc.target/riscv/sat/sat_s_add-run-3-i32.c: ...here.
* gcc.target/riscv/sat_s_add-run-3-i64.c: Move to...
* gcc.target/riscv/sat/sat_s_add-run-3-i64.c: ...here.
* gcc.target/riscv/sat_s_add-run-3-i8.c: Move to...
* gcc.target/riscv/sat/sat_s_add-run-3-i8.c: ...here.
* gcc.target/riscv/sat_s_add-run-4-i16.c: Move to...
* gcc.target/riscv/sat/sat_s_add-run-4-i16.c: ...here.
* gcc.target/riscv/sat_s_add-run-4-i32.c: Move to...
* gcc.target/riscv/sat/sat_s_add-run-4-i32.c: ...here.
* gcc.target/riscv/sat_s_add-run-4-i64.c: Move to...
* gcc.target/riscv/sat/sat_s_add-run-4-i64.c: ...here.
* gcc.target/riscv/sat_s_add-run-4-i8.c: Move to...
* gcc.target/riscv/sat/sat_s_add-run-4-i8.c: ...here.
* gcc.target/riscv/sat_s_add_imm-1-1.c: Move to...
* gcc.target/riscv/sat/sat_s_add_imm-1-1.c: ...here.
* gcc.target/riscv/sat_s_add_imm-1.c: Move to...
* gcc.target/riscv/sat/sat_s_add_imm-1.c: ...here.
* gcc.target/riscv/sat_s_add_imm-2-1.c: Move to...
* gcc.target/riscv/sat/sat_s_add_imm-2-1.c: ...here.
* gcc.target/riscv/sat_s_add_imm-2.c: Move to...
* gcc.target/riscv/sat/sat_s_add_imm-2.c: ...here.
* gcc.target/riscv/sat_s_add_imm-3-1.c: Move to...
* gcc.target/riscv/sat/sat_s_add_imm-3-1.c: ...here.
* gcc.target/riscv/sat_s_add_imm-3.c: Move to...
* gcc.target/riscv/sat/sat_s_add_imm-3.c: ...here.
* gcc.target/riscv/sat_s_add_imm-4.c: Move to...
* gcc.target/riscv/sat/sat_s_add_imm-4.c: ...here.
* gcc.target/riscv/sat_s_add_imm-run-1.c: Move to...
* gcc.target/riscv/sat/sat_s_add_imm-run-1.c: ...here.
* gcc.target/riscv/sat_s_add_imm-run-2.c: Move to...
* gcc.target/riscv/sat/sat_s_add_imm-run-2.c: ...here.
* gcc.target/riscv/sat_s_add_imm-run-3.c: Move to...
* gcc.target/riscv/sat/sat_s_add_imm-run-3.c: ...here.
* gcc.target/riscv/sat_s_add_imm-run-4.c: Move to...
* gcc.target/riscv/sat/sat_s_add_imm-run-4.c: ...here.
* gcc.target/riscv/sat_u_add-1-u16.c: Move to...
* gcc.target/riscv/sat/sat_u_add-1-u16.c: ...here.
* gcc.target/riscv/sat_u_add-1-u32.c: Move to...
* gcc.target/riscv/sat/sat_u_add-1-u32.c: ...here.
* gcc.target/riscv/sat_u_add-1-u64.c: Move to...
* gcc.target/riscv/sat/sat_u_add-1-u64.c: ...here.
* gcc.target/riscv/sat_u_add-1-u8.c: Move to...
* gcc.target/riscv/sat/sat_u_add-1-u8.c: ...here.
* gcc.target/riscv/sat_u_add-2-u16.c: Move to...
* gcc.target/riscv/sat/sat_u_add-2-u16.c: ...here.
* gcc.target/riscv/sat_u_add-2-u32.c: Move to...
* gcc.target/riscv/sat/sat_u_add-2-u32.c: ...here.
* gcc.target/riscv/sat_u_add-2-u64.c: Move to...
* gcc.target/riscv/sat/sat_u_add-2-u64.c: ...here.
* gcc.target/riscv/sat_u_add-2-u8.c: Move to...
* gcc.target/riscv/sat/sat_u_add-2-u8.c: ...here.
* gcc.target/riscv/sat_u_add-3-u16.c: Move to...
* gcc.target/riscv/sat/sat_u_add-3-u16.c: ...here.
* gcc.target/riscv/sat_u_add-3-u32.c: Move to...
* gcc.target/riscv/sat/sat_u_add-3-u32.c: ...here.
* gcc.target/riscv/sat_u_add-3-u64.c: Move to...
* gcc.target/riscv/sat/sat_u_add-3-u64.c: ...here.
* gcc.target/riscv/sat_u_add-3-u8.c: Move to...
* gcc.target/riscv/sat/sat_u_add-3-u8.c: ...here.
* gcc.target/riscv/sat_u_add-4-u16.c: Move to...
* gcc.target/riscv/sat/sat_u_add-4-u16.c: ...here.
* gcc.target/riscv/sat_u_add-4-u32.c: Move to...
* gcc.target/riscv/sat/sat_u_add-4-u32.c: ...here.
* gcc.target/riscv/sat_u_add-4-u64.c: Move to...
* gcc.target/riscv/sat/sat_u_add-4-u64.c: ...here.
* gcc.target/riscv/sat_u_add-4-u8.c: Move to...
* gcc.target/riscv/sat/sat_u_add-4-u8.c: ...here.
* gcc.target/riscv/sat_u_add-5-u16.c: Move to...
* gcc.target/riscv/sat/sat_u_add-5-u16.c: ...here.
* gcc.target/riscv/sat_u_add-5-u32.c: Move to...
* gcc.target/riscv/sat/sat_u_add-5-u32.c: ...here.
* gcc.target/riscv/sat_u_add-5-u64.c: Move to...
* gcc.target/riscv/sat/sat_u_add-5-u64.c: ...here.
* gcc.target/riscv/sat_u_add-5-u8.c: Move to...
* gcc.target/riscv/sat/sat_u_add-5-u8.c: ...here.
* gcc.target/riscv/sat_u_add-6-u16.c: Move to...
* gcc.target/riscv/sat/sat_u_add-6-u16.c: ...here.
* gcc.target/riscv/sat_u_add-6-u32.c: Move to...
* gcc.target/riscv/sat/sat_u_add-6-u32.c: ...here.
* gcc.target/riscv/sat_u_add-6-u64.c: Move to...
* gcc.target/riscv/sat/sat_u_add-6-u64.c: ...here.
* gcc.target/riscv/sat_u_add-6-u8.c: Move to...
* gcc.target/riscv/sat/sat_u_add-6-u8.c: ...here.
* gcc.target/riscv/sat_u_add-run-1-u16.c: Move to...
* gcc.target/riscv/sat/sat_u_add-run-1-u16.c: ...here.
* gcc.target/riscv/sat_u_add-run-1-u32.c: Move to...
* gcc.target/riscv/sat/sat_u_add-run-1-u32.c: ...here.
* gcc.target/riscv/sat_u_add-run-1-u64.c: Move to...
* gcc.target/riscv/sat/sat_u_add-run-1-u64.c: ...here.
* gcc.target/riscv/sat_u_add-run-1-u8.c: Move to...
* gcc.target/riscv/sat/sat_u_add-run-1-u8.c: ...here.
* gcc.target/riscv/sat_u_add-run-2-u16.c: Move to...
* gcc.target/riscv/sat/sat_u_add-run-2-u16.c: ...here.
* gcc.target/riscv/sat_u_add-run-2-u32.c: Move to...
* gcc.target/riscv/sat/sat_u_add-run-2-u32.c: ...here.
* gcc.target/riscv/sat_u_add-run-2-u64.c: Move to...
* gcc.target/riscv/sat/sat_u_add-run-2-u64.c: ...here.
* gcc.target/riscv/sat_u_add-run-2-u8.c: Move to...
* gcc.target/riscv/sat/sat_u_add-run-2-u8.c: ...here.
* gcc.target/riscv/sat_u_add-run-3-u16.c: Move to...
* gcc.target/riscv/sat/sat_u_add-run-3-u16.c: ...here.
* gcc.target/riscv/sat_u_add-run-3-u32.c: Move to...
* gcc.target/riscv/sat/sat_u_add-run-3-u32.c: ...here.
* gcc.target/riscv/sat_u_add-run-3-u64.c: Move to...
* gcc.target/riscv/sat/sat_u_add-run-3-u64.c: ...here.
* gcc.target/riscv/sat_u_add-run-3-u8.c: Move to...
* gcc.target/riscv/sat/sat_u_add-run-3-u8.c: ...here.
* gcc.target/riscv/sat_u_add-run-4-u16.c: Move to...
* gcc.target/riscv/sat/sat_u_add-run-4-u16.c: ...here.
* gcc.target/riscv/sat_u_add-run-4-u32.c: Move to...
* gcc.target/riscv/sat/sat_u_add-run-4-u32.c: ...here.
* gcc.target/riscv/sat_u_add-run-4-u64.c: Move to...
* gcc.target/riscv/sat/sat_u_add-run-4-u64.c: ...here.
* gcc.target/riscv/sat_u_add-run-4-u8.c: Move to...
* gcc.target/riscv/sat/sat_u_add-run-4-u8.c: ...here.
* gcc.target/riscv/sat_u_add-run-5-u16.c: Move to...
* gcc.target/riscv/sat/sat_u_add-run-5-u16.c: ...here.
* gcc.target/riscv/sat_u_add-run-5-u32.c: Move to...
* gcc.target/riscv/sat/sat_u_add-run-5-u32.c: ...here.
* gcc.target/riscv/sat_u_add-run-5-u64.c: Move to...
* gcc.target/riscv/sat/sat_u_add-run-5-u64.c: ...here.
* gcc.target/riscv/sat_u_add-run-5-u8.c: Move to...
* gcc.target/riscv/sat/sat_u_add-run-5-u8.c: ...here.
* gcc.target/riscv/sat_u_add-run-6-u16.c: Move to...
* gcc.target/riscv/sat/sat_u_add-run-6-u16.c: ...here.
* gcc.target/riscv/sat_u_add-run-6-u32.c: Move to...
* gcc.target/riscv/sat/sat_u_add-run-6-u32.c: ...here.
* gcc.target/riscv/sat_u_add-run-6-u64.c: Move to...
* gcc.target/riscv/sat/sat_u_add-run-6-u64.c: ...here.
* gcc.target/riscv/sat_u_add-run-6-u8.c: Move to...
* gcc.target/riscv/sat/sat_u_add-run-6-u8.c: ...here.
* gcc.target/riscv/sat_u_add_imm-1-u16.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-1-u16.c: ...here.
* gcc.target/riscv/sat_u_add_imm-1-u32.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-1-u32.c: ...here.
* gcc.target/riscv/sat_u_add_imm-1-u64.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-1-u64.c: ...here.
* gcc.target/riscv/sat_u_add_imm-1-u8.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-1-u8.c: ...here.
* gcc.target/riscv/sat_u_add_imm-2-u16.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-2-u16.c: ...here.
* gcc.target/riscv/sat_u_add_imm-2-u32.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-2-u32.c: ...here.
* gcc.target/riscv/sat_u_add_imm-2-u64.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-2-u64.c: ...here.
* gcc.target/riscv/sat_u_add_imm-2-u8.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-2-u8.c: ...here.
* gcc.target/riscv/sat_u_add_imm-3-u16.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-3-u16.c: ...here.
* gcc.target/riscv/sat_u_add_imm-3-u32.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-3-u32.c: ...here.
* gcc.target/riscv/sat_u_add_imm-3-u64.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-3-u64.c: ...here.
* gcc.target/riscv/sat_u_add_imm-3-u8.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-3-u8.c: ...here.
* gcc.target/riscv/sat_u_add_imm-4-u16.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-4-u16.c: ...here.
* gcc.target/riscv/sat_u_add_imm-4-u32.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-4-u32.c: ...here.
* gcc.target/riscv/sat_u_add_imm-4-u64.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-4-u64.c: ...here.
* gcc.target/riscv/sat_u_add_imm-4-u8.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-4-u8.c: ...here.
* gcc.target/riscv/sat_u_add_imm-run-1-u16.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-run-1-u16.c: ...here.
* gcc.target/riscv/sat_u_add_imm-run-1-u32.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-run-1-u32.c: ...here.
* gcc.target/riscv/sat_u_add_imm-run-1-u64.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-run-1-u64.c: ...here.
* gcc.target/riscv/sat_u_add_imm-run-1-u8.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-run-1-u8.c: ...here.
* gcc.target/riscv/sat_u_add_imm-run-2-u16.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-run-2-u16.c: ...here.
* gcc.target/riscv/sat_u_add_imm-run-2-u32.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-run-2-u32.c: ...here.
* gcc.target/riscv/sat_u_add_imm-run-2-u64.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-run-2-u64.c: ...here.
* gcc.target/riscv/sat_u_add_imm-run-2-u8.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-run-2-u8.c: ...here.
* gcc.target/riscv/sat_u_add_imm-run-3-u16.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-run-3-u16.c: ...here.
* gcc.target/riscv/sat_u_add_imm-run-3-u32.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-run-3-u32.c: ...here.
* gcc.target/riscv/sat_u_add_imm-run-3-u64.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-run-3-u64.c: ...here.
* gcc.target/riscv/sat_u_add_imm-run-3-u8.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-run-3-u8.c: ...here.
* gcc.target/riscv/sat_u_add_imm-run-4-u16.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-run-4-u16.c: ...here.
* gcc.target/riscv/sat_u_add_imm-run-4-u32.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-run-4-u32.c: ...here.
* gcc.target/riscv/sat_u_add_imm-run-4-u64.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-run-4-u64.c: ...here.
* gcc.target/riscv/sat_u_add_imm-run-4-u8.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm-run-4-u8.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-1.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-1.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-10.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-10.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-11.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-11.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-12.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-12.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-13.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-13.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-14.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-14.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-15.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-15.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-16.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-16.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-17.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-17.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-18.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-18.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-19.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-19.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-2.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-2.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-20.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-20.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-21.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-21.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-22.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-22.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-23.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-23.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-24.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-24.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-25.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-25.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-26.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-26.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-27.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-27.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-28.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-28.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-29.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-29.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-3.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-3.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-30.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-30.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-31.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-31.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-32.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-32.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-33.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-33.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-34.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-34.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-35.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-35.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-36.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-36.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-37.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-37.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-38.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-38.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-39.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-39.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-4.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-4.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-40.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-40.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-41.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-41.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-42.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-42.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-43.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-43.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-44.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-44.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-45.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-45.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-46.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-46.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-47.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-47.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-48.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-48.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-49.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-49.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-5.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-5.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-50.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-50.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-51.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-51.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-52.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-52.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-53.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-53.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-54.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-54.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-55.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-55.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-56.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-56.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-57.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-57.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-58.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-58.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-59.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-59.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-6.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-6.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-60.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-60.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-7.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-7.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-8.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-8.c: ...here.
* gcc.target/riscv/sat_u_add_imm_type_check-9.c: Move to...
* gcc.target/riscv/sat/sat_u_add_imm_type_check-9.c: ...here.
* gcc.target/riscv/sat/sat_arith.h: New test.
* gcc.target/riscv/sat/sat_arith_data.h: New test.
* gcc.target/riscv/sat/scalar_sat_binary.h: New test.
* gcc.target/riscv/sat/scalar_sat_binary_run_xxx.h: New test.

Signed-off-by: Pan Li <pan2.li@intel.com>
8 months agors6000: Rework vector integer comparison in rs6000_emit_vector_compare - p5
Kewen Lin [Fri, 15 Nov 2024 03:46:33 +0000 (03:46 +0000)] 
rs6000: Rework vector integer comparison in rs6000_emit_vector_compare - p5

The current handlings in rs6000_emit_vector_compare is a bit
complicated to me, especially after we emit vector float
comparison insn with the given code directly.  So it's better
to refactor the handlings of vector integer comparison here.

This is part 5, it's to refactor all the handlings of vector
integer comparison to make it neat.  This patch doesn't
introduce any functionality change.

gcc/ChangeLog:

* config/rs6000/rs6000.cc (rs6000_emit_vector_compare): Refactor the
handlings of vector integer comparison.

8 months agors6000: Rework vector integer comparison in rs6000_emit_vector_compare - p4
Kewen Lin [Fri, 15 Nov 2024 03:46:33 +0000 (03:46 +0000)] 
rs6000: Rework vector integer comparison in rs6000_emit_vector_compare - p4

The current handlings in rs6000_emit_vector_compare is a bit
complicated to me, especially after we emit vector float
comparison insn with the given code directly.  So it's better
to refactor the handlings of vector integer comparison here.

This is part 4, it's to rework the handlings on GE/GEU/LE/LEU,
also make the function not recursive any more.  This patch
doesn't introduce any functionality change.

gcc/ChangeLog:

* config/rs6000/rs6000.cc (rs6000_emit_vector_compare): Refine the
handlings for operators GE/GEU/LE/LEU.

8 months agors6000: Rework vector integer comparison in rs6000_emit_vector_compare - p3
Kewen Lin [Fri, 15 Nov 2024 03:46:33 +0000 (03:46 +0000)] 
rs6000: Rework vector integer comparison in rs6000_emit_vector_compare - p3

The current handlings in rs6000_emit_vector_compare is a bit
complicated to me, especially after we emit vector float
comparison insn with the given code directly.  So it's better
to refactor the handlings of vector integer comparison here.

This is part 3, it's to refactor the handlings on NE.
This patch doesn't introduce any functionality change.

gcc/ChangeLog:

* config/rs6000/rs6000.cc (rs6000_emit_vector_compare): Refactor the
handlings for operator NE.

8 months agors6000: Rework vector integer comparison in rs6000_emit_vector_compare - p2
Kewen Lin [Fri, 15 Nov 2024 03:46:33 +0000 (03:46 +0000)] 
rs6000: Rework vector integer comparison in rs6000_emit_vector_compare - p2

The current handlings in rs6000_emit_vector_compare is a bit
complicated to me, especially after we emit vector float
comparison insn with the given code directly.  So it's better
to refactor the handlings of vector integer comparison here.

This is part 2, it's to refactor the handlings on LT and LTU.
This patch doesn't introduce any functionality change.

gcc/ChangeLog:

* config/rs6000/rs6000.cc (rs6000_emit_vector_compare): Refine the
handlings for operators LT and LTU.

8 months agors6000: Rework vector integer comparison in rs6000_emit_vector_compare - p1
Kewen Lin [Fri, 15 Nov 2024 03:46:33 +0000 (03:46 +0000)] 
rs6000: Rework vector integer comparison in rs6000_emit_vector_compare - p1

The current handlings in rs6000_emit_vector_compare is a bit
complicated to me, especially after we emit vector float
comparison insn with the given code directly.  So it's better
to refactor the handlings of vector integer comparison here.

This is part 1, it's to remove the helper function
rs6000_emit_vector_compare_inner and move the logics into
rs6000_emit_vector_compare.  This patch doesn't introduce any
functionality change.

gcc/ChangeLog:

* config/rs6000/rs6000.cc (rs6000_emit_vector_compare_inner): Remove.
(rs6000_emit_vector_compare): Emit rtx comparison for operators EQ/
GT/GTU directly.

8 months agors6000: Rework vector float comparison in rs6000_emit_vector_compare - p4
Kewen Lin [Fri, 15 Nov 2024 03:46:33 +0000 (03:46 +0000)] 
rs6000: Rework vector float comparison in rs6000_emit_vector_compare - p4

All kinds of vector float comparison operators have been
supported in a rtl comparison pattern as vector.md, we can
just emit an rtx comparison insn with the given comparison
operator in function rs6000_emit_vector_compare instead of
checking and handling the reverse condition cases.

This is part 4, it further checks for comparison opeators
LT/UNGE.  In rs6000_emit_vector_compare, for the handling
of LT, it switches to use code GT, swaps operands and try
again, it's exactly the same as what we have in vector.md:

; lt(a,b)   = gt(b,a)

As to UNGE, in rs6000_emit_vector_compare, it uses reversed
code LT and further operates on the result with one_cmpl,
it's also the same as what's in vector.md:

; unge(a,b) = ~lt(a,b)

This patch should not have any functionality change too.

gcc/ChangeLog:

* config/rs6000/rs6000.cc (rs6000_emit_vector_compare_inner): Emit rtx
comparison for operators LT/UNGE of MODE_VECTOR_FLOAT directly.
(rs6000_emit_vector_compare): Move assertion of no MODE_VECTOR_FLOAT to
function beginning.

8 months agors6000: Rework vector float comparison in rs6000_emit_vector_compare - p3
Kewen Lin [Fri, 15 Nov 2024 03:46:32 +0000 (03:46 +0000)] 
rs6000: Rework vector float comparison in rs6000_emit_vector_compare - p3

All kinds of vector float comparison operators have been
supported in a rtl comparison pattern as vector.md, we can
just emit an rtx comparison insn with the given comparison
operator in function rs6000_emit_vector_compare instead of
checking and handling the reverse condition cases.

This is part 3, it further checks for comparison opeators
LE/UNGT.  In rs6000_emit_vector_compare, UNGT is handled
with reversed code LE and inverting with one_cmpl_optab,
LE is handled with LT ior EQ, while in vector.md, we have
the support:

; le(a,b)   = ge(b,a)
; ungt(a,b) = ~le(a,b)

The associated test case shows it's an improvement.

gcc/ChangeLog:

* config/rs6000/rs6000.cc (rs6000_emit_vector_compare): Emit rtx
comparison for operators LE/UNGT of MODE_VECTOR_FLOAT directly.

gcc/testsuite/ChangeLog:

* gcc.target/powerpc/vcond-fp.c: New test.

8 months agors6000: Rework vector float comparison in rs6000_emit_vector_compare - p2
Kewen Lin [Fri, 15 Nov 2024 03:46:32 +0000 (03:46 +0000)] 
rs6000: Rework vector float comparison in rs6000_emit_vector_compare - p2

All kinds of vector float comparison operators have been
supported in a rtl comparison pattern as vector.md, we can
just emit an rtx comparison insn with the given comparison
operator in function rs6000_emit_vector_compare instead of
checking and handling the reverse condition cases.

This is part 2, it further checks for comparison opeators
NE/UNLE/UNLT.  In rs6000_emit_vector_compare, they are
handled with reversed code which is queried from function
reverse_condition_maybe_unordered and inverting with
one_cmpl_optab.  It's the same as what we have in vector.md:

; ne(a,b)   = ~eq(a,b)
; unle(a,b) = ~gt(a,b)
; unlt(a,b) = ~ge(a,b)

The operators on the right side have been supported in part 1.
This patch should not have any functionality change too.

gcc/ChangeLog:

* config/rs6000/rs6000.cc (rs6000_emit_vector_compare): Emit rtx
comparison for operators NE/UNLE/UNLT of MODE_VECTOR_FLOAT directly.

8 months agors6000: Rework vector float comparison in rs6000_emit_vector_compare - p1
Kewen Lin [Fri, 15 Nov 2024 03:46:32 +0000 (03:46 +0000)] 
rs6000: Rework vector float comparison in rs6000_emit_vector_compare - p1

All kinds of vector float comparison operators have been
supported in a rtl comparison pattern as vector.md, we can
just emit an rtx comparison insn with the given comparison
operator in function rs6000_emit_vector_compare instead of
checking and handling the reverse condition cases.

This is part 1, it only handles the operators which are
already emitted with an rtx comparison previously in function
rs6000_emit_vector_compare_inner, they are EQ/GT/GE/ORDERED/
UNORDERED/UNEQ/LTGT.  There is no functionality change.

With this change, rs6000_emit_vector_compare_inner would
only work for vector integer comparison handling, it would
be cleaned up later in vector integer comparison rework.

gcc/ChangeLog:

* config/rs6000/rs6000.cc (rs6000_emit_vector_compare_inner): Move
MODE_VECTOR_FLOAT handlings out.
(rs6000_emit_vector_compare): Emit rtx comparison for operators EQ/GT/
GE/UNORDERED/ORDERED/UNEQ/LTGT of MODE_VECTOR_FLOAT directly, and
adjust one call site of rs6000_emit_vector_compare_inner to
rs6000_emit_vector_compare.

8 months agoDaily bump.
GCC Administrator [Fri, 15 Nov 2024 00:16:23 +0000 (00:16 +0000)] 
Daily bump.

8 months agolibstdc++: Fix indentation in std::list::emplace_back
Jonathan Wakely [Fri, 15 Nov 2024 00:00:38 +0000 (00:00 +0000)] 
libstdc++: Fix indentation in std::list::emplace_back

libstdc++-v3/ChangeLog:

* include/bits/stl_list.h (list::emplace_back): Fix indentation.

8 months ago[RISC-V][V2] Fix type on vector move patterns
Jeff Law [Thu, 14 Nov 2024 23:57:50 +0000 (16:57 -0700)] 
[RISC-V][V2] Fix type on vector move patterns

Updated version of my prior patch to fix type attributes on the
pre-allocation vector move pattern.  This version just adds a suitable
set of attributes to a second pattern that was obviously wrong.

Passed on my tester for rv64 and rv32 crosses.  Bootstrapped and
regression tested on riscv64-linux-gnu as well.

--

So I was looking into a horrific schedule for SAD a week or so ago and
came across this gem.

Basically we were treating a vector load as a vector move from a
scheduling standpoint during sched1.  Naturally we didn't expose much
ILP during sched1.  That in turn caused the register allocator to pack
the pseudos onto the physical vector registers tightly.  regrename
didn't do anything useful and the resulting code had too many false
dependencies for sched2 to do anything useful.

As a result we were taking many load->use stalls in x264's SAD routine.

I'm confident the types are fine, but I'm a lot less sure about the
other attributes (mode, avl_type_index, mode_idx).  If someone could
take a look at that, it'd be greatly appreciated.

There's other cases that may need similar treatment.  But I didn't want
to muck with them until I understood those other attributes and how they
need adjustments.

In particular mov<VLS_AVL_REG:mode><P:mode>_lra appears to have the same
problem.

--

gcc/
* config/riscv/vector.md (mov<mode> pattern/splitter): Fix type and
other attributes.
(mov<VLS_AVL_REG:mode><P:mode>_lra): Likewise.

8 months agoFortran: fix passing of NULL() actual argument to character dummy [PR104819]
Harald Anlauf [Thu, 14 Nov 2024 20:38:04 +0000 (21:38 +0100)] 
Fortran: fix passing of NULL() actual argument to character dummy [PR104819]

Ensure that character length is set and passed by the call to a procedure
when its dummy argument is NULL() with MOLD argument present, or set length
to either 0 or the callee's expected character length.  For assumed-rank
dummies, use the rank of the MOLD argument.  Generate temporaries for
passed arguments when needed.

PR fortran/104819

gcc/fortran/ChangeLog:

* trans-expr.cc (conv_null_actual): Helper function to handle
passing of NULL() to non-optional dummy arguments of non-bind(c)
procedures.
(gfc_conv_procedure_call): Use it for character dummies.

gcc/testsuite/ChangeLog:

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

8 months agogcc: regenerate configure
Sam James [Thu, 14 Nov 2024 20:52:43 +0000 (20:52 +0000)] 
gcc: regenerate configure

r15-5257-g56ded80b96b0f6 didn't regenerate configure correctly.

See https://inbox.sourceware.org/gcc-patches/ZzZf69gORVPRo6Ct@zen.kayari.org/.

gcc/ChangeLog:

* configure: Regenerate.

8 months agoThe fix for PR117191
Denis Chertykov [Thu, 14 Nov 2024 20:50:36 +0000 (00:50 +0400)] 
The fix for PR117191

Wrong code appears after dse2 pass because it removes necessary insns.
(ie insn 554 - store to frame spill slot)
This happened because LRA pass doesn't cleanup the code exactly like reload does.
The reload1.c has a special pass for such cleanup.
The reload removes CLOBBER insns with spill slots like this:
(insn 202 184 186 7 (clobber (mem/c:TI (plus:HI (reg/f:HI 28 r28)
                (const_int 1 [0x1])) [3 %sfp+1 S16 A8])) -1
     (nil))

Fragment from reload1.c:
--------------------------------------------------------------------------------
  reload_completed = 1;

  /* Make a pass over all the insns and delete all USEs which we inserted
     only to tag a REG_EQUAL note on them.  Remove all REG_DEAD and REG_UNUSED
     notes.  Delete all CLOBBER insns, except those that refer to the return
     value and the special mem:BLK CLOBBERs added to prevent the scheduler
     from misarranging variable-array code, and simplify (subreg (reg))
     operands.  Strip and regenerate REG_INC notes that may have been moved
     around.  */

  for (insn = first; insn; insn = NEXT_INSN (insn))
    if (INSN_P (insn))
      {
rtx *pnote;

if (CALL_P (insn))
  replace_pseudos_in (& CALL_INSN_FUNCTION_USAGE (insn),
      VOIDmode, CALL_INSN_FUNCTION_USAGE (insn));

if ((GET_CODE (PATTERN (insn)) == USE
     /* We mark with QImode USEs introduced by reload itself.  */
     && (GET_MODE (insn) == QImode
 || find_reg_note (insn, REG_EQUAL, NULL_RTX)))
    || (GET_CODE (PATTERN (insn)) == CLOBBER
&& (!MEM_P (XEXP (PATTERN (insn), 0))
    || GET_MODE (XEXP (PATTERN (insn), 0)) != BLKmode
    || (GET_CODE (XEXP (XEXP (PATTERN (insn), 0), 0)) != SCRATCH
&& XEXP (XEXP (PATTERN (insn), 0), 0)
!= stack_pointer_rtx))
&& (!REG_P (XEXP (PATTERN (insn), 0))
    || ! REG_FUNCTION_VALUE_P (XEXP (PATTERN (insn), 0)))))
  {
    delete_insn (insn);
    continue;
  }
--------------------------------------------------------------------------------

LRA have a similar place where it removes unnecessary insns, but not CLOBBER insns with
memory spill slots. It's `lra_final_code_change' function.

I just mark a CLOBBER insn with pseudo spilled to memory for removing it later together
with LRA temporary CLOBBER insns.

PR rtl-optimization/117191
gcc/
* lra-spills.cc (spill_pseudos): Mark a CLOBBER insn with pseudo
spilled to memory for removing it later together with LRA temporary
CLOBBER insns.

8 months agolibstdc++: Make equal and is_permutation short-circuit (LWG 3560)
Jonathan Wakely [Thu, 14 Nov 2024 16:57:17 +0000 (16:57 +0000)] 
libstdc++: Make equal and is_permutation short-circuit (LWG 3560)

We already implement short-circuiting for random access iterators, but
we also need to do so for ranges::equal and ranges::is_permutation when
given sized ranges that are not random access ranges (e.g. std::list).

libstdc++-v3/ChangeLog:

* include/bits/ranges_algo.h (__is_permutation_fn::operator()):
Short-circuit for sized ranges with different sizes, as per LWG
3560.
* include/bits/ranges_algobase.h (__equal_fn::operator()):
Likewise.
* include/bits/stl_algo.h (__is_permutation): Use if-constexpr
for random access iterator branches.
* include/bits/stl_algobase.h (__equal4): Likewise.
* testsuite/25_algorithms/equal/lwg3560.cc: New test.
* testsuite/25_algorithms/is_permutation/lwg3560.cc: New test.

Reviewed-by: Patrick Palka <ppalka@redhat.com>
8 months agoipa: Rationalize IPA-VR computations across pass-through jump functions
Martin Jambor [Thu, 14 Nov 2024 19:55:06 +0000 (20:55 +0100)] 
ipa: Rationalize IPA-VR computations across pass-through jump functions

Currently ipa_value_range_from_jfunc and
propagate_vr_across_jump_function contain similar but not same code
for dealing with pass-through jump functions.  This patch puts these
common bits into one function which can also handle comparison
operations.

gcc/ChangeLog:

2024-11-01  Martin Jambor  <mjambor@suse.cz>

PR ipa/114985
* ipa-cp.cc (ipa_vr_intersect_with_arith_jfunc): New function.
(ipa_value_range_from_jfunc): Move the common functionality to the
above new function, adjust the rest so that it works with it well.
(propagate_vr_across_jump_function): Likewise.

8 months agolibstdc++: Implement LWG 3563 changes to keys_view and values_view
Patrick Palka [Thu, 14 Nov 2024 18:27:41 +0000 (13:27 -0500)] 
libstdc++: Implement LWG 3563 changes to keys_view and values_view

This LWG issue corrects the definition of these alias templates to make
them suitable for alias CTAD.

libstdc++-v3/ChangeLog:

* include/std/ranges (keys_view): Adjust as per LWG 3563.
(values_view): Likewise.
* testsuite/std/ranges/adaptors/elements.cc (test08): New test.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
8 months agolibstdc++: Fix get<0> constraint for lvalue ranges::subrange (LWG 3589)
Jonathan Wakely [Thu, 14 Nov 2024 17:31:43 +0000 (17:31 +0000)] 
libstdc++: Fix get<0> constraint for lvalue ranges::subrange (LWG 3589)

Apprived at October 2021 plenary.

libstdc++-v3/ChangeLog:

* include/bits/ranges_util.h (subrange::begin): Fix constraint,
as per LWG 3589.
* testsuite/std/ranges/subrange/lwg3589.cc: New test.

8 months agoDaily bump.
GCC Administrator [Thu, 14 Nov 2024 17:20:15 +0000 (17:20 +0000)] 
Daily bump.

8 months agocontrib: Add another ignored commit
Jeff Law [Thu, 14 Nov 2024 17:14:53 +0000 (10:14 -0700)] 
contrib: Add another ignored commit

* gcc-changelog/git_update_version.py (ignored_commits): Add
another ignored commit.

8 months agolibstdc++: Make _GLIBCXX_NODISCARD work for C++11 and C++14
Jonathan Wakely [Mon, 26 Feb 2024 11:40:46 +0000 (11:40 +0000)] 
libstdc++: Make _GLIBCXX_NODISCARD work for C++11 and C++14

The _GLIBCXX_NODISCARD macro only expands to [[__nodiscard__]] for C++17
and later, but all supported compilers will allow us to use that for
C++11 and C++14 too. Enable it for those older standards, to give
improved diagnostics for users of those older standards.

libstdc++-v3/ChangeLog:

* include/bits/c++config (_GLIBCXX_NODISCARD): Expand for C++11
and C++14.
* testsuite/22_locale/locale/cons/12438.cc: Adjust dg-warning to
expect nodiscard warnings for C++11 and C++14 as well.
* testsuite/22_locale/locale/operations/2.cc: Likewise.
* testsuite/25_algorithms/equal/debug/1_neg.cc: Likewise.
* testsuite/25_algorithms/equal/debug/2_neg.cc: Likewise.
* testsuite/25_algorithms/equal/debug/3_neg.cc: Likewise.
* testsuite/25_algorithms/find_first_of/concept_check_1.cc:
Likewise.
* testsuite/25_algorithms/is_permutation/2.cc: Likewise.
* testsuite/25_algorithms/lexicographical_compare/71545.cc:
Likewise.
* testsuite/25_algorithms/lower_bound/33613.cc: Likewise.
* testsuite/25_algorithms/lower_bound/debug/irreflexive.cc:
Likewise.
* testsuite/25_algorithms/lower_bound/debug/partitioned_neg.cc:
Likewise.
* testsuite/25_algorithms/lower_bound/debug/partitioned_pred_neg.cc: Likewise.
* testsuite/25_algorithms/minmax/3.cc: Likewise.
* testsuite/25_algorithms/search/78346.cc: Likewise.
* testsuite/25_algorithms/search_n/58358.cc: Likewise.
* testsuite/25_algorithms/unique/1.cc: Likewise.
* testsuite/25_algorithms/unique/11480.cc: Likewise.
* testsuite/25_algorithms/upper_bound/33613.cc: Likewise.
* testsuite/25_algorithms/upper_bound/debug/partitioned_neg.cc:
Likewise.
* testsuite/25_algorithms/upper_bound/debug/partitioned_pred_neg.cc: Likewise.
* testsuite/27_io/ios_base/types/fmtflags/bitmask_operators.cc:
Likewise.
* testsuite/27_io/ios_base/types/iostate/bitmask_operators.cc:
Likewise.
* testsuite/27_io/ios_base/types/openmode/bitmask_operators.cc:
Likewise.
* testsuite/ext/concept_checks.cc: Likewise.
* testsuite/ext/is_heap/47709.cc: Likewise.
* testsuite/ext/is_sorted/cxx0x.cc: Likewise.

8 months agocontrib: Add 2 further ignored commits
Jeff Law [Thu, 14 Nov 2024 16:43:37 +0000 (09:43 -0700)] 
contrib: Add 2 further ignored commits

I goof'd and double-reverted a change.  Add those to the ignore
list, leaving the final reversion as-is.

* gcc-changelog/git_update_version.py (ignored_commits): Add 2
further commits.

8 months agolibstdc++: stdc++.h and <coroutine>
Jason Merrill [Thu, 14 Nov 2024 04:39:53 +0000 (23:39 -0500)] 
libstdc++: stdc++.h and <coroutine>

r13-3036 moved #include <coroutine> into the new freestanding section, but
also moved it from a C++20 section to a C++23 section.  This patch moves it
back.

Incidentally, I'm curious why a few headers were removed from the hosted
section (including <coroutine>), but most were left in place, so we have
redundant includes of most hosted headers.

libstdc++-v3/ChangeLog:

* include/precompiled/stdc++.h: <coroutine> is C++20.

8 months agoc++: fix namespace alias export
Jason Merrill [Tue, 12 Nov 2024 21:04:52 +0000 (16:04 -0500)] 
c++: fix namespace alias export

This affected std::views in module std.

gcc/cp/ChangeLog:

* name-lookup.cc (do_namespace_alias): set_originating_module after
pushdecl.

gcc/testsuite/ChangeLog:

* g++.dg/modules/namespace-7_a.C: New test.
* g++.dg/modules/namespace-7_b.C: New test.

8 months agoc++: module dialect tweak
Jason Merrill [Tue, 12 Nov 2024 00:27:52 +0000 (19:27 -0500)] 
c++: module dialect tweak

Coroutines have been enabled by -std=c++20 since GCC 11.

gcc/cp/ChangeLog:

* module.cc (module_state_config::get_dialect): Expect coroutines in
C++20.

8 months agoFix common.opt.urls
Jan Hubicka [Thu, 14 Nov 2024 16:29:14 +0000 (17:29 +0100)] 
Fix common.opt.urls

gcc/ChangeLog:

* common.opt.urls: Fix.

8 months agoRevert "Reapply "[PATCH v2] RISC-V: zero_extend(not) -> xor optimization [PR112398]""
Jeff Law [Thu, 14 Nov 2024 16:26:11 +0000 (09:26 -0700)] 
Revert "Reapply "[PATCH v2] RISC-V: zero_extend(not) -> xor optimization [PR112398]""

This reverts commit 10d76b7f1e5b63ad6d2b92940c39007913ced037.

8 months agoaarch64: Fix nonlocal goto tests incompatible with GCS
Yury Khrustalev [Thu, 14 Nov 2024 16:15:14 +0000 (16:15 +0000)] 
aarch64: Fix nonlocal goto tests incompatible with GCS

gcc/testsuite/ChangeLog:
* gcc.target/aarch64/gcs-nonlocal-3.c: New test.
* gcc.target/aarch64/sme/nonlocal_goto_4.c: Update.
* gcc.target/aarch64/sme/nonlocal_goto_5.c: Update.
* gcc.target/aarch64/sme/nonlocal_goto_6.c: Update.