aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.editorconfig122
-rw-r--r--gcc/ChangeLog108
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in10
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/auto-profile.cc308
-rw-r--r--gcc/c-family/c.opt.urls3
-rw-r--r--gcc/c/ChangeLog6
-rw-r--r--gcc/c/Make-lang.in5
-rw-r--r--gcc/cfghooks.cc9
-rw-r--r--gcc/cp/Make-lang.in6
-rw-r--r--gcc/doc/invoke.texi5
-rw-r--r--gcc/fortran/ChangeLog15
-rw-r--r--gcc/fortran/decl.cc2
-rw-r--r--gcc/lto/Make-lang.in19
-rw-r--r--gcc/params.opt4
-rw-r--r--gcc/predict.cc8
-rw-r--r--gcc/testsuite/ChangeLog41
-rw-r--r--gcc/testsuite/gcc.dg/pr120560.c13
-rw-r--r--gcc/testsuite/gfortran.dg/pdt_51.f0357
-rw-r--r--gcc/tree-vect-loop.cc6
-rw-r--r--gcc/vr-values.cc4
-rw-r--r--libgcc/ChangeLog6
-rw-r--r--libstdc++-v3/ChangeLog8
-rw-r--r--libstdc++-v3/include/bits/stl_uninitialized.h3
-rw-r--r--libstdc++-v3/testsuite/20_util/unique_ptr/modifiers/93562.cc25
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get/char/3.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/3.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/9875_seekoff.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/9875_seekpos.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char/1.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11603.cc2
-rw-r--r--libstdc++-v3/testsuite/28_regex/algorithms/regex_match/multiline.cc4
-rw-r--r--libstdc++-v3/testsuite/28_regex/basic_regex/assign/wchar_t/pstring.cc3
-rw-r--r--libstdc++-v3/testsuite/std/memory/polymorphic/copy.cc18
35 files changed, 693 insertions, 145 deletions
diff --git a/.editorconfig b/.editorconfig
index af1a284..e5e9997 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,38 +1,142 @@
-# top-most EditorConfig file for gcc
+# Copyright 2025 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This file helps editors auto-configure whitespace settings.
+#
+# See here for more information about the format and editor support:
+#
+# https://editorconfig.org/
+
+# This file is common to the GCC and GDB/Binutils projects. If you
+# update one, please sync it with the other.
+
+# top-most EditorConfig file
root = true
[*]
end_of_line = lf
insert_final_newline = true
+tab_width = 8
-[*.{h,cc}]
+# EditorConfig files
+[.editorconfig]
charset = utf-8
-indent_style = tab
-indent_size = 2
-tab_width = 8
trim_trailing_whitespace = true
-[{Makefile,ChangeLog}*]
+# Makefile
+[{Makefile,*.mk,*.am}*]
indent_style = tab
indent_size = 8
trim_trailing_whitespace = true
+# ChangeLogs
[ChangeLog*]
+indent_style = tab
+indent_size = 8
+trim_trailing_whitespace = true
+charset = utf-8
+
+# C/C++
+[*.{c,h,cc}]
charset = utf-8
+indent_style = tab
+indent_size = 2
+trim_trailing_whitespace = true
+# GCC .def files. These are generally C fragments that get included
+# one or more times
+[gcc/**.def]
+charset = utf-8
+indent_style = tab
+indent_size = 2
+trim_trailing_whitespace = true
+
+# Texinfo files
[*.texi]
charset = utf-8
indent_size = 2
-tab_width = 8
trim_trailing_whitespace = true
+# Expect / TCL
+[*.{exp,tcl}]
+indent_style = tab
+indent_size = 4
+trim_trailing_whitespace = true
+
+# Python
[*.py]
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
-[*.exp]
+# Assembler
+[*.{s,S,asm}]
+indent_style = tab
+indent_size = 8
+trim_trailing_whitespace = true
+
+# GCC Machine description files
+[gcc/config/**.md]
+indent_style = tab
+indent_size = 2
+trim_trailing_whitespace = true
+
+# Awk
+[*.awk]
+indent_style = tab
+indent_size = 2
+trim_trailing_whitespace = true
+
+# Autoconf
+[*.{ac,m4}]
+indent_style = tab
+indent_size = 2
+trim_trailing_whitespace = true
+
+# Shell scripts
+[*.sh]
indent_style = tab
indent_size = 4
-tab_width = 8
+trim_trailing_whitespace = true
+
+# Ada
+[*.ad[bs]]
+indent_style = space
+indent_size = 3
+trim_trailing_whitespace = true
+
+# D
+[*.d]
+indent_style = space
+indent_size = 4
+trim_trailing_whitespace = true
+
+# Go
+[*.go]
+indent_style = tab
+indent_size = 8
+trim_trailing_whitespace = true
+
+# Fortran
+[*.[Ff]90]
+indent_style = space
+indent_size = 2
+trim_trailing_whitespace = true
+
+# Cobol
+[*.cbl]
+indent_style = space
+indent_size = 2
trim_trailing_whitespace = true
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 63fd0f2..65a07a1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,111 @@
+2025-09-30 David Malcolm <dmalcolm@redhat.com>
+
+ * diagnostics/output-spec.cc (text_scheme_handler::make_sink): Use
+ the value of the "color" to determine if the sink's printer is
+ colorized.
+
+2025-09-30 David Malcolm <dmalcolm@redhat.com>
+
+ * diagnostics/output-spec.cc: Add comments. Introduce a
+ "struct decoded_args" within each scheme_handler subclass,
+ and split out per-scheme key-value parsing from each make_sink
+ implementation into new per-scheme decode_kv member functions.
+
+2025-09-30 David Malcolm <dmalcolm@redhat.com>
+
+ * diagnostics/output-spec.cc: Move class scheme_handler out from
+ inside class output_factory.
+
+2025-09-30 David Malcolm <dmalcolm@redhat.com>
+
+ * diagnostics/output-spec.cc: Rename "parsed_arg" to
+ "scheme_and_kvs" throughout. Rename "unparsed_arg" to
+ "unparsed_spec" throughout, and make a member of
+ output_spec::context rather than passing it around.
+ * diagnostics/output-spec.h: Likewise.
+ * libgdiagnostics.cc: Likewise.
+ * opts-diagnostic.cc: Likewise.
+
+2025-09-30 Alfie Richards <alfie.richards@arm.com>
+
+ * config/aarch64/aarch64.cc (aarch64_functions_b_resolvable_from_a): New
+ function.
+ (TARGET_OPTION_FUNCTIONS_B_RESOLVABLE_FROM_A): New define.
+ * doc/tm.texi: Regenerate.
+ * doc/tm.texi.in: Add documentation for
+ TARGET_OPTION_FUNCTIONS_B_RESOLVABLE_FROM_A.
+ * multiple_target.cc (redirect_to_specific_clone): Add new optimisation
+ logic.
+ (ipa_target_clone): Remove check for TARGET_HAS_FMV_TARGET_ATTRIBUTE.
+ * target.def: Document new hook..
+ * attribs.cc: (functions_b_resolvable_from_a) New function.
+ * attribs.h: (functions_b_resolvable_from_a) New function.
+
+2025-09-30 Jakub Jelinek <jakub@redhat.com>
+
+ * auto-profile.h (maybe_hot_afdo_count_p): Fix comment typos,
+ possiby -> possibly and ture -> true.
+ * gimplify.cc (build_asan_poison_call_expr): Change "of a for"
+ to "memory of the" in a comment.
+ * ipa-devirt.cc (add_type_duplicate): Fix comment typo,
+ mangles -> mangled.
+ * auto-profile.cc: Fix comment typo, -fauto-profile-inlinig
+ -> -fauto-profile-inlining.
+ (maybe_hot_afdo_count_p): Fix comment typos, possiby -> possibly
+ and ture -> true.
+ (function_instance::removed_icall_target): Fix comment typo,
+ Reutrn -> Return.
+ (function_instance::in_worklist_): Fix comment typo, Ture -> True.
+ (function_instance::offline): Fix comment typo, tolevel -> toplevel.
+ (function_instance::match): Fix comment typo, craeate_gcov ->
+ create_gcov.
+ (autofdo_source_profile::offline_external_functions): Fix comment
+ typos, tolevel -> toplevel and porfile -> profile.
+ (autofdo_source_profile::get_function_instance_by_inline_stack): Fix
+ comment typo, chekcing -> checking.
+ (struct scale): Fix comment typo, scalle -> scale.
+ * gimple.h (currently_expanding_gimple_stmt): Fix comment typo,
+ comminucating -> communicating.
+ * tree.h (canonical_type_used_p): Fix comment typo, ture -> true.
+ * tree-ssa-alias.cc (types_equal_for_same_type_for_tbaa_p): Likewise.
+ * ipa-profile.cc (contains_hot_call_p): Likewise.
+ * cfgexpand.cc (add_scope_conflicts_2): Fix comment typos,
+ Querry -> Query, referendd -> referenced and Querrying -> Querying.
+ * ipa-param-manipulation.cc (currently_expanding_gimple_stmt): Fix
+ comment typo, comminucating -> communicating.
+ * ipa-prop.cc (ipa_cst_ref_desc::refcount): Fix comment typo,
+ if -> is.
+ * tree-if-conv.cc (version_loop_for_if_conversion): Fix comment typos,
+ porfile -> profile and confistency -> consistency.
+ * fold-const.cc: Change size_int_wide in comment to size_int as
+ size_int_wide doesn't exit for 21 years.
+
+2025-09-30 Jan Hubicka <hubicka@ucw.cz>
+
+ * auto-profile.cc (function_instance::match): Sanity check
+ that gimple PHI has no location.
+ * tree-cfg.cc (assign_discriminators): Also remap locations
+ of gimple PHI arguments.
+
+2025-09-30 Jan Hubicka <hubicka@ucw.cz>
+
+ * basic-block.h (GCOV_COMPUTE_SCALE): Remove.
+ * ipa-profile.cc (ipa_profile_generate_summary): Use
+ profile-count scaling.
+ * sched-rgn.cc (compute_trg_info): Likewise.
+
+2025-09-30 Jan Hubicka <hubicka@ucw.cz>
+
+ * auto-profile.cc (stmt_loc_used_by_debug_info): New function.
+ (autofdo_source_profile::get_count_info): Use it.
+ (afdo_set_bb_count): Likewise.
+ (afdo_vpt_for_early_inline): Likewise.
+
+2025-09-30 Andre Vieira <andre.simoesdiasvieira@arm.com>
+
+ * gimple-lower-bitint.cc (bitint_precision_kind): Fix inconsistency in
+ results between first and consecutive calls to this function.
+
2025-09-28 liuhongt <hongtao.liu@intel.com>
PR target/121970
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index c5ef3a2..ce6a0ae 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20250930
+20251001
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 4503dab..6a9d620 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1908,6 +1908,9 @@ OBJS-libcommon-target = $(common_out_object_file) prefix.o \
# This lists all host objects for the front ends.
ALL_HOST_FRONTEND_OBJS = $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS))
+# All auto-profile files
+ALL_FDAS = $(foreach v,$(CONFIG_LANGUAGES),$($(v)_FDAS))
+
ALL_HOST_BACKEND_OBJS = $(GCC_OBJS) $(OBJS) $(OBJS-libcommon) \
$(OBJS-libcommon-target) main.o c-family/cppspec.o \
$(COLLECT2_OBJS) $(EXTRA_GCC_OBJS) $(GCOV_OBJS) $(GCOV_DUMP_OBJS) \
@@ -1918,8 +1921,8 @@ ALL_HOST_BACKEND_OBJS = $(GCC_OBJS) $(OBJS) $(OBJS-libcommon) \
# is likely the most exercised during the build
ifeq ($(if $(wildcard ../stage_current),$(shell cat \
../stage_current)),stageautofeedback)
-$(ALL_HOST_BACKEND_OBJS): ALL_COMPILERFLAGS += -fauto-profile=cc1plus.fda
-$(ALL_HOST_BACKEND_OBJS): cc1plus.fda
+$(ALL_HOST_BACKEND_OBJS): ALL_COMPILERFLAGS += -fauto-profile=all.fda
+$(ALL_HOST_BACKEND_OBJS): all.fda
endif
# This lists all host object files, whether they are included in this
@@ -4744,6 +4747,9 @@ paranoia.o: $(srcdir)/../contrib/paranoia.cc $(CONFIG_H) $(SYSTEM_H) $(TREE_H)
paranoia: paranoia.o real.o $(LIBIBERTY)
g++ -o $@ paranoia.o real.o $(LIBIBERTY)
+all.fda: $(ALL_FDAS)
+ $(PROFILE_MERGER) $(ALL_FDAS) --output_file all.fda -gcov_version 2
+
# These exist for maintenance purposes.
CTAGS=@CTAGS@
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 16653d2..db7a3d1 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,9 @@
+2025-09-30 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR ada/117517
+ * sem_attr.adb (Resolve_Attribute) <Attribute_Reduce>: Try to
+ resolve the reducer first. Fix casing of error message.
+
2025-09-29 Tonu Naks <naks@adacore.com>
* doc/gnat_rm/implementation_advice.rst: PolyORB
diff --git a/gcc/auto-profile.cc b/gcc/auto-profile.cc
index 8c8d9be..6971204 100644
--- a/gcc/auto-profile.cc
+++ b/gcc/auto-profile.cc
@@ -2972,6 +2972,48 @@ update_count_by_afdo_count (profile_count *count, profile_count c)
*count = c;
}
+/* Try to determine unscaled count of edge E.
+ Return -1 if nothing is known. */
+
+static gcov_type
+afdo_unscaled_edge_count (edge e)
+{
+ gcov_type max_count = -1;
+ basic_block bb_succ = e->dest;
+ count_info info;
+ if (afdo_source_profile->get_count_info (e->goto_locus, &info))
+ {
+ if (info.count > max_count)
+ max_count = info.count;
+ if (dump_file && info.count)
+ {
+ fprintf (dump_file,
+ " goto location of edge %i->%i with count %" PRIu64"\n",
+ e->src->index, e->dest->index, (int64_t)info.count);
+ }
+ }
+ for (gphi_iterator gpi = gsi_start_phis (bb_succ);
+ !gsi_end_p (gpi); gsi_next (&gpi))
+ {
+ gphi *phi = gpi.phi ();
+ location_t phi_loc
+ = gimple_phi_arg_location_from_edge (phi, e);
+ if (afdo_source_profile->get_count_info (phi_loc, &info))
+ {
+ if (info.count > max_count)
+ max_count = info.count;
+ if (dump_file && info.count)
+ {
+ fprintf (dump_file,
+ " phi op of edge %i->%i with count %" PRIu64": ",
+ e->src->index, e->dest->index, (int64_t)info.count);
+ print_gimple_stmt (dump_file, phi, 0, TDF_SLIM);
+ }
+ }
+ }
+ return max_count;
+}
+
/* For a given BB, set its execution count. Attach value profile if a stmt
is not in PROMOTED, because we only want to promote an indirect call once.
Return TRUE if BB is annotated. */
@@ -2980,8 +3022,7 @@ static bool
afdo_set_bb_count (basic_block bb, hash_set <basic_block> &zero_bbs)
{
gimple_stmt_iterator gsi;
- gcov_type max_count = 0;
- bool has_annotated = false;
+ gcov_type max_count = -1;
if (dump_file)
fprintf (dump_file, " Looking up AFDO count of bb %i\n", bb->index);
@@ -3001,7 +3042,6 @@ afdo_set_bb_count (basic_block bb, hash_set <basic_block> &zero_bbs)
(int64_t)info.count);
print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
}
- has_annotated = true;
gcall *call = dyn_cast <gcall *> (gsi_stmt (gsi));
/* TODO; if inlined early and indirect call was not optimized out,
we will end up speculating again. Early inliner should remove
@@ -3012,44 +3052,11 @@ afdo_set_bb_count (basic_block bb, hash_set <basic_block> &zero_bbs)
}
}
- if (!has_annotated)
- {
- /* For an empty BB with all debug stmt which assigne a value with
- constant, check successors PHIs corresponding to the block and
- use those counts. */
- edge tmp_e;
- edge_iterator tmp_ei;
- FOR_EACH_EDGE (tmp_e, tmp_ei, bb->succs)
- {
- basic_block bb_succ = tmp_e->dest;
- for (gphi_iterator gpi = gsi_start_phis (bb_succ);
- !gsi_end_p (gpi);
- gsi_next (&gpi))
- {
- gphi *phi = gpi.phi ();
- location_t phi_loc
- = gimple_phi_arg_location_from_edge (phi, tmp_e);
- count_info info;
- if (afdo_source_profile->get_count_info (phi_loc, &info)
- && info.count != 0)
- {
- if (info.count > max_count)
- max_count = info.count;
- if (dump_file && info.count)
- {
- fprintf (dump_file,
- " phi op in BB %i with count %" PRIu64": ",
- bb_succ->index, (int64_t)info.count);
- print_gimple_stmt (dump_file, phi, 0, TDF_SLIM);
- }
- has_annotated = true;
- }
- }
- }
+ if (max_count == -1 && single_succ_p (bb))
+ max_count = afdo_unscaled_edge_count (single_succ_edge (bb));
- if (!has_annotated)
- return false;
- }
+ if (max_count == -1)
+ return false;
if (max_count)
{
@@ -3507,6 +3514,109 @@ scale_bbs (const vec <basic_block> &bbs, sreal scale)
}
}
+/* Determine scaling factor by taking robust average of SCALES
+ and taking into account limits.
+ MAX_COUNT is maximal guessed count to be scaled while MAC_COUNT_IN_FN
+ is maximal count in function determined by auto-fdo. */
+
+sreal
+determine_scale (vec <scale> *scales, profile_count max_count,
+ profile_count max_count_in_fn)
+{
+ scales->qsort (cmp);
+
+ uint64_t overall_weight = 0;
+ for (scale &e : *scales)
+ overall_weight += e.weight;
+
+ uint64_t cummulated = 0, weight_sum = 0;
+ sreal scale_sum = 0;
+ for (scale &e : *scales)
+ {
+ uint64_t prev = cummulated;
+ cummulated += e.weight;
+ if (cummulated >= overall_weight / 4
+ && prev <= 3 * overall_weight / 4)
+ {
+ scale_sum += e.scale * e.weight;
+ weight_sum += e.weight;
+ if (dump_file)
+ fprintf (dump_file, " accounting scale %.16f, weight %" PRId64 "\n",
+ e.scale.to_double (), e.weight);
+ }
+ else if (dump_file)
+ fprintf (dump_file, " ignoring scale %.16f, weight %" PRId64 "\n",
+ e.scale.to_double (), e.weight);
+ }
+ sreal scale = scale_sum / (sreal)weight_sum;
+
+ /* Avoid scaled regions to have very large counts.
+ Otherwise they may dominate ipa-profile's histogram computing cutoff
+ of hot basic blocks. */
+ if (max_count * scale > max_count_in_fn.guessed_local ().apply_scale (128, 1))
+ {
+ if (dump_file)
+ {
+ fprintf (dump_file, "Scaling by %.16f produces max count ",
+ scale.to_double ());
+ (max_count * scale).dump (dump_file);
+ fprintf (dump_file, " that exceeds max count in fn ");
+ max_count_in_fn.dump (dump_file);
+ fprintf (dump_file, "; capping\n");
+ }
+ scale = max_count_in_fn.guessed_local ().to_sreal_scale (max_count);
+ }
+ return scale;
+}
+
+/* Scale profile of the whole function to approximately match auto-profile. */
+
+bool
+scale_bb_profile ()
+{
+ const function_instance *s
+ = afdo_source_profile->get_function_instance_by_decl
+ (current_function_decl);
+
+ /* In the first pass only store non-zero counts. */
+ gcov_type head_count = s->head_count () * autofdo::afdo_count_scale;
+ hash_set <basic_block> zero_bbs;
+ auto_vec <basic_block, 20> bbs (n_basic_blocks_for_fn (cfun));
+ auto_vec <scale, 20> scales;
+ basic_block bb;
+ profile_count max_count = profile_count::zero ();
+ profile_count max_count_in_fn = profile_count::zero ();
+ bbs.quick_push (ENTRY_BLOCK_PTR_FOR_FN (cfun));
+ bbs.quick_push (EXIT_BLOCK_PTR_FOR_FN (cfun));
+ if (head_count > 0)
+ {
+ profile_count entry_count = ENTRY_BLOCK_PTR_FOR_FN (cfun)->count;
+ max_count = entry_count;
+ update_count_by_afdo_count (&entry_count, head_count);
+ max_count_in_fn = entry_count;
+ add_scale (&scales, entry_count, ENTRY_BLOCK_PTR_FOR_FN (cfun)->count);
+ }
+ FOR_EACH_BB_FN (bb, cfun)
+ {
+ profile_count cnt = bb->count;
+ bbs.safe_push (bb);
+ max_count = max_count.max (bb->count);
+ if (afdo_set_bb_count (bb, zero_bbs))
+ {
+ std::swap (cnt, bb->count);
+ max_count_in_fn = max_count_in_fn.max (cnt);
+ add_scale (&scales, cnt, bb->count);
+ }
+ }
+ if (scales.length ())
+ {
+ sreal scale = determine_scale (&scales, max_count, max_count_in_fn);
+ scale_bbs (bbs, scale);
+ return true;
+ }
+ return false;
+}
+
/* In case given basic block was fully optimized out, AutoFDO
will have no data about it. In this case try to preserve static profile.
Identify connected components (in undirected form of CFG) which has
@@ -3716,47 +3826,7 @@ afdo_adjust_guessed_profile (bb_set *annotated_bb)
continue;
}
gcc_checking_assert (scales.length ());
- scales.qsort (cmp);
-
- uint64_t overall_weight = 0;
- for (scale &e : scales)
- overall_weight += e.weight;
-
- uint64_t cummulated = 0, weight_sum = 0;
- sreal scale_sum = 0;
- for (scale &e : scales)
- {
- uint64_t prev = cummulated;
- cummulated += e.weight;
- if (cummulated >= overall_weight / 4
- && prev <= 3 * overall_weight / 4)
- {
- scale_sum += e.scale * e.weight;
- weight_sum += e.weight;
- if (dump_file)
- fprintf (dump_file, " accounting scale %.16f, weight %" PRId64 "\n",
- e.scale.to_double (), e.weight);
- }
- else if (dump_file)
- fprintf (dump_file, " ignoring scale %.16f, weight %" PRId64 "\n",
- e.scale.to_double (), e.weight);
- }
- sreal scale = scale_sum / (sreal)weight_sum;
-
- /* Avoid scaled regions to have very large counts.
- Otherwise they may dominate ipa-profile's histogram computing cutoff
- of hot basic blocks. */
- if (max_count * scale > max_count_in_fn.guessed_local ())
- {
- if (dump_file)
- {
- fprintf (dump_file, "Scaling by %.16f produces max count ",
- scale.to_double ());
- (max_count * scale).dump (dump_file);
- fprintf (dump_file, " that exceeds max count in fn; capping\n");
- }
- scale = max_count_in_fn.guessed_local ().to_sreal_scale (max_count);
- }
+ sreal scale = determine_scale (&scales, max_count, max_count_in_fn);
scale_bbs (bbs, scale);
}
}
@@ -3778,6 +3848,30 @@ afdo_calculate_branch_prob (bb_set *annotated_bb)
{
gcc_assert (e->aux == NULL);
e->aux = new edge_info ();
+ gcov_type c = afdo_unscaled_edge_count (e);
+ if (c == 0 && e->count () == profile_count::zero ())
+ {
+ AFDO_EINFO (e)->set_count (profile_count::zero ());
+ if (dump_file)
+ fprintf (dump_file,
+ " Annotating edge %i->%i with count 0;"
+ " static profile aggress",
+ e->src->index, e->dest->index);
+ }
+ else if (c > 0)
+ {
+ AFDO_EINFO (e)->set_count
+ (profile_count::from_gcov_type
+ (c * autofdo::afdo_count_scale).afdo ());
+ if (dump_file)
+ {
+ fprintf (dump_file,
+ " Annotating edge %i->%i with count ",
+ e->src->index, e->dest->index);
+ AFDO_EINFO (e)->get_count ().dump (dump_file);
+ fprintf (dump_file, "\n");
+ }
+ }
}
}
@@ -3808,24 +3902,41 @@ afdo_calculate_branch_prob (bb_set *annotated_bb)
}
if (!all_known || !total_count.nonzero_p ())
continue;
+ if (dump_file)
+ {
+ fprintf (dump_file, "Total count of bb %i is ", bb->index);
+ total_count.dump (dump_file);
+ fprintf (dump_file, "\n");
+ }
FOR_EACH_EDGE (e, ei, bb->succs)
if (AFDO_EINFO (e)->is_annotated ())
{
+ profile_count cnt = AFDO_EINFO (e)->get_count ();
/* If probability is 1, preserve reliable static prediction
(This is, for example the case of single fallthru edge
or single fallthru plus unlikely EH edge.) */
- if (AFDO_EINFO (e)->get_count () == total_count
+ if (cnt == total_count
&& e->probability == profile_probability::always ())
;
- else if (AFDO_EINFO (e)->get_count ().nonzero_p ())
+ else if (cnt.nonzero_p ())
e->probability
- = AFDO_EINFO (e)->get_count ().probability_in (total_count);
+ = cnt.probability_in (total_count);
/* If probability is zero, preserve reliable static
prediction. */
else if (e->probability.nonzero_p ()
|| e->probability.quality () == GUESSED)
e->probability = profile_probability::never ().afdo ();
+ if (dump_file)
+ {
+ fprintf (dump_file, " probability of edge %i->%i"
+ " with count ",
+ e->src->index, e->dest->index);
+ cnt.dump (dump_file);
+ fprintf (dump_file, " set to ");
+ e->probability.dump (dump_file);
+ fprintf (dump_file, "\n");
+ }
}
}
afdo_adjust_guessed_profile (annotated_bb);
@@ -3882,21 +3993,30 @@ afdo_annotate_cfg (void)
s->dump (dump_file);
fprintf (dump_file, "\n");
}
-
- /* In the first pass only store non-zero counts. */
- gcov_type head_count = s->head_count () * autofdo::afdo_count_scale;
- bool profile_found = head_count > 0;
+ bool profile_found = false;
hash_set <basic_block> zero_bbs;
- FOR_EACH_BB_FN (bb, cfun)
+ gcov_type head_count = s->head_count () * autofdo::afdo_count_scale;
+
+ if (!param_auto_profile_bbs)
{
- if (afdo_set_bb_count (bb, zero_bbs))
+ if (scale_bb_profile ())
+ return;
+ }
+ else
+ {
+ /* In the first pass only store non-zero counts. */
+ profile_found = head_count > 0;
+ FOR_EACH_BB_FN (bb, cfun)
{
- if (bb->count.quality () == AFDO)
+ if (afdo_set_bb_count (bb, zero_bbs))
{
- gcc_assert (bb->count.nonzero_p ());
- profile_found = true;
+ if (bb->count.quality () == AFDO)
+ {
+ gcc_assert (bb->count.nonzero_p ());
+ profile_found = true;
+ }
+ set_bb_annotated (bb, &annotated_bb);
}
- set_bb_annotated (bb, &annotated_bb);
}
}
/* Exit without clobbering static profile if there was no
diff --git a/gcc/c-family/c.opt.urls b/gcc/c-family/c.opt.urls
index e09d51d..6c01a7d 100644
--- a/gcc/c-family/c.opt.urls
+++ b/gcc/c-family/c.opt.urls
@@ -595,6 +595,9 @@ UrlSuffix(gcc/Warning-Options.html#index-Wmultichar)
Wmultiple-inheritance
UrlSuffix(gcc/C_002b_002b-Dialect-Options.html#index-Wmultiple-inheritance)
+Wmultiple-parameter-fwd-decl-lists
+UrlSuffix(gcc/Warning-Options.html#index-Wmultiple-parameter-fwd-decl-lists)
+
Wmultistatement-macros
UrlSuffix(gcc/Warning-Options.html#index-Wmultistatement-macros)
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index ef985ba..dea3113 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,9 @@
+2025-09-30 Martin Uecker <uecker@tugraz.at>
+
+ PR target/121933
+ * c-typeck.cc (mark_decl_used): Set DECL_NONLOCAL
+ only for VAR_DECL, FUNC_DECL, PARM_DECL.
+
2025-09-26 Alejandro Colomar <alx@kernel.org>
* c-decl.cc (c_scope): Rename {warned > had}_forward_parm_decls.
diff --git a/gcc/c/Make-lang.in b/gcc/c/Make-lang.in
index 2517b64..f09fc99 100644
--- a/gcc/c/Make-lang.in
+++ b/gcc/c/Make-lang.in
@@ -58,6 +58,7 @@ C_AND_OBJC_OBJS = attribs.o c/c-errors.o c/c-decl.o c/c-typeck.o \
# Language-specific object files for C.
C_OBJS = c/c-lang.o c-family/stub-objc.o $(C_AND_OBJC_OBJS)
c_OBJS = $(C_OBJS) cc1-checksum.o c/gccspec.o
+c_FDAS = cc1.fda
# Use strict warnings for this front end.
c-warn = $(STRICT_WARN)
@@ -101,7 +102,7 @@ create_fdas_for_cc1: ../stage1-gcc/cc1$(exeext) ../prev-gcc/$(PERF_DATA)
echo $$perf_path; \
if [ -f $$perf_path ]; then \
profile_name=cc1_$$component_in_prev.fda; \
- $(CREATE_GCOV) -binary ../stage1-gcc/cc1$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \
+ $(CREATE_GCOV) -binary ../stage1-gcc/cc1$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2 || exit 1; \
fi; \
done;
@@ -111,7 +112,7 @@ create_fdas_for_cc1: ../stage1-gcc/cc1$(exeext) ../prev-gcc/$(PERF_DATA)
echo $$perf_path; \
if [ -f $$perf_path ]; then \
profile_name=cc1_$$component_in_prev_target.fda; \
- $(CREATE_GCOV) -binary ../prev-gcc/cc1$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \
+ $(CREATE_GCOV) -binary ../prev-gcc/cc1$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2 || exit 1; \
fi; \
done;
diff --git a/gcc/cfghooks.cc b/gcc/cfghooks.cc
index 5f7fc27..8b33468 100644
--- a/gcc/cfghooks.cc
+++ b/gcc/cfghooks.cc
@@ -817,6 +817,15 @@ merge_blocks (basic_block a, basic_block b)
if (!cfg_hooks->merge_blocks)
internal_error ("%s does not support merge_blocks", cfg_hooks->name);
+ /* Pick the more reliable count. If both qualities agrees, pick the larger
+ one since turning mistakely hot code to cold is more harmful. */
+ if (a->count.initialized_p ())
+ a->count = b->count;
+ else if (a->count.quality () < b->count.quality ())
+ a->count = b->count;
+ else if (a->count.quality () == b->count.quality ())
+ a->count = a->count.max (b->count);
+
cfg_hooks->merge_blocks (a, b);
if (current_loops != NULL)
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index dae3c68..70cfe2b 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -123,6 +123,8 @@ CXX_OBJS = cp/cp-lang.o c-family/stub-objc.o $(CXX_AND_OBJCXX_OBJS)
c++_OBJS = $(CXX_OBJS) cc1plus-checksum.o cp/g++spec.o
+c++_FDAS = cc1plus.fda
+
# Use strict warnings for this front end.
cp-warn = $(STRICT_WARN)
@@ -199,7 +201,7 @@ create_fdas_for_cc1plus: ../stage1-gcc/cc1plus$(exeext) ../prev-gcc/$(PERF_DATA)
echo $$perf_path; \
if [ -f $$perf_path ]; then \
profile_name=cc1plus_$$component_in_prev.fda; \
- $(CREATE_GCOV) -binary ../stage1-gcc/cc1plus$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \
+ $(CREATE_GCOV) -binary ../stage1-gcc/cc1plus$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2 || exit 1; \
fi; \
done;
@@ -209,7 +211,7 @@ create_fdas_for_cc1plus: ../stage1-gcc/cc1plus$(exeext) ../prev-gcc/$(PERF_DATA)
echo $$perf_path; \
if [ -f $$perf_path ]; then \
profile_name=cc1plus_$$component_in_prev_target.fda; \
- $(CREATE_GCOV) -binary ../prev-gcc/cc1plus$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \
+ $(CREATE_GCOV) -binary ../prev-gcc/cc1plus$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2 || exit 1; \
fi; \
done;
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 99607a0..492ca29 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -16245,6 +16245,11 @@ In each case, the @var{value} is an integer. The following choices
of @var{name} are recognized for all targets:
@table @gcctabopt
+@item auto-profile-bbs
+If non-zero and used together with @option{-fauto-profile}, the auto-profile
+will be used to determine basic block profile. If zero, then only function
+level profile will be read.
+
@item phiopt-factor-max-stmts-live
When factoring statements out of if/then/else, this is the max # of statements
after the defining statement to be allow to extend the lifetime of a name
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 31a19ed..ad537f7 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,18 @@
+2025-09-30 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/102241
+ * gfortran.h: Add symbol attribute 'pdt_comp'.
+ * module.cc : Add 'pdt_comp' to 'ab_attribute' and 'attr_bits'.
+ (mio_symbol_attribute): Set 'pdt_comp'.
+ * resolve.cc (resolve_component): If a PDT component is found
+ in a non-PDT type, generate the PDT instance, if necessary, and
+ set the 'pdt_comp' attribute. Fix some whitespace issues.
+ * trans-decl.cc (gfc_get_symbol_decl, gfc_trans_deferred_vars):
+ If 'pdt_comp' set, initialize the PDT components.
+ * trans-stmt.cc (gfc_trans_deallocate): Verify that a typespec
+ parameter list is available for PDT components of ordinary
+ derived types.
+
2025-09-27 Paul Thomas <pault@gcc.gnu.org>
PR fortran/87908
diff --git a/gcc/fortran/decl.cc b/gcc/fortran/decl.cc
index a891dc8..f00f0e1 100644
--- a/gcc/fortran/decl.cc
+++ b/gcc/fortran/decl.cc
@@ -4076,6 +4076,8 @@ gfc_get_pdt_instance (gfc_actual_arglist *param_list, gfc_symbol **sym,
/* Start building the new instance of the parameterized type. */
gfc_copy_attr (&instance->attr, &pdt->attr, &pdt->declared_at);
+ if (pdt->attr.use_assoc)
+ instance->module = pdt->module;
instance->attr.pdt_template = 0;
instance->attr.pdt_type = 1;
instance->declared_at = gfc_current_locus;
diff --git a/gcc/lto/Make-lang.in b/gcc/lto/Make-lang.in
index 553e6dd..2af8bba 100644
--- a/gcc/lto/Make-lang.in
+++ b/gcc/lto/Make-lang.in
@@ -26,18 +26,15 @@ LTO_DUMP_INSTALL_NAME := $(shell echo lto-dump|sed '$(program_transform_name)')
# The LTO-specific object files inclued in $(LTO_EXE).
LTO_OBJS = lto/lto-lang.o lto/lto.o lto/lto-object.o attribs.o lto/lto-partition.o lto/lto-symtab.o lto/lto-common.o
lto_OBJS = $(LTO_OBJS)
+lto_FDAS = lto1.fda
LTO_DUMP_OBJS = lto/lto-lang.o lto/lto-object.o attribs.o lto/lto-partition.o lto/lto-symtab.o lto/lto-dump.o lto/lto-common.o
lto_dump_OBJS = $(LTO_DUMP_OBJS)
-# this is only useful in a LTO bootstrap, but this does not work right
-# now. Should reenable after this is fixed, but only when LTO bootstrap
-# is enabled.
-
-#ifeq ($(if $(wildcard ../stage_current),$(shell cat \
-# ../stage_current)),stageautofeedback)
-#$(LTO_OBJS): CFLAGS += -fauto-profile=lto1.fda
-#$(LTO_OBJS): lto1.fda
-#endif
+ifeq ($(if $(wildcard ../stage_current),$(shell cat \
+ ../stage_current)),stageautofeedback)
+$(LTO_OBJS): CFLAGS += -fauto-profile=lto1.fda
+$(LTO_OBJS): lto1.fda
+endif
# Rules
@@ -118,7 +115,7 @@ create_fdas_for_lto1: ../stage1-gcc/lto1$(exeext) ../prev-gcc/$(PERF_DATA)
echo $$perf_path; \
if [ -f $$perf_path ]; then \
profile_name=lto1_$$component_in_prev.fda; \
- $(CREATE_GCOV) -binary ../stage1-gcc/lto1$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \
+ $(CREATE_GCOV) -binary ../stage1-gcc/lto1$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2 || exit 1; \
fi; \
done;
@@ -128,7 +125,7 @@ create_fdas_for_lto1: ../stage1-gcc/lto1$(exeext) ../prev-gcc/$(PERF_DATA)
echo $$perf_path; \
if [ -f $$perf_path ]; then \
profile_name=lto1_$$component_in_prev_target.fda; \
- $(CREATE_GCOV) -binary ../prev-gcc/lto1$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \
+ $(CREATE_GCOV) -binary ../prev-gcc/lto1$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2 || exit 1; \
fi; \
done;
diff --git a/gcc/params.opt b/gcc/params.opt
index ae61709..1f6297d 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -66,6 +66,10 @@ Enable asan stack protection.
Common Joined UInteger Var(param_asan_use_after_return) Init(1) IntegerRange(0, 1) Param Optimization
Enable asan detection of use-after-return bugs.
+-param=auto-profile-bbs=
+Common Joined UInteger Var(param_auto_profile_bbs) Init(1) IntegerRange(0, 1) Param Optimization
+Build basic block profile using auto profile
+
-param=cycle-accurate-model=
Common Joined UInteger Var(param_cycle_accurate_model) Init(1) IntegerRange(0, 1) Param Optimization
Whether the scheduling description is mostly a cycle-accurate model of the target processor and is likely to be spill aggressively to fill any pipeline bubbles.
diff --git a/gcc/predict.cc b/gcc/predict.cc
index 5639d81..895c5f9 100644
--- a/gcc/predict.cc
+++ b/gcc/predict.cc
@@ -852,7 +852,7 @@ unlikely_executed_stmt_p (gimple *stmt)
heuristics. */
if (gimple_bb (stmt)->count.reliable_p ()
&& gimple_bb (stmt)->count.nonzero_p ())
- return gimple_bb (stmt)->count == profile_count::zero ();
+ return false;
/* NORETURN attribute alone is not strong enough: exit() may be quite
likely executed once during program run. */
if (gimple_call_fntype (stmt)
@@ -4521,6 +4521,9 @@ rebuild_frequencies (void)
&& (!uninitialized_count_found || uninitialized_probablity_found)
&& !cfun->cfg->count_max.very_large_p ())
{
+ /* Propagating zero counts should be safe and may
+ help hot/cold splitting. */
+ determine_unlikely_bbs ();
if (dump_file)
fprintf (dump_file, "Profile is consistent\n");
return;
@@ -4545,6 +4548,9 @@ rebuild_frequencies (void)
for a given run, we would only propagate the error further. */
if (feedback_found && !uninitialized_count_found)
{
+ /* Propagating zero counts should be safe and may
+ help hot/cold splitting. */
+ determine_unlikely_bbs ();
if (dump_file)
fprintf (dump_file,
"Profile is inconsistent but read from profile feedback;"
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a4c4a17..a7d81ad 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,44 @@
+2025-09-30 David Malcolm <dmalcolm@redhat.com>
+
+ * lib/sarif.py: Remove import of ET.
+
+2025-09-30 Alfie Richards <alfie.richards@arm.com>
+
+ * g++.target/aarch64/fmv-selection1.C: New test.
+ * g++.target/aarch64/fmv-selection2.C: New test.
+ * g++.target/aarch64/fmv-selection3.C: New test.
+ * g++.target/aarch64/fmv-selection4.C: New test.
+ * g++.target/aarch64/fmv-selection5.C: New test.
+ * g++.target/aarch64/fmv-selection6.C: New test.
+ * g++.target/aarch64/fmv-selection7.C: New test.
+
+2025-09-30 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/vect/tsvc/vect-tsvc-s1244.c (s1244): Fix comment typo,
+ ture -> true.
+ * gcc.dg/vect/tsvc/vect-tsvc-s2244.c (s2244): Likewise.
+
+2025-09-30 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/reduce1.adb: New test.
+
+2025-09-30 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/105380
+ PR fortran/102241
+ * gfortran.dg/pdt_49.f03: New test.
+ * gfortran.dg/pdt_11.f03: Deallocate 'o_fdef'.
+ * gfortran.dg/pdt_15.f03: Reinstate final 'pop_8' and update
+ the tree dump counts.
+ * gfortran.dg/pdt_20.f03: Deallocate 'x'.
+ * gfortran.dg/pdt_23.f03: Deallocate 'x'.
+ * gfortran.dg/pdt_3.f03: Eliminate the temporary 'matrix' and
+ use w%d directly in the allocation. Change the TODO comment and
+ comment on memory leak in allocation.
+ * gfortran.dg/pdt_39.f03: Comments on memory leaks.
+ * gfortran.dg/pdt_40.f03: Deallocate 'foo' and bar%x.
+ * gfortran.dg/pdt_50.f03: New test.
+
2025-09-29 YunQiang Su <yunqiang@isrc.iscas.ac.cn>
* gcc.target/mips/pr99217-2.c: New test.
diff --git a/gcc/testsuite/gcc.dg/pr120560.c b/gcc/testsuite/gcc.dg/pr120560.c
new file mode 100644
index 0000000..deb3c18
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr120560.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-tree-ccp -fdump-tree-evrp" } */
+int main() {
+ int a = -1, b = 2, c = 1;
+ if (a >= 0)
+ c = 0;
+ while (1) {
+ if (-b + c - 7 >= 0)
+ return 0;
+ b = b - 1000 - 2147482648;
+ }
+}
+/* { dg-final { scan-tree-dump "return 0" "evrp" } } */
diff --git a/gcc/testsuite/gfortran.dg/pdt_51.f03 b/gcc/testsuite/gfortran.dg/pdt_51.f03
new file mode 100644
index 0000000..46697bf
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pdt_51.f03
@@ -0,0 +1,57 @@
+! { dg-do compile }
+! { dg-options "-fdump-tree-original" }
+!
+! Test the fix for PR122089 in which the generic interface checking failed.
+!
+! Contributed by Damian Rouson <damian@archaeologic.codes>
+!
+module tensor_m
+ implicit none
+
+ type tensor_t(k)
+ integer, kind :: k = kind(1.)
+ real(k) values_
+ contains
+ generic :: values => double_precision_values
+ procedure double_precision_values
+ end type
+
+contains
+ function double_precision_values(self)
+ class(tensor_t(kind(1D0))) self
+ double precision double_precision_values
+ double_precision_values = self%values_
+ end function
+end module
+
+module input_output_pair_m
+ use tensor_m, only : tensor_t
+ implicit none
+
+ type input_output_pair_t(k)
+ integer, kind :: k = kind(1.)
+ type(tensor_t(k)) inputs_
+ end type
+
+ interface
+ module subroutine double_precision_write_to_stdout(input_output_pairs)
+ implicit none
+ type(input_output_pair_t(kind(1D0))) input_output_pairs
+ end subroutine
+ end interface
+end module
+
+submodule(input_output_pair_m) input_output_pair_s
+ implicit none
+contains
+ module procedure double_precision_write_to_stdout
+ print *, input_output_pairs%inputs_%values()
+ end procedure
+end submodule
+
+ use input_output_pair_m
+ type(input_output_pair_t(kind(1d0))) :: tgt
+ tgt%inputs_%values_ = 42d0
+ call double_precision_write_to_stdout(tgt)
+end
+! { dg-final { scan-tree-dump-times "double_precision_write_to_stdout \\(&tgt\\);" 1 "original" } }
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index 1836037..1d549e4 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -7187,7 +7187,11 @@ vectorizable_reduction (loop_vec_info loop_vinfo,
return false;
/* Do not try to vectorize bit-precision reductions. */
- if (!type_has_mode_precision_p (op.type))
+ if (!VECTOR_BOOLEAN_TYPE_P (vectype_out)
+ && !type_has_mode_precision_p (op.type)
+ && op.code != BIT_AND_EXPR
+ && op.code != BIT_IOR_EXPR
+ && op.code != BIT_XOR_EXPR)
return false;
/* Lane-reducing ops also never can be used in a SLP reduction group
diff --git a/gcc/vr-values.cc b/gcc/vr-values.cc
index ff11656..44dff35 100644
--- a/gcc/vr-values.cc
+++ b/gcc/vr-values.cc
@@ -278,14 +278,14 @@ range_from_loop_direction (irange &r, tree type,
r.set_varying (type);
else if (dir == EV_DIR_GROWS)
{
- if (wi::gt_p (begin.lower_bound (), end.upper_bound (), sign))
+ if (wi::ge_p (begin.lower_bound (), end.upper_bound (), sign))
r.set_varying (type);
else
r = int_range<1> (type, begin.lower_bound (), end.upper_bound ());
}
else
{
- if (wi::gt_p (end.lower_bound (), begin.upper_bound (), sign))
+ if (wi::ge_p (end.lower_bound (), begin.upper_bound (), sign))
r.set_varying (type);
else
r = int_range<1> (type, end.lower_bound (), begin.upper_bound ());
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 7e401bb..f9059af 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,9 @@
+2025-09-30 Andre Vieira <andre.simoesdiasvieira@arm.com>
+
+ * config/t-softfp: Don't use softfp_wrap for bitint functions.
+ (softfp_cflags): New parameter that is passed to the building of bitint
+ functions.
+
2025-09-25 John David Anglin <danglin@gcc.gnu.org>
* config/pa/sync-libfuncs.c (atomic_store_8): Fix asm.
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index b215b3a..0403156 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,11 @@
+2025-09-30 François Dumont <frs.dumont@gmail.com>
+
+ * include/std/inplace_vector:
+ (std::swap(inplace_vector<>&, inplace_vector<>&)): Remove the duplicated
+ implementation at std namespace level. Keep the friend inline one.
+ (inplace_vector<Tp, 0>::assign(initializer_list<>)): Add missing return
+ statement.
+
2025-09-27 Jonathan Wakely <jwakely@redhat.com>
* testsuite/20_util/allocator_traits/members/allocate_hint.cc:
diff --git a/libstdc++-v3/include/bits/stl_uninitialized.h b/libstdc++-v3/include/bits/stl_uninitialized.h
index 0398b65..70a5646 100644
--- a/libstdc++-v3/include/bits/stl_uninitialized.h
+++ b/libstdc++-v3/include/bits/stl_uninitialized.h
@@ -236,6 +236,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wc++17-extensions"
+#pragma GCC diagnostic ignored "-Wclass-memaccess"
/**
* @brief Copies the range [first,last) into result.
* @param __first An input iterator.
@@ -427,6 +428,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#if __cplusplus >= 201103L
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wc++17-extensions"
+#pragma GCC diagnostic ignored "-Wclass-memaccess"
#if __glibcxx_raw_memory_algorithms >= 202411L // >= C++26
if consteval {
return std::__do_uninit_fill(__first, __last, __x);
@@ -529,6 +531,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wc++17-extensions"
+#pragma GCC diagnostic ignored "-Wclass-memaccess"
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR 1339. uninitialized_fill_n should return the end of its range
/**
diff --git a/libstdc++-v3/testsuite/20_util/unique_ptr/modifiers/93562.cc b/libstdc++-v3/testsuite/20_util/unique_ptr/modifiers/93562.cc
index 95df7af..0443578 100644
--- a/libstdc++-v3/testsuite/20_util/unique_ptr/modifiers/93562.cc
+++ b/libstdc++-v3/testsuite/20_util/unique_ptr/modifiers/93562.cc
@@ -76,11 +76,32 @@ test03()
VERIFY(p2.get_deleter().id == -1);
}
+namespace B
+{
+ struct Deleter
+ {
+ Deleter& operator=(const Deleter&) = delete;
+
+ void operator()(int* p) const noexcept { delete[] p; }
+
+ // found by ADL
+ friend void swap(Deleter& lhs, Deleter& rhs) noexcept
+ { std::swap(lhs.id, rhs.id); }
+
+ int id;
+ };
+
+ static_assert(!std::is_move_assignable<Deleter>::value, "not assignable");
+#if __cplusplus >= 201703L
+ static_assert(std::is_swappable_v<Deleter>, "but swappable");
+#endif
+} // namespace B
+
void
test04()
{
- std::unique_ptr<int[], A::Deleter> p1(new int[1]{1}, { -1 });
- std::unique_ptr<int[], A::Deleter> p2(new int[2]{2, 2}, { -2 });
+ std::unique_ptr<int[], B::Deleter> p1(new int[1]{1}, { -1 });
+ std::unique_ptr<int[], B::Deleter> p2(new int[2]{2, 2}, { -2 });
int* const pi1 = p1.get();
int* const pi2 = p2.get();
// This type must swappable even though the deleter is not move-assignable:
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get/char/3.cc b/libstdc++-v3/testsuite/22_locale/time_get/get/char/3.cc
index 48a5f12..49bcd2a 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get/char/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get/char/3.cc
@@ -226,7 +226,7 @@ test01()
format = "%e";
ret = tget.get(iter(iss), end, iss, err, &time,
format.data(), format.data()+format.size());
- VERIFY( err == ios_base::failbit|ios_base::eofbit );
+ VERIFY( err == (ios_base::failbit|ios_base::eofbit) );
VERIFY( ret == end );
iss.str("35");
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/3.cc
index b7eb5bc..4b1b6e4 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get/wchar_t/3.cc
@@ -226,7 +226,7 @@ test01()
format = L"%e";
ret = tget.get(iter(iss), end, iss, err, &time,
format.data(), format.data()+format.size());
- VERIFY( err == ios_base::failbit|ios_base::eofbit );
+ VERIFY( err == (ios_base::failbit|ios_base::eofbit) );
VERIFY( ret == end );
iss.str(L"35");
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/9875_seekoff.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/9875_seekoff.cc
index 052d80f..474a49f 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/9875_seekoff.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/9875_seekoff.cc
@@ -66,7 +66,7 @@ protected:
virtual int
do_length(std::mbstate_t&, const char* from, const char* end,
- std::size_t max)
+ std::size_t max) const
{
std::size_t len = (end - from) / sizeof(wchar_t);
return std::min(len, max) * sizeof(wchar_t);
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/9875_seekpos.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/9875_seekpos.cc
index 5767f8a..f0d3b59 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/9875_seekpos.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/9875_seekpos.cc
@@ -66,7 +66,7 @@ protected:
virtual int
do_length(std::mbstate_t&, const char* from, const char* end,
- std::size_t max)
+ std::size_t max) const
{
std::size_t len = (end - from) / sizeof(wchar_t);
return std::min(len, max) * sizeof(wchar_t);
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char/1.cc
index a0396a4..6d4c71f 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char/1.cc
@@ -35,7 +35,7 @@ protected:
virtual result
do_in(state_type&, const char* from, const char*, const char*& from_next,
- char* to, char*, char*& to_next)
+ char* to, char*, char*& to_next) const
{
from_next = from;
to_next = to;
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11603.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11603.cc
index fcd95a9..c62ad02 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11603.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11603.cc
@@ -119,7 +119,7 @@ protected:
{ return width; }
virtual int
- do_length(const StateT&, const extern_type* from,
+ do_length(StateT&, const extern_type* from,
const extern_type* end, size_t max) const
{
size_t len = std::min(max,
diff --git a/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/multiline.cc b/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/multiline.cc
index a1982fc..f4b3cf0 100644
--- a/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/multiline.cc
+++ b/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/multiline.cc
@@ -27,11 +27,11 @@ test01()
VERIFY(std::regex_search("x\nab\nx", ml));
ml.assign("a$\n^b$\n^c", ECMAScript|__multiline);
- VERIFY( ml.flags() == ECMAScript|__multiline );
+ VERIFY( ml.flags() == (ECMAScript|__multiline) );
VERIFY( regex_search("a\nb\nc", ml) );
ml.assign("a$\n^b$\n^c", ECMAScript|__multiline|icase);
- VERIFY( ml.flags() == ECMAScript|__multiline|icase );
+ VERIFY( ml.flags() == (ECMAScript|__multiline|icase) );
VERIFY( regex_search("A\nB\nC", ml) );
}
diff --git a/libstdc++-v3/testsuite/28_regex/basic_regex/assign/wchar_t/pstring.cc b/libstdc++-v3/testsuite/28_regex/basic_regex/assign/wchar_t/pstring.cc
index 2e9dea1..91e5512 100644
--- a/libstdc++-v3/testsuite/28_regex/basic_regex/assign/wchar_t/pstring.cc
+++ b/libstdc++-v3/testsuite/28_regex/basic_regex/assign/wchar_t/pstring.cc
@@ -23,6 +23,7 @@
// [28.8.3] class template basic_regex assign()
#include <regex>
+#include <cwchar>
// Tests assign operation from a Pascal-style counted-string.
void test01()
@@ -31,7 +32,7 @@ void test01()
const wchar_t cs[] = L"aab";
test_type re;
- re.assign(cs, sizeof(cs)-1, std::regex_constants::basic);
+ re.assign(cs, std::wcslen(cs), std::regex_constants::basic);
}
int
diff --git a/libstdc++-v3/testsuite/std/memory/polymorphic/copy.cc b/libstdc++-v3/testsuite/std/memory/polymorphic/copy.cc
index bea05ac..d66cc06 100644
--- a/libstdc++-v3/testsuite/std/memory/polymorphic/copy.cc
+++ b/libstdc++-v3/testsuite/std/memory/polymorphic/copy.cc
@@ -44,14 +44,14 @@ private:
using __gnu_test::tracker_allocator;
using Counter = __gnu_test::tracker_allocator_counter;
-using Polymorhic = std::polymorphic<Base, tracker_allocator<Base>>;
-const Polymorhic src(std::in_place_type<Derived>, 1, 2, 3);
+using Polymorphic = std::polymorphic<Base, tracker_allocator<Base>>;
+const Polymorphic src(std::in_place_type<Derived>, 1, 2, 3);
constexpr void
test_ctor()
{
Counter::reset();
- Polymorhic i1(src);
+ Polymorphic i1(src);
VERIFY( *i1 == *src );
VERIFY( &*i1 != &*src );
VERIFY( Counter::get_allocation_count() >= sizeof(Derived) );
@@ -60,7 +60,7 @@ test_ctor()
VERIFY( Counter::get_destruct_count() == 0 );
Counter::reset();
- Polymorhic i2(std::allocator_arg, {}, src);
+ Polymorphic i2(std::allocator_arg, {}, src);
VERIFY( *i2 == *src );
VERIFY( &*i2 != &*src );
VERIFY( Counter::get_allocation_count() >= sizeof(Derived) );
@@ -73,7 +73,7 @@ constexpr void
test_assign()
{
Counter::reset();
- Polymorhic i1(std::in_place_type<Derived>);
+ Polymorphic i1(std::in_place_type<Derived>);
const size_t holderSize = Counter::get_allocation_count();
VERIFY( holderSize >= sizeof(Derived) );
Counter::reset();
@@ -101,26 +101,26 @@ test_assign()
constexpr void
test_valueless()
{
- Polymorhic e(std::in_place_type<Derived>);
+ Polymorphic e(std::in_place_type<Derived>);
auto(std::move(e));
VERIFY( e.valueless_after_move() );
Counter::reset();
- Polymorhic i1(e);
+ Polymorphic i1(e);
VERIFY( i1.valueless_after_move() );
VERIFY( Counter::get_allocation_count() == 0 );
VERIFY( Counter::get_deallocation_count() == 0 );
VERIFY( Counter::get_construct_count() == 0 );
VERIFY( Counter::get_destruct_count() == 0 );
- Polymorhic i2(std::allocator_arg, {}, e);
+ Polymorphic i2(std::allocator_arg, {}, e);
VERIFY( i2.valueless_after_move() );
VERIFY( Counter::get_allocation_count() == 0 );
VERIFY( Counter::get_deallocation_count() == 0 );
VERIFY( Counter::get_construct_count() == 0 );
VERIFY( Counter::get_destruct_count() == 0 );
- Polymorhic i3(src);
+ Polymorphic i3(src);
Counter::reset();
i3 = e;
VERIFY( i3.valueless_after_move() );