]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
8 days agoRISC-V: Allow RVV register overlap for vwadd[u].wv
Pan Li [Fri, 24 Jul 2026 03:01:59 +0000 (11:01 +0800)] 
RISC-V: Allow RVV register overlap for vwadd[u].wv

Like v[sz]ext.vf8, allow the rvv register overlap
for vwadd[u].wv.

gcc/ChangeLog:

* config/riscv/riscv-v.cc (riscv_v_widen_constraint_ok): Return
false when wide_mode and mode are same.
* config/riscv/vector.md: Leverage Wvr constraint.

Signed-off-by: Pan Li <pan2.li@intel.com>
8 days agoDaily bump.
GCC Administrator [Sun, 26 Jul 2026 00:16:35 +0000 (00:16 +0000)] 
Daily bump.

9 days agophiopt: New comparison combine part of phiopt [PR126138]
Andrea Pinski [Mon, 13 Jul 2026 22:20:09 +0000 (15:20 -0700)] 
phiopt: New comparison combine part of phiopt [PR126138]

Since phiopt rejects trapping statements, this has to be done
seperately but it does reuse most of the infastructure to handle
this.
This is designed to handle foating point comparisons mergining
with another one.
An example is:
```
c = false;
if (a > b) c = a >= b;
```
This should merge into just `c = a > b;`.
Which we do already if it was written as `a > b && a >= b`.
In this case this is already handled by DOM/VRP/ranger.

The case I am more interesting in is:
```
bool f1(double a, double b)
{
  if (a == b)
    return 1;
  return a > b;
}
```
Which can/should optimize to `a >= b`.
This comes from `(a <=> b) >= 0` without spaceship_replacement and/or
with a patch that forwprops the phi values into the `>= 0`; replacing
the phi.

That is this is prerequisite to
https://inbox.sourceware.org/gcc-patches/20260625233902.2605630-1-andrew.pinski@oss.qualcomm.com/.
and to remove spaceship_replacement in phiopt.

Bootstrapped and tested on x86_64-linux-gnu.

PR tree-optimization/126138
gcc/ChangeLog:

* tree-ssa-phiopt.cc (one_feeding_comparison_into_p): New function.
(comparison_combine): New function.
(pass_phiopt::execute): Call comparison_combine.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/fp-trapping-cmp-4.c: New test.
* gcc.dg/tree-ssa/fp-trapping-cmp-5.c: New test.

Signed-off-by: Andrea Pinski <andrew.pinski@oss.qualcomm.com>
9 days agoifcombine: Handle trapping ifcombining better. [PR126138]
Andrea Pinski [Sun, 12 Jul 2026 05:57:39 +0000 (22:57 -0700)] 
ifcombine: Handle trapping ifcombining better. [PR126138]

We can sometimes combine comparisons that are trapping.
This adds that optimization to ifcombine; using combine_comparison
from fold-const to do most of the work.

This does not handle all cases though; mostly dealing with where we need an
inversion of the outer comparison and it does not invert is not currently handled.
This will be handled later on as it needs some extra code added to combine_comparisons.

Bootstrapped and tested on x86_64-linux-gnu.

PR tree-optimization/126138
gcc/ChangeLog:

* tree-ssa-ifcombine.cc (bb_no_side_effects_p): Don't reject GIMPLE_COND
that can trap.
(ifcombine_ifandif): Handle trapping inner conditional specially.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/fp-trapping-cmp-2.c: New test.
* gcc.dg/tree-ssa/fp-trapping-cmp-3.c: New test.

Signed-off-by: Andrea Pinski <andrew.pinski@oss.qualcomm.com>
9 days agofold: Allow combining eq/ne with a trapping to get a trapping [PR126138]
Andrea Pinski [Sun, 12 Jul 2026 05:56:40 +0000 (22:56 -0700)] 
fold: Allow combining eq/ne with a trapping to get a trapping [PR126138]

For `(i == j) || (i < j)` this can be combined to just `i <= j` without
worrying about removal of a trap as a NaN would cause the the equal to be
false which will cause not to short circuit and the trapping instruction
will always be executed.

`(i != j) && (i < j)` has the same reasoning.

Bootstrapped and tested on x86_64-linux-gnu.

PR tree-optimization/126138

gcc/ChangeLog:

* fold-const.cc (combine_comparisons): Allow eq to combine
with || and ne combine with && if the original rcode was trapping
and the new code is trapping.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/fp-trapping-cmp-1.c: New test.

Signed-off-by: Andrea Pinski <andrew.pinski@oss.qualcomm.com>
9 days agoc++: function NTTP argument in pack considered unused [PR126280]
Patrick Palka [Sat, 25 Jul 2026 20:12:19 +0000 (16:12 -0400)] 
c++: function NTTP argument in pack considered unused [PR126280]

This is just the pack version of PR c++/105848, in which our non-dependent
call pruning may cause us to not mark an otherwise unused function pointer
template argument within a pack as used.

PR c++/126280

gcc/cp/ChangeLog:

* pt.cc (mark_template_arguments_used): Split out loop into ...
(mark_template_arguments_used_1): ... here. Recurse into
argument packs.

gcc/testsuite/ChangeLog:

* g++.dg/template/fn-ptr6.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
9 days agolibstdc++: Implement LWG 4074 changes to join_with_view's constraints
Patrick Palka [Sat, 25 Jul 2026 20:12:16 +0000 (16:12 -0400)] 
libstdc++: Implement LWG 4074 changes to join_with_view's constraints

libstdc++-v3/ChangeLog:

* include/std/ranges (__detail::__compatible_joinable_ranges):
Remove.
(__detail::__concat_reference_t): Move definition up.
(__detail::__concat_value_t): Likewise.
(__detail::__concat_rvalue_reference_t): Likewise.
(__detail::__concat_indirectly_readable_impl): Likewise.
(__detail::__concat_indirectly_readable): Likewise.
(__detail::__concatable): Likewise.
(join_with_view): Use __concatable instead of
__compatible_joinable_ranges in constraints as per LWG 4074.
(join_with_view::begin): Add __concatable constraint as per
LWG 4074.
(join_with_view::end): Likewise.
(join_with_view::_Iterator): Adjust out-of-line declaration.
(join_with_view::_Sentinel): Likewise.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
9 days agolibstdc++: Optimize flat_map range insertion for pair-like elements
Patrick Palka [Sat, 25 Jul 2026 20:12:13 +0000 (16:12 -0400)] 
libstdc++: Optimize flat_map range insertion for pair-like elements

When inserting a range of pair-like elements we can avoid constructing a
value_type (i.e. pair) temporary and instead obtain the corresponding key
and value directly from *__first.

This came up when looking at LWG 4499 for flat_set::insert_range (which
I think we already optimally implement) but it prompted me to look at
flat_map::insert_range during which I noticed this extra std::move.

libstdc++-v3/ChangeLog:

* include/std/flat_map (flat_map::_M_insert): Avoid constructing
value_type temporary when the iterator already has pair-like
elements.
* testsuite/23_containers/flat_map/1.cc (test14): New test.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
9 days agoUse HOST_SIZE_T_PRINT_UNSIGNED in a few other spots
Jakub Jelinek [Sat, 25 Jul 2026 19:56:48 +0000 (21:56 +0200)] 
Use HOST_SIZE_T_PRINT_UNSIGNED in a few other spots

On Thu, Jul 23, 2026 at 12:06 PM John David Anglin <dave.anglin@bell.net> wrote:
> Not all hosts support the "z" format length modifier.  Noticed
> by inspection.

That is not the only spot that does this though.
I've grepped for printf.*%z and found this.

2026-07-25  Jakub Jelinek  <jakub@redhat.com>

gcc/
* sym-exec/sym-exec-expression.cc (symbolic_bit::print): Use
HOST_SIZE_T_PRINT_UNSIGNED instead of "%zu" and add cast to
fmt_size_t.
* genoutput.cc (main): Likewise.
gcc/cobol/
* symbols.cc (symbols_dump): Use HOST_SIZE_T_PRINT_UNSIGNED instead
of "%zu" and add cast to fmt_size_t.

Reviewed-by: Andrea Pinski <andrew.pinski@oss.qualcomm.com>
9 days agolibgfortran: Fix whitespace in ceill_16.c
John David Anglin [Sat, 25 Jul 2026 15:45:33 +0000 (11:45 -0400)] 
libgfortran: Fix whitespace in ceill_16.c

2026-07-25  John David Anglin  <danglin@gcc.gnu.org>

libgfortran/ChangeLog:

* intrinsics/ceill_16.c: Fix whitespace.

9 days agoMAINTAINERS: Add myself to write-after-approval and DCO
Egas Ribeiro [Sat, 25 Jul 2026 14:37:26 +0000 (15:37 +0100)] 
MAINTAINERS: Add myself to write-after-approval and DCO

ChangeLog:

* MAINTAINERS: Add myself.
* MAINTAINERS.yml: Regenerate.

Signed-off-by: Egas Ribeiro <egas.g.ribeiro@gmail.com>
9 days agoAVR: Add __negdi2_r10 to libgcc.
Georg-Johann Lay [Sat, 25 Jul 2026 13:14:50 +0000 (15:14 +0200)] 
AVR: Add __negdi2_r10 to libgcc.

This patch introduces __negdi2_r10 to lib1funcs.S and tidies
some 64-bit negations.

libgcc/
* config/avr/t-avr (FUNCS_notiny): Add _negdi2_r10.
* config/avr/lib1funcs.S (__negdi2_r10): New function.
(__divdi3_moddi3): Use it.
* config/avr/lib1funcs-fixed.S (__mulQ64_work): Use it.

9 days agoifcvt: Keep only reaching definitions when rewiring sets [PR126184]
Kyrylo Tkachov [Wed, 22 Jul 2026 14:45:51 +0000 (16:45 +0200)] 
ifcvt: Keep only reaching definitions when rewiring sets [PR126184]

init_noce_multiple_sets_info records earlier SET destinations that are
mentioned by a later SET source.  When a pseudo is set more than once, only
its most recent prior definition reaches that source.

Recording every definition is unsafe in the second
noce_convert_multiple_sets_1 attempt.  The newest definition can be emitted
directly into its target pseudo, making its replacement a no-op.  A later
replacement using an older definition then substitutes a stale value.

PR126184 contains the following dependency chain:

  c = x + 1;
  x = c * y;
  c = z + 3;
  y = c * x;

The unfixed conversion computes the last multiply with the temporary that
holds `x + 1`, rather than the reaching `z + 3` value.

The unfixed final sequence forms `x + 1` in x0 and later uses x0 as the
multiply operand:

  add     x0, x1, 1
  csel    x1, x1, x3, eq
  mul     x0, x1, x0

With the fix, x3 retains z until `z + 3` is formed and used by the multiply:

  add     x3, x3, 3
  csel    x0, x0, x1, ne
  mul     x3, x0, x3

Walk definitions from newest to oldest and record only the first match for
each pseudo.  Add an AArch64 execution test for the reported dependency.

Bootstrapped and tested on aarch64-none-linux-gnu and
x86_64-pc-linux-gnu.

gcc/ChangeLog:

PR rtl-optimization/126184
* ifcvt.cc (init_noce_multiple_sets_info): Record only the most
recent prior definition of each pseudo register.

gcc/testsuite/ChangeLog:

PR rtl-optimization/126184
* gcc.target/aarch64/pr126184.c: New test.

Signed-off-by: Kyrylo Tkachov <ktkachov@nvidia.com>
9 days agoifcvt: Reject hard-register destinations in multiple sets [PR126184]
Kyrylo Tkachov [Wed, 22 Jul 2026 14:45:16 +0000 (16:45 +0200)] 
ifcvt: Reject hard-register destinations in multiple sets [PR126184]

noce_convert_multiple_sets keys its dependency information by destination
register number.  Hard registers can have overlapping definitions in
different modes.  An exact RTL replacement cannot represent the value from a
partial or mode-changing definition.

Reject hard-register destinations in the block eligibility check.  Assert
the resulting pseudo-only invariant when dependency information is
initialized.

Add an RTL execution test with mixed-mode hard-register definitions.  It
verifies that the block remains unconverted.

Bootstrapped and regtested on aarch64-none-linux-gnu and
x86_64-pc-linux-gnu.

gcc/ChangeLog:

PR rtl-optimization/126184
* ifcvt.cc (init_noce_multiple_sets_info): Assert that destinations
are pseudos.
(bb_ok_for_noce_convert_multiple_sets): Reject hard-register
destinations.

gcc/testsuite/ChangeLog:

PR rtl-optimization/126184
* gcc.target/aarch64/pr126184-2.c: New test.

Signed-off-by: Kyrylo Tkachov <ktkachov@nvidia.com>
9 days agogcc.target/i386/pr[27827|50038].c: Compile with -mno-sse
H.J. Lu [Sat, 25 Jul 2026 06:26:41 +0000 (14:26 +0800)] 
gcc.target/i386/pr[27827|50038].c: Compile with -mno-sse

After

commit fb0838bc1073aa5f22ec38e0cca2d70d625c6d71
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Jul 15 10:37:57 2026 +0200

    Support two-lane vector BB reductions without target support

we may vectorize gcc.target/i386/pr27827.c and gcc.target/i386/pr50038.c
with -march=native and

$ make check-gcc RUNTESTFLAGS="--target_board='unix{-m32\ -march=native,-march=native}'

get

FAIL: gcc.target/i386/pr27827.c scan-assembler fmul[ \t]*%st
FAIL: gcc.target/i386/pr50038.c scan-assembler-times movzbl 2

Since these 2 tests don't use SEE instructions originally, compile them
with -mno-sse to avoid test failures.

PR tree-optimization/126028
* gcc.target/i386/pr27827.c: Compile with -mno-sse.
* gcc.target/i386/pr50038.c: Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
9 days agocobol: ACCEPT <DATE> into subscripted and reference-modified variables.
Robert Dubner [Sat, 25 Jul 2026 04:57:49 +0000 (00:57 -0400)] 
cobol: ACCEPT <DATE> into subscripted and reference-modified variables.

The principal changes here are so that ACCEPT X(N) FROM <date-funcs> and
ACCEPT Y(A:B) FROM <date-funcs> work.

Another set of changes modifies SELECT ASSIGN to handle certain IBM
requirements about TO DEVICE syntax.

There are also changes here that improve the execution time of certain types
of MOVE statements.

gcc/cobol/ChangeLog:

* cbldiag.h (struct cbl_loc_t): Mollify cppcheck.
* gcobol.1: Documentation.
* genapi.cc (parser_accept_date_yymmdd): Changes to ACCEPT.
(parser_accept_date_yyyymmdd): Likewise.
(parser_accept_date_yyddd): Likewise.
(parser_accept_date_yyyyddd): Likewise.
(parser_accept_date_dow): Likewise.
(parser_accept_date_hhmmssff): Likewise.
(walk_initialization): Propagate based_e attribute to child variables.
(parser_file_open): SELECT ASSIGN TO DEVICE changes.
(parser_call): Include function name in error message when the
function name cannot be found.
* genapi.h (parser_accept_date_yymmdd): Changes to ACCEPT.
(parser_accept_date_yyyymmdd): Likewise.
(parser_accept_date_yyddd): Likewise.
(parser_accept_date_yyyyddd): Likewise.
(parser_accept_date_dow): Likewise.
(parser_accept_date_hhmmssff): Likewise.
* genutil.cc (FIXED_WIDE_INT): Potential improvement to MOVE
statements involving intermediate_e variables.
(get_power_of_two): Likewise.
* genutil.h (FIXED_WIDE_INT): Likewise.
* lexio.h (struct filespan_t): Mollify cppcheck.
* move.cc (mh_identical): Improve MOVE execution speed.
(copy_native_into_place): Likewise.
(copy_intermediate_into_place): Likewise.
(mh_to_binary): Likewise.
(move_helper): Likewise.
* parse.y: Changes to ACCEPT.
* symbols.cc (symbol_table_init): Add external_e attribute to
DEBUG-ITEM and children.
(new_temporary_impl): Mollify cppcheck.
* symfind.cc (struct funcname): Likewise.
* util.cc (determine_intermediate_type): Set output.data.digits to
zero.

