From 7640cc5ef80afae9b65afcca96e1eb2b9e513c21 Mon Sep 17 00:00:00 2001
From: Eric Botcazou
Date: Mon, 8 Sep 2025 19:18:59 +0200
Subject: [PATCH 001/945] Testsuite: Fix spurious of ACATS-4 test cxai033
This tentatively applies the same tweak as in other similar cases.
gcc/testsuite/
PR ada/121532
* ada/acats-4/tests/cxa/cxai033.a: Use Long_Switch_To_New_Task
constant instead of Switch_To_New_Task in delay statements.
---
gcc/testsuite/ada/acats-4/tests/cxa/cxai033.a | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/testsuite/ada/acats-4/tests/cxa/cxai033.a b/gcc/testsuite/ada/acats-4/tests/cxa/cxai033.a
index 90bd3f60279e..921655bcc624 100644
--- a/gcc/testsuite/ada/acats-4/tests/cxa/cxai033.a
+++ b/gcc/testsuite/ada/acats-4/tests/cxa/cxai033.a
@@ -116,7 +116,7 @@ begin
-- Give time for Reader_1 to activate.
- delay Impdef.Switch_To_New_Task;
+ delay Impdef.Long_Switch_To_New_Task;
if not Reader_1_Blocked then
@@ -145,7 +145,7 @@ begin
-- Give time for Writer_1 to activate;
- delay Impdef.Switch_To_New_Task;
+ delay Impdef.Long_Switch_To_New_Task;
if Reader_1_Blocked then
From 5ee35b12de830a4688e79ed7ab464f281a220d3d Mon Sep 17 00:00:00 2001
From: Eric Botcazou
Date: Mon, 8 Sep 2025 19:41:20 +0200
Subject: [PATCH 002/945] Ada: Make -fdump-ada-spec deal with pointers to
anonymous structure
This is about -fdump-ada-spec not generating the definition of the structure
for pointers to anonymous structure as structure elements.
gcc/c-family:
PR ada/121544
* c-ada-spec.cc (dump_ada_node) : Dump the name of
anonymous tagged pointed-to types specially.
(dump_nested_type) : Recurse on anonymous pointed-to
types declared in the same file.
Set TREE_VISITED on the underlying DECL of the field type, if any.
---
gcc/c-family/c-ada-spec.cc | 26 +++++++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
diff --git a/gcc/c-family/c-ada-spec.cc b/gcc/c-family/c-ada-spec.cc
index c7ae032230a8..42d75b49c94e 100644
--- a/gcc/c-family/c-ada-spec.cc
+++ b/gcc/c-family/c-ada-spec.cc
@@ -2442,8 +2442,14 @@ dump_ada_node (pretty_printer *pp, tree node, tree type, int spc,
break;
}
- dump_ada_node (pp, ref_type, ref_type, spc, is_access,
- true);
+ /* Dump anonymous tagged types specially. */
+ if (TYPE_NAME (ref_type)
+ || (!RECORD_OR_UNION_TYPE_P (ref_type)
+ && TREE_CODE (ref_type) != ENUMERAL_TYPE))
+ dump_ada_node (pp, ref_type, ref_type, spc, is_access,
+ true);
+ else
+ dump_anonymous_type_name (pp, ref_type);
}
}
}
@@ -2699,7 +2705,16 @@ dump_nested_type (pretty_printer *pp, tree field, tree t, int spc)
{
case POINTER_TYPE:
tmp = TREE_TYPE (field_type);
- dump_forward_type (pp, tmp, t, spc);
+ decl = get_underlying_decl (tmp);
+ if (TYPE_NAME (tmp) || !decl || DECL_NAME (decl))
+ dump_forward_type (pp, tmp, t, spc);
+ else if (DECL_SOURCE_FILE (decl) == DECL_SOURCE_FILE (t)
+ && !TREE_VISITED (decl))
+ {
+ /* Generate full declaration. */
+ dump_nested_type (pp, decl, t, spc);
+ TREE_VISITED (decl) = 1;
+ }
break;
case ARRAY_TYPE:
@@ -2773,6 +2788,11 @@ dump_nested_type (pretty_printer *pp, tree field, tree t, int spc)
default:
break;
}
+
+ /* Make sure not to output the nested type twice in C++. */
+ decl = get_underlying_decl (field_type);
+ if (decl)
+ TREE_VISITED (decl) = 1;
}
/* Hash table of overloaded names that we cannot support. It is needed even
From de35b739a849d6bc6d1b0978dbcdc737dd709c89 Mon Sep 17 00:00:00 2001
From: Nathan Myers
Date: Mon, 8 Sep 2025 15:33:23 -0400
Subject: [PATCH 003/945] libstdc++: fix makefile.in for syncbuf.lo
This patch fixes Makefile.in to include mention of new syncbuf.lo.
libstdc++-v3/Changelog:
* src/c++20/Makefile.in: Mention syncbuf.lo.
---
libstdc++-v3/src/c++20/Makefile.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libstdc++-v3/src/c++20/Makefile.in b/libstdc++-v3/src/c++20/Makefile.in
index 1e005ae3c14e..104ee597b5ec 100644
--- a/libstdc++-v3/src/c++20/Makefile.in
+++ b/libstdc++-v3/src/c++20/Makefile.in
@@ -121,7 +121,7 @@ CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
libc__20convenience_la_LIBADD =
-am__objects_1 = tzdb.lo format.lo atomic.lo clock.lo
+am__objects_1 = tzdb.lo format.lo atomic.lo clock.lo syncbuf.lo
@ENABLE_EXTERN_TEMPLATE_TRUE@am__objects_2 = sstream-inst.lo
@GLIBCXX_HOSTED_TRUE@am_libc__20convenience_la_OBJECTS = \
@GLIBCXX_HOSTED_TRUE@ $(am__objects_1) $(am__objects_2)
From d199a9c7c5034d0eddb3380a58342a5bcbe6febd Mon Sep 17 00:00:00 2001
From: Jonathan Wakely
Date: Wed, 18 Jun 2025 15:46:24 +0100
Subject: [PATCH 004/945] libstdc++: Fix docs for --enable-vtable-verify
[PR120698]
libstdc++-v3/ChangeLog:
PR libstdc++/120698
* doc/xml/manual/configure.xml: Do not claim that vtv is enabled
by default.
* doc/html/manual/configure.html: Regenerate.
---
libstdc++-v3/doc/html/manual/configure.html | 2 +-
libstdc++-v3/doc/xml/manual/configure.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libstdc++-v3/doc/html/manual/configure.html b/libstdc++-v3/doc/html/manual/configure.html
index 3564b0c409f0..eb4d42117100 100644
--- a/libstdc++-v3/doc/html/manual/configure.html
+++ b/libstdc++-v3/doc/html/manual/configure.html
@@ -268,7 +268,7 @@
operations (e.g. the library is configured for armv7 and then code
is compiled with -march=armv5t) then the program
might rely on support in libgcc to provide the atomics.
-
Use -fvtable-verify=std to compile the C++
runtime with instrumentation for vtable verification. All virtual
functions in the standard library will be verified at runtime.
Types impacted include locale and
diff --git a/libstdc++-v3/doc/xml/manual/configure.xml b/libstdc++-v3/doc/xml/manual/configure.xml
index cd5f44458a2e..460b994009da 100644
--- a/libstdc++-v3/doc/xml/manual/configure.xml
+++ b/libstdc++-v3/doc/xml/manual/configure.xml
@@ -438,7 +438,7 @@
- --enable-vtable-verify[default]
+ --enable-vtable-verify
Use -fvtable-verify=std to compile the C++
runtime with instrumentation for vtable verification. All virtual
From 8cad8f94b450be9b73d07bdeef7fa1778d3f2b96 Mon Sep 17 00:00:00 2001
From: "H.J. Lu"
Date: Fri, 5 Sep 2025 15:40:51 -0700
Subject: [PATCH 005/945] c: Update TLS model after processing a TLS variable
Set a tentative TLS model in grokvardecl and update TLS mode with the
default TLS access model after a TLS variable has been fully processed
if the default TLS access model is stronger.
gcc/c/
PR c/107419
* c-decl.cc (c_decl_attributes): Update TLS model with the
default TLS access model if the default TLS access model is
stronger.
(grokdeclarator): Set a tentative TLS model which will be
updated by c_decl_attributes later.
Signed-off-by: H.J. Lu
---
gcc/c/c-decl.cc | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/gcc/c/c-decl.cc b/gcc/c/c-decl.cc
index 589abf4e4e28..62a0545947e5 100644
--- a/gcc/c/c-decl.cc
+++ b/gcc/c/c-decl.cc
@@ -5582,7 +5582,16 @@ c_decl_attributes (tree *node, tree attributes, int flags)
tree last_decl = lookup_last_decl (*node);
if (last_decl == error_mark_node)
last_decl = NULL_TREE;
- return decl_attributes (node, attributes, flags, last_decl);
+ tree attr = decl_attributes (node, attributes, flags, last_decl);
+ if (VAR_P (*node) && DECL_THREAD_LOCAL_P (*node))
+ {
+ // tls_model attribute can set a stronger TLS access model.
+ tls_model model = DECL_TLS_MODEL (*node);
+ tls_model default_model = decl_default_tls_model (*node);
+ if (default_model > model)
+ set_decl_tls_model (*node, default_model);
+ }
+ return attr;
}
@@ -8181,8 +8190,11 @@ grokdeclarator (const struct c_declarator *declarator,
TREE_PUBLIC (decl) = extern_ref;
}
+ // NB: Set a tentative TLS model to avoid tls_model attribute
+ // warnings due to lack of thread storage duration. It will
+ // be updated by c_decl_attributes later.
if (threadp)
- set_decl_tls_model (decl, decl_default_tls_model (decl));
+ set_decl_tls_model (decl, TLS_MODEL_REAL);
}
if ((storage_class == csc_extern
From f65747d0d966bdee2cbe6053cf2347bedba8cf0d Mon Sep 17 00:00:00 2001
From: Jonathan Wakely
Date: Tue, 9 Sep 2025 00:34:21 +0100
Subject: [PATCH 006/945] libstdc++: Rename template parameter of
std::constant_wrapper
This fixes:
FAIL: 17_intro/badnames.cc -std=gnu++26 (test for excess errors)
libstdc++-v3/ChangeLog:
* include/std/type_traits (constant_wrapper): Rename template
parameter to avoid BADNAME.
---
libstdc++-v3/include/std/type_traits | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
index 26cbbb4fd5ba..42a1e7f1732b 100644
--- a/libstdc++-v3/include/std/type_traits
+++ b/libstdc++-v3/include/std/type_traits
@@ -4648,12 +4648,12 @@ template
}
};
- template<_CwFixedValue _X, typename>
+ template<_CwFixedValue _Xv, typename>
struct constant_wrapper : _CwOperators
{
- static constexpr const auto& value = _X._M_data;
+ static constexpr const auto& value = _Xv._M_data;
using type = constant_wrapper;
- using value_type = typename decltype(_X)::_S_type;
+ using value_type = typename decltype(_Xv)::_S_type;
template<_ConstExprParam _Right>
constexpr auto
From bc5781e76f58aeb89aec1bf54791f39056ca26d7 Mon Sep 17 00:00:00 2001
From: GCC Administrator
Date: Tue, 9 Sep 2025 00:23:09 +0000
Subject: [PATCH 007/945] Daily bump.
---
contrib/ChangeLog | 4 +
gcc/ChangeLog | 104 ++++++++++++++++++++++++++
gcc/DATESTAMP | 2 +-
gcc/c-family/ChangeLog | 9 +++
gcc/c/ChangeLog | 9 +++
gcc/fortran/ChangeLog | 7 ++
gcc/testsuite/ChangeLog | 161 ++++++++++++++++++++++++++++++++++++++++
libstdc++-v3/ChangeLog | 71 ++++++++++++++++++
8 files changed, 366 insertions(+), 1 deletion(-)
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 691203f9036b..ab38d8bd5273 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,7 @@
+2025-09-08 Christophe Lyon
+
+ * compare_tests: Report non-unique test names.
+
2025-08-17 Filip Kastl
* check-MAINTAINERS.py: Document the way the script sorts
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6a8792ab77cc..bd85e1abff99 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,107 @@
+2025-09-08 Richard Biener
+
+ PR tree-optimization/107997
+ PR tree-optimization/121844
+ * tree-ssa-loop-ivopts.cc (allow_ip_end_pos_p): Do not allow
+ IP_END for latches ending with a control stmt.
+ (create_new_iv): Do not split the latch edge, instead assert
+ that's not necessary.
+
+2025-09-08 Paul-Antoine Arras
+
+ * config/riscv/autovec-opt.md (*vfwadd_vf_): New pattern to
+ combine float_extend + vec_duplicate + vfwadd.vv into vfwadd.vf.
+
+2025-09-08 Anton Blanchard
+
+ * config/riscv/riscv.cc (tt_ascalon_d8_tune_info): Increase branch_cost
+ from 3 to 4.
+
+2025-09-08 Richard Biener
+
+ PR tree-optimization/121830
+ * tree-vect-loop.cc (vect_analyze_scalar_cycles_1): Only
+ set STMT_VINFO_REDUC_DEF on reductions.
+ * tree-vect-slp.cc (vect_build_slp_tree_2): Identify reduction
+ PHIs by a set STMT_VINFO_REDUC_DEF instead of their def type.
+
+2025-09-08 Richard Biener
+
+ PR tree-optimization/121829
+ * tree-vect-loop-manip.cc (vect_remove_forwarder): New
+ function.
+ (slpeel_tree_duplicate_loop_to_edge_cfg): Use it.
+
+2025-09-08 Alex Coplan
+
+ PR tree-optimization/114892
+ * doc/invoke.texi (Developer Options): Document -folding option
+ for -fdump-tree-*.
+
+2025-09-08 Kugan Vivekanandarajah
+
+ * ipa-cp.cc (gather_count_of_non_rec_edges): Check count
+ initialization before adding to total.
+
+2025-09-08 Paul-Antoine Arras
+
+ * config/riscv/autovec-opt.md (*vfrsub_vf_): New pattern to
+ combine vec_duplicate + vfsub.vv into vfrsub.vf.
+
+2025-09-08 Paul-Antoine Arras
+
+ * config/riscv/autovec-opt.md (*vfsub_vf_): New pattern to
+ combine vec_duplicate + vfsub.vv into vfsub.vf.
+ * config/riscv/vector.md (@pred__scalar): Allow VLS modes.
+
+2025-09-08 Paul-Antoine Arras
+
+ * config/riscv/autovec-opt.md (*vfadd_vf_): New pattern to
+ combine vec_duplicate + vfadd.vv into vfadd.vf.
+
+2025-09-08 Paul-Antoine Arras
+
+ * config/riscv/autovec-opt.md (*vfwmul_vf_): New pattern to
+ combine float_extend + vec_duplicate + vfmul.vv into vfmul.vf.
+ * config/riscv/vector.md (*@pred_dual_widen__scalar):
+ Swap operands to match the RTL emitted by expand, i.e. first
+ float_extend then vec_duplicate.
+
+2025-09-08 Paul-Antoine Arras
+
+ * config/riscv/autovec-opt.md (*vfmin_vf_ieee_): Rename into...
+ (*v_vf_): New pattern to combine vec_duplicate +
+ vf{max,min}.vv (unspec) into vf{max,min}.vf.
+
+2025-09-08 Gerald Pfeifer
+
+ * doc/extend.texi (SH Function Attributes): Remove reference to
+ GNU Binutils 2.7 requirement.
+ (H8/300 Variable Attributes): Ditto.
+
+2025-09-08 Andrew Pinski
+
+ PR tree-optimization/87900
+ * tree-ssa-strlen.cc (strlen_pass::handle_assign): Add RHS argument.
+ For empty constructor RHS, see if can combine with a previous malloc into
+ a calloc.
+ (strlen_pass::check_and_optimize_call): Update call to handle_assign;
+ passing NULL_TREE for RHS.
+ (strlen_pass::check_and_optimize_stmt): Update call to handle_assign.
+
+2025-09-08 Andrew Pinski
+
+ PR tree-optimization/83022
+ * tree-ssa-strlen.cc (last_stmt_ptr_check): New function.
+ (allow_memset_malloc_to_calloc): New function.
+ (strlen_pass::handle_builtin_memset): Check to see if it is a good
+ idea to do the malloc+memset->calloc optimization.
+ (printf_strlen_execute): Free post dom info.
+
+2025-09-08 Sam James
+
+ * common.opt.urls: Regenerate.
+
2025-09-07 Andrew Pinski
PR tree-optimization/121841
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 535d724e1543..757870bca1ac 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20250908
+20250909
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 582a282c2ee3..9725521151cb 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,12 @@
+2025-09-08 Eric Botcazou
+
+ PR ada/121544
+ * c-ada-spec.cc (dump_ada_node) : Dump the name of
+ anonymous tagged pointed-to types specially.
+ (dump_nested_type) : Recurse on anonymous pointed-to
+ types declared in the same file.
+ Set TREE_VISITED on the underlying DECL of the field type, if any.
+
2025-08-27 Jakub Jelinek
PR target/121520
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index d719cb8598ec..36f7c9d9974a 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,12 @@
+2025-09-08 H.J. Lu
+
+ PR c/107419
+ * c-decl.cc (c_decl_attributes): Update TLS model with the
+ default TLS access model if the default TLS access model is
+ stronger.
+ (grokdeclarator): Set a tentative TLS model which will be
+ updated by c_decl_attributes later.
+
2025-09-05 Jakub Jelinek
* c-decl.cc (pushtag): Remove ()s around string literal
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index d4ea58f5d194..ef751fb87e84 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,10 @@
+2025-09-08 Paul Thomas
+
+ PR fortran/84008
+ * decl.cc (insert_parameter_exprs): Correct the typespec of new
+ variable declarations, where the type is set to BT_PROCEDURE as
+ a precaution for resolution of the whole program unit.
+
2025-09-06 Paul Thomas
PR fortran/84119
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 965d93b3f6ae..d80bd20c57bd 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,164 @@
+2025-09-08 Eric Botcazou
+
+ PR ada/121532
+ * ada/acats-4/tests/cxa/cxai033.a: Use Long_Switch_To_New_Task
+ constant instead of Switch_To_New_Task in delay statements.
+
+2025-09-08 Xi Ruoyao
+
+ * gcc.dg/fixed-point/bitint-1.c (dg-options): Use -std=gnu23
+ instead of -std=c23.
+
+2025-09-08 Richard Biener
+
+ PR tree-optimization/107997
+ PR tree-optimization/121844
+ * gcc.dg/torture/pr121844.c: New testcase.
+
+2025-09-08 Paul-Antoine Arras
+
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-1-f16.c: Add vfwadd.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-1-f32.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-2-f16.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-2-f32.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-3-f16.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-3-f32.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-4-f16.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-4-f32.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf_binop.h
+ (DEF_VF_BINOP_WIDEN_CASE_0): Fix OP.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf_vfwadd-run-1-f16.c: New test.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf_vfwadd-run-1-f32.c: New test.
+
+2025-09-08 Richard Biener
+
+ PR tree-optimization/121830
+ * gcc.dg/vect/pr121830.c: New testcase.
+
+2025-09-08 Richard Biener
+
+ PR tree-optimization/121829
+ * gcc.dg/torture/pr121829.c: New testcase.
+
+2025-09-08 Paul-Antoine Arras
+
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-1-f16.c: Add vfrsub.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-1-f32.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-1-f64.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-2-f16.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-2-f32.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-2-f64.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-3-f16.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-3-f32.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-3-f64.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-4-f16.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-4-f32.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-4-f64.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf_binop_data.h: Add data for
+ vfrsub.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf_vfrsub-run-1-f16.c: New test.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf_vfrsub-run-1-f32.c: New test.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf_vfrsub-run-1-f64.c: New test.
+
+2025-09-08 Paul-Antoine Arras
+
+ * gcc.target/riscv/rvv/autovec/vls/floating-point-sub-2.c: Adjust scan
+ dumps.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-1-f16.c: Add vfsub.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-1-f32.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-1-f64.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-2-f16.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-2-f32.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-2-f64.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-3-f16.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-3-f32.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-3-f64.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-4-f16.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-4-f32.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-4-f64.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf_binop_data.h: Add data for
+ vfsub.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf_vfsub-run-1-f16.c: New test.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf_vfsub-run-1-f32.c: New test.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf_vfsub-run-1-f64.c: New test.
+
+2025-09-08 Paul-Antoine Arras
+
+ * gcc.target/riscv/rvv/autovec/vls/floating-point-add-2.c: Adjust scan
+ dump.
+ * gcc.target/riscv/rvv/autovec/vls/floating-point-add-3.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vls/floating-point-sub-3.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-1-f16.c: Add vfadd.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-1-f32.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-1-f64.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-2-f16.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-2-f32.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-2-f64.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-3-f16.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-3-f32.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-3-f64.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-4-f16.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-4-f32.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-4-f64.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf_binop_data.h: Add data for
+ vfadd.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf_vfadd-run-1-f16.c: New test.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf_vfadd-run-1-f32.c: New test.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf_vfadd-run-1-f64.c: New test.
+
+2025-09-08 Paul-Antoine Arras
+
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-1-f16.c: Add vfwmul.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-1-f32.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-2-f16.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-2-f32.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-3-f16.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-3-f32.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-4-f16.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-4-f32.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf_binop.h: Add support for
+ widening variants.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf_binop_widen_run.h: New test
+ helper.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf_vfwmul-run-1-f16.c: New test.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf_vfwmul-run-1-f32.c: New test.
+
+2025-09-08 Paul-Antoine Arras
+
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-5-f16.c: Add vfmax.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-5-f32.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-5-f64.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-6-f16.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-6-f32.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-6-f64.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-7-f16.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-7-f32.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-7-f64.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-8-f16.c: Add vfmax. Also add
+ missing -fno-fast-math.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-8-f32.c: Likewise.
+ * gcc.target/riscv/rvv/autovec/vx_vf/vf-8-f64.c: Likewise.
+
+2025-09-08 Paul Thomas
+
+ PR fortran/84008
+ * gfortran.dg/pdt_45.f03: New test.
+
+2025-09-08 Andrew Pinski
+
+ PR tree-optimization/87900
+ * gcc.dg/tree-ssa/calloc-10.c: New test.
+ * gcc.dg/tree-ssa/calloc-11.c: New test.
+ * gcc.dg/tree-ssa/calloc-12.c: New test.
+
+2025-09-08 Andrew Pinski
+
+ PR tree-optimization/83022
+ * gcc.dg/tree-ssa/calloc-6.c: New test.
+ * gcc.dg/tree-ssa/calloc-7.c: New test.
+ * gcc.dg/tree-ssa/calloc-8.c: New test.
+ * gcc.dg/tree-ssa/calloc-9.c: New test.
+
2025-09-07 Andrew Pinski
PR tree-optimization/121841
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 33b10869759d..b9efabd35648 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,74 @@
+2025-09-08 Jonathan Wakely
+
+ * include/std/type_traits (constant_wrapper): Rename template
+ parameter to avoid BADNAME.
+
+2025-09-08 Jonathan Wakely
+
+ PR libstdc++/120698
+ * doc/xml/manual/configure.xml: Do not claim that vtv is enabled
+ by default.
+ * doc/html/manual/configure.html: Regenerate.
+
+2025-09-08 Nathan Myers
+
+ * src/c++20/Makefile.in: Mention syncbuf.lo.
+
+2025-09-08 Nathan Myers
+
+ * include/std/syncstream: (syncbuf<>::__mutex) Remove _S_get_mutex,
+ use extern function instead.
+ * src/c++20/syncbuf.cc: Define global __syncbuf_get_mutex.
+ * src/c++20/Makefile.am: Mention syncbuf.cc.
+ * src/c++20/Makefile.in: Regenerate.
+ * config/abi/pre/gnu.ver: Mention mangled __syncbuf_get_mutex.
+
+2025-09-08 Jakub Jelinek
+
+ PR libstdc++/121827
+ * include/precompiled/extc++.h: Don't include ext/cast.h which is an
+ internal header.
+ * include/ext/pointer.h: Include bits/c++config.h before
+ #if _GLIBCXX_HOSTED.
+
+2025-09-08 Gerald Pfeifer
+
+ * doc/xml/manual/using_exceptions.xml: Update link to "Tunables"
+ section in the Glibc manual.
+ * doc/html/manual/using_exceptions.html: Regenerate.
+
+2025-09-08 Luc Grosheintz
+
+ * include/std/span (__integral_constant_like): Allow the member
+ `value` of a constant wrapping type to be a const reference of
+ an integer.
+ * testsuite/23_containers/mdspan/extents/misc.cc: Add test for
+ cw and constant_wrapper.
+ * testsuite/23_containers/mdspan/mdspan.cc: Ditto.
+ * testsuite/23_containers/span/deduction.cc: Ditto.
+
+2025-09-08 Luc Grosheintz
+ Tomasz Kamiński
+
+ * include/bits/version.def (constant_wrapper): Add.
+ * include/bits/version.h: Regenerate.
+ * include/std/type_traits (_CwFixedValue): New class.
+ (_IndexSequence): New struct.
+ (_BuildIndexSequence): New struct.
+ (_ConstExprParam): New concept.
+ (_CwOperators): New struct.
+ (constant_wrapper): New struct.
+ (cw): New global constant.
+ * src/c++23/std.cc.in (constant_wrapper): Add.
+ (cw): Add.
+ * testsuite/20_util/constant_wrapper/adl.cc: New test.
+ * testsuite/20_util/constant_wrapper/ex.cc: New test.
+ * testsuite/20_util/constant_wrapper/generic.cc: New test.
+ * testsuite/20_util/constant_wrapper/instantiate.cc: New test.
+ * testsuite/20_util/constant_wrapper/op_comma_neg.cc: New test.
+ * testsuite/20_util/constant_wrapper/version.cc: New test.
+ * testsuite/20_util/constant_wrapper/other_wrappers.cc: New file.
+
2025-09-05 Patrick Palka
PR libstdc++/121804
From f4154da55586ab591c1b01936ebd6ab370bc2e80 Mon Sep 17 00:00:00 2001
From: liuhongt
Date: Tue, 19 Aug 2025 22:46:40 -0700
Subject: [PATCH 008/945] Exclude fake cross-lane permutation from
avx256_avoid_vec_perm.
SLP may take a broadcast as kind of vec_perm, the patch checks the
permutation index to exclude those false positive.
gcc/ChangeLog:
* config/i386/i386.cc (ix86_vector_costs::add_stmt_cost):
Check permutation index for vec_perm, don't count it if we
know it's not a cross-lane permutation.
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx256_avoid_vec_perm.c: Adjust testcase.
* gcc.target/i386/avx256_avoid_vec_perm-2.c: New test.
* gcc.target/i386/avx256_avoid_vec_perm-5.c: New test.
---
gcc/config/i386/i386.cc | 59 ++++++++++++++++++-
.../gcc.target/i386/avx256_avoid_vec_perm-2.c | 21 +++++++
.../gcc.target/i386/avx256_avoid_vec_perm-5.c | 24 ++++++++
.../gcc.target/i386/avx256_avoid_vec_perm.c | 2 +-
4 files changed, 103 insertions(+), 3 deletions(-)
create mode 100644 gcc/testsuite/gcc.target/i386/avx256_avoid_vec_perm-2.c
create mode 100644 gcc/testsuite/gcc.target/i386/avx256_avoid_vec_perm-5.c
diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
index 471be3e86158..d71975a42bea 100644
--- a/gcc/config/i386/i386.cc
+++ b/gcc/config/i386/i386.cc
@@ -26392,8 +26392,63 @@ ix86_vector_costs::add_stmt_cost (int count, vect_cost_for_stmt kind,
stmt_cost = ix86_default_vector_cost (kind, mode);
if (kind == vec_perm && vectype
- && GET_MODE_SIZE (TYPE_MODE (vectype)) == 32)
- m_num_avx256_vec_perm[where]++;
+ && GET_MODE_SIZE (TYPE_MODE (vectype)) == 32
+ /* BIT_FIELD_REF 0 times vec_perm costs 0 in body. */
+ && count != 0)
+ {
+ bool real_perm = true;
+ unsigned nunits = TYPE_VECTOR_SUBPARTS (vectype);
+
+ if (node
+ && SLP_TREE_LOAD_PERMUTATION (node).exists ()
+ /* Loop vectorization will have 4 times vec_perm
+ with index as {0, 0, 0, 0}.
+ But it actually generates
+ vec_perm_expr
+ vec_perm_expr
+ vec_perm_expr
+ Need to be handled separately. */
+ && is_a (m_vinfo))
+ {
+ unsigned half = nunits / 2;
+ unsigned i = 0;
+ bool allsame = true;
+ unsigned first = SLP_TREE_LOAD_PERMUTATION (node)[0];
+ bool cross_lane_p = false;
+ for (i = 0 ; i != SLP_TREE_LANES (node); i++)
+ {
+ unsigned tmp = SLP_TREE_LOAD_PERMUTATION (node)[i];
+ /* allsame is just a broadcast. */
+ if (tmp != first)
+ allsame = false;
+
+ /* 4 times vec_perm with number of lanes multiple of nunits. */
+ tmp = tmp & (nunits - 1);
+ unsigned index = i & (nunits - 1);
+ if ((index < half && tmp >= half)
+ || (index >= half && tmp < half))
+ cross_lane_p = true;
+
+ if (!allsame && cross_lane_p)
+ break;
+ }
+
+ if (i == SLP_TREE_LANES (node))
+ real_perm = false;
+ }
+
+ if (real_perm)
+ {
+ m_num_avx256_vec_perm[where] += count;
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "Detected avx256 cross-lane permutation: ");
+ if (stmt_info)
+ print_gimple_expr (dump_file, stmt_info->stmt, 0, TDF_SLIM);
+ fprintf (dump_file, " \n");
+ }
+ }
+ }
/* Penalize DFmode vector operations for Bonnell. */
if (TARGET_CPU_P (BONNELL) && kind == vector_stmt
diff --git a/gcc/testsuite/gcc.target/i386/avx256_avoid_vec_perm-2.c b/gcc/testsuite/gcc.target/i386/avx256_avoid_vec_perm-2.c
new file mode 100644
index 000000000000..8d4e641444d2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx256_avoid_vec_perm-2.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-march=sierraforest -O2 -fdump-tree-slp-details" } */
+/* { dg-final { scan-tree-dump-times {(?n)Detected avx256 cross-lane permutation} 1 "slp2" } } */
+
+void
+foo (double* a, double* __restrict b, int c, int n)
+{
+ a[0] = b[100] * b[2];
+ a[1] = b[100] * b[3];
+ a[2] = b[100] * b[0];
+ a[3] = b[100] * b[1];
+}
+
+void
+foo1 (double* a, double* __restrict b, int c, int n)
+{
+ a[0] = b[100] * b[0];
+ a[1] = b[100] * b[1];
+ a[2] = b[100] * b[3];
+ a[3] = b[100] * b[2];
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx256_avoid_vec_perm-5.c b/gcc/testsuite/gcc.target/i386/avx256_avoid_vec_perm-5.c
new file mode 100644
index 000000000000..c11bea8c7b36
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx256_avoid_vec_perm-5.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-march=sierraforest -Ofast" } */
+/* { dg-final { scan-assembler-not {(?n)vpermpd.*%ymm} } } */
+
+typedef struct {
+ unsigned short m1, m2, m3, m4;
+} the_struct_t;
+typedef struct {
+ double m1, m2, m3, m4, m5;
+} the_struct2_t;
+
+double bar1 (the_struct2_t*);
+
+double foo (double* k, unsigned int n, the_struct_t* the_struct) {
+ unsigned int u;
+ the_struct2_t result;
+ for (u=0; u < n; u++, k--) {
+ result.m1 += (*k)*the_struct[u].m1;
+ result.m2 += (*k)*the_struct[u].m2;
+ result.m3 += (*k)*the_struct[u].m3;
+ result.m4 += (*k)*the_struct[u].m4;
+ }
+ return bar1 (&result);
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx256_avoid_vec_perm.c b/gcc/testsuite/gcc.target/i386/avx256_avoid_vec_perm.c
index d4f00b3fb520..e0399041ad9d 100644
--- a/gcc/testsuite/gcc.target/i386/avx256_avoid_vec_perm.c
+++ b/gcc/testsuite/gcc.target/i386/avx256_avoid_vec_perm.c
@@ -13,7 +13,7 @@ foo (void)
b[i*8+0] = a[i*8+0];
b[i*8+1] = a[i*8+0];
b[i*8+2] = a[i*8+3];
- b[i*8+3] = a[i*8+3];
+ b[i*8+3] = a[i*8+5];
b[i*8+4] = a[i*8+4];
b[i*8+5] = a[i*8+6];
b[i*8+6] = a[i*8+4];
From 7a527754fdb61597b6a4c3289b63af3c86b2aa9d Mon Sep 17 00:00:00 2001
From: liuhongt
Date: Mon, 1 Sep 2025 01:12:49 -0700
Subject: [PATCH 009/945] Use vpermil{ps,pd} instead of vperm{d,q} when
permutation is in-lane.
gcc/ChangeLog:
* config/i386/i386-expand.cc (expand_vec_perm_vpermil): Extend
to handle V8SImode.
* config/i386/i386.cc (avx_vpermilp_parallel): Extend to
handle vector integer modes with same vector size and same
component size.
* config/i386/sse.md
(_vpermilp): Ditto.
(V48_AVX): New mode iterator.
(ssefltmodesuffix): Extend for V16SI/V8DI/V16SF/V8DF.
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx256_avoid_vec_perm-3.c: New test.
* gcc.target/i386/avx256_avoid_vec_perm-4.c: New test.
* gcc.target/i386/avx512bw-vpalignr-4.c: Adjust testcase.
* gcc.target/i386/avx512vl-vpalignr-4.c: Ditto.
---
gcc/config/i386/i386-expand.cc | 13 ++++++++--
gcc/config/i386/i386.cc | 6 +++++
gcc/config/i386/sse.md | 22 ++++++++++-------
.../gcc.target/i386/avx256_avoid_vec_perm-3.c | 24 +++++++++++++++++++
.../gcc.target/i386/avx256_avoid_vec_perm-4.c | 21 ++++++++++++++++
.../gcc.target/i386/avx512bw-vpalignr-4.c | 4 +---
.../gcc.target/i386/avx512vl-vpalignr-4.c | 2 +-
7 files changed, 78 insertions(+), 14 deletions(-)
create mode 100644 gcc/testsuite/gcc.target/i386/avx256_avoid_vec_perm-3.c
create mode 100644 gcc/testsuite/gcc.target/i386/avx256_avoid_vec_perm-4.c
diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
index 3278f1fea251..dc26b3452cb1 100644
--- a/gcc/config/i386/i386-expand.cc
+++ b/gcc/config/i386/i386-expand.cc
@@ -20826,7 +20826,8 @@ expand_vec_perm_vpermil (struct expand_vec_perm_d *d)
rtx rperm[8], vperm;
unsigned i;
- if (!TARGET_AVX || d->vmode != V8SFmode || !d->one_operand_p)
+ if (!TARGET_AVX || !d->one_operand_p
+ || (d->vmode != V8SImode && d->vmode != V8SFmode))
return false;
/* We can only permute within the 128-bit lane. */
@@ -20856,7 +20857,15 @@ expand_vec_perm_vpermil (struct expand_vec_perm_d *d)
vperm = gen_rtx_CONST_VECTOR (V8SImode, gen_rtvec_v (8, rperm));
vperm = force_reg (V8SImode, vperm);
- emit_insn (gen_avx_vpermilvarv8sf3 (d->target, d->op0, vperm));
+ rtx target = d->target;
+ rtx op0 = d->op0;
+ if (d->vmode == V8SImode)
+ {
+ target = lowpart_subreg (V8SFmode, target, V8SImode);
+ op0 = lowpart_subreg (V8SFmode, op0, V8SImode);
+ }
+
+ emit_insn (gen_avx_vpermilvarv8sf3 (target, op0, vperm));
return true;
}
diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
index d71975a42bea..5311d8c43342 100644
--- a/gcc/config/i386/i386.cc
+++ b/gcc/config/i386/i386.cc
@@ -20603,6 +20603,7 @@ avx_vpermilp_parallel (rtx par, machine_mode mode)
switch (mode)
{
case E_V8DFmode:
+ case E_V8DImode:
/* In the 512-bit DFmode case, we can only move elements within
a 128-bit lane. First fill the second part of the mask,
then fallthru. */
@@ -20621,6 +20622,7 @@ avx_vpermilp_parallel (rtx par, machine_mode mode)
/* FALLTHRU */
case E_V4DFmode:
+ case E_V4DImode:
/* In the 256-bit DFmode case, we can only move elements within
a 128-bit lane. */
for (i = 0; i < 2; ++i)
@@ -20638,6 +20640,7 @@ avx_vpermilp_parallel (rtx par, machine_mode mode)
break;
case E_V16SFmode:
+ case E_V16SImode:
/* In 512 bit SFmode case, permutation in the upper 256 bits
must mirror the permutation in the lower 256-bits. */
for (i = 0; i < 8; ++i)
@@ -20646,6 +20649,7 @@ avx_vpermilp_parallel (rtx par, machine_mode mode)
/* FALLTHRU */
case E_V8SFmode:
+ case E_V8SImode:
/* In 256 bit SFmode case, we have full freedom of
movement within the low 128-bit lane, but the high 128-bit
lane must mirror the exact same pattern. */
@@ -20656,7 +20660,9 @@ avx_vpermilp_parallel (rtx par, machine_mode mode)
/* FALLTHRU */
case E_V2DFmode:
+ case E_V2DImode:
case E_V4SFmode:
+ case E_V4SImode:
/* In the 128-bit case, we've full freedom in the placement of
the elements from the source operand. */
for (i = 0; i < nelt; ++i)
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 73906b85d899..e87c26fcc072 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -302,6 +302,12 @@
V16SF (V8SF "TARGET_AVX512VL")
V8DF (V4DF "TARGET_AVX512VL")])
+(define_mode_iterator V48_AVX
+ [(V16SI "TARGET_AVX512F") (V8SI "TARGET_AVX") V4SI
+ (V8DI "TARGET_AVX512F") (V4DI "TARGET_AVX") (V2DI "TARGET_SSE2")
+ (V16SF "TARGET_AVX512F") (V8SF "TARGET_AVX") V4SF
+ (V8DF "TARGET_AVX512F") (V4DF "TARGET_AVX") (V2DF "TARGET_SSE2")])
+
;; All AVX-512{F,VL} vector modes. Supposed TARGET_AVX512F baseline.
(define_mode_iterator V48H_AVX512VL
[V16SI (V8SI "TARGET_AVX512VL") (V4SI "TARGET_AVX512VL")
@@ -1428,6 +1434,10 @@
(define_mode_attr DOUBLEMASKMODE
[(HI "SI") (SI "DI")])
+;; Float mode suffix used for instructions like vpermilpd with integer modes.
+(define_mode_attr ssefltmodesuffix
+ [(V2DI "pd") (V4DI "pd") (V8DI "pd") (V4SI "ps") (V8SI "ps") (V16SI "ps")
+ (V2DF "pd") (V4DF "pd") (V8DF "pd") (V4SF "ps") (V8SF "ps") (V16SF "ps")])
;; Include define_subst patterns for instructions with mask
(include "subst.md")
@@ -23655,10 +23665,6 @@
(set_attr "btver2_decode" "vector,vector,vector")
(set_attr "mode" "")])
-(define_mode_attr ssefltmodesuffix
- [(V2DI "pd") (V4DI "pd") (V4SI "ps") (V8SI "ps")
- (V2DF "pd") (V4DF "pd") (V4SF "ps") (V8SF "ps")])
-
(define_mode_attr ssefltvecmode
[(V2DI "V2DF") (V4DI "V4DF") (V4SI "V4SF") (V8SI "V8SF")])
@@ -27615,9 +27621,9 @@
;; being a subset of what vpermp* can do), but vpermilp* has shorter
;; latency as it never crosses lanes.
(define_insn "*_vpermilp"
- [(set (match_operand:VF 0 "register_operand" "=v")
- (vec_select:VF
- (match_operand:VF 1 "nonimmediate_operand" "vm")
+ [(set (match_operand:V48_AVX 0 "register_operand" "=v")
+ (vec_select:V48_AVX
+ (match_operand:V48_AVX 1 "nonimmediate_operand" "vm")
(match_parallel 2 ""
[(match_operand 3 "const_int_operand")])))]
"TARGET_AVX &&
@@ -27625,7 +27631,7 @@
{
int mask = avx_vpermilp_parallel (operands[2], mode) - 1;
operands[2] = GEN_INT (mask);
- return "vpermil\t{%2, %1, %0|%0, %1, %2}";
+ return "vpermil\t{%2, %1, %0|%0, %1, %2}";
}
[(set_attr "type" "sselog")
(set_attr "prefix_extra" "1")
diff --git a/gcc/testsuite/gcc.target/i386/avx256_avoid_vec_perm-3.c b/gcc/testsuite/gcc.target/i386/avx256_avoid_vec_perm-3.c
new file mode 100644
index 000000000000..cb1328ce2d0b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx256_avoid_vec_perm-3.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=sierraforest -fdump-tree-vect-details" } */
+/* { dg-final { scan-tree-dump "loop vectorized using 32 byte vectors" "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-assembler "vpermilps" { xfail *-*-* } } } */
+/* { dg-final { scan-assembler-not "vpermd" } } */
+
+int a[256], b[256];
+
+void __attribute__((noinline))
+foo (void)
+{
+ int i;
+ for (i = 0; i < 32; ++i)
+ {
+ b[i*8+0] = a[i*8+0];
+ b[i*8+1] = a[i*8+0];
+ b[i*8+2] = a[i*8+3];
+ b[i*8+3] = a[i*8+3];
+ b[i*8+4] = a[i*8+4];
+ b[i*8+5] = a[i*8+6];
+ b[i*8+6] = a[i*8+4];
+ b[i*8+7] = a[i*8+6];
+ }
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx256_avoid_vec_perm-4.c b/gcc/testsuite/gcc.target/i386/avx256_avoid_vec_perm-4.c
new file mode 100644
index 000000000000..016771ab743c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx256_avoid_vec_perm-4.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-mavx2 -O2" } */
+/* { dg-final { scan-assembler-times {(?n)vpermilp[ds]} 2} } */
+/* { dg-final { scan-assembler-not {(?n)vperm[dq]} } } */
+
+
+typedef long long v4di __attribute__((vector_size(32)));
+typedef int v8si __attribute__((vector_size(32)));
+
+v4di
+foo (v4di a)
+{
+ return __builtin_shufflevector (a, a, 1, 0, 3, 2);
+}
+
+v8si
+foo1 (v8si a)
+{
+ return __builtin_shufflevector (a, a, 1, 0, 3, 2, 7, 6, 5, 4);
+}
+
diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-vpalignr-4.c b/gcc/testsuite/gcc.target/i386/avx512bw-vpalignr-4.c
index 50a2a3522139..cdd08f5be63f 100644
--- a/gcc/testsuite/gcc.target/i386/avx512bw-vpalignr-4.c
+++ b/gcc/testsuite/gcc.target/i386/avx512bw-vpalignr-4.c
@@ -55,8 +55,6 @@ f4 (V4 x)
asm volatile ("" : "+v" (a));
}
-/* { dg-final { scan-assembler-times "vpalignr\[^\n\r]*\\\$8\[^\n\r]*%xmm16\[^\n\r]*%xmm16\[^\n\r]*%xmm16" 1 } } */
-
typedef float V5 __attribute__((vector_size (16)));
void
@@ -83,4 +81,4 @@ f6 (V6 x)
asm volatile ("" : "+v" (a));
}
-/* { dg-final { scan-assembler-times "vpermilpd\[^\n\r]*\\\$1\[^\n\r]*%xmm16\[^\n\r]*%xmm16" 1 } } */
+/* { dg-final { scan-assembler-times "vpermilpd\[^\n\r]*\\\$1\[^\n\r]*%xmm16\[^\n\r]*%xmm16" 2 } } */
diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vpalignr-4.c b/gcc/testsuite/gcc.target/i386/avx512vl-vpalignr-4.c
index 4936d2f4c5b0..3076fb020a7c 100644
--- a/gcc/testsuite/gcc.target/i386/avx512vl-vpalignr-4.c
+++ b/gcc/testsuite/gcc.target/i386/avx512vl-vpalignr-4.c
@@ -83,4 +83,4 @@ f6 (V6 x)
asm volatile ("" : "+v" (a));
}
-/* { dg-final { scan-assembler-times "vpermilpd\[^\n\r]*\\\$1\[^\n\r]*%xmm16\[^\n\r]*%xmm16" 1 } } */
+/* { dg-final { scan-assembler-times "vpermilpd\[^\n\r]*\\\$1\[^\n\r]*%xmm16\[^\n\r]*%xmm16" 2 } } */
From 1d1396559e2683c849fb5dba5c8f56f2a4a1ff64 Mon Sep 17 00:00:00 2001
From: "H.J. Lu"
Date: Mon, 8 Sep 2025 13:19:45 -0700
Subject: [PATCH 010/945] x86: Enable SSE4.1 ceil/floor/trunc for -Os
Enable SSE4.1 ceil/floor/trunc for -Os to replace a function call with
roundss or roundsd by dropping the !flag_trapping_math check.
gcc/
PR target/121861
* config/i386/i386.cc (ix86_optab_supported_p): Drop
!flag_trapping_math check for floor_optab, ceil_optab and
btrunc_optab.
gcc/testsuite/
PR target/121861
* gcc.target/i386/pr121861-1a.c: New file.
* gcc.target/i386/pr121861-1b.c: Likewise.
Signed-off-by: H.J. Lu
---
gcc/config/i386/i386.cc | 9 ++---
gcc/testsuite/gcc.target/i386/pr121861-1a.c | 43 +++++++++++++++++++++
gcc/testsuite/gcc.target/i386/pr121861-1b.c | 7 ++++
3 files changed, 54 insertions(+), 5 deletions(-)
create mode 100644 gcc/testsuite/gcc.target/i386/pr121861-1a.c
create mode 100644 gcc/testsuite/gcc.target/i386/pr121861-1b.c
diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
index 5311d8c43342..5ef7c315091d 100644
--- a/gcc/config/i386/i386.cc
+++ b/gcc/config/i386/i386.cc
@@ -27250,11 +27250,10 @@ ix86_optab_supported_p (int op, machine_mode mode1, machine_mode,
case floor_optab:
case ceil_optab:
case btrunc_optab:
- if (((SSE_FLOAT_MODE_P (mode1)
- && TARGET_SSE_MATH
- && TARGET_SSE4_1)
- || mode1 == HFmode)
- && !flag_trapping_math)
+ if ((SSE_FLOAT_MODE_P (mode1)
+ && TARGET_SSE_MATH
+ && TARGET_SSE4_1)
+ || mode1 == HFmode)
return true;
return opt_type == OPTIMIZE_FOR_SPEED;
diff --git a/gcc/testsuite/gcc.target/i386/pr121861-1a.c b/gcc/testsuite/gcc.target/i386/pr121861-1a.c
new file mode 100644
index 000000000000..ebd0a57253c7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121861-1a.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -mfpmath=sse -mno-avx -msse4.1" } */
+
+#include
+
+float
+cf (float x)
+{
+ return ceilf (x);
+}
+
+float
+ff (float x)
+{
+ return floorf (x);
+}
+
+float
+tf (float x)
+{
+ return truncf (x);
+}
+
+double
+c (double x)
+{
+ return ceil (x);
+}
+
+double
+f (double x)
+{
+ return floor (x);
+}
+
+double
+t (double x)
+{
+ return trunc (x);
+}
+
+/* { dg-final { scan-assembler-times "roundss" 3 } } */
+/* { dg-final { scan-assembler-times "roundsd" 3 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr121861-1b.c b/gcc/testsuite/gcc.target/i386/pr121861-1b.c
new file mode 100644
index 000000000000..b52faae66d0e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121861-1b.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -mfpmath=sse -mno-avx512f -mavx" } */
+
+#include "pr121861-1a.c"
+
+/* { dg-final { scan-assembler-times "vroundss" 3 } } */
+/* { dg-final { scan-assembler-times "vroundsd" 3 } } */
From 19d1c7c28f4fd0557dd868a7a4041b00ceada890 Mon Sep 17 00:00:00 2001
From: Matthias Kretz
Date: Fri, 5 Sep 2025 12:16:34 +0200
Subject: [PATCH 011/945] c++: Fix mangling of _Float16 template args
[PR121801]
Signed-off-by: Matthias Kretz
gcc/testsuite/ChangeLog:
PR c++/121801
* g++.dg/abi/pr121801.C: New test.
gcc/cp/ChangeLog:
PR c++/121801
* mangle.cc (write_real_cst): Handle 16-bit real and assert
that reals have 16 bits or a multiple of 32 bits.
---
gcc/cp/mangle.cc | 15 ++++++++++++++-
gcc/testsuite/g++.dg/abi/pr121801.C | 13 +++++++++++++
2 files changed, 27 insertions(+), 1 deletion(-)
create mode 100644 gcc/testsuite/g++.dg/abi/pr121801.C
diff --git a/gcc/cp/mangle.cc b/gcc/cp/mangle.cc
index 80be40d2dce3..c1aae2de52b0 100644
--- a/gcc/cp/mangle.cc
+++ b/gcc/cp/mangle.cc
@@ -2176,11 +2176,24 @@ write_real_cst (const tree value)
int i, limit, dir;
tree type = TREE_TYPE (value);
- int words = GET_MODE_BITSIZE (SCALAR_FLOAT_TYPE_MODE (type)) / 32;
+ int bits = GET_MODE_BITSIZE (SCALAR_FLOAT_TYPE_MODE (type));
+ int words = bits / 32;
real_to_target (target_real, &TREE_REAL_CST (value),
TYPE_MODE (type));
+ if (words == 0)
+ {
+ /* _Float16 and std::bfloat16_t are the only supported types smaller than
+ 32 bits. */
+ gcc_assert (bits == 16);
+ sprintf (buffer, "%04lx", (unsigned long) target_real[0]);
+ write_chars (buffer, 4);
+ return;
+ }
+
+ gcc_assert (bits % 32 == 0);
+
/* The value in target_real is in the target word order,
so we must write it out backward if that happens to be
little-endian. write_number cannot be used, it will
diff --git a/gcc/testsuite/g++.dg/abi/pr121801.C b/gcc/testsuite/g++.dg/abi/pr121801.C
new file mode 100644
index 000000000000..cd35186d8881
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/pr121801.C
@@ -0,0 +1,13 @@
+// PR c++/121801
+// { dg-do compile { target { c++20 && float16 } } }
+// { dg-add-options float16 }
+
+template<_Float16 T> void f() {}
+
+void uses() {
+ f<_Float16(1)>();
+ f<_Float16(2)>();
+}
+
+// { dg-final { scan-assembler "_Z1fILDF16_3c00EEvv" } }
+// { dg-final { scan-assembler "_Z1fILDF16_4000EEvv" } }
From c7e9d256fb94bfd9129cd33d9a24c76aa698d7ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?=
Date: Tue, 9 Sep 2025 12:57:49 +0200
Subject: [PATCH 012/945] libstdc++: Replace "Tunables" link with one that does
not have an anchor
This works around a dblatex bug, where dblatex emits invalid TeX, by
placing a raw "#" in a \href.
Fixes: f6ff531d907d ("libstdc++: Update link to "Tunables" in Glibc manual")
libstdc++-v3/ChangeLog:
* doc/xml/manual/using_exceptions.xml: Replace "Tunables" link
with one that does not have an anchor.
* doc/html/manual/using_exceptions.html: Regenerate.
---
libstdc++-v3/doc/html/manual/using_exceptions.html | 2 +-
libstdc++-v3/doc/xml/manual/using_exceptions.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libstdc++-v3/doc/html/manual/using_exceptions.html b/libstdc++-v3/doc/html/manual/using_exceptions.html
index 67b4365fbbc8..9b53e3688ae7 100644
--- a/libstdc++-v3/doc/html/manual/using_exceptions.html
+++ b/libstdc++-v3/doc/html/manual/using_exceptions.html
@@ -366,7 +366,7 @@
GCC Bug 25191: exception_defines.h #defines try/catch
.