aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog170
-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/ChangeLog4
-rw-r--r--gcc/c-family/c.opt.urls3
-rw-r--r--gcc/c/ChangeLog11
-rw-r--r--gcc/c/Make-lang.in5
-rw-r--r--gcc/cfghooks.cc9
-rw-r--r--gcc/config/m68k/m68k.md16
-rw-r--r--gcc/config/riscv/bitmanip.md16
-rw-r--r--gcc/cp/ChangeLog12
-rw-r--r--gcc/cp/Make-lang.in6
-rw-r--r--gcc/cp/constexpr.cc5
-rw-r--r--gcc/cp/contracts.h15
-rw-r--r--gcc/doc/invoke.texi5
-rw-r--r--gcc/fortran/ChangeLog29
-rw-r--r--gcc/fortran/decl.cc2
-rw-r--r--gcc/fortran/trans-array.cc9
-rw-r--r--gcc/lto/ChangeLog5
-rw-r--r--gcc/lto/Make-lang.in19
-rw-r--r--gcc/m2/ChangeLog6
-rw-r--r--gcc/m2/pge-boot/Gldtoa.cc2
-rw-r--r--gcc/params.opt4
-rw-r--r--gcc/predict.cc8
-rw-r--r--gcc/testsuite/ChangeLog66
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr122066.c18
-rw-r--r--gcc/testsuite/gcc.dg/pr120560.c13
-rw-r--r--gcc/testsuite/gcc.target/riscv/pr122106.c3
-rw-r--r--gcc/testsuite/gfortran.dg/pdt_51.f0357
-rw-r--r--gcc/testsuite/gfortran.dg/ubsan/missing_optional_dummy_9.f9022
-rw-r--r--gcc/tree-vect-loop.cc6
-rw-r--r--gcc/vr-values.cc4
34 files changed, 741 insertions, 135 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 63fd0f2..81c5f80 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,173 @@
+2025-10-01 Jeff Law <jlaw@ventanamicro.com>
+
+ PR target/122106
+ * config/riscv/bitmanip.md (crc expanders): Add predicate for
+ polynomial argument. Drop unnecessary constraints.
+
+2025-10-01 Andreas Schwab <schwab@linux-m68k.org>
+
+ PR target/122066
+ * config/m68k/m68k.md (adddi3, subdi3): Strip POST_INC and PRE_DEC
+ when generating high part of the destination operand.
+
+2025-10-01 Jan Hubicka <hubicka@ucw.cz>
+
+ * auto-profile.cc (afdo_calculate_branch_prob): Improve dump file.
+
+2025-10-01 Jan Hubicka <hubicka@ucw.cz>
+
+ * auto-profile.cc (determine_scale): Break out from ...
+ (afdo_adjust_guessed_profile): ... here.
+ (scale_bb_profile): New function.
+ (afdo_annotate_cfg): Use it.
+ * params.opt (auto-profile-bbs): New parmaeter.
+ * doc/invoke.texi (auto-profile-bbs): Document.
+
+2025-10-01 Jan Hubicka <hubicka@ucw.cz>
+
+ * auto-profile.cc (afdo_unscaled_edge_count): New function based on
+ part of ...
+ (afdo_set_bb_count): ... this function; use it here.
+ (afdo_calculate_branch_prob): Try to determine edge counts using
+ phi args and goto locuses.
+
+2025-10-01 Jan Hubicka <hubicka@ucw.cz>
+
+ * Makefile.in (ALL_FDAS): New variable.
+ (ALL_HOST_BACKEND_OBJ): Use all.fda instead of cc1plus.fda
+ (all.fda): New target
+
+2025-10-01 Jan Hubicka <hubicka@ucw.cz>
+
+ * cfghooks.cc (merge_blocks): Choose more reliable or higher BB
+ count.
+
+2025-10-01 Jan Hubicka <hubicka@ucw.cz>
+
+ * predict.cc (unlikely_executed_stmt_p): Remove redundant check.
+ (rebuild_frequencies): Also recompute unlikely bbs when profile is
+ present or consistent.
+
+2025-10-01 Andrew MacLeod <amacleod@redhat.com>
+
+ PR tree-optimization/120560
+ * vr-values.cc (range_from_loop_direction): Use wi::ge_p rather
+ than wi::gt_p.
+
+2025-10-01 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/122110
+ * tree-vect-loop.cc (vectorizable_reduction): Relax restriction
+ to mode-precision operations.
+
+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..924403e 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20250930
+20251002
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/ChangeLog b/gcc/c-family/ChangeLog
index bf15d94..9054428 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,7 @@
+2025-10-01 Alejandro Colomar <alx@kernel.org>
+
+ * c.opt.urls: Regenerate
+
2025-09-26 Alejandro Colomar <alx@kernel.org>
* c.opt: Add -Wmultiple-parameter-fwd-decl-lists
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..72634fa 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,14 @@
+2025-10-01 Jan Hubicka <hubicka@ucw.cz>
+
+ * Make-lang.in: Add c_FDAS
+ (create_fdas_for_cc1): Be sure that build fails if create_gcov fails.
+
+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/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
index c96937f..7f345bf 100644
--- a/gcc/config/m68k/m68k.md
+++ b/gcc/config/m68k/m68k.md
@@ -2442,14 +2442,15 @@
gcc_assert (GET_CODE (operands[0]) == MEM);
if (GET_CODE (XEXP (operands[0], 0)) == POST_INC)
{
- operands[1] = gen_rtx_MEM (SImode,
- plus_constant (Pmode,
- XEXP(operands[0], 0), -8));
+ operands[1]
+ = gen_rtx_MEM (SImode,
+ plus_constant (Pmode,
+ XEXP (XEXP (operands[0], 0), 0), -8));
return "move%.l %0,%3\;add%.l %R2,%0\;addx%.l %2,%3\;move%.l %3,%1";
}
else if (GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
{
- operands[1] = XEXP(operands[0], 0);
+ operands[1] = XEXP (XEXP (operands[0], 0), 0);
return "add%.l %R2,%0\;move%.l %0,%3\;addx%.l %2,%3\;move%.l %3,%1";
}
else
@@ -2949,13 +2950,14 @@
if (GET_CODE (XEXP (operands[0], 0)) == POST_INC)
{
operands[1]
- = gen_rtx_MEM (SImode, plus_constant (Pmode,
- XEXP (operands[0], 0), -8));
+ = gen_rtx_MEM (SImode,
+ plus_constant (Pmode,
+ XEXP (XEXP (operands[0], 0), 0), -8));
return "move%.l %0,%3\;sub%.l %R2,%0\;subx%.l %2,%3\;move%.l %3,%1";
}
else if (GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
{
- operands[1] = XEXP(operands[0], 0);
+ operands[1] = XEXP (XEXP (operands[0], 0), 0);
return "sub%.l %R2,%0\;move%.l %0,%3\;subx%.l %2,%3\;move%.l %3,%1";
}
else
diff --git a/gcc/config/riscv/bitmanip.md b/gcc/config/riscv/bitmanip.md
index 5fd139a..59b71ed 100644
--- a/gcc/config/riscv/bitmanip.md
+++ b/gcc/config/riscv/bitmanip.md
@@ -1218,13 +1218,13 @@
;; Reversed CRC 8, 16, 32 for TARGET_64
(define_expand "crc_rev<ANYI1:mode><ANYI:mode>4"
;; return value (calculated CRC)
- [(set (match_operand:ANYI 0 "register_operand" "=r")
+ [(set (match_operand:ANYI 0 "register_operand")
;; initial CRC
- (unspec:ANYI [(match_operand:ANYI 1 "register_operand" "r")
+ (unspec:ANYI [(match_operand:ANYI 1 "register_operand")
;; data
- (match_operand:ANYI1 2 "register_operand" "r")
+ (match_operand:ANYI1 2 "register_operand")
;; polynomial without leading 1
- (match_operand:ANYI 3)]
+ (match_operand:ANYI 3 "const_int_operand")]
UNSPEC_CRC_REV))]
/* We don't support the case when data's size is bigger than CRC's size. */
"<ANYI:MODE>mode >= <ANYI1:MODE>mode"
@@ -1258,13 +1258,13 @@
;; CRC 8, 16, (32 for TARGET_64)
(define_expand "crc<SUBX1:mode><SUBX:mode>4"
;; return value (calculated CRC)
- [(set (match_operand:SUBX 0 "register_operand" "=r")
+ [(set (match_operand:SUBX 0 "register_operand")
;; initial CRC
- (unspec:SUBX [(match_operand:SUBX 1 "register_operand" "r")
+ (unspec:SUBX [(match_operand:SUBX 1 "register_operand")
;; data
- (match_operand:SUBX1 2 "register_operand" "r")
+ (match_operand:SUBX1 2 "register_operand")
;; polynomial without leading 1
- (match_operand:SUBX 3)]
+ (match_operand:SUBX 3 "const_int_operand")]
UNSPEC_CRC))]
/* We don't support the case when data's size is bigger than CRC's size. */
"(TARGET_ZBKC || TARGET_ZBC || TARGET_ZVBC)
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 98b48ff..ab3878b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,15 @@
+2025-10-01 Iain Sandoe <iain@sandoe.co.uk>
+
+ * constexpr.cc (cxx_eval_constant_expression): Use revised
+ interfaces to determine if contracts are ignored and, if not,
+ whether they are evaluated.
+ * contracts.h (contract_ignored_p, contract_evaluated_p): New.
+
+2025-10-01 Jan Hubicka <hubicka@ucw.cz>
+
+ * Make-lang.in: Add c++_FDAS
+ (create_fdas_for_cc1plus): Be sure that build fails if create_gcov fails.
+
2025-09-27 Jason Merrill <jason@redhat.com>
PR c++/112632
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/cp/constexpr.cc b/gcc/cp/constexpr.cc
index 6ebe6eb..558ef6e 100644
--- a/gcc/cp/constexpr.cc
+++ b/gcc/cp/constexpr.cc
@@ -10162,14 +10162,13 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t,
case PRECONDITION_STMT:
case POSTCONDITION_STMT:
{
- contract_semantic semantic = get_contract_semantic (t);
- if (semantic == CCS_IGNORE)
+ if (contract_ignored_p (t))
break;
if (!cxx_eval_assert (ctx, CONTRACT_CONDITION (t),
G_("contract predicate is false in "
"constant expression"),
- EXPR_LOCATION (t), checked_contract_p (semantic),
+ EXPR_LOCATION (t), contract_evaluated_p (t),
non_constant_p, overflow_p))
*non_constant_p = true;
r = void_node;
diff --git a/gcc/cp/contracts.h b/gcc/cp/contracts.h
index ead07d1..54eacd9 100644
--- a/gcc/cp/contracts.h
+++ b/gcc/cp/contracts.h
@@ -334,4 +334,19 @@ set_contract_semantic (tree t, contract_semantic semantic)
}
+/* Will this contract be ignored. */
+
+inline bool
+contract_ignored_p (const_tree contract)
+{
+ return (get_contract_semantic (contract) <= CCS_IGNORE);
+}
+
+/* Will this contract be evaluated? */
+
+inline bool
+contract_evaluated_p (const_tree contract)
+{
+ return (get_contract_semantic (contract) >= CCS_NEVER);
+}
#endif /* ! GCC_CP_CONTRACT_H */
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..1453a2a 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,32 @@
+2025-10-01 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/122080
+ * trans-array.cc (gfc_conv_array_parameter): Wrap the derivation of
+ bounds and strides for the descriptor of an optional dummy array
+ argument by a test on argument presence when it is supposed to be
+ passed to an optional argument.
+
+2025-10-01 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/122089
+ * decl.cc (gfc_get_pdt_instance): If the pdt_template is use
+ associated, 'module' field should be copied to this instance.
+
+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/fortran/trans-array.cc b/gcc/fortran/trans-array.cc
index 0111c95..db34de4 100644
--- a/gcc/fortran/trans-array.cc
+++ b/gcc/fortran/trans-array.cc
@@ -9446,6 +9446,15 @@ gfc_conv_array_parameter (gfc_se *se, gfc_expr *expr, bool g77,
gfc_add_expr_to_block (&se->pre, tmp);
}
+ else if (pass_optional && full_array_var && sym->as && sym->as->rank != 0)
+ {
+ /* Perform calculation of bounds and strides of optional array dummy
+ only if the argument is present. */
+ tmp = build3_v (COND_EXPR, gfc_conv_expr_present (sym),
+ gfc_finish_block (&se->pre),
+ build_empty_stmt (input_location));
+ gfc_add_expr_to_block (&se->pre, tmp);
+ }
}
/* Deallocate the allocatable components of structures that are
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 4da9ca3..55e0883 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,8 @@
+2025-10-01 Jan Hubicka <hubicka@ucw.cz>
+
+ * Make-lang.in: Add lto_FDAS; enable FDA collection
+ (create_fdas_for_lto1): Be sure that build fails if create_gcov fails.
+
2025-04-15 Kyrylo Tkachov <ktkachov@nvidia.com>
* lto-partition.cc (add_node_references_to_partition): Define.
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/m2/ChangeLog b/gcc/m2/ChangeLog
index b9e2b4d..1e9f733 100644
--- a/gcc/m2/ChangeLog
+++ b/gcc/m2/ChangeLog
@@ -1,3 +1,9 @@
+2025-10-01 Gaius Mulley <gaiusmod2@gmail.com>
+
+ PR modula2/122009
+ * pge-boot/Gldtoa.cc (ldtoa_ldtoa): Change int to bool for
+ parameter sign.
+
2025-09-21 Mark Wielaard <mark@klomp.org>
* lang.opt.urls: Regenerate.
diff --git a/gcc/m2/pge-boot/Gldtoa.cc b/gcc/m2/pge-boot/Gldtoa.cc
index 0a43de0..9fa2fd2 100644
--- a/gcc/m2/pge-boot/Gldtoa.cc
+++ b/gcc/m2/pge-boot/Gldtoa.cc
@@ -63,7 +63,7 @@ ldtoa_strtold (void *s, bool *error)
}
char *
-ldtoa_ldtoa (long double d, int mode, int ndigits, int *decpt, int *sign)
+ldtoa_ldtoa (long double d, int mode, int ndigits, int *decpt, bool *sign)
{
char format[50];
char *p;
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..7562dc2 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,69 @@
+2025-10-01 Jeff Law <jlaw@ventanamicro.com>
+
+ PR target/122106
+ * gcc.target/riscv/pr122106.c: New test.
+
+2025-10-01 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/122080
+ * gfortran.dg/ubsan/missing_optional_dummy_9.f90: New test.
+
+2025-10-01 Andreas Schwab <schwab@linux-m68k.org>
+
+ PR target/122066
+ * gcc.c-torture/compile/pr122066.c: New test.
+
+2025-10-01 Andrew MacLeod <amacleod@redhat.com>
+
+ PR tree-optimization/120560
+ * gcc.dg/pr120560.c: New.
+
+2025-10-01 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/122089
+ * gfortran.dg/pdt_51.f03: New test.
+
+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.c-torture/compile/pr122066.c b/gcc/testsuite/gcc.c-torture/compile/pr122066.c
new file mode 100644
index 0000000..5fecb7f
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr122066.c
@@ -0,0 +1,18 @@
+/* PR target/122066 -- adddi3/subdi3 mishandle POST_INC/PRE_DEC dest on m68k */
+
+struct {
+ long long wp_ssd[3];
+ long long wp_sum[3];
+} m_lowres;
+void calcAdaptiveQuantFrame() {
+ for (int i = 0; i < 3; i++) {
+ long sum = m_lowres.wp_sum[i];
+ long long ssd = m_lowres.wp_ssd[i];
+ m_lowres.wp_ssd[i] = ssd - sum;
+ }
+ for (int i = 0; i < 3; i++) {
+ long sum = m_lowres.wp_sum[i];
+ long long ssd = m_lowres.wp_ssd[i];
+ m_lowres.wp_ssd[i] = ssd + sum;
+ }
+}
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/gcc.target/riscv/pr122106.c b/gcc/testsuite/gcc.target/riscv/pr122106.c
new file mode 100644
index 0000000..b0345b0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/pr122106.c
@@ -0,0 +1,3 @@
+/* { dg-do compile } */
+
+short foo() { return __builtin_rev_crc16_data16(0, 0, 0); }
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/testsuite/gfortran.dg/ubsan/missing_optional_dummy_9.f90 b/gcc/testsuite/gfortran.dg/ubsan/missing_optional_dummy_9.f90
new file mode 100644
index 0000000..06b0004
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/ubsan/missing_optional_dummy_9.f90
@@ -0,0 +1,22 @@
+! { dg-do compile }
+! { dg-options "-O2 -fdump-tree-original -fdump-tree-optimized -fsanitize=undefined" }
+!
+! PR fortran/122080 - UBSAN: uninitialized stride for missing actual argument
+!
+! Contributed by Henri Menke
+
+subroutine outer (optarr)
+ real, optional, intent(in) :: optarr(:,:)
+ interface
+ subroutine inner (optarr)
+ real, optional, intent(in) :: optarr(:,:)
+ end subroutine inner
+ end interface
+ call inner (optarr)
+end subroutine outer
+
+! There will be 2 remaining UBSAN checks of stride wrapped by a check
+! for argument presence:
+!
+! { dg-final { scan-tree-dump-times "if \\(optarr.0 != 0B\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "UBSAN_CHECK_SUB (.)* stride" 2 "optimized" } }
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 ());