libgcobol/ChangeLog:

* constants.cc (struct cblc_field_t):  Add external_e attribute to
DEBUG-ITEM and children.
* libgcobol.cc (field_from_ascii): Changes to ACCEPT.
(__gg__get_date_yymmdd): Likewise.
(__gg__get_date_yyyymmdd): Likewise.
(__gg__get_date_yyddd): Likewise.
(__gg__get_yyyyddd): Likewise.
(__gg__get_date_dow): Likewise.
(__gg__get_date_hhmmssff): Likewise.
(format_for_display_internal): Initialize an automatic variable.
(default_exception_handler): Include function name in "missing
function" run-time error.
(__gg__set_exception_code): Likewise.
(__gg__set_exception_call): Likewise.

gcc/testsuite/ChangeLog:

* cobol.dg/group2/ACCEPT_FROM__date__with_subscripts_and_refmods.cob: New test.
* cobol.dg/group2/ACCEPT_FROM__date__with_subscripts_and_refmods.out: New test.
* cobol.dg/group2/MOVE__identical__operations.cob: New test.
* cobol.dg/group2/MOVE__identical__operations.out: New test.
* cobol.dg/group2/RT3574_PR__40-_Repository_section_intrinsic_funcs.cob: New test.

9 days ago[PATCH v2] tree-optimization: Fix strlen(s) != 0 not folded into *s [PR92408]
Ashley Chekhova [Sat, 25 Jul 2026 05:26:43 +0000 (23:26 -0600)] 
[PATCH v2] tree-optimization: Fix strlen(s) != 0 not folded into *s [PR92408]

Checks for strlen(s) == 0 could be rewritten as *s == 0 in the simple
case, but in complex cases (such as those involving variable
assignment), the optimization wouldn't be implemented. Fix this
by moving it over to forwprop from fold-const. Although, since
this currently only runs when PROP_last_full_fold is set, the
original code is kept in as well.

Bootstrapped and tested on x86_64-pc-linux-gnu

PR tree-optimization/92408

gcc/ChangeLog:

* tree-ssa-forwprop.cc (optimize_strlen_comp): Rewrite
strlen(s) == 0 as *s == 0 and strlen(s) != 0 as *s != 0.
(simplify_builtin_call): Added call to optimize_strlen_comp.

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

9 days agoRISC-V: Use ordered scatter variants.
Robin Dapp [Tue, 21 Jul 2026 08:37:58 +0000 (10:37 +0200)] 
RISC-V: Use ordered scatter variants.

The vectorizer expects scatters to write in an ordered fashion.
Only the ordered indexed stores offer this, so use them instead of the
unordered ones.

PR target/126334

gcc/ChangeLog:

* config/riscv/riscv-v.cc (get_gather_scatter_code): Use ordered
indexed stores.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_32-1.c:
Adjust test expectations.
* gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_32-10.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_32-11.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_32-12.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_32-2.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_32-3.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_32-4.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_32-5.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_32-6.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_32-7.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_32-8.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_32-9.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_gather_load_32-1.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_gather_load_32-10.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_gather_load_32-11.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_gather_load_32-2.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_gather_load_32-3.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_gather_load_32-4.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_gather_load_32-5.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_gather_load_32-6.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_gather_load_32-7.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_gather_load_32-8.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_gather_load_32-9.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_scatter_store_32-1.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_scatter_store_32-10.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_scatter_store_32-2.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_scatter_store_32-3.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_scatter_store_32-4.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_scatter_store_32-5.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_scatter_store_32-6.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_scatter_store_32-7.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_scatter_store_32-8.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_scatter_store_32-9.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_scatter_store_64-1.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_scatter_store_64-10.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_scatter_store_64-2.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_scatter_store_64-3.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_scatter_store_64-4.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_scatter_store_64-5.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_scatter_store_64-6.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_scatter_store_64-7.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_scatter_store_64-8.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/mask_scatter_store_64-9.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/scatter_store_32-1.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/scatter_store_32-10.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/scatter_store_32-2.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/scatter_store_32-4.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/scatter_store_32-5.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/scatter_store_32-6.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/scatter_store_32-7.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/scatter_store_32-8.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/scatter_store_32-9.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/scatter_store_64-1.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/scatter_store_64-10.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/scatter_store_64-2.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/scatter_store_64-3.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/scatter_store_64-4.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/scatter_store_64-5.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/scatter_store_64-6.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/scatter_store_64-7.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/scatter_store_64-8.c: Ditto.
* gcc.target/riscv/rvv/autovec/gather-scatter/scatter_store_64-9.c: Ditto.

9 days agotestsuite: Split rs6000 mma related PR test cases to dmf and nodmf
Avinash Jayakar [Fri, 17 Jul 2026 10:46:07 +0000 (05:46 -0500)] 
testsuite: Split rs6000 mma related PR test cases to dmf and nodmf

Hi Michael,

The same changes as done for 1/2 patch is done for this as well. Kindly
review and approve for trunk and gcc-16.

Thanks,
Avinash

Changes from v1:
* Use dmf, nodmf instead of p10 and future in updated test file names.
* Use powerpc_future_compile_ok for dmf tests.
* Use -mno-dense-math for nodmf tests.

All the remaining test cases which use mma functionality have been
split into power10 and future.

gcc/testsuite/ChangeLog:
PR target/100777
PR target/101849
PR target/102976
PR target/103127
PR target/104923
PR target/106016
PR target/106017
PR target/106833
PR target/110411
PR target/96446
PR target/96530
PR target/96808
PR target/97360
PR target/98872
* gcc.target/powerpc/pr100777.c: Move to...
* gcc.target/powerpc/pr100777.h: ...here.
* gcc.target/powerpc/pr101849.c: Move to...
* gcc.target/powerpc/pr101849.h: ...here.
* gcc.target/powerpc/pr103127.c: Move to...
* gcc.target/powerpc/pr103127.h: ...here.
* gcc.target/powerpc/pr104923.c: Move to...
* gcc.target/powerpc/pr104923.h: ...here.
* gcc.target/powerpc/pr106016.c: Move to...
* gcc.target/powerpc/pr106016.h: ...here.
* gcc.target/powerpc/pr106017.c: Move to...
* gcc.target/powerpc/pr106017.h: ...here.
* gcc.target/powerpc/pr110411-2.c: Move to...
* gcc.target/powerpc/pr110411-2.h: ...here.
* gcc.target/powerpc/pr96446.c: Move to...
* gcc.target/powerpc/pr96446.h: ...here.
* gcc.target/powerpc/pr96530.c: Move to...
* gcc.target/powerpc/pr96530.h: ...here.
* gcc.target/powerpc/pr96808.c: Move to...
* gcc.target/powerpc/pr96808.h: ...here.
* gcc.target/powerpc/pr97360.c: Move to...
* gcc.target/powerpc/pr97360.h: ...here.
* gcc.target/powerpc/pr98872.c: Move to...
* gcc.target/powerpc/pr98872.h: ...here.
* gcc.target/powerpc/pr102976.c: Removed.
* gcc.target/powerpc/pr103627-1.c: Removed.
* gcc.target/powerpc/pr106833.c: Removed.
* gcc.target/powerpc/pr100777.dmf.c: New test.
* gcc.target/powerpc/pr100777.nodmf.c: New test.
* gcc.target/powerpc/pr101849.dmf.c: New test.
* gcc.target/powerpc/pr101849.nodmf.c: New test.
* gcc.target/powerpc/pr102976.dmf.c: New test.
* gcc.target/powerpc/pr102976.h: New test.
* gcc.target/powerpc/pr102976.nodmf.c: New test.
* gcc.target/powerpc/pr103127.dmf.c: New test.
* gcc.target/powerpc/pr103127.nodmf.c: New test.
* gcc.target/powerpc/pr104923.dmf.c: New test.
* gcc.target/powerpc/pr104923.nodmf.c: New test.
* gcc.target/powerpc/pr106016.dmf.c: New test.
* gcc.target/powerpc/pr106016.nodmf.c: New test.
* gcc.target/powerpc/pr106017.dmf.c: New test.
* gcc.target/powerpc/pr106017.nodmf.c: New test.
* gcc.target/powerpc/pr106833.dmf.c: New test.
* gcc.target/powerpc/pr106833.h: New test.
* gcc.target/powerpc/pr106833.nodmf.c: New test.
* gcc.target/powerpc/pr110411-2.dmf.c: New test.
* gcc.target/powerpc/pr110411-2.nodmf.c: New test.
* gcc.target/powerpc/pr96446.dmf.c: New test.
* gcc.target/powerpc/pr96446.nodmf.c: New test.
* gcc.target/powerpc/pr96530.dmf.c: New test.
* gcc.target/powerpc/pr96530.nodmf.c: New test.
* gcc.target/powerpc/pr96808.dmf.c: New test.
* gcc.target/powerpc/pr96808.nodmf.c: New test.
* gcc.target/powerpc/pr97360.dmf.c: New test.
* gcc.target/powerpc/pr97360.nodmf.c: New test.
* gcc.target/powerpc/pr98872.dmf.c: New test.
* gcc.target/powerpc/pr98872.nodmf.c: New test.

9 days agomiddle-end: Remove most ENUM_BITFIELD uses. [PR125507]
Kael Andrew Alonzo Franco [Sat, 25 Jul 2026 00:28:25 +0000 (20:28 -0400)] 
middle-end: Remove most ENUM_BITFIELD uses. [PR125507]

GCC requires C++14 and C++ supports enum bitfield so ENUM_BITFIELD is deprecated macro.

Bootstrapped and regtested on x86_64-pc-linux-gnu.

PR middle-end/125507

gcc/c-family/ChangeLog:

* c-common.h (struct c_common_resword): Remove ENUM_BITFIELD.
* c-indentation.h (struct token_indent_info): Ditto.

gcc/c/ChangeLog:

* c-parser.h (struct c_token): Remove ENUM_BITFIELD.
* c-tree.h (struct c_declspecs): Ditto.

gcc/cp/ChangeLog:

* cp-tree.h (struct lang_decl_base): Remove ENUM_BITFIELD.
(struct lang_decl_fn): Ditto.
(struct cp_declarator): Ditto.
* name-lookup.h (struct cp_binding_level): Ditto.

gcc/ChangeLog:

* cfgloop.h (class loop): Remove ENUM_BITFIELD.
* cgraph.h (struct toplevel_node): Ditto.
(struct symtab_node): Ditto.
(struct cgraph_node): Ditto.
* combine.cc (struct reg_stat_type): Ditto.
* config/i386/i386.h (struct machine_function): Ditto.
* cse.cc (struct qty_table_elem): Ditto.
(struct table_elt): Ditto.
(struct set): Ditto.
* df.h (struct df_mw_hardreg): Ditto.
(struct df_base_ref): Ditto.
* domwalk.h (class dom_walker): Ditto.
* dwarf2out.h (struct dw_val_node): Ditto.
* gimple.h (struct gimple): Ditto.
* ipa-predicate.h (struct expr_eval_op): Ditto.
(struct condition): Ditto.
* ipa-ref.h (struct ipa_ref): Ditto.
* ira-int.h (struct ira_dependent_filter): Ditto.
(struct ira_allocno): Ditto.
* lra-int.h (struct lra_operand_data): Ditto.
(struct lra_insn_reg): Ditto.
* optabs.h (class expand_operand): Ditto.
* recog.h (struct operand_alternative): Ditto.
(struct insn_operand_data): Ditto.
* ree.cc (struct ext_modified): Ditto.
* regrename.h (struct du_chain): Ditto.
* rtl.h (struct rtx_def): Ditto.
* sched-int.h (struct _dep): Ditto.
* tree-into-ssa.cc (struct common_info): Ditto.
* tree-ssa-loop-ivopts.cc (struct iv_cand): Ditto.
* tree-ssa-sccvn.h (struct vn_nary_op_s): Ditto.
(struct vn_reference_op_struct): Ditto.
* value-range-storage.h (class vrange_storage): Ditto.
* value-range.h (class vrange): Ditto.
* var-tracking.cc (struct variable): Ditto.
* vmsdbg.h (struct _DST_HEADER): Ditto.

Signed-off-by: Kael Andrew Franco <kaelfandrew@gmail.com>
9 days agoDaily bump.
GCC Administrator [Sat, 25 Jul 2026 00:16:32 +0000 (00:16 +0000)] 
Daily bump.

10 days agoFix m68k bootstrap due to -Wempty-body warning
Jeff Law [Fri, 24 Jul 2026 22:19:57 +0000 (16:19 -0600)] 
Fix m68k bootstrap due to -Wempty-body warning

Ah the jobs of conditional compilation...

A recent change is breaking m68k bootstrap as it doesn't have any
UNSPECV_VALUES and as a result we end up with

if (cond)
  ;
[ With no else clauses. ]

Which triggers:

> /home/jlaw/test/gcc/gcc/print-rtl.cc: In function ‘void print_exp(pretty_printer*, const_rtx, int)’:
> /home/jlaw/test/gcc/gcc/print-rtl.cc:1622:11: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]

Rather than using ";" we can use a "{}" pair with proper formatting as the
warning suggests.

Committing as obvious and hopefully restoring m68k bootstrap.

gcc/
* print-rtl.cc (print_exp): Avoid -Wempty-body warning.

10 days agotestsuite/aarch64: Update bitint-args.c for w vs x reg usage
Andrea Pinski [Fri, 24 Jul 2026 20:47:02 +0000 (13:47 -0700)] 
testsuite/aarch64: Update bitint-args.c for w vs x reg usage

bitint-args.c was failing due to the code produced by gcc,
now using the w form of register for f19.  This code is
correct and expected form now after prefering the w form
over the x form.

Pushed as obvious after testing to make sure it works now.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/bitint-args.c (f19): Fix
expected form of sbfx to use the w form.

Signed-off-by: Andrea Pinski <andrew.pinski@oss.qualcomm.com>
10 days agox86: Check register argument spill by callee
H.J. Lu [Sun, 19 Jul 2026 23:57:31 +0000 (07:57 +0800)] 
x86: Check register argument spill by callee

commit b4c215b36d63e1c264d8c1bd5d34f9aef1bb8463
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sat Jun 28 06:27:25 2025 +0800

    Adjust check for addressable misaligned stack argument

ignores arguments passed on stack since caller is responsible to align
the outgoing stack for arguments passed on stack.  However, callee may
spill a register argument:

(set (mem/c:V2DI (plus:DI (reg/f:DI 7 sp)
(const_int -16 [0xfffffffffffffff0])) [4 a1+0 S16 A128])
     (reg:V2DI 20 xmm0 [ a1 ]))

Update ix86_argument_passed_on_stack_p to check spill of register argument
by callee.

gcc/

PR target/126320
* config/i386/i386.cc (ix86_spill_register_argument_p): New
function.
(ix86_argument_passed_on_stack_p): Add a pattern argument.  Call
ix86_spill_register_argument_p to check spill of register argument
by callee.
(ix86_update_stack_alignment): Pass pat to
ix86_argument_passed_on_stack_p.

gcc/testsuite/

PR target/126320
* gcc.target/i386/pr126320.c: New test.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Co-Authored-By: Uros Bizjak <ubizjak@gmail.com>
10 days agomiddle-end: Replace INTEGER_CST + expand_normal with tree_to_uwhi. [PR126363]
Kael Andrew Alonzo Franco [Fri, 24 Jul 2026 12:42:44 +0000 (08:42 -0400)] 
middle-end: Replace INTEGER_CST + expand_normal with tree_to_uwhi. [PR126363]

Replace INTEGER_CST + expand_normal with tree_fits_uwhi_p + tree_to_uwhi
since it is less expensive and is more readable.

Bootstrapped and regtested on x86_64-pc-linux-gnu.

PR middle-end/126363

gcc/ChangeLog:

* builtins.cc (fold_builtin_atomic_always_lock_free): Replace
INTEGER_CST + expand_normal with tree_to_uwhi.

Signed-off-by: Kael Andrew Franco <kaelfandrew@gmail.com>
10 days agogcn: mkoffload - pass -L<dir> on to the amdgcn-amdhsa linker
Tobias Burnus [Fri, 24 Jul 2026 12:27:03 +0000 (14:27 +0200)] 
gcn: mkoffload - pass -L<dir> on to the amdgcn-amdhsa linker

Add a way to specify a linker-search path to the amdgcn-amdhsa/collect2
linker call, which is in particular useful as '.' (current directory) is
not in the search path.

Note that the -L specified to the host compiler are not passed to mkoffload,
i.e. only using a flag like --offload-options="-L." will affect the linker
search path.

gcc/ChangeLog:

* config/gcn/mkoffload.cc (main): Pass -L<dir> on to the
device compiler.

10 days agoAArch64: Update Neoverse V2 cost model for SVE structure loads/stores
Pengfei Li [Fri, 17 Jul 2026 11:45:33 +0000 (11:45 +0000)] 
AArch64: Update Neoverse V2 cost model for SVE structure loads/stores

The current Neoverse V2 cost model underestimates the costs of SVE
structure loads and stores. This can cause the vectorizer to make a
suboptimal choice between AdvSIMD and SVE.

This patch brings the cost model in line with the latest Neoverse V2
Software Optimization Guide, which indicates that SVE structure loads
and stores are generally more expensive than the AdvSIMD versions.

Performance testing shows this change improves SPEC CPU 2026 735.ocio_r
by ~10.8% on Neoverse V2.

Bootstrapped and tested on aarch64-linux-gnu.

gcc/ChangeLog:

* config/aarch64/tuning_models/neoversev2.h: Update the costs
of SVE structure loads and stores.

gcc/testsuite/ChangeLog:

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

10 days agotarget/126328 - [x86] insn_cost of *sse3_h{add,sub}v2df3[_low]
Richard Biener [Tue, 21 Jul 2026 13:10:24 +0000 (15:10 +0200)] 
target/126328 - [x86] insn_cost of *sse3_h{add,sub}v2df3[_low]

I run into issues with gcc.target/i386/pr54400.c when SLP vectorizing
a horizontal reduction of a V2DF vector.  The following plugs the
remaining hole in costing which prevents combine from doing its work
to recover the single hadd instruction for { p[0] + p[1], q[0] + q[1] }
The patch avoids the pattern cost special-casing of vec_concat
by costing the insn based on a new cost_special attribute which I placed
on all of the haddsub patterns.

PR target/126328
PR target/126383
* config/i386/i386.md (cost_special): New attribute.
* config/i386/sse.md (avx_h<insn>v4df3): Add cost_special
attribute with value haddsub.
(*sse3_haddv2df3): Likewise.
(sse3_hsubv2df3): Likewise.
(*sse3_haddv2df3_low): Likewise.
(*sse3_hsubv2df3_low): Likewise.
(avx_h<insn>v8sf3): Likewise.
(sse3_h<insn>v4sf3): Likewise.
* config/i386/i386.cc (ix86_insn_cost): Cost insns with
the cost_special attribute value of haddsub like an add.

10 days agoRemove shift vectorization check from vect_build_slp_tree_1
Richard Biener [Fri, 24 Jul 2026 07:21:50 +0000 (09:21 +0200)] 
Remove shift vectorization check from vect_build_slp_tree_1

The following removes the SLP discovery failure caused by not
vectorizable shifts.  This does not belong here.  I have kept
the heuristic that forces uniform shift operands when vector-vector
shifts are not supported.

* tree-vect-slp.cc (vect_build_slp_tree_1): Remove failure
on unvectorizable shifts.

10 days agoSet INSN_CODE to recognized insn before calling insn_cost in combine
Richard Biener [Tue, 21 Jul 2026 14:24:23 +0000 (16:24 +0200)] 
Set INSN_CODE to recognized insn before calling insn_cost in combine

The following makes the recognized INSN_CODEs available to the
backends for costing via insn_cost.

PR target/126328
* combine.cc (combine_validate_cost): New arguments for
the insn codes.  Set INSN_CODE to recognized values
before calling insn_cost.
(try_combine): Adjust.

10 days agotestsuite: Split rs6000 mma tests into power10 and future
Avinash Jayakar [Fri, 17 Jul 2026 10:20:51 +0000 (05:20 -0500)] 
testsuite: Split rs6000 mma tests into power10 and future

This patch splits the mma related test cases for powerpc into power10
and future.

gcc/testsuite/ChangeLog:
* gcc.target/powerpc/mma-builtin-1.c: Move to...
* gcc.target/powerpc/mma-builtin-1.h: ...here.
* gcc.target/powerpc/mma-builtin-10-pair.c: Move to...
* gcc.target/powerpc/mma-builtin-10-pair.h: ...here.
* gcc.target/powerpc/mma-builtin-2.c: Move to...
* gcc.target/powerpc/mma-builtin-2.h: ...here.
* gcc.target/powerpc/mma-builtin-3.c: Move to...
* gcc.target/powerpc/mma-builtin-3.nodmf.c: ...here.
* gcc.target/powerpc/mma-builtin-4.c: Move to...
* gcc.target/powerpc/mma-builtin-4.h: ...here.
* gcc.target/powerpc/mma-builtin-5.c: Move to...
* gcc.target/powerpc/mma-builtin-5.h: ...here.
* gcc.target/powerpc/mma-builtin-6.c: Move to...
* gcc.target/powerpc/mma-builtin-6.nodmf.c: ...here.
* gcc.target/powerpc/mma-builtin-7.c: Move to...
* gcc.target/powerpc/mma-builtin-7.h: ...here.
* gcc.target/powerpc/mma-builtin-8.c: Move to...
* gcc.target/powerpc/mma-builtin-8.h: ...here.
* gcc.target/powerpc/mma-builtin-9.c: Move to...
* gcc.target/powerpc/mma-builtin-9.h: ...here.
* gcc.target/powerpc/mma-builtin-10-quad.c: Removed.
* gcc.target/powerpc/mma-builtin-1.dmf.c: New test.
* gcc.target/powerpc/mma-builtin-1.nodmf.c: New test.
* gcc.target/powerpc/mma-builtin-10-pair.dmf.c: New test.
* gcc.target/powerpc/mma-builtin-10-pair.nodmf.c: New test.
* gcc.target/powerpc/mma-builtin-10-quad.dmf.c: New test.
* gcc.target/powerpc/mma-builtin-10-quad.h: New test.
* gcc.target/powerpc/mma-builtin-10-quad.nodmf.c: New test.
* gcc.target/powerpc/mma-builtin-2.dmf.c: New test.
* gcc.target/powerpc/mma-builtin-2.nodmf.c: New test.
* gcc.target/powerpc/mma-builtin-3.dmf.c: New test.
* gcc.target/powerpc/mma-builtin-3.h: New test.
* gcc.target/powerpc/mma-builtin-4.dmf.c: New test.
* gcc.target/powerpc/mma-builtin-4.nodmf.c: New test.
* gcc.target/powerpc/mma-builtin-5.dmf.c: New test.
* gcc.target/powerpc/mma-builtin-5.nodmf.c: New test.
* gcc.target/powerpc/mma-builtin-6.dmf.c: New test.
* gcc.target/powerpc/mma-builtin-6.h: New test.
* gcc.target/powerpc/mma-builtin-7.dmf.c: New test.
* gcc.target/powerpc/mma-builtin-7.nodmf.c: New test.
* gcc.target/powerpc/mma-builtin-8.dmf.c: New test.
* gcc.target/powerpc/mma-builtin-8.nodmf.c: New test.
* gcc.target/powerpc/mma-builtin-9.dmf.c: New test.
* gcc.target/powerpc/mma-builtin-9.nodmf.c: New test.

10 days agoOpenMP/C++: Handle OMP_CLAUSE_DEVICE_TYPE in pt.cc
Tobias Burnus [Fri, 24 Jul 2026 08:39:29 +0000 (10:39 +0200)] 
OpenMP/C++: Handle OMP_CLAUSE_DEVICE_TYPE in pt.cc

gcc/cp/ChangeLog:

* pt.cc (tsubst_omp_clauses): Add OMP_CLAUSE_DEVICE_TYPE
to switch statement.

gcc/testsuite/ChangeLog:

* g++.dg/gomp/target-device-type.C: New test.

10 days agoMention the forge on unofficial mirrors
Claudio Bantaloukas [Fri, 24 Jul 2026 07:43:00 +0000 (07:43 +0000)] 
Mention the forge on unofficial mirrors

ChangeLog:

* .github/CONTRIBUTING.md: Update text.
* .github/PULL_REQUEST_TEMPLATE.md: Link
to CONTRIBUTING.md directly.

10 days agox86 SSE: Use insertps to zero V4SI/V4SF elements in a single instruction.
Roger Sayle [Fri, 24 Jul 2026 06:21:48 +0000 (07:21 +0100)] 
x86 SSE: Use insertps to zero V4SI/V4SF elements in a single instruction.

This patch teaches the x86 backend that the SSE4.1 insertps instruction
can be used/abused to clear one or more elements of a V4SI or V4SF vector
in a single instruction (i.e. without requiring pxor to clear a second
register).

Consider the test case

typedef int v4si __attribute__ ((__vector_size__ (16)));
v4si foo(v4si x) { x[2]=0; return x; }

Currently with -O2 -mavx2, we generate:

foo:    xorl    %eax, %eax
        vpinsrd $2, %eax, %xmm0, %xmm0
        ret

with this patch we now generate:

foo: vinsertps       $4, %xmm0, %xmm0, %xmm0
        ret

For the more complicated example:

v4si bar(v4si x) { x[1]=0; x[3]=0; return x; }

previously, we'd generate:

bar:    xorl    %eax, %eax
        vpinsrd $1, %eax, %xmm0, %xmm0
        vpinsrd $3, %eax, %xmm0, %xmm0
        ret

with this patch we now generate:

bar:    vinsertps       $10, %xmm0, %xmm0, %xmm0
        ret

One improvement that I'll leave to an i386/SSE expert, is that setting
elements 1, 2 and 3 [i.e. zero extending element 0] still falls back
to the existing patterns (and tests for this are commented out in the
new test cases).  Tweaking sse_movss_v4si to consider using insertps
requires expertise in register preferencing and instruction attributes
that I'm happy to leave to someone else.

2026-07-24  Roger Sayle  <roger@nextmovesoftware.com>
    Hongtao Liu  <hongtao.liu@intel.com>

gcc/ChangeLog
* config/i386/i386-expand.cc (ix86_expand_vec_set_builtin): Don't
force op1 to a register when it is CONST0_RTX (mode1).
(ix86_expand_vector_set_var): For now, force VAL to a register.
(ix86_expand_vector_set): If val is CONST0_RTX, expand using
the new sse4_1_insertps_v4s[if]_zero patterns on TARGET_SSE4_1.
Otherwise, force val to a register (restoring previous behaviour).
* config/i386/sse.md (sse4_1_insertps_<mode>_zero): New insn
using vec_merge to select which elements to clear/preserve.
(vec_set<mode>): Tweak operand 1 to allow both REGs and CONST0_RTX.

gcc/testsuite/ChangeLog
* gcc.target/i386/sse4_1-insertps-6.c: New test case.
* gcc.target/i386/sse4_1-insertps-7.c: Likewise.

10 days agoifcvt: drop redundant reversibility pre-checks in store-flag callers
Philipp Tomsich [Thu, 23 Jul 2026 17:09:21 +0000 (19:09 +0200)] 
ifcvt: drop redundant reversibility pre-checks in store-flag callers

The PR126347 fix (commit dcb8c8d3e733) made noce_emit_store_flag return
NULL_RTX whenever the requested (reversed) comparison code is UNKNOWN, so
every caller already copes with an unreversible condition through the
existing NULL_RTX return.

Remove the redundant guards and document the invariant on
noce_emit_store_flag, matching noce_try_store_flag_logical, which already
relies on the NULL_RTX return with no pre-check.  The noce_reversed_cond_code
guards in noce_try_addcc and noce_try_cmove_arith protect a different
consumer and are left in place.

Bootstrapped and regression tested on x86_64-pc-linux-gnu with no
regressions.

gcc/
* ifcvt.cc (noce_emit_store_flag): Document that a NULL_RTX
return signals an unreversible condition.
(noce_try_store_flag): Drop redundant noce_reversed_cond_code
pre-check.
(noce_try_shifted_store_flag): Likewise.
(noce_try_store_flag_constants): Drop redundant can_reverse
guards on the reversed 2^n and -1 cases.
(noce_try_store_flag_mask): Set reversep unconditionally; the
store-flag emission now handles an unreversible condition.

10 days agolibgfortran: Add additional long double math support for hppa64-hpux*
John David Anglin [Fri, 24 Jul 2026 02:06:50 +0000 (22:06 -0400)] 
libgfortran: Add additional long double math support for hppa64-hpux*

On hppa-hpux, we lack support for C99 math routines but the long
double type conforms to the standard 16-byte IEEE (IEC 60559)
specification.  This allows us to use the quad routines from
libquadmath.

2026-07-22  John David Anglin  <danglin@gcc.gnu.org>

libgfortran/ChangeLog:

PR libfortran/126305
* c99_protos.h (acosl, acoshl, asinl, asinhl,atan2l, atanl,
atanhl, ceill, cosl, coshl, expl, hypotl, logl, sinl, sinhl,
sqrtl, tanl, tanhl, truncl, nextafterl, powl, erfl, erfcl):
Add declarations.
* configure.ac (powl, erfl): Add GCC_CHECK_MATH_FUNCs.
* configure: Regenerate.
* config.h.in: Regenerate.
* intrinsics/c99_functions.c: Include math_imp.h.  Move code
to manipulate the floating-point type to math_imp.h.
(erfl, erfcl, acosl, acoshl, asinl, asinhl, atan2l, atanl,
atanhl, ceill, cosl, coshl, expl, floorl, fmodl, hypotl,
logl, sinl, sinhl, sqrtl, tanl, tanhl, truncl, nextafterl,
powl, log10l): Implement.
(frexpl): Move code to intrinsics/frexpl_16.c.
(scalbnl): Move code to intrinsics/scalbnl_16.c.
* intrinsics/ceill_16.c: New.
* intrinsics/floorl_16.c: New.
* intrinsics/frexpl_16.c: New.
* intrinsics/math_imp.h: New.
* intrinsics/nextafterl_16.c: New.
* intrinsics/scalbnl_16.c: New.
* intrinsics/truncl_16.c: New.
* libgfortran.h (USE_LIBQUADLIB): Define on hppa-hpux.

10 days agoDaily bump.
GCC Administrator [Fri, 24 Jul 2026 00:16:42 +0000 (00:16 +0000)] 
Daily bump.

11 days agoUse HOST_SIZE_T_PRINT_UNSIGNED instead of %zu format string
John David Anglin [Thu, 23 Jul 2026 19:19:39 +0000 (15:19 -0400)] 
Use HOST_SIZE_T_PRINT_UNSIGNED instead of %zu format string

Not all hosts support the "z" format length modifier.  Noticed
by inspection.

2026-07-23  John David Anglin  <danglin@gcc.gnu.org>

gcc/ChangeLog:

* crc-verification.cc (sb_match): Use HOST_SIZE_T_PRINT_UNSIGNED
instead of "%zu".
(lfsr_and_crc_bits_match): Likewise.

11 days agocobol: Handle -Wno options and -fPIC better in gcobc emulation script.
James K. Lowden [Thu, 23 Jul 2026 14:59:20 +0000 (10:59 -0400)] 
cobol: Handle -Wno options and -fPIC better in gcobc emulation script.

Make -fPIC the default except when producing an executable. Add
handling of -Wno- options.

gcc/cobol/ChangeLog:

* gcobc: Consolidate warning cases and update comments.

11 days agotestsuite: use arm_neon as xfail condition [PR118407]
Torbjörn SVENSSON [Wed, 22 Jul 2026 10:35:27 +0000 (12:35 +0200)] 
testsuite: use arm_neon as xfail condition [PR118407]

Before r17-2558-g383854a7016ad2, the test predcom-8.c test was only
failing for -march=armv7ve+neon and -march=armv7ve+simd. After, there
are xpass for Cortex-M targets. Correct xfail condition to arm_neon to
rectify my mistake.

gcc/testsuite/ChangeLog:

PR testsuite/118407
* gcc.dg/tree-ssa/predcom-8.c: Use arm_neon as xfail condition.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
11 days agors6000: Builtins for MMA+ float16 outer product instructions
Surya Kumari Jangala [Thu, 23 Jul 2026 13:53:15 +0000 (08:53 -0500)] 
rs6000: Builtins for MMA+ float16 outer product instructions

This patch adds builtins for the Matrix Multiply Assist Plus (MMA+)
float16 GER instructions. These instructions may or may not be
supported in a future Power processor. Specifically, builtins have been
added for the following instructions:

Float16 GER operations:
  - dmxvf16gerx2 and its variants (pp, pn, np, nn)
  - pmdmxvf16gerx2 and its variants (pp, pn, np, nn)

Note, the names of the builtins may change in the future.

2026-06-25  Surya Kumari Jangala  <jskumari@linux.ibm.com>

gcc:
* config/rs6000/mma.md (UNSPEC_DMF_DMXVF16GERX2): New UNSPEC entry.
(UNSPEC_DMF_DMXVF16GERX2PP): Likewise.
(UNSPEC_DMF_DMXVF16GERX2PN): Likewise.
(UNSPEC_DMF_DMXVF16GERX2NP): Likewise.
(UNSPEC_DMF_DMXVF16GERX2NN): Likewise.
(UNSPEC_DMF_PMDMXVF16GERX2): Likewise.
(UNSPEC_DMF_PMDMXVF16GERX2PP): Likewise.
(UNSPEC_DMF_PMDMXVF16GERX2PN): Likewise.
(UNSPEC_DMF_PMDMXVF16GERX2NP): Likewise.
(UNSPEC_DMF_PMDMXVF16GERX2NN): Likewise.
(DMF_PV): Add UNSPEC_DMF_DMXVF16GERX2.
(DMF_DPV): Add f16 variants.
(DMF_PVI8I4I2): Add UNSPEC_DMF_PMDMXVF16GERX2.
(DMF_DPVI8I4I2): Add f16 prefixed variants.
(pv): Add dmxvf16gerx2 attribute.
(dpv): Add f16 attributes.
(pvi8i4i2): Add pmdmxvf16gerx2 attribute.
(dpvi8i4i2): Add f16 prefixed attributes.
* config/rs6000/rs6000-builtins.def (__builtin_mma_dmxvf16gerx2): New
builtin.
(__builtin_mma_dmxvf16gerx2pp): Likewise.
(__builtin_mma_dmxvf16gerx2pn): Likewise.
(__builtin_mma_dmxvf16gerx2np): Likewise.
(__builtin_mma_dmxvf16gerx2nn): Likewise.
(__builtin_mma_pmdmxvf16gerx2): Likewise.
(__builtin_mma_pmdmxvf16gerx2pp): Likewise.
(__builtin_mma_pmdmxvf16gerx2pn): Likewise.
(__builtin_mma_pmdmxvf16gerx2np): Likewise.
(__builtin_mma_pmdmxvf16gerx2nn): Likewise.
(__builtin_mma_dmxvf16gerx2_internal): New internal builtin.
(__builtin_mma_dmxvf16gerx2pp_internal): Likewise.
(__builtin_mma_dmxvf16gerx2pn_internal): Likewise.
(__builtin_mma_dmxvf16gerx2np_internal): Likewise.
(__builtin_mma_dmxvf16gerx2nn_internal): Likewise.
(__builtin_mma_pmdmxvf16gerx2_internal): Likewise.
(__builtin_mma_pmdmxvf16gerx2pp_internal): Likewise.
(__builtin_mma_pmdmxvf16gerx2pn_internal): Likewise.
(__builtin_mma_pmdmxvf16gerx2np_internal): Likewise.
(__builtin_mma_pmdmxvf16gerx2nn_internal): Likewise.
* doc/extend.texi (PowerPC Matrix-Multiply Assist Built-in Functions):
Document new MMA+ builtins for f16 operations.

gcc/testsuite:
* gcc.target/powerpc/dmf-builtin-2.c: New test.

11 days agomiddle-end: Fold averages with equal operands [PR122715]
Odysseas Georgoudis [Thu, 23 Jul 2026 14:46:24 +0000 (08:46 -0600)] 
middle-end: Fold averages with equal operands [PR122715]

IFN_AVG_FLOOR (x, x) and IFN_AVG_CEIL (x, x) both
produce x.  Fold these cases in match.pd.

PR middle-end/122715

gcc/ChangeLog:

* match.pd: Fold IFN_AVG_FLOOR and IFN_AVG_CEIL with equal
operands.

gcc/testsuite/ChangeLog:

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

11 days agoifcvt: do not emit a store flag for an irreversible condition [PR126347]
Philipp Tomsich [Tue, 21 Jul 2026 19:19:53 +0000 (21:19 +0200)] 
ifcvt: do not emit a store flag for an irreversible condition [PR126347]

noce_emit_store_flag feeds the possibly-reversed comparison code to a
store-flag insn, and to emit_store_flag, without checking that the
reversal succeeded.  reversed_comparison_code returns UNKNOWN for
UNLT/UNLE/UNGT/UNGE, and for a MODE_CC comparison it cannot trace back
to its COMPARE -- common for a floating-point condition on targets that
compare into a condition-code register.  emit_store_flag then reaches
its floating-point path and calls swap_condition (UNKNOWN), which aborts.

This was latent until r17-2519-ga33f26607eb4f3 made
noce_try_shifted_store_flag the first caller to reach
noce_emit_store_flag with REVERSEP set for such a condition.

Bail out early when the reversal failed.

Bootstrapped and regression tested on aarch64-unknown-linux-gnu with no
regressions.

PR rtl-optimization/126347
gcc/
* ifcvt.cc (noce_emit_store_flag): Return NULL_RTX when the
comparison code is UNKNOWN.

11 days agors6000: Builtins for MMA+ bfloat16 and int8 instructions [RFC02658]
Surya Kumari Jangala [Thu, 23 Jul 2026 07:50:42 +0000 (02:50 -0500)] 
rs6000: Builtins for MMA+ bfloat16 and int8 instructions [RFC02658]

This patch adds builtins for the Matrix Multiply Assist Plus (MMA+)
instructions defined in RFC02658. These instructions may or may not be
supported in a future Power processor. Specifically, builtins have been
added for the following instructions:

1. Bfloat16 GER operations:
   - dmxvbf16gerx2 and its variants (pp, pn, np, nn)
   - pmdmxvbf16gerx2 and its variants (pp, pn, np, nn)

2. Signed accumulate variant for 8-bit integer GER operations:
   - dmxvi8gerx4spp
   - pmdmxvi8gerx4spp

Note, the names of the builtins may change in the future.

2026-06-24  Surya Kumari Jangala  <jskumari@linux.ibm.com>

gcc:
* config/rs6000/mma.md (UNSPEC_DMF_DMXVI8GERX4SPP): New UNSPEC entry.
(UNSPEC_DMF_PMDMXVI8GERX4SPP): Likewise.
(UNSPEC_DMF_DMXVBF16GERX2): Likewise.
(UNSPEC_DMF_DMXVBF16GERX2PP): Likewise.
(UNSPEC_DMF_DMXVBF16GERX2PN): Likewise.
(UNSPEC_DMF_DMXVBF16GERX2NP): Likewise.
(UNSPEC_DMF_DMXVBF16GERX2NN): Likewise.
(UNSPEC_DMF_PMDMXVBF16GERX2): Likewise.
(UNSPEC_DMF_PMDMXVBF16GERX2PP): Likewise.
(UNSPEC_DMF_PMDMXVBF16GERX2PN): Likewise.
(UNSPEC_DMF_PMDMXVBF16GERX2NP): Likewise.
(UNSPEC_DMF_PMDMXVBF16GERX2NN): Likewise.
(DMF_PV): Add UNSPEC_DMF_DMXVBF16GERX2.
(DMF_DPV): Add bf16 and int8 signed accumulate variants.
(DMF_DPVI8I4I4): Add UNSPEC_DMF_PMDMXVI8GERX4SPP.
(DMF_PVI8I4I2): New int iterator.
(DMF_DPVI8I4I2): Likewise.
(pv): Add dmxvbf16gerx2 attribute.
(apv): Removed dmxvi8gerx4pp attribute.
(dpv): New attribute.
(dpvi8i4i4): Add pmdmxvi8gerx4spp attribute.
(pvi8i4i2): New attribute.
(dpvi8i4i2): Likewise.
(dmf_<dpv>): Rename from dmf_<apv> and update to use dpv attribute.
(dmf_<pvi8i4i2>): New insn pattern.
(dmf_<dpvi8i4i2>): Likewise.
* config/rs6000/rs6000-builtins.def (__builtin_mma_dmxvi8gerx4spp): New
builtin.
(__builtin_mma_pmdmxvi8gerx4spp): Likewise.
(__builtin_mma_dmxvbf16gerx2): Likewise.
(__builtin_mma_dmxvbf16gerx2pp): Likewise.
(__builtin_mma_dmxvbf16gerx2pn): Likewise.
(__builtin_mma_dmxvbf16gerx2np): Likewise.
(__builtin_mma_dmxvbf16gerx2nn): Likewise.
(__builtin_mma_pmdmxvbf16gerx2): Likewise.
(__builtin_mma_pmdmxvbf16gerx2pp): Likewise.
(__builtin_mma_pmdmxvbf16gerx2pn): Likewise.
(__builtin_mma_pmdmxvbf16gerx2np): Likewise.
(__builtin_mma_pmdmxvbf16gerx2nn): Likewise.
(__builtin_mma_dmxvi8gerx4spp_internal): New internal builtin.
(__builtin_mma_pmdmxvi8gerx4spp_internal): Likewise.
(__builtin_mma_dmxvbf16gerx2_internal): Likewise.
(__builtin_mma_dmxvbf16gerx2pp_internal): Likewise.
(__builtin_mma_dmxvbf16gerx2pn_internal): Likewise.
(__builtin_mma_dmxvbf16gerx2np_internal): Likewise.
(__builtin_mma_dmxvbf16gerx2nn_internal): Likewise.
(__builtin_mma_pmdmxvbf16gerx2_internal): Likewise.
(__builtin_mma_pmdmxvbf16gerx2pp_internal): Likewise.
(__builtin_mma_pmdmxvbf16gerx2pn_internal): Likewise.
(__builtin_mma_pmdmxvbf16gerx2np_internal): Likewise.
(__builtin_mma_pmdmxvbf16gerx2nn_internal): Likewise.
* doc/extend.texi (PowerPC Matrix-Multiply Assist Built-in Functions):
Document new MMA+ builtins for int8 and bf16 operations.

gcc/testsuite:
* gcc.target/powerpc/dmf-builtin-1.c: New test.

11 days agocobol: Recognize TYPE clause as implicit USAGE for validation.
James K. Lowden [Thu, 23 Jul 2026 14:00:28 +0000 (10:00 -0400)] 
cobol: Recognize TYPE clause as implicit USAGE for validation.

gcc/cobol/ChangeLog:

* parse.y: Add value_clause_e to bitmask for test.
* symbols.cc (symbols_update): Improve diagnostic message.

11 days agors6000: Add DMR extract builtins for Dense Math support
Surya Kumari Jangala [Thu, 23 Jul 2026 07:33:09 +0000 (02:33 -0500)] 
rs6000: Add DMR extract builtins for Dense Math support

Add two new builtins for extracting data from 1024-bit Dense Math
Registers (DMRs):

  - __builtin_dmr_extract512 (void *, dmr1024 *, const int<2>):
    extracts one 512-bit half of a DMR into four 128-bit vectors.
  - __builtin_disassemble_dmr (void *, dmr1024 *):
    extracts both 512-bit halves of a DMR into eight 128-bit vectors.

2026-07-16  Surya Kumari Jangala  <jskumari@linux.ibm.com>

gcc:
* config/rs6000/rs6000-builtins.def (__builtin_dmr_extract512): New
built-in.
(__builtin_disassemble_dmr): Likewise.
(__builtin_dmr_extract512_internal): New internal built-in.
* config/rs6000/rs6000-builtin.cc (rs6000_gimple_fold_mma_builtin):
Exempt RS6000_BIF_DISASSEMBLE_DMR from the early-return guard.
Generate appropriate gimple code for the extract builtins.

gcc/testsuite:
* gcc.target/powerpc/dmf-extract512.c: New test.
* gcc.target/powerpc/dmf-disassemble-dmr.c: New test.

11 days agoc++: implement LWG 3819, reference_xes_from_temporary [PR112908]
Marek Polacek [Tue, 21 Jul 2026 16:59:40 +0000 (12:59 -0400)] 
c++: implement LWG 3819, reference_xes_from_temporary [PR112908]

This is an attempt to implement <https://cplusplus.github.io/LWG/issue3819>.

My understanding of this issue is that previously, ref_xes_from_temporary
was defined by using is_constructible, which is implemented by seeing
if
  T t(declval<Args>()...);
is well-formed.  But declval always yields an xvalue, never a prvalue.
In practice this means that for

    struct U {
      U();
      U(U&&) = delete;
    };

    struct T {
      T(U);
    };

reference_constructs_from_temporary_v<const T&, U> is false due
to the deleted move ctor.  But if we have a prvalue, then the
call to the move ctor should be elided and so it doesn't matter
that it's deleted.  So the result should be 'true'.

Our ref_xes_from_temporary already doesn't check is_constructible<T, U>
as the comment says, but we always use build_trait_object which
gives us an xvalue.  What we need is to implement [meta.unary.prop]/5.2:
Otherwise [not a reference or function type], VAL<T> is a prvalue that
initially has type T.  For this I've added build_prvalue_trait_object.

The finish_trait_expr change is so that get_target_expr doesn't crash
on an incomplete type.  This change should be correct since
https://cplusplus.github.io/LWG/issue2939 didn't adjust
reference_xes_from_temporary the same way as is_convertible/constructible.

PR c++/112908

gcc/cp/ChangeLog:

* method.cc (build_prvalue_trait_object): New.
(ref_xes_from_temporary): Use build_prvalue_trait_object.
Use deferring_access_check_sentinel and cp_unevaluated.  Don't
call force_rvalue or rvalue.
* semantics.cc (finish_trait_expr)
<case CPTK_REF_CONSTRUCTS_FROM_TEMPORARY>: Actually check
completeness.

gcc/testsuite/ChangeLog:

* g++.dg/ext/is_constructible8.C: Move
__reference_*_from_temporary testing to a new test.
* g++.dg/ext/reference_xes_from_temporary2.C: New test.
* g++.dg/ext/reference_xes_from_temporary3.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
11 days agoc++: Diagnose return from [[noreturn]] function during constant evaluation [PR126354]
Jakub Jelinek [Thu, 23 Jul 2026 13:42:10 +0000 (15:42 +0200)] 
c++: Diagnose return from [[noreturn]] function during constant evaluation [PR126354]

This PR complains about g++ not diagnosing return from [[noreturn]]
function (which is UB) during constant evaluation.

This patch diagnoses that.
I haven't included the [[noreturn]] function name in the diagnostics
as it is printed in the context:
/home/jakub/src/gcc/gcc/testsuite/g++.dg/cpp1y/pr126354.C:18:24:   in 'constexpr' expansion of 'bar()'
/home/jakub/src/gcc/gcc/testsuite/g++.dg/cpp1y/pr126354.C:15:7:   in 'constexpr' expansion of 'foo(false)'
/home/jakub/src/gcc/gcc/testsuite/g++.dg/cpp1y/pr126354.C:15:7: error: '[[noreturn]]' call returns
But if you think it is better to emit
error ("%<[[noreturn]]%> %qD call returns", fun);
instead, I can certainly do that.

2026-07-23  Jakub Jelinek  <jakub@redhat.com>

PR c++/126354
* constexpr.cc (cxx_eval_call_expression): Diagnose return from
[[noreturn]] function.

* g++.dg/cpp1y/pr126354.C: New test.
* g++.dg/cpp26/pr126354.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
11 days agoc++: constant not recomputed when ADDR_EXPR changed [PR126215]
Marek Polacek [Wed, 22 Jul 2026 21:28:03 +0000 (17:28 -0400)] 
c++: constant not recomputed when ADDR_EXPR changed [PR126215]

Like in PR110822, the attached test produces an ICE in verify_address:

      error: constant not recomputed when 'ADDR_EXPR' changed

since r10-7718, but it wasn't fixed by r15-7762.  The reason is that
here we have:

  {.D.3013={.D.3006={.a={.ptr=&<retval>.D.3013.D.3006.a}},
    .D.3007={.b={.ptr=&<retval>.D.3013.D.3007.b}}}}

and we replace '<retval>' with 'names', but we only call
recompute_tree_invariant_expr for the first ADDR_EXPR, not the latter.
For the second ADDR_EXPR d->changed will be false: the first replacement
changed the shared tree <retval>.D.3013.  In replace_placeholders_r we
unshare_expr when replacing a PLACEHOLDER_EXPR, but we also replace
PLACEHOLDER_EXPRs in lookup_placeholder which didn't have this
unsharing.

PR c++/126215

gcc/cp/ChangeLog:

* constexpr.cc (lookup_placeholder): Do unshare_expr.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1z/constexpr-nsdmi1.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
11 days agolibstdc++: Use __chrono_write via _S_empty_fs for chrono ostream insertion
Anlai Lu [Tue, 30 Jun 2026 12:49:03 +0000 (12:49 +0000)] 
libstdc++: Use __chrono_write via _S_empty_fs for chrono ostream insertion

Add __detail::__chrono_write which formats a chrono object into a
stack buffer via std::format_to_n with _S_empty_fs(), then writes
through __ostream_insert. A non-type template parameter _BufSize
allows per-type buffer tuning.  Each _BufSize is the smallest power
of two that accommodates the longest possible formatted output for
that type, including error cases.  All chrono operator<< overloads
that previously used std::format, std::vformat, or basic_stringstream
now use this helper.

libstdc++-v3/ChangeLog:

* include/bits/chrono_io.h (__formatter_chrono::_S_empty_fs):
Make public.
(__detail::__chrono_write): New function template.
(operator<<): Use __chrono_write consistently for all chrono
types.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Signed-off-by: Anlai Lu <agicy@qq.com>
11 days agolibstdc++: Remove noexcept from basic_string instantiations [PR126327]
Nathan Blackburn [Wed, 22 Jul 2026 16:48:38 +0000 (16:48 +0000)] 
libstdc++: Remove noexcept from basic_string instantiations [PR126327]

The explicit instantiations of basic_string's default constructor used
an unconditional noexcept specification. For the fully-dynamic COW
string, those default constructors are noexcept(false).

Remove noexcept from both the char and wchar_t instantiations.

libstdc++-v3/ChangeLog:

PR libstdc++/126327
* src/c++20/string-inst.cc (basic_string::basic_string): Remove
noexcept.

11 days agolibstdc++: Don't dereference past-the-end iterator with overloaded operator&& [PR125981]
Yan Churkin [Fri, 26 Jun 2026 19:45:31 +0000 (22:45 +0300)] 
libstdc++: Don't dereference past-the-end iterator with overloaded operator&& [PR125981]

std::__find_if, std::__mismatch and std::__push_heap drove their loops
with a condition of the form

  while (__first != __last && PREDICATE_CALL(...))

If the predicate/comparator result type has an ADL-reachable
operator&&(bool, T), overload resolution selects that user-defined
operator&& for the loop condition.  It does not short-circuit, so the
operand that dereferences *__first is evaluated even when
__first == __last, dereferencing the past-the-end iterator.

Such a result type does not model boolean-testable, so this is undefined
behaviour and not a conformance issue.  Handle it anyway as a QoI
extension, consistent with std::equal, std::binary_search and
std::__partition, by forcing the predicate result to bool so the
built-in && is used.  This has no effect on well-behaved predicates; the
ranges:: versions are unaffected because their wrappers already return
bool.

PR libstdc++/125981

libstdc++-v3/ChangeLog:

* include/bits/stl_algobase.h (__find_if): Force the predicate
result to bool so that non-boolean_testable predicates cannot
cause a past-the-end iterator to be dereferenced.
(__mismatch): Likewise for both overloads.
* include/bits/stl_heap.h (__push_heap): Likewise for the
comparator result.
* testsuite/25_algorithms/find_if/overloaded_logical_ops.cc: New
test.
* testsuite/25_algorithms/mismatch/overloaded_logical_ops.cc:
New test.

Signed-off-by: Yan Churkin <yanchurkin@gmail.com>
11 days agolibsanitizer: parallelize subdir builds
Harmen Stoppels [Thu, 23 Jul 2026 09:57:42 +0000 (11:57 +0200)] 
libsanitizer: parallelize subdir builds

Automake normally builds subdirectories sequentially, which makes the
libsanitizer builds effectively sequential as there is little parallelism per
subdirectory. This patch replaces the all-recursive loop with an explicit
dependency graph: asan and hwasan depend on lsan, while others just need
sanitizer_common.

Exposing this DAG to make raises the CPU load from 2.3 to 3.7, yielding a
roughly 30% reduction in build time on multi-core machines.

libsanitizer/ChangeLog:

* Makefile.am: Override all-recursive and define explicit
DAG dependencies for all-* targets to enable parallel builds.
* Makefile.in: Regenerate.

Signed-off-by: Harmen Stoppels <me@harmenstoppels.nl>
Reviewed-by: Jakub Jelinek <jakub@redhat.com>
11 days agogcn: Fix sram-ecc default for gfx9-4-generic
Tobias Burnus [Thu, 23 Jul 2026 09:40:32 +0000 (11:40 +0200)] 
gcn: Fix sram-ecc default for gfx9-4-generic

gcc/ChangeLog:

* config/gcn/gcn-devices.def (gfx9-4-generic): Set sram-ecc
default to HSACO_ATTR_ANY.

11 days agoc++: Diagnose declaration of objects with anonymous union or struct types [CWG3130]
Jakub Jelinek [Thu, 23 Jul 2026 09:14:21 +0000 (11:14 +0200)] 
c++: Diagnose declaration of objects with anonymous union or struct types [CWG3130]

https://wg21.link/CWG3130 added
"All objects of such an unnamed type shall be such an unnamed object."
sentence which should prevent reusing anonymous union types (and by
extension anonymous struct types too) as types of some other declarations,
which in some cases ICEs, in other cases is just really weird and could
misbehave when trying to look things up etc.
That wording is IMHO bad, because creation of objects is what happens
at runtime, so it is something that really can't be diagnosed by the compiler
because it doesn't know if a variable, function parameter, temporary etc.
will be actually encountered during runtime or not.
This patch assumes this sentence is changed to something reasonable that
would disallow anything that can create such objects at compile time,
so, declaration of variables, function parameters, class members,
constructs that need temporaries of this type, or all of those with
a type (perhaps multidimensional) array of anonmous union/struct.
In addition to that, I've added an error trying to make derived types from
anonymous struct types (one can't make derived types from union types, so
that case isn't a problem).

2026-07-23  Jakub Jelinek  <jakub@redhat.com>

gcc/cp/
* typeck2.cc: Implement part of CWG3130 - Naming function members of
anonymous unions.
(abstract_virtuals_error): Diagnose trying to create
an object with anonymous union or struct type.
* semantics.cc (finish_compound_literal): Call abstract_virtuals_error.
(finish_member_declaration): Diagnose named members with anonymous
union or struct type.
* decl.cc (xref_basetypes): Diagnose anonymous structs as bases.
gcc/testsuite/
* g++.dg/cpp0x/anon-union4.C: New test.
* g++.dg/reflect/anon6.C: New test.
* g++.dg/reflect/anon7.C: New test.
* g++.dg/reflect/anon8.C: New test.
* g++.dg/reflect/anon9.C: New test.
* g++.dg/template/anonunion3.C: Expect an error.

Reviewed-by: Jason Merrill <jason@redhat.com>
11 days agoconfigure: Fix a typo
Jakub Jelinek [Thu, 23 Jul 2026 08:55:06 +0000 (10:55 +0200)] 
configure: Fix a typo

I've noticed a typo in gcc/configure message.

2026-07-23  Jakub Jelinek  <jakub@redhat.com>

* configure.ac: Fix a typo, respones -> response.
* configure: Regenerate.

11 days agotestsuite: Provide shf_link_order effective target
Rainer Orth [Thu, 23 Jul 2026 08:29:33 +0000 (10:29 +0200)] 
testsuite: Provide shf_link_order effective target

Like R_flag_in_section, the o_flag_in_section effective target is a
misnomer.  It actually signifies support for the SHF_LINK_ORDER section
flag.  Therefore this patch uses the et-static framework to determine it
from HAVE_GAS_SECTION_LINK_ORDER in auto-host.h, adapting the existing
uses.

Bootstrapped without regressions on i386-pc-solaris2.11 and
x86_64-pc-linux-gnu.

2026-01-13  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc:
* configure.ac (HAVE_GAS_SECTION_LINK_ORDER): Clarify comment.
* config.in: Regenerate.

* doc/sourcebuild.texi (Effective-Target Keywords)
(o_flag_in_section): Rename to shf_link_order.  Update description.

gcc/testsuite:
* lib/target-supports.exp
(check_effective_target_o_flag_in_section): Remove.
* lib/et-static.def (shf_link_order): New effective target.
* g++.dg/pr93195a.C: Require shf_link_order.
* gcc.dg/pr110729.c: Likewise.

11 days agoSupport two-lane vector BB reductions without target support
Richard Biener [Wed, 15 Jul 2026 08:37:57 +0000 (10:37 +0200)] 
Support two-lane vector BB reductions without target support

The following implements BB reduction epilog handling for two-lane
vectors with lane extracts.  This allows targets to omit defining
reduc_*_scal optabs for two lane vector modes and enables trivial
handling of in-order reductions with two lanes.  The former is
one issue we run into with PR126028 on x86_64.

This causes some no-op vectorization since we now accept vector
costs equal to scalar costs.

For gcc.target/i386/pr54400.c this shows that after SLP vectorizing
a two lane reduction we are no longer able to match up the x86 haddpd
instruction I have sent a partial x86 backend fix.
For g++.target/i386/pr114187.C it shows the usual
argument/return costing difficulties but also a too broad testcase
and inadverted coverage of -m32 - I have adjusted the testcase.

PR tree-optimization/126028
* tree-vect-slp.cc (vect_slp_check_for_roots): Move
fold-left reduction check ...
(vectorizable_bb_reduc_epilogue): ... here and allow
two reduction lanes to be unaffected.  Handle the two
vector lane without target support for the reduction.
(vectorize_slp_instance_root_stmt): Implement manual two-lane
reduction.

* gcc.dg/vect/bb-slp-reduc-1.c: New testcase for a two-lane
in-order reduction.
* c-c++-common/vector-subscript-4.c: Use -fno-vectorize.
* g++.target/i386/pr114187.C: Narrow pattern to better
only catch the reported issue.

11 days agotestsuite: Provide gnu_retain effective target
Rainer Orth [Thu, 23 Jul 2026 08:20:56 +0000 (10:20 +0200)] 
testsuite: Provide gnu_retain effective target

The existing R_flag_in_section effective target is badly named: the name
carries no mnemonic value and is actually an implementation detail of a
specific assembler section flag syntax.

This patch uses the et-static framework to replace it by a new
gnu_retain keyword.  Given that the existing R_flag_in_section
implementation checks for both HAVE_GAS_SHF_GNU_RETAIN and
HAVE_INITFINI_ARRAY_SUPPORT, this patch starts with matching
shf_gnu_retain and sht_init_array keywords and combines them into
gnu_retain proper.

The existing tests are adaptated accordingly.

Bootstrapped without regressions on i386-pc-solaris2.11 and
x86_64-pc-linux-gnu.

2026-01-13  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc:
* configure.ac (HAVE_GAS_SHF_GNU_RETAIN): Clarify comment.
* config.in: Regenerate.

* doc/sourcebuild.texi (Effective-Target Keywords)
(R_flag_in_section): Remove.
(Effective-Target Keywords, gnu_retain): New keyword.
(Effective-Target Keywords, shf_gnu_retain): Likewise.
(Effective-Target Keywords, sht_init_array): Likewise.

gcc/testsuite:
* lib/et-static.def (shf_gnu_retain, sht_init_array): New
effective targets.
* lib/target-supports.exp
(check_effective_target_R_flag_in_section): Remove.
(check_effective_target_gnu_retain): New proc.

* c-c++-common/attr-retain-1.c: Use gnu_retain
instead of R_flag_in_section.
* c-c++-common/attr-retain-2.c: Likewise.
* c-c++-common/attr-retain-3.c: Likewise.
* c-c++-common/attr-retain-4.c: Likewise.
* c-c++-common/attr-retain-5.c: Likewise.
* c-c++-common/attr-retain-6.c: Likewise.
* c-c++-common/attr-retain-7.c: Likewise.
* c-c++-common/attr-retain-8.c: Likewise.
* c-c++-common/attr-retain-9.c: Likewise.
* c-c++-common/attr-retain-10.c: Likewise.
* c-c++-common/attr-retain-11.c: Likewise.
* c-c++-common/attr-used-2.c: Likewise.
* c-c++-common/attr-used-3.c: Likewise.
* c-c++-common/attr-used-4.c: Likewise.
* c-c++-common/attr-used-5.c: Likewise.
* c-c++-common/attr-used-6.c: Likewise.
* c-c++-common/attr-used-7.c: Likewise.
* c-c++-common/attr-used-8.c: Likewise.
* c-c++-common/attr-used-9.c: Likewise.
* c-c++-common/attr-used.c: Likewise.
* c-c++-common/pr99113.c: Likewise.
* gcc.c-torture/compile/attr-retain-1.c: Likewise.
* gcc.c-torture/compile/attr-retain-2.c: Likewise.
* gcc.c-torture/compile/attr-used-retain-1.c: Likewise.
* gcc.c-torture/compile/attr-used-retain-2.c: Likewise.

11 days agotestsuite: Don't use auto-host.h in target-supports.exp
Rainer Orth [Thu, 23 Jul 2026 08:08:21 +0000 (10:08 +0200)] 
testsuite: Don't use auto-host.h in target-supports.exp

Several effective targets use a complicated dance to determine their
values from auto-host.h.  This prompted the et-static framework, which
is now used to replace their implementations.

Bootstrapped without regressions on i386-pc-solaris2.11 and
x86_64-pc-linux-gnu.

2026-05-21  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc/testsuite:
* lib/et-static.def (code_6_gottpoff_reloc): New effective target.
(fentry): Likewise.
(got32x_reloc): Likewise.
(pie_copyreloc): Likewise.
(powerpc_as_p10_htm): Likewise.
(tls_get_addr_via_got): Likewise.

* lib/target-supports.exp (check_effective_target_pie_copyreloc):
Remove.
(check_effective_target_code_6_gottpoff_reloc): Likewise.
(check_effective_target_got32x_reloc): Likwise.
(check_effective_target_tls_get_addr_via_got): Likewise.
(check_effective_target_powerpc_as_p10_htm): Likewise.
(check_effective_target_fentry): Likewise.

* gcc.target/i386/pr120881-2a.c: Restrict to 64-bit x86.

11 days agotestsuite: Use solaris_ld effective target
Rainer Orth [Thu, 23 Jul 2026 08:04:33 +0000 (10:04 +0200)] 
testsuite: Use solaris_ld effective target

Like the gas/solaris_as case, a testcase actually checks if Solaris ld
is in use.  This patch uses the et-static framework to introduce a
solaris_ld effective target for this.

Other uses of the existing gld effective target are about GNU ld
features and remain untouched.

Bootstrapped without regressions on i386-pc-solaris2.11,
sparc-sun-solaris2.11 (as/ld and gas/gld), and x86_64-pc-linux-gnu.

2026-05-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc/testsuite:
* lib/et-static.def (solaris_ld): New effective target.

* g++.dg/eh/unwind-direct.C: Check solaris_ld instead of !gld.

gcc:
* doc/sourcebuild.texi (Effective-Target Keywords, Other
attributes): Document solaris_ld.

11 days agotestsuite: Use solaris_as effective target
Rainer Orth [Thu, 23 Jul 2026 08:02:10 +0000 (10:02 +0200)] 
testsuite: Use solaris_as effective target

Several uses of the gas effective target in the testsuite are actually
about if Solaris as is in use.  This patch uses the new framework to
generate effective targets from auto-host.h to introduce a solaris_as
effective target and adjusts affected tests accordingly.

The existing gas effective target remains, however, because other uses
are about using gas features in particular.

Bootstrapped without regressions on i386-pc-solaris2.11,
sparc-sun-solaris2.11, x86_64-pc-linux-gnu, and
sparc64-unknown-linux-gnu.

2026-05-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc/testsuite:
* lib/et-static.def (solaris_as): New effective target.

* g++.dg/abi/lambda-static-1.C: Check solaris_as instead of !gas.
* g++.dg/debug/dwarf2/nested-4.C: Likewise.
* g++.dg/eh/pr119507.C: Likewise.
* gcc.c-torture/compile/pr61159.c: Likewise.
* gcc.dg/attr-weakref-1.c: Likewise.
* gcc.dg/tree-ssa/cswtch-6.c: Likewise.
* gcc.dg/tree-ssa/cswtch-7.c: Likewise.
* gcc.target/i386/avx512cd-vpbroadcastmb2q-2.c: Likewise.
* gcc.target/i386/avx512cd-vpbroadcastmw2d-2.c: Likewise.
* gcc.target/i386/pr91298-1.c: Likewise.
* gcc.target/i386/pr91298-2.c: Likewise.
* lib/target-supports.exp (check_effective_target_avx512dq):
Likewise.
(check_effective_target_avx512bw): Likewise.

gcc:
* doc/sourcebuild.texi (Effective-Target Keywords, Other
attributes): Document solaris_as.

11 days agoi386: Update Suffix for AVX10.2 SAT CVT scalar Intrinsics
Hu, Lin1 [Wed, 22 Jul 2026 08:11:22 +0000 (16:11 +0800)] 
i386: Update Suffix for AVX10.2 SAT CVT scalar Intrinsics

The previous _ep[i|u]{32,64} suffix for scalar SAT CVT intrinsics does
not match the intrinsic naming convention: scalar convert intrinsics
have used _[i|u]{32,64} (with _si{32,64} aliases for signed variants)
since AVX-512F, so the AVX10.2 scalar SAT CVT names need to follow the
same convention.

This patch renames the scalar SAT CVT intrinsics to use _[i|u]{32,64}
suffix and provides _si{32,64} aliases for the signed intrinsics.

gcc/ChangeLog:

* config/i386/avx10_2satcvtintrin.h
(_mm_cvtts_sd_i32): Renamed from _mm_cvtts_sd_epi32.
(_mm_cvtts_sd_si32): New alias of _mm_cvtts_sd_i32.
(_mm_cvtts_sd_u32): Renamed from _mm_cvtts_sd_epu32.
(_mm_cvtts_ss_i32): Renamed from _mm_cvtts_ss_epi32.
(_mm_cvtts_ss_si32): New alias of _mm_cvtts_ss_i32.
(_mm_cvtts_ss_u32): Renamed from _mm_cvtts_ss_epu32.
(_mm_cvtts_roundsd_i32): Renamed from _mm_cvtts_roundsd_epi32.
(_mm_cvtts_roundsd_si32): New alias of _mm_cvtts_roundsd_i32.
(_mm_cvtts_roundsd_u32): Renamed from _mm_cvtts_roundsd_epu32.
(_mm_cvtts_roundss_i32): Renamed from _mm_cvtts_roundss_epi32.
(_mm_cvtts_roundss_si32): New alias of _mm_cvtts_roundss_i32.
(_mm_cvtts_roundss_u32): Renamed from _mm_cvtts_roundss_epu32.
(_mm_cvtts_sd_i64): Renamed from _mm_cvtts_sd_epi64.
(_mm_cvtts_sd_si64): New alias of _mm_cvtts_sd_i64.
(_mm_cvtts_sd_u64): Renamed from _mm_cvtts_sd_epu64.
(_mm_cvtts_ss_i64): Renamed from _mm_cvtts_ss_epi64.
(_mm_cvtts_ss_si64): New alias of _mm_cvtts_ss_i64.
(_mm_cvtts_ss_u64): Renamed from _mm_cvtts_ss_epu64.
(_mm_cvtts_roundsd_i64): Renamed from _mm_cvtts_roundsd_epi64.
(_mm_cvtts_roundsd_si64): New alias of _mm_cvtts_roundsd_i64.
(_mm_cvtts_roundsd_u64): Renamed from _mm_cvtts_roundsd_epu64.
(_mm_cvtts_roundss_i64): Renamed from _mm_cvtts_roundss_epi64.
(_mm_cvtts_roundss_si64): New alias of _mm_cvtts_roundss_i64.
(_mm_cvtts_roundss_u64): Renamed from _mm_cvtts_roundss_epu64.

gcc/testsuite/ChangeLog:

* gcc.target/i386/avx10_2-satcvt-1.c: Update intrin names and
add _si alias tests.
* gcc.target/i386/sse-14.c: Ditto.
* gcc.target/i386/sse-22.c: Ditto.
* gcc.target/i386/avx10_2-vcvttsd2sis-2.c: Update intrin names.
* gcc.target/i386/avx10_2-vcvttsd2usis-2.c: Ditto.
* gcc.target/i386/avx10_2-vcvttss2sis-2.c: Ditto.
* gcc.target/i386/avx10_2-vcvttss2usis-2.c: Ditto.
* gcc.target/i386/zext-avx10-1.c: Ditto.

11 days agoi386: Add vector lrint expanders for conversions
liuhongt [Thu, 9 Jul 2026 03:28:00 +0000 (20:28 -0700)] 
i386: Add vector lrint expanders for conversions

Expose existing vector conversion instructions through lrint optabs so
the vectorizer can use vcvtps2qq and vcvtpd2dq instead of scalar
conversion sequences.

gcc/ChangeLog:

PR target/126160
* config/i386/sse.md (lrint<ssePSmode2lower><mode>2): New expander.
(lrintv2sfv2di2): Likewise.
(ssedfsimode): New mode attribute.
(ssedfsimodelower): Likewise.
(lrint<mode><ssedfsimodelower>2): New expander.

gcc/testsuite/ChangeLog:

PR target/126160
* gcc.target/i386/pr126160.c: New test.
* gcc.target/i386/pr126160-2.c: New test.

11 days agoopenmp, c++: Fix up OpenMP/OpenACC handling in C++ modules [PR119102]: Update 'module...
Thomas Schwinge [Wed, 22 Jul 2026 22:31:15 +0000 (00:31 +0200)] 
openmp, c++: Fix up OpenMP/OpenACC handling in C++ modules [PR119102]: Update 'module_state' comment for 'SE_BITS' change

Minor fix-up for commit ddeb70548c81f5dba91f281290584698897151d8
"openmp, c++: Fix up OpenMP/OpenACC handling in C++ modules [PR119102]", which
did:

     enum streamed_extensions {
    -  SE_OPENMP = 1 << 0,
    -  SE_BITS = 1
    +  SE_OPENMP_SIMD = 1 << 0,
    +  SE_OPENMP = 1 << 1,
    +  SE_OPENACC = 1 << 2,
    +  SE_BITS = 3
     };

..., but didn't update the documentary use of 'SE_BITS' in 'module_state'.

PR c++/119102
gcc/cp/
* module.cc (module_state): Update comment for 'SE_BITS' change.

11 days agors6000: Update existing mma insns to use wD constraint and update %A printer
Avinash Jayakar [Thu, 16 Jul 2026 06:07:05 +0000 (11:37 +0530)] 
rs6000: Update existing mma insns to use wD constraint and update %A printer

This patch replaces the 'd' constraint that was used for accumulators
previously since they overlapped with the FPRs, to use 'wD' constraint
and the new accumulator_operand in the existing mma define_insns. The
behaviour without dense-math option will be same as before, only if
dense-math option is used will the DMR registers be used.

It also updates the %A operand printer to print the DMR register numbers
instead of FPR if dense-math option is enabled

2026-07-16  Avinash Jayakar  <avinashd@linux.ibm.com>
    Vijay Shankar  <vijay@linux.ibm.com>

gcc/ChangeLog:
* config/rs6000/mma.md (mma_xxsetaccz): Use wD constraint and
accumulator operand.
(mma_<vv>): Likewise.
(mma_<avv>): Likewise.
(mma_<pv>): Likewise.
(mma_<apv>): Likewise.
(mma_<vvi4i4i8>): Likewise.
(mma_<avvi4i4i8>): Likewise.
(mma_<vvi4i4i2>): Likewise.
(mma_<avvi4i4i2>): Likewise.
(mma_<vvi4i4>): Likewise.
(mma_<avvi4i4>): Likewise.
(mma_<pvi4i2>): Likewise.
(mma_<apvi4i2>): Likewise.
(mma_<vvi4i4i4>): Likewise.
(mma_<avvi4i4i4>): Likewise.
* config/rs6000/rs6000.cc (print_operand): Print DMR register
numbers if dense math option enabled.

11 days agofrange: Add a comparison function for range endpoints
Aldy Hernandez [Tue, 14 Jul 2026 15:06:25 +0000 (15:06 +0000)] 
frange: Add a comparison function for range endpoints

IEEE calls -0.0 and +0.0 equal, but in frange they are distinct:
[+0.0, x] excludes -0.0 and [-0.0, x] includes it.  We have been
fixing things on the fly at each modification site, either manually or
by calling combine_zeros to fix up the signs.  This was hacky at best.

This patch removes the signed zero special casing by providing
frange_cmp(), a comparison function that orders -0.0 strictly below +0.0.

The ranges themselves are unchanged.  The only difference is that we
are now more exact about whether we actually modified a range
containing a zero.  Previously combine_zeros flagged a change whenever
the two ranges disagreed on the sign of a zero endpoint, even when the
canonical result was the sign we already had.  This made union_ and
intersect return a changed range pessimistically.  We are now more
accurate, so in theory the ranger cache should be happier.

With these cleanups we can start implementing multi-ranges for frange
without any special casing for signed zeros.

Tested on x86-64 and ppc64le Linux.  No changes to assembly for a
corpus of preprocessed files from LAPACK.  Also, LAPACK and GCC tests
pass as usual.

gcc/ChangeLog:

* value-range.cc (frange_cmp): New.
(frange::combine_zeros): Remove.
(frange::union_): Use frange_cmp to merge endpoints.
(frange::intersect): Likewise.
(frange::contains_p): Use frange_cmp.
(frange::verify_range): Use frange_cmp.
* value-range.h (class frange): Remove combine_zeros.

11 days agors6000: Add Dense Math (DMF/MMA+) built-in/instruction support
Kishan Parmar [Thu, 23 Jul 2026 06:13:29 +0000 (11:43 +0530)] 
rs6000: Add Dense Math (DMF/MMA+) built-in/instruction support

Add support for the DMF (Dense Math Facility) and MMA+
(Matrix-Multiply Assist Plus) builtins and instructions which may be
available on a future Power processor.

This patch extends the existing MMA infrastructure to support Dense
Math Registers (DMRs).

Key changes:

1. Extended MMA operand support from 7 to 9 operands (MAX_MMA_OPERANDS)

2. Added new DMF-specific unspecs:

   * UNSPEC_DMF_DMXOR for DMR XOR operations
   * UNSPEC_DMF_DMXVI8GERX4* for DMR GER (outer product) operations
   * UNSPEC_DMF_PMDMXVI8GERX4* for prefixed DMR GER operations
   * UNSPEC_DMF_DMSETDMRZ for zeroing a DMR register

3. Implemented new instruction patterns in mma.md:

   * dmf_build_dmr: Build a DMR from eight vector operands
   * dmf_dmsetdmrz: Zero a DMR register
   * dmf_dmxor: XOR operation on DMR registers
   * dmf_dmxvi8gerx4/dmxvi8gerx4pp: DMR outer product operations
   * dmf_pmdmxvi8gerx4/pmdmxvi8gerx4pp: Prefixed DMR outer product
     operations

4. Added new DMF builtins and updated GIMPLE folding:

   * Added DMF and MMA+ builtins
   * Updated GIMPLE folding to handle DMR pass-by-reference semantics
   * Extended builtin expansion to support up to 9 operand instructions

5. Added documentation for the new DMF and MMA+ builtins.

The implementation follows the existing MMA pattern where user-facing
builtins use pass-by-reference for DMR arguments, while internal
builtins use pass-by-value for optimization.

2026-07-15  Peter Bergner  <bergner@linux.ibm.com>
    Surya Kumari Jangala  <jskumari@linux.ibm.com>
    Kishan Parmar  <kishan@linux.ibm.com>

gcc/ChangeLog:
* config/rs6000/mma.md (MAX_MMA_OPERANDS): Increase from 7 to 9.
(UNSPEC_DMF_DMXOR): New unspec.
(UNSPEC_DMF_DMXVI8GERX4): Likewise.
(UNSPEC_DMF_DMXVI8GERX4PP): Likewise.
(UNSPEC_DMF_PMDMXVI8GERX4): Likewise.
(UNSPEC_DMF_PMDMXVI8GERX4PP): Likewise.
(UNSPEC_DMF_DMSETDMRZ): Likewise.
(DMF_PV): New iterator.
(DMF_DPV): Likewise.
(DMF_PVI8I4I4): Likewise.
(DMF_DPVI8I4I4): Likewise.
(pv): Add DMF mappings.
(apv): Likewise.
(pvi8i4i4): New attribute.
(dpvi8i4i4): Likewise.
(dmf_build_dmr): New define_expand.
(dmf_dmsetdmrz): New insn.
(dmf_dmxor): Likewise.
(dmf_<pv>): New insn pattern.
(dmf_<apv>): Likewise.
(dmf_<pvi8i4i4>): Likewise.
(dmf_<dpvi8i4i4>): Likewise.
* config/rs6000/rs6000-builtin.cc (rs6000_gimple_fold_mma_builtin): Add
DMF builtin support. Handle DMR pass-by-reference semantics.
Support up to nine builtin operands.
(mma_expand_builtin): Likewise.
(rs6000_expand_builtin): Handle DMF builtins.
* config/rs6000/rs6000-builtins.def: Add DMF and MMA+ builtin
definitions.
* doc/extend.texi
(PowerPC Matrix-Multiply Assist Built-in Functions): Document
MMA+ builtins.
(PowerPC Dense Math Facility Built-in Functions): Document DMF builtins.

gcc/testsuite/ChangeLog:
* gcc.target/powerpc/dmf-build-dmr.c: New test.
* gcc.target/powerpc/dmf-builtin.c: New test.

11 days agotestsuite: prevent packing enum in vect-early-break_65.c [PR124112]
Torbjörn SVENSSON [Mon, 20 Jul 2026 19:31:59 +0000 (21:31 +0200)] 
testsuite: prevent packing enum in vect-early-break_65.c [PR124112]

GCC might be compiled with -fshort-enum enabled by default.
For those targets, it is important that the enum type is not packed into
something smaller than int, or vectorization will not match.

gcc/testsuite/ChangeLog:

PR testsuite/124112
* gcc.dg/vect/vect-early-break_65.c: Prevent packing enum to a
smaller object.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
11 days agors6000: Add the __dmr1024 opaque type.
Manjunath S Matti [Wed, 22 Jul 2026 14:07:32 +0000 (09:07 -0500)] 
rs6000: Add the __dmr1024 opaque type.

The changes have been bootstrapped and regression tested on
powerpc64le-linux.

Register __dmr1024 as a new 1024-bit opaque built-in type, following
the same pattern as the existing __vector_pair (OOmode) and
__vector_quad (XOmode) opaque types.  __dmr1024 uses TDOmode, which
was already added in a previous commit ("rs6000: Add TDOmode
support"), and is intended to hold the contents of a Dense Math
Register (DMR) when the Dense Math Facility (-mdense-math) is
enabled.

2026-07-22  Manjunath Matti  <mmatti@linux.ibm.com>

gcc/
* config/rs6000/rs6000.h (RS6000_BTI_dmr1024): New enumerator.
(RS6000_BTI_ptr_dmr1024): New enumerator.
(dmr1024_type_node): New macro.
(ptr_dmr1024_type_node): New macro.
* config/rs6000/rs6000-builtin.cc (rs6000_type_string): Handle
dmr1024_type_node.
(rs6000_init_builtins): Register the __dmr1024 opaque type and
its pointer-to-const variant, with 512-bit alignment.
* config/rs6000/rs6000.cc (rs6000_mangle_type): Handle
dmr1024_type_node.
(rs6000_invalid_conversion): Reject conversions to/from TDOmode.
(rs6000_opaque_type_invalid_use_p): Gate __vector_quad and
__vector_pair on TARGET_MMA and __dmr1024 on TARGET_DMF
independently, and require -mdense-math for __dmr1024.

gcc/testsuite/
* gcc.target/powerpc/dmr1024-alignment.c: New test case.
* gcc.target/powerpc/dmr1024-compile.c: Likewise.
* gcc.target/powerpc/dmr1024-invalid-use-1.c: Likewise.
* gcc.target/powerpc/dmr1024-invalid-use-2.c: Likewise.
* gcc.target/powerpc/dmf-no-mma.c: Likewise.

11 days agolto-streamer: Remove an unused field
Filip Kastl [Mon, 20 Jul 2026 11:00:35 +0000 (13:00 +0200)] 
lto-streamer: Remove an unused field

This patch removes the unused field 'stream_linemap_order' from the
class 'lto_location_cache'.

gcc/ChangeLog:

* lto-streamer.h: Remove the field 'stream_linemap_order' from
the class 'lto_location_cache'.

Signed-off-by: Filip Kastl <fkastl@suse.cz>
11 days agoRISC-V: Adjust test case due to allow vwcvt.x[u].f.v overlap
Pan Li [Wed, 22 Jul 2026 03:08:57 +0000 (11:08 +0800)] 
RISC-V: Adjust test case due to allow vwcvt.x[u].f.v overlap

Remove the xfail due to overlap changes.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/base/pr112431-13-0.c: Remove xfail.

Signed-off-by: Pan Li <pan2.li@intel.com>
11 days agoRISC-V: Add test cases for vfwcvt.rtz.xu.f.v reg overlap
Pan Li [Wed, 22 Jul 2026 01:33:45 +0000 (09:33 +0800)] 
RISC-V: Add test cases for vfwcvt.rtz.xu.f.v reg overlap

Add test cases for register group overlap, please
note it is not overlap as much as possible.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_rtz_xu-f16-m1.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_rtz_xu-f16-m2.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_rtz_xu-f16-m4.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_rtz_xu-f16-mf2.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_rtz_xu-f16-mf4.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_rtz_xu-f32-m1.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_rtz_xu-f32-m2.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_rtz_xu-f32-m4.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_rtz_xu-f32-mf2.c: New test.

Signed-off-by: Pan Li <pan2.li@intel.com>
11 days agoRISC-V: Add test cases for vfwcvt.rtz.x.f.v reg overlap
Pan Li [Wed, 22 Jul 2026 01:32:21 +0000 (09:32 +0800)] 
RISC-V: Add test cases for vfwcvt.rtz.x.f.v reg overlap

Add test cases for register group overlap, please
note it is not overlap as much as possible.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_rtz_x-f16-m1.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_rtz_x-f16-m2.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_rtz_x-f16-m4.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_rtz_x-f16-mf2.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_rtz_x-f16-mf4.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_rtz_x-f32-m1.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_rtz_x-f32-m2.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_rtz_x-f32-m4.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_rtz_x-f32-mf2.c: New test.

Signed-off-by: Pan Li <pan2.li@intel.com>
11 days agoRISC-V: Allow RVV register overlap for vfwcvt.rtz.x[u].f.v
Pan Li [Wed, 22 Jul 2026 01:30:05 +0000 (09:30 +0800)] 
RISC-V: Allow RVV register overlap for vfwcvt.rtz.x[u].f.v

Like v[sz]ext.vf8, allow the rvv register overlap
for vfwcvt.x[u].f.v.

gcc/ChangeLog:

* config/riscv/vector.md: Leverage Wvr constraint.

Signed-off-by: Pan Li <pan2.li@intel.com>
11 days agoDaily bump.
GCC Administrator [Thu, 23 Jul 2026 00:16:35 +0000 (00:16 +0000)] 
Daily bump.

11 days agophiopt: for non-diamond case, invoke a limited conditional store elimination
Andrew Pinski [Mon, 22 Jun 2026 23:54:27 +0000 (16:54 -0700)] 
phiopt: for non-diamond case, invoke a limited conditional store elimination

After adding a limited store elimination function which is always valid even
without non-trapping code, we can call this from phiopt to optimize earlier
some ifconversion.  This should allow for earlier optimizations of say perlbmk.
Also since the _limited version does not depend on store sinking, to happen,
some cases in loops might be better optimized.

Changes since v1:
* v2: Add false argument to cond_store_replacement_limited. And add/fixup
testcases.

gcc/ChangeLog:

* tree-ssa-phiopt.cc (factor_out_all): Call
cond_store_replacement_limited too.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/pr124405.c: Look at phiopt1 instead of cselim.
* gcc.dg/tree-ssa/pr89430-2.c: Likewise.
* gcc.dg/tree-ssa/pr89430-7-comp-ref.c: Likewise.
* gcc.dg/tree-ssa/pr99473-1.c: Likewise.
* gcc.dg/tree-ssa/ssa-pre-17.c: Disable phiopt too.
* gcc.dg/tree-ssa/pr89430-1.c: Disable phiopt.
* gcc.dg/tree-ssa/pr89430-5.c: Disable phiopt.
* gcc.dg/tree-ssa/pr89430-6.c: Disable phiopt.
* gcc.dg/tree-ssa/pr89430-1a.c: New test.
* gcc.dg/tree-ssa/pr89430-5a.c: New test.
* gcc.dg/tree-ssa/pr89430-6a.c: New test.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
11 days agocselim: reduced cs-elim without non-trapping
Andrew Pinski [Sun, 21 Jun 2026 06:01:07 +0000 (23:01 -0700)] 
cselim: reduced cs-elim without non-trapping

This adds a reduced cs-elim functionality which will be used
from phiopt. The design is similar to cond_store_replacement except
we are looking for a similar store right beore the condition or a
non-trapping (no data races or local variable) load right before
the conditional. This allows for 2 things, the reuse of the same
aliasing set and second is allows for use in phiopt in a secondary patch.

It supports the inserting on the edge for the case where there is
no load/stores before the condition if the store is a non-trapping memory
with no data races; this is a similar to what is done in cond_store_replacement
already. Thia part is not going to be used with phiopt though as it is too
complex to support there and it adds a conditional load for no benifit for
phiopt.

Note pr99473-1.c of a case where can be optimized even without
-fallow-store-data-races now. The store happens before the conditional
and inside the conditional, so afterwards there is only one store rather
than 2. The code was also handling it in sink in GCC 12 the same way too
but now handling it in cselim before sink1.

Changes since v1:
* v2: Add support for loads before the conditional and support
for doing the load on the edge. Fix formating and comments.
* v3: Move and rename can_trap_as_a_store to tree-eh.cc (lhs_could_trap_p).
Rename may_alias_mem to copy_mem_with_alias_set_zero.

Bootstrapped and tested on x86_64-linux-gnu.

gcc/ChangeLog:

* tree-eh.cc (lhs_could_trap_p): New function.
* tree-eh.h (lhs_could_trap_p): New decl.
* tree-ssa-phiopt.cc (copy_mem_with_alias_set_zero): New function.
(cond_store_replacement_limited): New function.
(pass_cselim::execute): Call cond_store_replacement_limited before

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/pr99473-1.c: Remove -fallow-store-data-races as it is not
needed with cond_store_replacement_limited.

Signed-off-by: Andrea Pinski <andrew.pinski@oss.qualcomm.com>
12 days agocobol: Restrict CDF reserved words to CDF parsing.
James K. Lowden [Wed, 22 Jul 2026 22:16:43 +0000 (18:16 -0400)] 
cobol: Restrict CDF reserved words to CDF parsing.

Among others PARAMETER was captured as a reserved word during normal
parsing, which it is not.  Move that and some other obvious CDF tokens
to the cdf_state start condition.

gcc/cobol/ChangeLog:

* scan.l: Make PARAMETER and friends unspecial outside CDF.

12 days agocobol: Improve "sameness" test when deciding whether a CDF token was used.
James K. Lowden [Wed, 22 Jul 2026 21:50:47 +0000 (17:50 -0400)] 
cobol: Improve "sameness" test when deciding whether a CDF token was used.

In establishing whether or not the CDF parser discarded a lookahead
token, compare not just the last scanned token's type, but also its
location.

gcc/cobol/ChangeLog:

* cdf.y (cdf::location): New function.
* scan_post.h (same_end): New function to match token ending
locations.
(same_token): New function to match two tokens.

12 days ago[frange] Consolidate signed-zero canonicalization of endpoints
Aldy Hernandez [Wed, 15 Jul 2026 09:16:10 +0000 (09:16 +0000)] 
[frange] Consolidate signed-zero canonicalization of endpoints

The methods frange::set() and frange::flush_denormals_to_zero() canonicalize
ranges containing floating point zero endpoints differently.  Whereas set()
includes both +0.0 and -0.0 in the range, so contains_p([+-]0.0) works, even
under -ffast-math, flush_denormals_to_zero() always sets the lower bound of a
positive denormal as +0.0, regardless of HONOR_SIGNED_ZEROS.  This means that
contains_p(-0.0) would theoretically fail under -ffast-math.

In reality this last scenario doesn't happen because all users of zero endpoints
in the code are special casing signed zeros.  Also, building a range with -0.0
would cause the set() canonicalization to kick in, and set the range to
[-0.0, +0.0] anyhow.  Not only is this fragile at best, but in follow-up patches
I'd like to do some cleanup in this area, and one representation across the
board is in the spirit of what we've always tried to do with irange: a given
range should be representable in only one way (ok, not exactly cause we have
irange_bitmask's which complicate things, but we try ;-)).

Ultimately I'd like to implement sub-ranges for frange so we can represent
inequality with a constant, and tackle a couple of the signed zero PRs in this
area.  But initially I just want to provide an frange_cmp() comparison
function that respects signed zeros, and lets users not have to worry about
special casing anything when dealing with endpoints.

For example, frange_cmp() will order -0.0 strictly below +0.0, so a membership
test becomes just two endpoint comparisons: -0.0 lands outside [+0.0, x] but
inside [-0.0, x], and nobody has to first ask "is this a zero, and if so which
one?".  But that only works if a range always spells its zero endpoints the same
way.  Today set() spells the lower zero of [0.0, 5.0] as -0.0 under -ffast-math,
while flush_denormals_to_zero() spells it +0.0, so one range ends up with two
bit patterns, and frange_cmp() would tell you [+0.0, 5.0] is a strict subset of
[-0.0, 5.0] even though they are the same range.  Once both producers run
through canonicalize_zeros() the order is well defined, and when frange_cmp()
gets implemented, contains_p(), and the eventual sub-range union/intersect code
can just call it and drop their signed-zero special cases entirely.

This patch moves the canonicalization into one function that both set() and
flush_denormals_to_zero() can share.  With it flush_denormals_to_zero() moves
the denormal endpoint to the zero on its side and lets canonicalize_zeros()
settle the sign, exactly as set() does.

I've included a selftest to test this: under -ffast-math, flushing
[+DENORM, 5.0] used to yield [+0.0, 5.0], while set() on the same range yields
[-0.0, 5.0].  With this patch, flushing also yields [-0.0, 5.0], matching set().

There's no observable change with this patch-- every consumer that reads the
sign of a zero endpoint already special-cases !HONOR_SIGNED_ZEROS, so nothing
today can tell the two representations apart.

Tested on x86-64 Linux with a full bootstrap and regtests.  I also tested the
LAPACK suite for regressions, and I ran f951 over all the preprocessed Fortran
files in LAPACK and made sure there are no changes in the assembly with and
without this patch.  Also, tested on ppc64le Linux, including LAPACK,
and making sure there are no changes in assembly with the preprocessed Fortran
files.

This is an internal-consistency fix and a prerequisite for upcoming patches
which will make the sign of a zero endpoint load-bearing.

gcc/ChangeLog:

* value-range.cc (frange::flush_denormals_to_zero): Collapse a
denormal endpoint to the zero of the same sign and defer the sign
to canonicalize_zeros.
(frange::canonicalize_zeros): New.
(frange::set): Use it.
(range_tests_flush_denormals): New.
(range_tests_floats): Call it.
* value-range.h (class frange): Declare canonicalize_zeros.

12 days agocobol: Enable suppression of unimplemented exception conditions.
James K. Lowden [Wed, 22 Jul 2026 20:19:14 +0000 (16:19 -0400)] 
cobol: Enable suppression of unimplemented exception conditions.

For each warning, provide both Wx and Wno-x in the specs string, so
that the driver passes both forms to the driver.  This enables, in
addition to being able to defeat a default, to override the warning
status implied by a dialect.

gcc/cobol/ChangeLog:

* cobol1.cc (enable_exceptions): Remove redundant message.
* lang-specs.h: Provide both forms of every warning.
* parse.y: Remove deleterious comment.

12 days agofortran: [PR78718] ICE in gfc_get_symbol_decl, at fortran/trans-decl.c
Jerry DeLisle [Sat, 11 Jul 2026 04:47:59 +0000 (21:47 -0700)] 
fortran: [PR78718] ICE in gfc_get_symbol_decl, at fortran/trans-decl.c

PR fortran/78718

gcc/fortran/ChangeLog:

* resolve.cc (was_declared): Recognize the RESULT attribute so a
function's result variable is not mistaken for a host-associated
symbol of the same name.

gcc/testsuite/ChangeLog:

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

12 days agolibstdc++: std::variant test should be C++17 and up
Jonathan Wakely [Wed, 22 Jul 2026 18:22:44 +0000 (19:22 +0100)] 
libstdc++: std::variant test should be C++17 and up

libstdc++-v3/ChangeLog:

* testsuite/20_util/variant/lwg3990.cc: Change et to c++17.

12 days agolibgomp: Add by-device capabilities for OpenMP 'omp requires' handling: Fix OpenMP...
Thomas Schwinge [Wed, 22 Jul 2026 18:10:21 +0000 (20:10 +0200)] 
libgomp: Add by-device capabilities for OpenMP 'omp requires' handling: Fix OpenMP reverse offload capability checking

I noticed that as of commit 7cb252f60c1f600066300ede2781a2c9e3808adb
"libgomp: Add by-device capabilities for OpenMP 'omp requires' handling",
'libgomp.fortran/reverse-offload-5.f90' no longer XFAILs NVIDIA GPU offloading
execution, no matter whether non-USM or USM single-GPU system.  That was
suspicious, given that this commit shouldn't cause any such difference in
behavior, per my understanding.  Well, turns out, this commit indeed didn't
magically fix the failure, but it's just another case of non-existing static
type checking of flag values...

libgomp/
* target.c (gomp_target_init): Fix OpenMP reverse offload
capability checking.

12 days agocobol: Accept ASSIGN TO DEVICE.
James K. Lowden [Wed, 22 Jul 2026 17:43:46 +0000 (13:43 -0400)] 
cobol: Accept ASSIGN TO DEVICE.

For SELECT fd-name ASSIGN TO dev, "dev" may name either a runtime
environment variable (as previously) or, as now, an
implementation-defined device.  New warnings govern dialect
variations.  Fixes RT 3617.

gcc/cobol/ChangeLog:

* cbldiag.h (enum cbl_diag_id_t): New warnings.
* cobol1.cc (cobol_langhook_handle_option): Process warnings.
* gcobol.1: Document warnings and devices.
* lang-specs.h: Accept warngings.
* lang.opt: Define warnings.
* messages.cc: Associate warnings with dialects.
* parse.y: Parse new syntax.

12 days agofortran: [PR53296] Fix character array-ctor function called twice
Jerry DeLisle [Tue, 21 Jul 2026 16:15:50 +0000 (09:15 -0700)] 
fortran: [PR53296] Fix character array-ctor function called twice

Avoid the redundant generated call to the pre chain when
no_function_call is set.

Also fix a related stack-buffer-overflow: gfc_conv_array_parameter
wrote over the array constructor's. The specified length was to short.
Use the explicit character type-spec length instead.

PR fortran/53296

gcc/fortran/ChangeLog:

* trans-expr.cc (gfc_conv_procedure_call): Skip the redundant
function call added to the pre chain when no_function_call is
set and the character result length was already determined
without running the callee.
* trans-array.cc (gfc_conv_array_parameter): Convert an array
constructor's explicit character type-spec length directly
instead of using the first elements length.

gcc/testsuite/ChangeLog:

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

12 days agoUpdate my name in the MAINTAINERS file
Andrea Pinski [Tue, 21 Jul 2026 18:31:38 +0000 (11:31 -0700)] 
Update my name in the MAINTAINERS file

As slowing changing my name in places; it is time to update
the MAINTAINERS file too.

ChangeLog:

* MAINTAINERS.yml: Update my name.
* MAINTAINERS: Regenerate.

Signed-off-by: Andrea Pinski <andrew.pinski@oss.qualcomm.com>
12 days agoFix maintainer_utils.py for older jsonscheme [PR126162]
Andrea Pinski [Tue, 21 Jul 2026 18:25:34 +0000 (11:25 -0700)] 
Fix maintainer_utils.py for older jsonscheme [PR126162]

Some semi-older distros don't have a new enough jsonscheme
installed. So this moves the scheme to the older json scheme
rather than using the 2020 one.

PR testsuite/126162
contrib/ChangeLog:

* maintainer_utils.py: Move to the older scheme which
is valid for MAINTAINERS.yml.

Signed-off-by: Andrea Pinski <andrew.pinski@oss.qualcomm.com>
Co-authored-by: Arsen Arsenović <aarsenovic@baylibre.com>
12 days agors6000: Add DMF-specific XO move pattern
Vijay Shankar [Mon, 20 Jul 2026 08:04:54 +0000 (03:04 -0500)] 
rs6000: Add DMF-specific XO move pattern

Split the movxo pattern into DMF and non-DMF variants.

Use DMF move instructions (dmxxinstdmr512, dmmr, and dmxxextfdmr512)
for accumulator/DMR moves while retaining the existing split for
non-DMR operands.

2026-07-15  Vijay Shankar  <vijay@linux.ibm.com>

gcc/ChangeLog:
* config/rs6000/mma.md (*movxo): renamed to movxo_nodmf
(*movxo_nodmf): updated contraint to use wD and add !TARGET_DMF
(*movxo_dmf): New pattern to handle dmf insert/extract from vsx

12 days agoSimplify vect_schedule_slp_node
Richard Biener [Wed, 22 Jul 2026 12:22:56 +0000 (14:22 +0200)] 
Simplify vect_schedule_slp_node

The following simplifies SLP scheduling insert iteration computation.

* tree-vect-slp.cc (vect_schedule_slp_node): Simplify scheduling.

12 days agoFix SLP scheduling in-region check
Richard Biener [Wed, 22 Jul 2026 10:58:47 +0000 (12:58 +0200)] 
Fix SLP scheduling in-region check

This corrects assessing whether a stmt is inside the vector region,
checking random stmt UIDs against -1 does not work for loop vectorization.

* tree-vect-slp.cc (vect_schedule_slp_node): Correct in-region
stmt check.

12 days agors6000: Add TDOmode reload patterns for DMR registers
Surya Kumari Jangala [Wed, 22 Jul 2026 12:56:51 +0000 (07:56 -0500)] 
rs6000: Add TDOmode reload patterns for DMR registers

Add define_insn_and_split patterns for reloading TDOmode values between
Dense Math Registers (DMRs) and memory when TARGET_DMF is enabled.

2026-07-15  Surya Kumari Jangala  <jskumari@linux.ibm.com>
    Peter Bergner  <bergner@linux.ibm.com>

gcc:
* config/rs6000/mma.md (UNSPEC_DMR_RELOAD_FROM_MEMORY): New unspec.
(UNSPEC_DMR_RELOAD_TO_MEMORY): Likewise.
(reload_tdo_load): New define_insn_and_split.
(reload_tdo_store): Likewise.
* config/rs6000/rs6000.cc (rs6000_init_hard_regno_mode_ok): Set
reload_load and reload_store for TDOmode when TARGET_DMF.

12 days agoAVR: Use more .branch_plus in lib1funcs.S
Georg-Johann Lay [Wed, 22 Jul 2026 11:13:58 +0000 (13:13 +0200)] 
AVR: Use more .branch_plus in lib1funcs.S

This patch uses .branch_plus in two more cases,
and it adjusts some comments.

libgcc/
* config/avr/lib1funcs.S (__mulqihi3): Use .branch_plus.
(__mulsidi3): Same.

12 days agolibstdc++: Update Solaris baselines for GCC 17.0
Rainer Orth [Wed, 22 Jul 2026 11:17:13 +0000 (13:17 +0200)] 
libstdc++: Update Solaris baselines for GCC 17.0

This patch updates the Solaris baselines after the introduction of the
GLIBCXX_3.4.37 version.

Tested on i386-pc-solaris2.11 and sparc-sun-solaris2.11 (32 and 64-bit
each).

2026-07-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

libstdc++-v3:
* config/abi/post/i386-solaris/baseline_symbols.txt: Regenerate.
* config/abi/post/i386-solaris/amd64/baseline_symbols.txt:
Likewise.
* config/abi/post/sparc-solaris/baseline_symbols.txt: Likewise.
* config/abi/post/sparc-solaris/sparcv9/baseline_symbols.txt:
Likewise.

12 days agoAVR: Tweak lib1funcs-fixed.S::__mulQ64_work once more.
Georg-Johann Lay [Wed, 22 Jul 2026 10:50:14 +0000 (12:50 +0200)] 
AVR: Tweak lib1funcs-fixed.S::__mulQ64_work once more.

libgcc/
* config/avr/lib1funcs-fixed.S (__mulQ64_work): Shave
off one more instruction.

12 days agoAVR: Tweak lib1funcs-fixed.S::__mulQ64_work.
Georg-Johann Lay [Wed, 22 Jul 2026 10:25:30 +0000 (12:25 +0200)] 
AVR: Tweak lib1funcs-fixed.S::__mulQ64_work.

This patch
- Tweaks the signed overflow handling in __mulQ64_work.
- Rename misnomed fx24-mul.c to fx64-mul-1.c.
- Adds more test cases in fx64-mul-2.c.

libgcc/
* config/avr/lib1funcs-fixed.S (__mulQ64_work): Tweak
overflow handling.  Use __negsi2 (non-saturating negation)
to negate.
gcc/testsuite/
* gcc.target/avr/fx24-mul.c: Renamed to...
* gcc.target/avr/fx64-mul-1.c: ...this.
* gcc.target/avr/fx64-mul-2.c: New test.
* gcc.target/avr/fx64-mul.h: New file.

12 days agotestsuite: require cortex-a53 in reg_equal_test.c test
Torbjörn SVENSSON [Mon, 20 Jul 2026 18:36:45 +0000 (20:36 +0200)] 
testsuite: require cortex-a53 in reg_equal_test.c test

The original purpose of the test is to verify that, when the backend
emits a mov-pair sequence, the sequence carries a REG_EQUAL note for the
final constant value.  Make that precondition explicit instead of
depending on target-specific tuning behavior, by forcing the test to
a CPU with the required properties.

gcc/testsuite/ChangeLog:

* gcc.target/arm/reg_equal_test.c: Add require effective target
cortex-a53 for test.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
12 days agolibstdc++: Update Linux baselines for GCC 17.0
Jakub Jelinek [Wed, 22 Jul 2026 09:56:48 +0000 (11:56 +0200)] 
libstdc++: Update Linux baselines for GCC 17.0

The following patch applies the powerpc64le-linux-gnu/baseline_symbols.txt
and x86_64-linux-gnu/baseline_symbols.txt r17-2579 changes to all
other linux arches which have recently updated baseline_symbols.txt
(i.e. those which have GLIBCXX_3.4.35 symbol version in it).
Those 3 symbols are architecture independent, they don't have any
size_t etc. argument that depends on the architecture, j (unsigned int) for
the last one is unsigned int on all arches.
On most the patch applied cleanly, on some (powerpc*/s390x*) I had to
manually resolve fuzz, as
FUNC:_ZNKSt16bad_array_length4whatEv@@CXXABI_1.3.8
there wasn't followed by
FUNC:_ZNKSt17bad_function_call4whatEv@@GLIBCXX_3.4.18
but some @@GLIBCXX_LDBL_3.4 symbols (which are _ZNKSt17* though, so the
two new comes alphabetically sorted before those).

2026-07-22  Jakub Jelinek  <jakub@redhat.com>

* config/abi/post/aarch64-linux-gnu/baseline_symbols.txt: Regenerate
from 16 branch.
* config/abi/post/hppa-linux-gnu/baseline_symbols.txt: Likewise.
* config/abi/post/i386-linux-gnu/baseline_symbols.txt: Likewise.
* config/abi/post/i486-linux-gnu/baseline_symbols.txt: Likewise.
* config/abi/post/ia64-linux-gnu/baseline_symbols.txt: Likewise.
* config/abi/post/m68k-linux-gnu/baseline_symbols.txt: Likewise.
* config/abi/post/powerpc-linux-gnu/baseline_symbols.txt: Likewise.
* config/abi/post/powerpc64-linux-gnu/32/baseline_symbols.txt:
Likewise.
* config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt: Likewise.
* config/abi/post/riscv64-linux-gnu/baseline_symbols.txt: Likewise.
* config/abi/post/s390x-linux-gnu/baseline_symbols.txt: Likewise.
* config/abi/post/sparc64-linux-gnu/32/baseline_symbols.txt: Likewise.
* config/abi/post/sparc64-linux-gnu/baseline_symbols.txt: Likewise.
* config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt: Likewise.
* config/abi/post/x86_64-linux-gnu/x32/baseline_symbols.txt: Likewise.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
12 days agolibgomp: Add by-device capabilities for OpenMP 'omp requires' handling
Tobias Burnus [Wed, 22 Jul 2026 08:40:36 +0000 (10:40 +0200)] 
libgomp: Add by-device capabilities for OpenMP 'omp requires' handling

Before the capabilities of a device were statically set to a generic
by-device-type value. This has been modified to additionally set them
to a value for a specific device.

On the plugin side, this permits to set the unified-shared memory
capability for only a subset of devices and to mark devices that are
integrated GPUs (APU) and support USM, which in turn permitted to move
the handling of OpenMP requirements from the plugin back to target.c
and permits in future to automatically enable unified-shared memory
for integrated GPUs/APUs.

The check for whether host memory can be accessed is for Nvidia GPUs
whether pageableMemoryAccess is supported (unchanged) and for AMD GPUs
whether SVM_ACCESSIBLE_BY_DEFAULT is supported (unchanged, global
property) and, if not, now also whether the device is an APU and
either XNACK is enabled or not supported by the hardware. For systems
with a single GPU, the result should be identical.

Note: The resulting capability is currently only used with
  omp requires unified_shared_memory / self_maps
such that this flag is only set if the user code has this requirement
and all devices not supporting the host-memory access are filtered out.

Co-authored-by: Andrew Stubbs <ams@baylibre.com>
Co-authored-by: supers1ngular <supers1ngular@baylibre.com>
include/ChangeLog:

* hsa.h (hsa_system_info_t): Add HSA_AMD_SYSTEM_INFO_XNACK_ENABLED.

libgomp/ChangeLog:

* libgomp-plugin.h (GOMP_OFFLOAD_CAP_APU_SHARED_MEM,
GOMP_OFFLOAD_CAP_UNIFIED_ADDR, GOMP_OFFLOAD_CAP_REV_OFFLOAD): Add.
(GOMP_OFFLOAD_get_dev_caps): New prototype.
(GOMP_OFFLOAD_get_num_devices): Remove requirement argument.
* libgomp.h (struct gomp_device_descr): Add get_dev_caps_func.
* libgomp.texi (nvptx, AMD Radeon): Update for by-device
USM support.
* oacc-host.c (host_get_num_devices,
host_openacc_get_property): Update call.
* oacc-init.c (resolve_device, acc_init_1, acc_shutdown_1,
goacc_attach_host_thread_to_device, acc_get_num_devices,
acc_set_device_num, get_property_any): Likewise.
* plugin/plugin-gcn.c (is_integrated_apu): Remove.
(GOMP_OFFLOAD_get_caps): Mark unified address and
reverse offload as supported.
(GOMP_OFFLOAD_get_dev_caps): New.
(GOMP_OFFLOAD_get_num_devices): Remove requirements arg.
* plugin/plugin-nvptx.c (using_usm): Init with -1.
(GOMP_OFFLOAD_get_caps): Mark unified address and
reverse offload as supported.
(GOMP_OFFLOAD_get_dev_caps): New.
(GOMP_OFFLOAD_get_num_devices): Remove requirements arg.
(GOMP_OFFLOAD_is_accessible_ptr): Check for using_usm > 0.
* target.c (gomp_load_plugin_for_device): Load get_dev_caps.
(gomp_target_init): Change to by-device capabilities, skip
only those devices not devices types that do not support a
capability.