]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
4 days agomake autprofiledbootstrap with LTO meaningful
Jan Hubicka [Wed, 1 Oct 2025 15:06:41 +0000 (17:06 +0200)] 
make autprofiledbootstrap with LTO meaningful

currently autoprofiled bootstrap produces auto-profiles for cc1 and cc1plus
binaries.  Those are used to build respective frontend files.  For backend
cc1plus.fda is used.   This does not work well with LTO bootstrap where cc1plus
backend is untrained since it is used only for parsing and ealry opts. As a
result all binaries gets most of the backend optimized for size rather then
speed.

This patch adds lto1.fda and then combines all of cc1, cc1plus and lto1 into
all.fda that is used compiling common modules.  This is more or less equivalent
to what -fprofile-use effectively uses modulo that with -fprofile-use we know
number of runs of evety object file and scale accordingly at LTO time.

gcc/ChangeLog:

* Makefile.in (ALL_FDAS): New variable.
(ALL_HOST_BACKEND_OBJ): Use all.fda instead of cc1plus.fda
(all.fda): New target

gcc/c/ChangeLog:

* Make-lang.in: Add c_FDAS
(create_fdas_for_cc1): Be sure that build fails if create_gcov fails.

gcc/cp/ChangeLog:

* Make-lang.in: Add c++_FDAS
(create_fdas_for_cc1plus): Be sure that build fails if create_gcov fails.

gcc/lto/ChangeLog:

* Make-lang.in: Add lto_FDAS; enable FDA collection
(create_fdas_for_lto1): Be sure that build fails if create_gcov fails.

4 days agoImprove profile update in merge_blocks
Jan Hubicka [Wed, 1 Oct 2025 14:56:15 +0000 (16:56 +0200)] 
Improve profile update in merge_blocks

When merging blocks we currently alway use count of the first basic block.
In some cases we merge block containing call to cold noreturn function (thus
having count 0 (reliable)) with earlier block with weaker form of profile.
In this case we can still preserve reliable count of 0.

The patch also makes block merging to pick higher of the counts if quality
is the same.  This should reduce chances of losing track of hot code in broken
profiles.

gcc/ChangeLog:

* cfghooks.cc (merge_blocks): Choose more reliable or higher BB
count.

4 days agoPropagate unlikely executed BBs even on measured profiles
Jan Hubicka [Wed, 1 Oct 2025 14:51:26 +0000 (16:51 +0200)] 
Propagate unlikely executed BBs even on measured profiles

While looking into AutoFDO porfiles I noticed that sometimes we lost
precise zero counts due to inlining and merging basic blocks.  Propagating
precise zero counts should be safe even for measured profiles and thus
this patch enables it.

gcc/ChangeLog:

* predict.cc (unlikely_executed_stmt_p): Remove redundant check.
(rebuild_frequencies): Also recompute unlikely bbs when profile is
present or consistent.

4 days agotoplevel: unify the GCC and GDB/binutils .editorconfig files
Richard Earnshaw [Tue, 23 Sep 2025 16:36:20 +0000 (17:36 +0100)] 
toplevel: unify the GCC and GDB/binutils .editorconfig files

Both GCC and GDB/binutils now have root editorconfig files.  It would
make sense to unify them as this sets the general tone for these
projects.

ChangeLog:
* .editorconfig: Unify the GCC and GDB/binutils root config.

4 days agolibstdc++: Fix sizeof(wide-string)-1 bug in std::regex test
Jonathan Wakely [Wed, 1 Oct 2025 12:11:38 +0000 (13:11 +0100)] 
libstdc++: Fix sizeof(wide-string)-1 bug in std::regex test

This uses sizeof on a wide string to get the length, which is wrong
because each wchar_t is more than one byte. This was presumably copied
from a narrow char test.

libstdc++-v3/ChangeLog:

* testsuite/28_regex/basic_regex/assign/wchar_t/pstring.cc: Use
wcslen(cs) instead of sizeof(cs)-1.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
4 days agoFix off by one in range_from_loop_direction.
Andrew MacLeod [Tue, 30 Sep 2025 19:59:38 +0000 (15:59 -0400)] 
Fix off by one in range_from_loop_direction.

When bounds_of_var_in_loop was converted to range_from_loop_direction,
the final check returned FALSE when the beginning and end bounds were
the same...  The new code was using wi::gt_p, when it should have been
wi::ge_p when checking for the fail condition.

PR tree-optimization/120560
gcc/
* vr-values.cc (range_from_loop_direction): Use wi::ge_p rather
than wi::gt_p.

gcc/testsuite/
* gcc.dg/pr120560.c: New.

4 days agolibstdc++: Fix -Wmismatched-delete bug in std::unique_ptr test
Jonathan Wakely [Tue, 30 Sep 2025 11:10:15 +0000 (12:10 +0100)] 
libstdc++: Fix -Wmismatched-delete bug in std::unique_ptr test

libstdc++-v3/ChangeLog:

* testsuite/20_util/unique_ptr/modifiers/93562.cc: Define a
separate deleter for array cases.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
4 days agolibstdc++: Fix incorrect overriders in filebuf tests
Jonathan Wakely [Tue, 30 Sep 2025 16:13:03 +0000 (17:13 +0100)] 
libstdc++: Fix incorrect overriders in filebuf tests

These test facets were failing to override the members in the
std::codecvt base class.

libstdc++-v3/ChangeLog:

* testsuite/27_io/basic_filebuf/seekoff/wchar_t/9875_seekoff.cc
(Cvt::do_length): Fix signature to override virtual function in
base.
* testsuite/27_io/basic_filebuf/seekpos/wchar_t/9875_seekpos.cc:
(Cvt::do_length): Likewise.
* testsuite/27_io/basic_filebuf/underflow/char/1.cc
(NoconvCvt::do_in): Likewise.
* testsuite/27_io/basic_filebuf/underflow/wchar_t/11603.cc
(checksumcvt::do_length): Likewise.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
4 days agolibstdc++: Add missing parentheses to tests with wrong precedence
Jonathan Wakely [Tue, 30 Sep 2025 16:10:42 +0000 (17:10 +0100)] 
libstdc++: Add missing parentheses to tests with wrong precedence

These tests are currently evaluated as (err == failbit)|eofbit which is
not what we want. It should be err == (failbit|eofbit).

libstdc++-v3/ChangeLog:

* testsuite/22_locale/time_get/get/char/3.cc: Add parentheses to
x == y|z expression.
* testsuite/22_locale/time_get/get/wchar_t/3.cc: Likewise.
* testsuite/28_regex/algorithms/regex_match/multiline.cc:
Likewise.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
4 days agolibstdc++: Suppress -Wclass-memaccess warnings in bits/stl_uninitialized.h
Jonathan Wakely [Tue, 30 Sep 2025 09:49:08 +0000 (10:49 +0100)] 
libstdc++: Suppress -Wclass-memaccess warnings in bits/stl_uninitialized.h

Running the testsuite with warnings enabled gives:

FAIL: 20_util/specialized_algorithms/uninitialized_copy/58982.cc  -std=gnu++26 (test for excess errors)
Excess errors:
.../libstdc++-v3/include/bits/stl_uninitialized.h:293: warning: 'void* __builtin_memcpy(void*, const void*, long unsigned int)' writing to an object of type 'struct T' with no trivial copy-assignment; use copy-initialization instead [-Wclass-memaccess]

This is because -Wclass-memaccess warns about using memcpy on types
which have a deleted assignment, even though those can be trivially
copyable and so using memcpy on them is technically valid. Where these
warnings occur in bits/stl_uninitialized.h we're only using memcpy after
checking for trivially copyable (and any other relevant conditions) so
we can be confident that we're using it safely. We also don't actually
care about assignment here because we're only constructing new objects,
not copying over existing ones (which is what std::copy does, but not
std::uninitialized_copy).

Uses of memcpy in the C++98 code don't need to have -Wclass-memaccess
suppressed, because there are no deleted functions in C++98 so there are
no types which are trivially copyable but trigger the warning.

libstdc++-v3/ChangeLog:

* include/bits/stl_uninitialized.h (uninitialized_copy)
(uninitialized_fill, uninitialized_fill_n): Use pragmas to
suppress -Wclass-memaccess warnings.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
4 days agotree-optimization/122110 - do not reject all bit-precision reductions
Richard Biener [Wed, 1 Oct 2025 09:26:45 +0000 (11:26 +0200)] 
tree-optimization/122110 - do not reject all bit-precision reductions

We can handle bitwise-operation reductions and reductions on mask
vectors just fine.

PR tree-optimization/122110
* tree-vect-loop.cc (vectorizable_reduction): Relax restriction
to mode-precision operations.

4 days agoc: Regenerate c.opt.urls
Alejandro Colomar [Sat, 27 Sep 2025 08:20:44 +0000 (10:20 +0200)] 
c: Regenerate c.opt.urls

This was regenerated with (slightly simplified):

$ make bootstrap && make html && cd gcc && make regenerate-opt-urls;

Fixes: 33c35b7f4c18 (2025-09-26; "c, objc: Add -Wmultiple-parameter-fwd-decl-lists")
gcc/c-family/ChangeLog:

* c.opt.urls: Regenerate

Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 days agolibstdc++: Fix spelling of "Polymorphic" in a test
Jonathan Wakely [Wed, 1 Oct 2025 10:58:38 +0000 (11:58 +0100)] 
libstdc++: Fix spelling of "Polymorphic" in a test

libstdc++-v3/ChangeLog:

* testsuite/std/memory/polymorphic/copy.cc: Fix spelling of
typedef.

4 days agoFortran: Generic interface checking with use associated PDTs [PR122089]
Paul Thomas [Wed, 1 Oct 2025 07:14:00 +0000 (08:14 +0100)] 
Fortran: Generic interface checking with use associated PDTs [PR122089]

2025-10-01  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/122089
* decl.cc (gfc_get_pdt_instance): If the pdt_template is use
associated, 'module' field should be copied to this instance.

gcc/testsuite/
PR fortran/122089
* gfortran.dg/pdt_51.f03: New test.

5 days agoDaily bump.
GCC Administrator [Wed, 1 Oct 2025 00:20:51 +0000 (00:20 +0000)] 
Daily bump.

5 days agotestsuite: remove redundant import in sarif.py
David Malcolm [Tue, 30 Sep 2025 21:23:32 +0000 (17:23 -0400)] 
testsuite: remove redundant import in sarif.py

I believe I stopped using this in r16-2211-ga5d9debedd2f46.

gcc/testsuite/ChangeLog:
* lib/sarif.py: Remove import of ET.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
5 days agodiagnostics::output_spec: fix "color" in "text" output scheme
David Malcolm [Tue, 30 Sep 2025 21:23:32 +0000 (17:23 -0400)] 
diagnostics::output_spec: fix "color" in "text" output scheme

The previous refactoring highlighted that we were ignoring the "color"
key within the "text" output scheme for diagnostics.

Fixed thusly.

gcc/ChangeLog:
* diagnostics/output-spec.cc (text_scheme_handler::make_sink): Use
the value of the "color" to determine if the sink's printer is
colorized.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
5 days agodiagnostics::output_spec: refactor per-sink key-value handling
David Malcolm [Tue, 30 Sep 2025 21:23:31 +0000 (17:23 -0400)] 
diagnostics::output_spec: refactor per-sink key-value handling

No functional change intended.

gcc/ChangeLog:
* 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.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
5 days agodiagnostics::output_spec: move class scheme_handler
David Malcolm [Tue, 30 Sep 2025 21:23:31 +0000 (17:23 -0400)] 
diagnostics::output_spec: move class scheme_handler

Simplification; no functional change intended.

gcc/ChangeLog:
* diagnostics/output-spec.cc: Move class scheme_handler out from
inside class output_factory.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
5 days agodiagnostics: simplifying output-spec.cc
David Malcolm [Tue, 30 Sep 2025 21:23:31 +0000 (17:23 -0400)] 
diagnostics: simplifying output-spec.cc

No functional change intended.

gcc/ChangeLog:
* 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.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
5 days agoc: Fix regression related to DECL_NONLOCAL on aarch64 [PR121933]
Martin Uecker [Sat, 13 Sep 2025 06:37:32 +0000 (08:37 +0200)] 
c: Fix regression related to DECL_NONLOCAL on aarch64 [PR121933]

The recent patch r16-3747-gafa74d37e81 to detect the use of non-local
context by nested functions caused regressions on aarch64, because
DECL_NONLOCAL was set on labels.  Fix this by setting it only to
the same types of decls as before.

PR target/121933

gcc/c/ChangeLog:
* c-typeck.cc (mark_decl_used): Set DECL_NONLOCAL
only for VAR_DECL, FUNC_DECL, PARM_DECL.

5 days agolibstdc++: std::inplace_vector implementation cleaup
François Dumont [Mon, 22 Sep 2025 16:54:46 +0000 (18:54 +0200)] 
libstdc++: std::inplace_vector implementation cleaup

Remove duplicated std::swap implementation.

libstdc++-v3/ChangeLog

* 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.

5 days agofmv: Redirect to specific target
Alfie Richards [Mon, 14 Apr 2025 14:11:29 +0000 (14:11 +0000)] 
fmv: Redirect to specific target

Adds an optimisation in FMV to redirect to a specific target if possible.

A call is redirected to a specific target if both:
- the caller can always call the callee version
- and, it is possible to rule out all higher priority versions of the callee
  fmv set. That is estabilished either by the callee being the highest priority
  version, or each higher priority version of the callee implying that, were it
  resolved, a higher priority version of the caller would have been selected.

For this logic, introduces the new TARGET_OPTION_FUNCTIONS_B_RESOLVABLE_FROM_A
hook. Adds a full implementation for Aarch64, and a weaker default version
for other targets.

This allows the target to replace the previous optimisation as the new one is
able to cover the same case where two function sets implement the same versions.

gcc/ChangeLog:

* 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.

gcc/testsuite/ChangeLog:

* 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.

5 days agoFix various comment typos
Jakub Jelinek [Tue, 30 Sep 2025 14:11:56 +0000 (16:11 +0200)] 
Fix various comment typos

The following patch fixes various comment typos.

2025-09-30  Jakub Jelinek  <jakub@redhat.com>

gcc/
* 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.
gcc/testsuite/
* gcc.dg/vect/tsvc/vect-tsvc-s1244.c (s1244): Fix comment typo,
ture -> true.
* gcc.dg/vect/tsvc/vect-tsvc-s2244.c (s2244): Likewise.

5 days agoFix discriminators of gimple PHI arguments
Jan Hubicka [Tue, 30 Sep 2025 12:51:39 +0000 (14:51 +0200)] 
Fix discriminators of gimple PHI arguments

while gimple PHI itself does not have locations, the arguments does and they
can be used to determine count of edges in CFG.  Assign_discriminators already
knows how to handle goto_locus and PHI args should be handled same way as
done by this patch.

Bootstrapped/regtested x86_64-linux, comitted.

gcc/ChangeLog:

* 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.

5 days agoFix overflow in ipa_profile_generate_summary
Jan Hubicka [Tue, 30 Sep 2025 11:07:53 +0000 (13:07 +0200)] 
Fix overflow in ipa_profile_generate_summary

With profile count scaling we now get overflow in ipa_profile_generate_summary
which uses old macro GCOV_COMPUTE_SCALE that is not ready for very large
counts.  This patch replaces remaining two uses of it by (somewhat elaborate)
profile-count based equivalent which is overflow safe.

gcc/ChangeLog:

* 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.

5 days agoRestrict what kind of statements are used for auto-profile
Jan Hubicka [Mon, 29 Sep 2025 22:22:48 +0000 (00:22 +0200)] 
Restrict what kind of statements are used for auto-profile

When building profile of walk_tree_1 during autoprofiledbootstrap we produce
non-zero counts to call of tree_check_failed because location of INLINE_ENTRY
debug statement is misplaced.  Auto-profile already knows it should skip
clobbers since their locations will never go into debug info.  This patch extend
it to all kind of debug statement except for DEBUG_BEGIN_STMT, nops, labels
and predict.

autoprofilebootstrapped/regtested x86_64-linux.

gcc/ChangeLog:

* 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.

5 days agoAda: Fix internal error on ill-formed Reduce attribute in Ada 2022
Eric Botcazou [Tue, 30 Sep 2025 09:55:18 +0000 (11:55 +0200)] 
Ada: Fix internal error on ill-formed Reduce attribute in Ada 2022

This is an internal error on the new Reduce attribute of Ada 2022 when the
programmer swaps its arguments(!)  The change makes it so that the compiler
gives an error message instead.

gcc/ada/
PR ada/117517
* sem_attr.adb (Resolve_Attribute) <Attribute_Reduce>: Try to
resolve the reducer first.  Fix casing of error message.

gcc/testsuite/
* gnat.dg/reduce1.adb: New test.

5 days agolibgcc, bitint: do not use softfp_wrap for bitint and add build option
Andre Vieira [Tue, 30 Sep 2025 09:57:58 +0000 (10:57 +0100)] 
libgcc, bitint: do not use softfp_wrap for bitint and add build option

This patch circumvents the softfp_wrap for bitint functions in libgcc as certain
ports, like arm, can use softfp_wrap to distinquigh between targets they want to
use specialized assembly functions for and targets that they use the soft-fp
C implementations for.  This is an orthogonal choice to the use of the soft-fp
C implementations for bitint conversions.

This patch also adds extra options to build bitint soft-fp functions, this is
needed by the arm port to build HF bitint conversion functions.

libgcc/ChangeLog:

* config/t-softfp: Don't use softfp_wrap for bitint functions.
(softfp_cflags): New parameter that is passed to the building of bitint
functions.

5 days agobitint: fix inconsistency in bitint_precision_kind
Andre Vieira [Tue, 30 Sep 2025 09:57:46 +0000 (10:57 +0100)] 
bitint: fix inconsistency in bitint_precision_kind

This patch fixes an issue where the first call to bitint_precision_kind would
return the bitint kind, which was also inconsistent with subsequent calls with
the same bitint size.

gcc/ChangeLog:

* gimple-lower-bitint.cc (bitint_precision_kind): Fix inconsistency in
results between first and consecutive calls to this function.

5 days agoFortran: ICE in derived type with a PDT component [PR102241,PR105380]
Paul Thomas [Tue, 30 Sep 2025 08:24:11 +0000 (09:24 +0100)] 
Fortran: ICE in derived type with a PDT component [PR102241,PR105380]

2025-09-30  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
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.

gcc/testsuite/
PR fortran/105380
* gfortran.dg/pdt_49.f03: New test.

PR fortran/102241
* 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.

6 days agoDaily bump.
GCC Administrator [Tue, 30 Sep 2025 00:21:09 +0000 (00:21 +0000)] 
Daily bump.

6 days agoada: Remove references to ASIS, explain PolyORB status.
Tonu Naks [Thu, 18 Sep 2025 09:24:47 +0000 (09:24 +0000)] 
ada: Remove references to ASIS, explain PolyORB status.

gcc/ada/ChangeLog:

* doc/gnat_rm/implementation_advice.rst: PolyORB
* doc/gnat_rm/implementation_defined_characteristics.rst: PolyORB
* doc/gnat_rm/implementation_defined_pragmas.rst: ASIS
* doc/gnat_rm/obsolescent_features.rst: PolyORB
* doc/gnat_rm/specialized_needs_annexes.rst: PolyORB
* doc/gnat_rm/the_gnat_library.rst: PolyORB
* doc/gnat_ugn/building_executable_programs_with_gnat.rst: ASIS
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.

6 days agoada: Improve error for pre/post on generic formal subprogram in Ada 2012 mode
Piotr Trojanek [Thu, 24 Jul 2025 08:20:40 +0000 (10:20 +0200)] 
ada: Improve error for pre/post on generic formal subprogram in Ada 2012 mode

Instead of saying that pragma placement is illegal, we now say that it
would be legal in Ada 2022.

gcc/ada/ChangeLog:

* sem_prag.adb (Analyze_Pre_Post_Condition): Handle contracts on
generic formal subprograms like on declarations of access-to-subprogram
types.

6 days agoada: Add special-case for 'Constrained on stand-alone objects in SPARK
Piotr Trojanek [Tue, 15 Jul 2025 13:18:26 +0000 (15:18 +0200)] 
ada: Add special-case for 'Constrained on stand-alone objects in SPARK

GNAT relies on standalone objects of indefinite, non-class-wide types getting a
constrained itypes; GNATprove relies on the same objects keeping their nominal,
unconstrained types. None of that can be simply changed, so instead we carry
this different handling to routine which provides the value of attribute
Constrained.

gcc/ada/ChangeLog:

* exp_util.adb (Attribute_Constrained_Static_Value): Special case
stand-alone objects for GNATprove.

6 days agoada: Fix error message about limited extensions
Ronan Desplanques [Tue, 16 Sep 2025 08:12:29 +0000 (10:12 +0200)] 
ada: Fix error message about limited extensions

Consider the following package:

    package P is
       type T1 is tagged limited null record;

       type T2 is new T1 with private;
    private

       type T2 is limited new T1 with null record;
    end P;

It should be rejected because of ARM 7.3 (10.1/3). Before this patch,
GNAT did reject it, with the following error message:

    full view of non-limited extension cannot be limited

This message is not right because the partial view of T2 here *is*
limited even if it doesn't have an explicit limited keyword in its
declaration. This patch changes the error message to something that's a
better match for ARM 7.3 (10.1/3).

This patch also tweaks another related error message and substitutes
a mention of ARM 7.3 (10.1/3) for the Ada Issue it originated from in a
comment.

gcc/ada/ChangeLog:

* sem_ch3.adb (Process_Full_View): Fix error message.

6 days agoada: Unsigned_Base_Range aspect (part 4)
Javier Miranda [Tue, 16 Sep 2025 10:50:45 +0000 (10:50 +0000)] 
ada: Unsigned_Base_Range aspect (part 4)

Disable this feature; more work needed.

gcc/ada/ChangeLog:

* aspects.adb (Get_Aspect_Id): Return No_Aspect for Unsigned_Base_Range
name.
* sem_prag.adb (Analyze_Pragma): Disable pragma Unsigned_Base_Range.
* par-ch4.adb (Scan_Apostrophe): Disable attribute Unsigned_Base_Range.
* doc/gnat_rm/gnat_language_extensions.rst: Remove documentation
of aspect unsigned base range.
* gnat_rm.texi: Regenerate.

6 days agoada: exp_ch6.adb: entirely disable call validation in CodePeer_Mode
Ghjuvan Lacambre [Tue, 16 Sep 2025 10:11:18 +0000 (12:11 +0200)] 
ada: exp_ch6.adb: entirely disable call validation in CodePeer_Mode

This call validation was introduced a couple of months ago and caused
GNAT2SCIL to fail a lot. It was determined that while being invalid for
GCC, the tree was valid for GNAT2SCIL. Since it was thought that only
the checking of the return type caused issue for CodePeer_Mode, this is
the only part that disabled. Recent changes revealed that there also
exists differences in the AST expected by GCC and GNAT2SCIL, and that
checking the actuals also causes issues for GNAT2SCIL. We hence entirely
disable the checking of calls in CodePeer_Mode instead of just the
checking of return values.

gcc/ada/ChangeLog:

* exp_ch6.adb (Validate_Subprogram_Calls): Do not Check_Calls in CodePeer_Mode.
(Check_Calls): Remove CodePeer_Mode special case.

6 days agoada: Update the GNAT RM with assertion level documentation
Viljar Indus [Mon, 15 Sep 2025 11:51:13 +0000 (14:51 +0300)] 
ada: Update the GNAT RM with assertion level documentation

* Add an entry for pragma Assertion Level.
* Point all assertion kind pragmas that support assertion level
  associations to the relevant section in the SPARK RM.

gcc/ada/ChangeLog:

* doc/gnat_rm/implementation_defined_pragmas.rst: update
rules for pragmas affected by assertion levels.
* gnat_rm.texi: Regenerate.

6 days agoada: Update the condition for ghost call arguments
Viljar Indus [Tue, 9 Sep 2025 12:00:56 +0000 (15:00 +0300)] 
ada: Update the condition for ghost call arguments

The SPARK RM specifies that the levels between the argument and
the call shall have the same level.

gcc/ada/ChangeLog:

* ghost.adb (Check_Procedure_Call_Policies): Update the check
between the levels of the argument and the call.

6 days agoMIPS/testsuite: add testcase for -fpatchable-function-entry=2,1
YunQiang Su [Mon, 29 Sep 2025 02:28:02 +0000 (10:28 +0800)] 
MIPS/testsuite: add testcase for -fpatchable-function-entry=2,1

gcc/testsuite/ChangeLog:
* gcc.target/mips/pr99217-2.c: New test.

7 days agoDaily bump.
GCC Administrator [Mon, 29 Sep 2025 00:19:11 +0000 (00:19 +0000)] 
Daily bump.

7 days agolibbacktrace: recognize PE bigobj objects at configure time
Ian Lance Taylor [Sun, 28 Sep 2025 21:42:49 +0000 (14:42 -0700)] 
libbacktrace: recognize PE bigobj objects at configure time

Patch from Christopher Wellons.

* filetype.awk: Recognize PE bigobj objects at configure time.

7 days agoDeprecate -mstore-max= and related tuning.
liuhongt [Wed, 24 Sep 2025 02:55:50 +0000 (19:55 -0700)] 
Deprecate -mstore-max= and related tuning.

For memset, the size of used vector is decided by MIN(MOVE_MAX_PIECES,
STORE_MAX_PIECES).
Unless there's u-arch prefer big size vector for memcpy and small size
vector for memset, there's no need to have a separate option or tune
for it.
In general, x86 backend always prefer big size vector for memset due
to STLF issue.

gcc/ChangeLog:

PR target/121970
* config/i386/i386-options.cc (ix86_target_string): Remove
store_max.
(ix86_debug_options): Ditto.
(ix86_function_specific_print): Ditto.
(ix86_valid_target_attribute_tree): Ditto.
(ix86_option_override_internal): Ditto.
* config/i386/i386-expand.cc (ix86_expand_builtin): Ditto.
* config/i386/i386-options.h (ix86_target_string): Ditto.
* config/i386/i386.h (MOVE_MAX): Ditto.
(STORE_MAX_PIECES): Set by move_max.
* config/i386/i386.opt: Deprecate mmove-max=.
* config/i386/x86-tune.def (X86_TUNE_AVX256_STORE_BY_PIECES):
Removed.
(X86_TUNE_AVX512_STORE_BY_PIECES): Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pieces-memcmp-2.c: Remove mstore-max.
* gcc.target/i386/pieces-memcpy-19.c: Ditto.
* gcc.target/i386/pieces-memcpy-20.c: Ditto.
* gcc.target/i386/pr104610.c: Ditto.
* gcc.target/i386/pieces-memset-47.c: Scan warning for
mstore-max deprecation.
* gcc.target/i386/pieces-memset-48.c: Change mstore-max to mmove-max.
* gcc.target/i386/pr121410.c: Ditto.
* gcc.target/i386/pieces-memset-11.c: Change
avx256_store_by_pieces to avx256_move_by_pieces.
* gcc.target/i386/pieces-memset-14.c: Ditto.
* gcc.target/i386/pieces-memset-2.c: Ditto.
* gcc.target/i386/pieces-memset-20.c: Ditto.
* gcc.target/i386/pieces-memset-23.c: Ditto.
* gcc.target/i386/pieces-memset-29.c: Ditto.
* gcc.target/i386/pieces-memset-30.c: Ditto.
* gcc.target/i386/pieces-memset-33.c: Ditto.
* gcc.target/i386/pieces-memset-34.c: Ditto.
* gcc.target/i386/pieces-memset-37.c: Ditto.
* gcc.target/i386/pieces-memset-44.c: Ditto.
* gcc.target/i386/pieces-memset-5.c: Ditto.
* gcc.target/i386/pr100865-10a.c: Ditto.
* gcc.target/i386/pr100865-4a.c: Ditto.
* gcc.target/i386/pr90773-20.c: Ditto.
* gcc.target/i386/pr90773-21.c: Ditto.
* gcc.target/i386/pr90773-22.c: Ditto.
* gcc.target/i386/pr90773-23.c: Ditto.
* g++.target/i386/pr80566-1.C: Ditto.
* gcc.target/i386/pieces-memset-45.c: Change
avx512_store_by_pieces to avx512_move_by_pieces.

7 days agodiagnostics: Fix mojibake from displaying UTF-8 on Windows consoles
Peter Damianov [Fri, 19 Sep 2025 19:02:37 +0000 (20:02 +0100)] 
diagnostics: Fix mojibake from displaying UTF-8 on Windows consoles

UTF-8 characters in diagnostic output (such as the warning emoji ⚠️
used by fanalyzer) display as mojibake on Windows unless the utf8
code page is being used

This patch adds UTF-8 to UTF-16 conversion when outputting to a console
on Windows.

gcc/ChangeLog:
* pretty-print.cc (decode_utf8_char): Move forward declaration.
(mingw_utf8_str_to_utf16_str): New function to convert UTF-8 to UTF-16.
(is_console_handle): New function to detect Windows console handles.
(write_all): Add UTF-8 to UTF-16 conversion for console output,
falling back to WriteFile for ASCII strings and regular files.

Signed-off-by: Peter Damianov <peter0x44@disroot.org>
Signed-off-by: Jonathan Yong <10walls@gmail.com>
8 days agoDaily bump.
GCC Administrator [Sun, 28 Sep 2025 00:19:51 +0000 (00:19 +0000)] 
Daily bump.

8 days agolibstdc++: Fix -Wmaybe-uninitialized warnings in testsuite
Jonathan Wakely [Sat, 27 Sep 2025 11:14:28 +0000 (12:14 +0100)] 
libstdc++: Fix -Wmaybe-uninitialized warnings in testsuite

These are false positives, but we might as well just value-init the
variables to avoid the warnings.

libstdc++-v3/ChangeLog:

* testsuite/20_util/allocator_traits/members/allocate_hint.cc:
Value-initialize variables to avoid -Wmaybe-uninitialized
warning.
* testsuite/20_util/allocator_traits/members/allocate_hint_nonpod.cc:
Likewise.
* testsuite/20_util/duration/114244.cc: Likewise.
* testsuite/20_util/duration/io.cc: Likewise.

8 days agolibstdc++: Fix some -Wsign-compare warnings in headers
Jonathan Wakely [Sat, 27 Sep 2025 11:47:45 +0000 (12:47 +0100)] 
libstdc++: Fix some -Wsign-compare warnings in headers

In all these cases we know the value with signed type is not negative so
the cast is safe.

libstdc++-v3/ChangeLog:

* include/bits/deque.tcc (deque::_M_shrink_to_fit): Cast
difference_type to size_type to avoid -Wsign-compare warning.
* include/std/spanstream (basic_spanbuf::seekoff): Cast
streamoff to size_t to avoid -Wsign-compare warning.

8 days agolibstdc++: Fix VERIFY(idx = 1) bugs in tests
Jonathan Wakely [Fri, 26 Sep 2025 14:02:43 +0000 (15:02 +0100)] 
libstdc++: Fix VERIFY(idx = 1) bugs in tests

These should be checking for equality, not performing assignments.

The tests for from_range on associative containers were actually
checking the wrong thing, but the bug in the is_equal function was
making the incorrect checks pass anyway, because all the values being
used were non-zero, so the result of lhs.id = rhs.id was true, but would
have been false if lhs.id == rhs.id had been used as intended.

libstdc++-v3/ChangeLog:

* testsuite/21_strings/basic_string/numeric_conversions/char/stoi.cc:
Fix assignment used instead of equality comparison.
* testsuite/21_strings/basic_string/numeric_conversions/char/stol.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/char/stoll.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/char/stoul.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/char/stoull.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoi.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stol.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoll.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoul.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoull.cc:
Likewise.
* testsuite/23_containers/map/cons/from_range.cc: Fix is_equal
function and expected value of comparison functions after
construction.
* testsuite/23_containers/multimap/cons/from_range.cc: Likewise.
* testsuite/23_containers/multiset/cons/from_range.cc: Likewise.
* testsuite/23_containers/set/cons/from_range.cc: Likewise.
* testsuite/23_containers/unordered_map/cons/from_range.cc: Fix
is_equal functions.
* testsuite/23_containers/unordered_multimap/cons/from_range.cc:
Likewise.
* testsuite/23_containers/unordered_multiset/cons/from_range.cc:
Likewise.
* testsuite/23_containers/unordered_set/cons/from_range.cc:
Likewise.
* testsuite/25_algorithms/minmax/constrained.cc: Fix assignment
used instead of equality comparison.
* testsuite/27_io/manipulators/extended/get_time/wchar_t/1.cc:
Likewise.

8 days agoMIPS/testsuite: Use isa_rev=2 instead of >=2
YunQiang Su [Sat, 27 Sep 2025 14:24:49 +0000 (22:24 +0800)] 
MIPS/testsuite: Use isa_rev=2 instead of >=2

So that they won't fail for r6 targets.

gcc/testsuite/ChangeLog:
* gcc.target/mips/mips16e2.c: Use isa_rev=2 instead of >=2.
* gcc.target/mips/mips16e2-cache.c: Ditto.
* gcc.target/mips/mips16e2-cmov.c: Ditto.
* gcc.target/mips/mips16e2-gp.c: Ditto.

8 days agoMIPS: Fix the issue with the '-fpatchable-function-entry=' feature.
ChengLulu [Tue, 9 Sep 2025 11:19:04 +0000 (19:19 +0800)] 
MIPS: Fix the issue with the '-fpatchable-function-entry=' feature.

PR target/99217

gcc/ChangeLog:

* config/mips/mips.cc (mips_start_function_definition):
Implements the functionality of '-fpatchable-function-entry='.
(mips_print_patchable_function_entry): Define empty function.
(TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY): Define macro.

gcc/testsuite/ChangeLog:

* gcc.target/mips/pr99217.c: New test.

8 days agoc++: concepts and conversions [PR112632]
Jason Merrill [Tue, 23 Sep 2025 10:19:49 +0000 (11:19 +0100)] 
c++: concepts and conversions [PR112632]

One case missed in my fix for this PR: Here we were omitting the
IMPLICIT_CONV_EXPR that expresses the conversion from int to char because
the target type was non-dependent and the argument was not type-dependent.
But we still need it if the argument is value-dependent.

PR c++/112632

gcc/cp/ChangeLog:

* pt.cc (convert_template_argument): Also force IMPLICIT_CONV_EXPR
if the argument is value-dependent.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/concepts-conv4.C: New test.

8 days agoc++: add testcase [PR121854]
Jason Merrill [Fri, 26 Sep 2025 12:51:33 +0000 (13:51 +0100)] 
c++: add testcase [PR121854]

Add the testcase for this GCC 15 PR, already fixed on trunk by r16-970.

PR c++/121854

gcc/testsuite/ChangeLog:

* g++.dg/cpp23/explicit-obj-lambda19.C: New test.

8 days agoc++: implicit 'this' in generic lambda [PR122048]
Jason Merrill [Wed, 24 Sep 2025 21:31:37 +0000 (22:31 +0100)] 
c++: implicit 'this' in generic lambda [PR122048]

Here template substitution was replacing a reference to the 'this' of X::f
with the implicit closure parameter of the operator(), which is wrong.  The
closure parameter is never a suitable replacement for a 'this' parameter.

PR c++/122048

gcc/cp/ChangeLog:

* pt.cc (tsubst_expr): Don't use a lambda current_class_ptr.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1y/lambda-generic-this6.C: New test.

8 days agoMIPS: Add conditions for use of the -mmips16e2 and -mips16 option.
Jie Mei [Fri, 17 Jan 2025 08:51:45 +0000 (16:51 +0800)] 
MIPS: Add conditions for use of the -mmips16e2 and -mips16 option.

Changes from V1:
* Raise the minimal revision to r2.

MIPS16e2 ASE is a superset of MIPS16e ASE, which is again a superset
of MIPS16 ASE. Later, all of them are forbidden in Release 6.

Make -mmips16e2 imply -mips16 as the ASE requires, so users won't
be surprised even if they expect it to. Meanwhile, check if
mips_isa_rev <= 5 when -mips16 is effective and >= 2 when -mmips16e2
is effective.

Co-developed-by: Rong Zhang <rongrong@oss.cipunited.com>
Signed-off-by: Rong Zhang <rongrong@oss.cipunited.com>
gcc/ChangeLog:
* config/mips/mips.cc(mips_option_override):Add conditions
for use of the -mmips16e2 and -mips16 option.

gcc/testsuite/ChangeLog:
* gcc.target/mips/mips16e2-cache.c: Use isa_rev>=2 instead of
-mips32r2 and remove -mips16 option.
* gcc.target/mips/mips16e2-cmov.c: Add isa_rev>=2 and remove
-mips16 option.
* gcc.target/mips/mips16e2-gp.c: Same as above.
* gcc.target/mips/mips16e2.c: Same as above.

8 days agoFortran: Revert r16-4069 causing memory leaks in f951 [PR87908]
Paul Thomas [Sat, 27 Sep 2025 07:01:30 +0000 (08:01 +0100)] 
Fortran: Revert r16-4069 causing memory leaks in f951 [PR87908]

2025-09-27  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/87908
* interface.cc (check_interface0): Revert changes.

gcc/testsuite/
PR fortran/87908
* gfortran.dg/pr87908.f90: Delete.

8 days agoMIPS: Add MSUBF.fmt instruction for MIPSr6
Jie Mei [Sat, 14 Sep 2024 07:04:09 +0000 (15:04 +0800)] 
MIPS: Add MSUBF.fmt instruction for MIPSr6

GCC currently uses two instructions (NEG.fmt and MADDF.fmt) for
operations like `x - (y * z)' for MIPSr6. We can further tune this by
using only MSUBF.fmt instead of those two.

This patch adds MSUBF.fmt instrutions with corresponding tests.

gcc/ChangeLog:

* config/mips/mips.md (fms<mode>4): Generates MSUBF.fmt
instructions.
(*fms<mode>4_msubf): Same as above.
(fnma<mode>4): Same as above.
(*fnma<mode>4_msubf): Same as above.

gcc/testsuite/ChangeLog:

* gcc.target/mips/mips-msubf.c: New tests for MIPSr6.

9 days agoDaily bump.
GCC Administrator [Sat, 27 Sep 2025 00:18:25 +0000 (00:18 +0000)] 
Daily bump.

9 days agoc, objc: Add -Wmultiple-parameter-fwd-decl-lists
Alejandro Colomar [Fri, 26 Sep 2025 19:27:28 +0000 (19:27 +0000)] 
c, objc: Add -Wmultiple-parameter-fwd-decl-lists

Warn about this:

void f(int x; int x; int x);

Add a new diagnostic, -Wmultiple-parameter-fwd-decl-lists, which
diagnoses uses of this obsolescent syntax.

Add this diagnostic in -Wextra.

Forward declarations of parameters are very rarely used.  And functions
that need two forward declaractions of parameters are also quite rare.
This combination results in this code almost not existing in any code
base, which makes adding this to -Wextra okay.  FWIW, I've tried finding
such code using a code search engine, and didn't find any cases (but the
regex for that isn't easy to writei, so I wouldn't trust it).

gcc/c-family/ChangeLog:

* c.opt: Add -Wmultiple-parameter-fwd-decl-lists

gcc/c/ChangeLog:

* c-decl.cc (c_scope): Rename {warned > had}_forward_parm_decls.
(mark_forward_parm_decls): Add
-Wmultiple-parameter-fwd-decl-lists.

gcc/ChangeLog:

* doc/extend.texi: Clarify documentation about lists of
parameter forward declarations, and mention that more than one
of them are unnecessary.
* doc/invoke.texi: Document the new
-Wmultiple-parameter-fwd-decl-lists.

gcc/testsuite/ChangeLog:

* gcc.dg/Wmultiple-parameter-fwd-decl-lists.c: New test.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 days agoFortran: fix uninitialized read in testcase gfortran.dg/pdt_48.f03
Harald Anlauf [Fri, 26 Sep 2025 17:20:39 +0000 (19:20 +0200)] 
Fortran: fix uninitialized read in testcase gfortran.dg/pdt_48.f03

Running the testcase using valgrind --leak-check=full --track-origins=yes:

==28585== Conditional jump or move depends on uninitialised value(s)
==28585==    at 0x400E19: MAIN__ (pdt_48.f03:48)
==28585==    by 0x400EDB: main (pdt_48.f03:34)
==28585==  Uninitialised value was created by a heap allocation
==28585==    at 0x4841984: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==28585==    by 0x400975: __pdt_m_MOD_add (pdt_48.f03:30)
==28585==    by 0x400D84: MAIN__ (pdt_48.f03:44)
==28585==    by 0x400EDB: main (pdt_48.f03:34)

The cause was a partial initialization of a vector used in a subsequent
addition.  Initialize the remaining elements of the first vector by zero.

gcc/testsuite/ChangeLog:

* gfortran.dg/pdt_48.f03:

9 days agoFix precise 0 handling in afdo_propagate_edge
Jan Hubicka [Fri, 26 Sep 2025 13:57:03 +0000 (15:57 +0200)] 
Fix precise 0 handling in afdo_propagate_edge

Currently afdo_propagate_edge will turn precise 0 to autofdo 0 because it thinks
auto-profile claims some samples has been executed in the given basic block, while
this is only a consequence of < being defined by
 0 (predise) < 0 (autofdo)

gcc/ChangeLog:

* auto-profile.cc (afdo_propagate_edge): Fix handling of precize 0
counts.

9 days agoamdgcn: Remove vector alignment restrictions
Andrew Stubbs [Wed, 24 Sep 2025 11:58:23 +0000 (11:58 +0000)] 
amdgcn: Remove vector alignment restrictions

The supported misalignment logic seems to be a bit arbitrary.  Some of it looks
like it was copied from the Arm implementation, although testing shows that the
packed accesses do not work (weird subregs happen).

AMD GCN does have some alignment restrictions on Buffer instructions, but as we
don't use those that's irrelvant.  The Flat and Global instructions (that we do
use) have no such restrictions.

LDS memory -- which can be accessed via Flat instructions -- does have
alignment restrictions, but the compiler is not using LDS for arbitrary
vectors.  If the user deliberately choses to place unaligned data in
low-latency memory then a runtime exception should occur (no silent bad
behaviour), so there's no reason to pessimise the normal case.

gcc/ChangeLog:

* config/gcn/gcn.cc
(gcn_vectorize_support_vector_misalignment): Allow any alignment, as
long as it's not packed.

9 days agoc: Give permerror for excess braces in scalar initializers [PR88642]
Joseph Myers [Fri, 26 Sep 2025 11:12:12 +0000 (11:12 +0000)] 
c: Give permerror for excess braces in scalar initializers [PR88642]

As noted in bug 88642, the C front end fails to give errors or
pedwarns for scalar initializers with too many levels of surrounding
braces.  There is a warning for redundant braces around a scalar
initializer within a larger braced initializer (valid for a single
such level within a structure, union or array initializer; not valid
for more than one such level, or where the outer layer of braces is
itself for a scalar, either redundant braces themselves or part of a
compound literal), but this never becomes an error even for invalid
cases.  Check for this case and turn the warning into a permerror when
there are more levels of braces than permitted.  The existing warning
is unchanged for a single (permitted) level of redundant braces around
a scalar initializer inside a structure, union or array initializer,
and it's also unchanged that no such warning is given for a single
(permitted) level of redundant braces around a top-level scalar
initializer.

Technically this is a C2y issue (these rules on valid initializers
moved into Constraints as a result of N3346, accepted in Minneapolis;
previously, as a "shall" outside constraints, violating these rules
resulted in compile-time undefined behavior without requiring a
diagnostic).

Hopefully little code is actually relying on not getting an error
here.  In view of gcc.dg/tree-ssa/ssa-dse-10.c showing that at least
some code may be using such over-braced initializers (initializer of
pubKeys at line 1167 in that test; I'm not at all sure how that
initializer ends up getting interpreted to translate it to something
equivalent but properly structured), this is made a permerror rather
than a hard error, so -fpermissive (as already used by that test) can
be used to disable the error (the default -fpermissive for old
standards modes is not a problem given that before C2y this is
undefined behavior not a constraint violation).

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

PR c/88642

gcc/c/
* c-typeck.cc (constructor_braced_scalar): New variable.
(struct constructor_stack): Add braced_scalar field.
(really_start_incremental_init): Handle constructor_braced_scalar
and braced_scalar field.
(push_init_level): Handle constructor_braced_scalar and
braced_scalar field.  Give permerror rather than warning for
nested braces around scalar initializer.
(pop_init_level): Handle constructor_braced_scalar and
braced_scalar field.

gcc/testsuite/
* gcc.dg/c2y-init-1.c: New test.

9 days agoFix integer overflow in profile_count::probability_in
Jan Hubicka [Fri, 26 Sep 2025 10:39:07 +0000 (12:39 +0200)] 
Fix integer overflow in profile_count::probability_in

This patch fixes integer overflow in profile_count::probability_in which happens
for very large counts.  This was probably not that common in practice until
scaled AutoFDO profiles were intorduces.

This was introduced as cut&paste from profile_probability implementation.
I reviewed multiplicaitons in the file for safety and noticed that in some
cases the code is over-protective. In profile_probability::operator/ we alrady
scale that m_val <= other.m_val and thus we know result will be in the range
0...max_probability.  In profile_probability::apply_scale we deal with 30bit
value from profile_probability so no overflow can happen.

gcc/ChangeLog:

* profile-count.h (profile_probability::operator/): Do not cap
twice.
(profile_probability::operator/=): Likewise.
(profile_probability::apply_scale): Do not watch for overflow.
(profile_count::probability_in): Watch overflow.

9 days agolibstdc++: Reuse predicates in std::search and std::is_permutation
Jonathan Wakely [Wed, 10 Sep 2025 09:10:07 +0000 (10:10 +0100)] 
libstdc++: Reuse predicates in std::search and std::is_permutation

Hoist construction of the call wrappers out of the loop when we're
repeatedly creating a call wrapper with the same bound arguments.

We need to be careful about iterators that return proxy references,
because bind1st(pred, *first) could bind a reference to a prvalue proxy
reference returned by *first. That would then be an invalid reference by
the time we invoked the call wrapper.

If we dereference the iterator first and store the result of that on the
stack, then we don't have a prvalue proxy reference, and can bind it (or
the value it refers to) into the call wrapper:

  auto&& val = *first; // lifetime extension
  auto wrapper = bind1st(pred, val);
  for (;;)
    /* use wrapper */;

This ensures that the reference returned from *first outlives the call
wrapper, whether it's a proxy reference or not.

For C++98 compatibility in __search we can use __decltype(expr) instead
of auto&&.

libstdc++-v3/ChangeLog:

* include/bits/stl_algobase.h (__search, __is_permutation):
Reuse predicate instead of creating a new one each time.
* include/bits/stl_algo.h (__is_permutation): Likewise.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
9 days agolibstdc++: Simplify std::erase functions for sequence containers
Jonathan Wakely [Fri, 19 Sep 2025 15:03:11 +0000 (16:03 +0100)] 
libstdc++: Simplify std::erase functions for sequence containers

This removes the use of std::ref that meant that __remove_if used an
indirection through the reference, which might be a pessimization. Users
can always use std::ref to pass expensive predicates into erase_if, but
we shouldn't do it unconditionally. We can std::move the predicate so
that if it's not cheap to copy and the user didn't use std::ref, then we
try to use a cheaper move instead of a copy.

There's no reason that std::erase shouldn't just be implemented by
forwarding to std::erase_if. I probably should have done that in
r12-4083-gacf3a21cbc26b3 when std::erase started to call __remove_if
directly.

libstdc++-v3/ChangeLog:

* include/std/deque (erase_if): Move predicate instead of
wrapping with std::ref.
(erase): Forward to erase_if.
* include/std/inplace_vector (erase_if, erase): Likewise.
* include/std/string (erase_if, erase): Likewise.
* include/std/vector (erase_if, erase): Likewise.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
9 days agolibstdc++: Eliminate __gnu_cxx::__ops function objects
Jonathan Wakely [Fri, 13 Jun 2025 16:27:51 +0000 (17:27 +0100)] 
libstdc++: Eliminate __gnu_cxx::__ops function objects

This removes the indirect functors from <bits/predefined_ops.h> that are
used by our STL algorithms. Currently we wrap all predicates and values
into callables which accept iterator arguments, and automatically
dereference the iterators. With this change we no longer do that
dereferencing and so all predicates are passed values not iterators, and
the algorithms that invoke those predicates must dereference the
iterators.

This avoids wrapping user-provided predicates into another predicate
that does the dereferencing. User-provided predicates are now passed
unchanged to our internal algos like __search_n. For the overloads that
take a value instead of a predicate, we still need to create a predicate
that does comparison to the value, but we can now use std::less<void>
and std::equal_to<void> as the base predicate and bind the value to
those base predicates.

Because the "transparent operators" std::less<void> and
std::equal_to<void> were not added until C++14, this change defines
those explicit specializations unconditionally for C++98 and C++11 too
(but the default template arguments that make std::less<> and
std::equal_to<> refer to those specializations are still only present
for C++14 and later, because we don't need to rely on those default
template arguments for our internal uses).

When binding a predicate and a value into a new call wrapper, we now
decide whether to store the predicate by value when it's an empty type
or a scalar (such as a function pointer). This avoids a
double-indirection through function pointers, and avoids storing and
invoking stateless empty functors through a reference. For C++11 and
later we also use [[no_unique_address]] to avoid wasted storage for
empty predicates (which includes all standard relational ops, such as
std::less).

The call wrappers in bits/predefined_ops.h all have non-const operator()
because we can't be sure that the predicates they wrap are
const-invocable. The requirements in [algorithms.requirements] for
Predicate and BinaryPredicate template arguments require pred(*i) to be
valid, but do not require that std::to_const(pred)(*i) has to be valid,
and similarly for binary_pred.

libstdc++-v3/ChangeLog:

* include/bits/predefined_ops.h (equal_to, less): Define aliases
for std::equal_to<void> and std::less<void>.
(bind1st, bind2nd, not1, __equal_to): New object generator
functions for adapting predicates.
(__iter_less_iter, __iter_less_val, __iter_comp_val)
(__val_less_iter, __val_comp_iter, __iter_equal_to_iter)
(__iter_equal_to_val, __iter_comp_iter, __negate): Remove all
object generator functions and the class templates they return.
* include/bits/stl_algo.h (__move_median_to_first, __find_if_not)
(__find_if_not_n, __search_n_aux, find_end, find_if_not)
(__remove_copy_if, remove_copy, remove_copy_if, remove)
(remove_if, __adjacent_find, __unique, unique, __unique_copy)
(__unique_copy_1, __stable_partition_adaptive, stable_partition)
(__heap_select, __partial_sort_copy, partial_sort_copy)
(__unguarded_linear_insert, __insertion_sort)
(__unguarded_insertion_sort, __unguarded_partition)
(lower_bound, __upper_bound, upper_bound, __equal_range)
(equal_range, binary_search, __move_merge_adaptive)
(__move_merge_adaptive_backward, __merge_adaptive_resize)
(__merge_without_buffer, inplace_merge, __move_merge)
(__includes, includes, __next_permutation, next_permutation)
(__prev_permutation, prev_permutation, __replace_copy_if)
(replace_copy, replace_copy_if, __is_sorted_until)
(is_sorted_until, __minmax_element, minmax_element, minmax)
(is_permutation, __is_permutation, find, find_if, adjacent_find)
(count, count_if, search, search_n, unique_copy, partial_sort)
(nth_element, sort, __merge, merge, stable_sort, __set_union)
(set_union, __set_intersection, set_intersection)
(__set_difference, set_difference, __set_symmetric_difference)
(set_symmetric_difference, __min_element, min_element)
(__max_element, max_element, min, max): Use direct predicates
instead of __iter_equal_to_iter, __iter_comp_iter, and
__iter_less_iter, __negate etc. Dereference iterators when
invoking predicates.
* include/bits/stl_algobase.h (__lexicographical_compare_impl)
(__lexicographical_compare::__lc, __lower_bound, lower_bound)
(lexicographical_compare, __mismatch, mismatch, __find_if)
(__count_if, __remove_if, __search, __is_permutation)
(is_permutation, search): Likewise.
* include/bits/stl_function.h (equal_to<void>, less<void>):
Define transparent comparison functions for C++98 and C++11.
* include/bits/stl_heap.h (__is_heap_until, __is_heap)
(__push_heap, push_heap, __adjust_heap, pop_heap, make_heap)
(sort_heap, is_heap_until, is_heap): Likewise.
* include/std/deque (erase_if): Remove call to __pred_iter.
(erase): Replace __iter_equals_val with __equal_to.
* include/std/inplace_vector (erase_if, erase): Likewise.
* include/std/string (erase_if, erase): Likewise.
* include/std/vector (erase_if, erase): Likewise.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Reviewed-by: François Dumont <frs.dumont@gmail.com>
9 days agolibstdc++: Fix unsafe comma operators in <random> [PR122062]
Jonathan Wakely [Thu, 25 Sep 2025 16:23:28 +0000 (17:23 +0100)] 
libstdc++: Fix unsafe comma operators in <random> [PR122062]

This fixes a 'for' loop in std::piecewise_linear_distribution that
increments two iterators with a comma operator between them, making it
vulnerable to evil overloads of the comma operator.

It also changes a 'for' loop used by some other distributions, even
though those are only used with std::vector<double>::iterator and so
won't find any overloaded commas.

libstdc++-v3/ChangeLog:

PR libstdc++/122062
* include/bits/random.tcc (__detail::__normalize): Use void cast
for operands of comma operator.
(piecewise_linear_distribution): Likewise.
* testsuite/26_numerics/random/piecewise_linear_distribution/cons/122062.cc:
New test.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Reviewed-by: Hewill Kang <hewillk@gmail.com>
9 days agoFortran: Fix uninitialized reads for pdt_13.f03 etc. [PR122002]
Paul Thomas [Fri, 26 Sep 2025 06:30:07 +0000 (07:30 +0100)] 
Fortran: Fix uninitialized reads for pdt_13.f03 etc. [PR122002]

2025-09-26  Harald Anlauf  <anlauf@gcc.gnu.org>

gcc/fortran
PR fortran/122002
* decl.cc (gfc_get_pdt_instance): Initialize 'instance' to NULL
and set 'kind_value' to zero before calling gfc_extract_int.
* primary.cc (gfc_match_rvalue): Intitialize 'ctr_arglist' to
NULL and test for default values if gfc_get_pdt_instance
returns NULL.

9 days agoLoongArch: Implement TARGET_CAN_INLINE_P[PR121875].
Lulu Cheng [Wed, 24 Sep 2025 06:49:53 +0000 (14:49 +0800)] 
LoongArch: Implement TARGET_CAN_INLINE_P[PR121875].

Because LoongArch does not implement TARGET_CAN_INLINE_P,
functions with the target attribute set and those without
it cannot be inlined.  At the same time, setting the
always_inline attribute will cause compilation failure.

To solve this problem, I implemented this hook. During the
implementation process, it checks the status of the target
special options of the caller and callee, such as the ISA
extension.

PR target/121875

gcc/ChangeLog:

* config/loongarch/loongarch.cc
(loongarch_can_inline_p): New function.
(TARGET_CAN_INLINE_P): Define.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/can_inline_1.c: New test.
* gcc.target/loongarch/can_inline_2.c: New test.
* gcc.target/loongarch/can_inline_3.c: New test.
* gcc.target/loongarch/can_inline_4.c: New test.
* gcc.target/loongarch/can_inline_5.c: New test.
* gcc.target/loongarch/can_inline_6.c: New test.
* gcc.target/loongarch/pr121875.c: New test.

10 days agoDaily bump.
GCC Administrator [Fri, 26 Sep 2025 00:20:03 +0000 (00:20 +0000)] 
Daily bump.

10 days agodoc: Standardize on "bitwise" and "elementwise"
Gerald Pfeifer [Thu, 25 Sep 2025 22:09:32 +0000 (00:09 +0200)] 
doc: Standardize on "bitwise" and "elementwise"

...over "bit-wise" and "element-wise".

gcc:
* doc/invoke.texi (Warning Options): Use "bitwise" over
"bit-wise".
* doc/extend.texi (Vector Extensions): Use "elementwise"
over "element-wise".
* doc/md.texi (Standard Names): Ditto.

10 days agodoc: Fix grammar around Vector Extensions
Gerald Pfeifer [Thu, 25 Sep 2025 21:54:43 +0000 (23:54 +0200)] 
doc: Fix grammar around Vector Extensions

gcc:
* doc/extend.texi (Vector Extensions): Fix grammar.

10 days agoFortran: ICE in character(kind=4) deferred-length array reference [PR121939]
Harald Anlauf [Wed, 24 Sep 2025 18:57:21 +0000 (20:57 +0200)] 
Fortran: ICE in character(kind=4) deferred-length array reference [PR121939]

PR fortran/121939

gcc/fortran/ChangeLog:

* trans-types.cc (gfc_init_types): Set string flag for all
character types.

gcc/testsuite/ChangeLog:

* gfortran.dg/deferred_character_39.f90: Disable temporary
workaround for character(kind=4) deferred-length bug.

10 days agohppa: Fix asm in atomic_store_8 in sync-libfuncs.c
John David Anglin [Thu, 25 Sep 2025 14:49:39 +0000 (10:49 -0400)] 
hppa: Fix asm in atomic_store_8 in sync-libfuncs.c

Fix typo in the asm in atomic_store_8.  Also correct floating
point store.

Reported by Nick Hudson for netbsd.

2025-09-25  John David Anglin  <danglin@gcc.gnu.org>

libgcc/ChangeLog:

* config/pa/sync-libfuncs.c (atomic_store_8): Fix asm.

10 days agolibstdc++: Refactor __mdspan::__static_quotient.
Luc Grosheintz [Tue, 23 Sep 2025 13:10:04 +0000 (15:10 +0200)] 
libstdc++: Refactor __mdspan::__static_quotient.

For padded layouts we want to check that the product of the
padded stride with the remaining extents is representable.

Creating a second overload, allows passing in subspans of the
static extents and retains the ergonomics for the common case
of passing in all static extents.

libstdc++-v3/ChangeLog:

* include/std/mdspan (__static_quotient): New overload.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
10 days agolibstdc++: Check feature test macro for robust_nonmodifying_seq_ops
Jonathan Wakely [Wed, 24 Sep 2025 13:37:37 +0000 (14:37 +0100)] 
libstdc++: Check feature test macro for robust_nonmodifying_seq_ops

We should check the relevant feature test macro instead of just the
value of __cplusplus.

Also add a comment explaining why the __cplusplus check guarding
__sample *can't* be changed to check __glibcxx_sample (because __sample
is also used in C++14 by std::experimental::sample, not only by C++17
std::sample).

libstdc++-v3/ChangeLog:

* include/bits/stl_algo.h: Check robust_nonmodifying_seq_ops
feature test macro instead of checking __cplusplus value. Add
comment to another __cplusplus check.
* include/bits/stl_algobase.h: Add comment to #endif.

10 days agolibstdc++: Remove unwanted STDC_HEADERS macro from c++config.h [PR79147]
Jonathan Wakely [Fri, 19 Sep 2025 11:11:26 +0000 (12:11 +0100)] 
libstdc++: Remove unwanted STDC_HEADERS macro from c++config.h [PR79147]

Similar to r16-4034-g1953939243e1ab, this comments out another macro
that Autoconf adds to the generated config.h but which is not wanted in
the c++config.h file that we install.

There's no benefit to defining _GLIBCXX_STDC_HEADERS in user code, so we
should just prevent it from being defined.

libstdc++-v3/ChangeLog:

PR libstdc++/79147
PR libstdc++/103650
* include/Makefile.am (c++config.h): Adjust sed command to
comment out STDC_HEADERS macro.
* include/Makefile.in: Regenerate.

10 days agolibstdc++: Prepare mapping layout tests for padded layouts.
Luc Grosheintz [Tue, 23 Sep 2025 13:10:03 +0000 (15:10 +0200)] 
libstdc++: Prepare mapping layout tests for padded layouts.

Using the existing tests for padded layouts requires the following
changes:

 * The padded layouts are template classes. In order to be able to use
   partially specialized templates, functions need to be converted to
   structs.

 * The layout mapping tests include a check that only applies if
   is_exhaustive is static. This commit introduces a concept to check if
   is_exhaustive is a static member function.

 * Fix a test to not use a hard-coded layout_left.

The test empty.cc contains indentation mistakes that are fixed.

libstdc++-v3/ChangeLog:

* testsuite/23_containers/mdspan/layouts/empty.cc: Fix indent.
* testsuite/23_containers/mdspan/layouts/mapping.cc
(test_stride_1d): Fix test.
(test_stride_2d): Rewrite using a struct.
(test_stride_3d): Ditto.
(has_static_is_exhaustive): New concept.
(test_mapping_properties): Update test.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
10 days agoc++/modules: Remove incorrect assertion [PR122015,PR122019]
Nathaniel Shead [Thu, 25 Sep 2025 11:05:40 +0000 (21:05 +1000)] 
c++/modules: Remove incorrect assertion [PR122015,PR122019]

This assertion, despite what I said in r16-4070, is not valid: we can
reach here when deduping a VAR_DECL that didn't get a LANG_SPECIFIC in
the current TU.  It's still correct to always use lang_cplusplus however
as for anything else the decl would have been created with an
appropriate LANG_SPECIFIC to start with.

PR c++/122015
PR c++/122019

gcc/cp/ChangeLog:

* module.cc (trees_in::install_entity): Remove incorrect
assertion.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
10 days agodoc: Reword the description of -f[no-]fp-int-builtin-inexact default
Xi Ruoyao [Wed, 24 Sep 2025 06:29:45 +0000 (14:29 +0800)] 
doc: Reword the description of -f[no-]fp-int-builtin-inexact default

Now -std=gnu23 is the default, so -fno-fp-int-builtin-inexact is
effectively the default value.

gcc/

* doc/invoke.texi (-ffp-int-builtin-inexact): Reword to match
the default value with the default C standard.

11 days agoDaily bump.
GCC Administrator [Thu, 25 Sep 2025 00:21:38 +0000 (00:21 +0000)] 
Daily bump.

11 days ago[PATCH][PR target/121778] RISC-V: Improve rotation detection for RISC-V
Dusan Stojkovic [Wed, 24 Sep 2025 21:11:58 +0000 (15:11 -0600)] 
[PATCH][PR target/121778] RISC-V: Improve rotation detection for RISC-V

This patch splits the canonical sign-bit checking idiom
into a 2-insn sequence when Zbb is available. Combine often normalizes
(xor (lshr A, (W - 1)) 1) to (ge A, 0). For width W = bitsize (mode), the
identity:

(a << 1) | (a >= 0)  ==  (a << 1) | ((a >> (W - 1)) ^ 1)  ==  ROL1 (a) ^ 1

lets us split:

(ior:X (ashift:X A 1) (ge:X A 0))

into:
  →  rotatert:X A, (W-1)
  →  xor:X        A, 1

PR target/121778

gcc/ChangeLog:

* config/riscv/riscv.md: Add define_split pattern.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/pr121778-1.c: New test.
* gcc.target/riscv/pr121778-2.c: New test.

11 days agoc: Fix handling of register atomic compound literals
Joseph Myers [Wed, 24 Sep 2025 19:53:01 +0000 (19:53 +0000)] 
c: Fix handling of register atomic compound literals

The logic for loads and stores of _Atomic objects in the C front end
involves taking the address of such objects, with really_atomic_lvalue
detecting cases where this cannot be done (and also no special
handling is needed for atomicity), in particular register _Atomic
objects.  This logic failed to deal with the case of register _Atomic
compound literals, so resulting in spurious errors "error: address of
register compound literal requested" followed by "error: argument 1 of
'__atomic_load' must be a non-void pointer type".  (This is a C23 bug
that I found while changing really_atomic_lvalue as part of previous
C2y changes.)  Add a use of COMPOUND_LITERAL_EXPR_DECL in that case.

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

gcc/c/
* c-typeck.cc (really_atomic_lvalue): For a COMPOUND_LITERAL_EXPR,
check C_DECL_REGISTER on the COMPOUND_LITERAL_EXPR_DECL.

gcc/testsuite/
* gcc.dg/c23-complit-9.c: New test.

11 days agofortran: Favor parser-generated module procedure namespaces [PR122046]
Mikael Morin [Wed, 24 Sep 2025 14:06:59 +0000 (16:06 +0200)] 
fortran: Favor parser-generated module procedure namespaces [PR122046]

In the testcase from the PR, an assertion triggers because the compiler
tries to access the parent namespace of a contained procedure.  But the
namespace is the formal namespace of a module procedure symbol in a
submodule, which hasn't its parent set.

To add a bit of context, in submodules, module procedures inherited from
their parent module have two different namespaces holding their dummy
arguments.  The first one is generated by the the host association of
the module from the .mod file, and is made accessible in the procedure
symbol's formal_ns field.  Its parent field is not set.  The second one
is generated by the parser and contains the procedure implementation.
It's accessible from the list of contained procedures in the submodule
namespace.  Its parent field is set.

This change modifies gfc_get_procedure_ns to favor the parser-generated
namespace in the submodule case where there are two namespaces to choose
from.

PR fortran/122046

gcc/fortran/ChangeLog:

* symbol.cc (gfc_get_procedure_ns): Try to find the namespace
among the list of contained namespaces before returning the
value from the formal_ns field.

gcc/testsuite/ChangeLog:

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

11 days agogimple-fold/fab: Move ASSUME_ALIGNED handling to gimple-fold [PR121762]
Andrew Pinski [Sat, 20 Sep 2025 03:58:31 +0000 (20:58 -0700)] 
gimple-fold/fab: Move ASSUME_ALIGNED handling to gimple-fold [PR121762]

This is the next patch in the series of removing fab.
This one is simplier than builtin_constant_p because the only
time we want to simplify this builtin is at the final folding step.

Note align-5.c needs to change slightly as __builtin_assume_aligned
is no longer taken into account for the same reason as why PR 111875
is closed as invalid and why the testcase is failing at -Og
I added a new testcase align-5a.c where the pointer is explictly aligned
so that the check is gone there.
Note __builtin_assume_aligned should really be instrumented for UBSAN,
I filed PR 122038 for that.

Bootstrapped and tested on x86_64-linux-gnu.

PR tree-optimization/121762
gcc/ChangeLog:

* gimple-fold.cc (gimple_fold_builtin_assume_aligned): New function.
(gimple_fold_builtin): Call gimple_fold_builtin_assume_aligned
for BUILT_IN_ASSUME_ALIGNED.
* tree-ssa-ccp.cc (pass_fold_builtins::execute): Remove handling
of BUILT_IN_ASSUME_ALIGNED.

gcc/testsuite/ChangeLog:

* c-c++-common/ubsan/align-5.c: Update as __builtin_assume_aligned
is no longer taked into account.
* c-c++-common/ubsan/align-5a.c: New test.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
11 days agoAArch64: Enable dispatch scheduling for Neoverse V2.
Jennifer Schmitz [Fri, 13 Jun 2025 08:19:43 +0000 (01:19 -0700)] 
AArch64: Enable dispatch scheduling for Neoverse V2.

This patch adds dispatch constraints for Neoverse V2 and illustrates the steps
necessary to enable dispatch scheduling for an AArch64 core.

The dispatch constraints are based on section 4.1 of the Neoverse V2 SWOG.
Please note that the values used here deviate slightly from the current SWOG
version but are based on correct numbers. Arm will do an official Neoverse V2
SWOG release with the updated values in due time.

Here are the steps how we implemented the dispatch constraints for
Neoverse V2:
1. We used instruction attributes to group instructions into dispatch groups,
   corresponding to operations that utilize a certain pipeline type. For that,
   we added a new attribute (neoversev2_dispatch) with values for the
   different dispatch groups. The values of neoversev2_dispatch are determined
   using expressions of other instruction attributes.
   For example, the SWOG describes a constraint of "Up to 4 uOPs utilizing the
   M pipelines". Thus, one of the values of neoversev2_dispatch is "m" and it
   groups instructions that use the M pipelines such as integer multiplication.
   Note that we made some minor simplifications compared to the information
   in the SWOG, because the instruction annotation does not allow for a fully
   accurate mapping of instructions to utilized pipelines. To give one example,
   the instructions IRG and LDG are both tagged with "memtag", but IRG uses
   the M pipelines, while LDG uses the L pipelines.
2. In the Neoverse V2 tuning model, we added an array of available slots per
   dispatch constraint and a callback function that takes an insn as
   input and returns a vector of pairs (a, b) where a is an index in the
   array of slots and b is the number of occupied slots. The callback
   function calls get_attr_neoversev2_dispatch(insn) and switches over the
   result values to create a vector of occupied slots.
   Thus, the new attribute neoversev2_dispatch provides a compact way to define
   the dispatch constraints.
   The array of available slots, its length, and a pointer to the
   callback function are collected in a struct dispatch_constraint_into
   which is referenced in the tune_params.
3. We enabled dispatch scheduling for Neoverse V2 by adding the
   AARCH64_EXTRA_TUNE_DISPATCH_SCHED tune flag.

Performance evaluation showed no regression in several different
workloads including SPEC2017 and GROMACS2024.
Thank you, Tamar, for helping with performance evaluation.

The patch was bootstrapped and tested on aarch64-linux-gnu, no regression.

Signed-off-by: Jennifer Schmitz <jschmitz@nvidia.com>
gcc/ChangeLog:

* config/aarch64/aarch64.md: Include neoversev2.md.
* config/aarch64/tuning_models/neoversev2.h: Enable dispatch
scheduling and add dispatch constraints.
* config/aarch64/neoversev2.md: New file and new instruction attribute
neoversev2_dispatch.

11 days agoAArch64: Implement target hooks for dispatch scheduling.
Jennifer Schmitz [Wed, 17 Sep 2025 10:22:12 +0000 (03:22 -0700)] 
AArch64: Implement target hooks for dispatch scheduling.

This patch adds dispatch scheduling for AArch64 by implementing the two target
hooks TARGET_SCHED_DISPATCH and TARGET_SCHED_DISPATCH_DO.

The motivation for this is that cores with out-of-order processing do
most of the reordering to avoid pipeline hazards on the hardware side
using large reorder buffers. For such cores, rather than scheduling
around instruction latencies and throughputs, the compiler should aim to
maximize the utilized dispatch bandwidth by inserting a certain
instruction mix into the frontend dispatch window.

In the following, we will describe the overall implementation:
Recall that the Haifa scheduler makes the following 6 types of queries to
a dispatch scheduling model:
1) targetm.sched.dispatch (NULL, IS_DISPATCH_ON)
2) targetm.sched.dispatch_do (NULL, DISPATCH_INIT)
3) targetm.sched.dispatch (insn, FITS_DISPATCH_WINDOW)
4) targetm.sched.dispatch_do (insn, ADD_TO_DISPATCH_WINDOW)
5) targetm.sched.dispatch (NULL, DISPATCH_VIOLATION)
6) targetm.sched.dispatch (insn, IS_CMP)

For 1), we created the new tune flag AARCH64_EXTRA_TUNE_DISPATCH_SCHED.

For 2-5), we modeled dispatch scheduling using the class dispatch_window.
A dispatch_window object represents the window of operations that is dispatched
per cycle. It contains the two arrays max_slots and free_slots (the length
of the arrays is the number of dispatch constraints specified for a core)
to keep track of the available slots.
The dispatch_window class exposes functions to ask whether a given
instruction would fit into the dispatch_window or to add an instruction to
the window.
The model operates using only one dispatch_window object that is constructed
when 2) is called. Upon construction, it copies the number of available slots
given in the tuning model (more details on the changes to tune_params below).
During scheduling, instructions are added according to the dispatch
constraints. For that, the dispatch_window queries the tuning model using a
callback function that takes an insn as input and returns a vector of
pairs (a, b), where a is the index of the constraint and b is the number of
slots occupied.
The dispatch_window checks if the instruction fits into the current
window. If not, i.e. the current window is full, the free_slots array is
reset to max_slots. Then the dispatch_window deducts b slots from
free_slots[a] for each pair (a, b) in the vector returned by the callback.
A dispatch violation occurs when the number of free slots becomes negative
for any dispatch_constraint.

For 6), return false (see comment in aarch64-sched-dispatch.cc).

Dispatch information for a core can be added in its tuning model. We added
the new field *dispatch_constraint to the struct tune_params that holds a
pointer to a struct dispatch_constraints_info.
All current tuning models were initialized with nullptr.
(In the next patch, dispatch information will be added for Neoverse V2.)

The patch was bootstrapped and tested on aarch64-linux-gnu, no regression.

Signed-off-by: Jennifer Schmitz <jschmitz@nvidia.com>
gcc/ChangeLog:

* config.gcc: Add aarch64-sched-dispatch.o to extra_objs.
* config/aarch64/aarch64-protos.h (struct tune_params): New
field for dispatch scheduling.
(struct dispatch_constraint_info): New struct for dispatch scheduling.
* config/aarch64/aarch64-tuning-flags.def
(AARCH64_EXTRA_TUNING_OPTION): New flag to enable dispatch scheduling.
* config/aarch64/aarch64.cc (TARGET_SCHED_DISPATCH): Implement
target hook.
(TARGET_SCHED_DISPATCH_DO): Likewise.
(aarch64_override_options_internal): Add check for definition of
dispatch constraints if dispatch-scheduling tune flag is set.
* config/aarch64/t-aarch64: Add aarch64-sched-dispatch.o.
* config/aarch64/tuning_models/a64fx.h: Initialize fields for
dispatch scheduling in tune_params.
* config/aarch64/tuning_models/ampere1.h: Likewise.
* config/aarch64/tuning_models/ampere1a.h: Likewise.
* config/aarch64/tuning_models/ampere1b.h: Likewise.
* config/aarch64/tuning_models/cortexa35.h: Likewise.
* config/aarch64/tuning_models/cortexa53.h: Likewise.
* config/aarch64/tuning_models/cortexa57.h: Likewise.
* config/aarch64/tuning_models/cortexa72.h: Likewise.
* config/aarch64/tuning_models/cortexa73.h: Likewise.
* config/aarch64/tuning_models/cortexx925.h: Likewise.
* config/aarch64/tuning_models/emag.h: Likewise.
* config/aarch64/tuning_models/exynosm1.h: Likewise.
* config/aarch64/tuning_models/fujitsu_monaka.h: Likewise.
* config/aarch64/tuning_models/generic.h: Likewise.
* config/aarch64/tuning_models/generic_armv8_a.h: Likewise.
* config/aarch64/tuning_models/generic_armv9_a.h: Likewise.
* config/aarch64/tuning_models/neoverse512tvb.h: Likewise.
* config/aarch64/tuning_models/neoversen1.h: Likewise.
* config/aarch64/tuning_models/neoversen2.h: Likewise.
* config/aarch64/tuning_models/neoversen3.h: Likewise.
* config/aarch64/tuning_models/neoversev1.h: Likewise.
* config/aarch64/tuning_models/neoversev2.h: Likewise.
* config/aarch64/tuning_models/neoversev3.h: Likewise.
* config/aarch64/tuning_models/neoversev3ae.h: Likewise.
* config/aarch64/tuning_models/olympus.h: Likewise.
* config/aarch64/tuning_models/qdf24xx.h: Likewise.
* config/aarch64/tuning_models/saphira.h: Likewise.
* config/aarch64/tuning_models/thunderx.h: Likewise.
* config/aarch64/tuning_models/thunderx2t99.h: Likewise.
* config/aarch64/tuning_models/thunderx3t110.h: Likewise.
* config/aarch64/tuning_models/thunderxt88.h: Likewise.
* config/aarch64/tuning_models/tsv110.h: Likewise.
* config/aarch64/tuning_models/xgene1.h: Likewise.
* config/aarch64/aarch64-sched-dispatch.cc: New file for
dispatch scheduling for aarch64.
* config/aarch64/aarch64-sched-dispatch.h: New header file.

11 days agoAArch64: Annotate SVE instructions with new instruction attribute.
Jennifer Schmitz [Fri, 11 Jul 2025 13:07:30 +0000 (06:07 -0700)] 
AArch64: Annotate SVE instructions with new instruction attribute.

In this patch, we add the new instruction attribute "sve_type" and use it to
annotate the SVE instructions in aarch64-sve.md and aarch64-sve2.md. This
allows us to use instruction attributes to group instructions into dispatch
groups for dispatch scheduling. While there had already been fine-grained
annotation of scalar and neon instructions (mostly using the "type"-attribute),
annotation was missing for SVE instructions.

The values of the attribute "sve_type" are comparatively coarse-grained, but
fulfill the two criteria we aimed for with regard to dispatch scheduling:
- the annotation allows the definition of CPU-specific high-level attributes
  mapping instructions to dispatch constraints
- the annotation is by itself CPU-independent and consistent, i.e. all
  instructions fulfilling certain criteria are tagged with the corresponding
  value

The patch was bootstrapped and tested on aarch64-linux-gnu, no regression.

Signed-off-by: Jennifer Schmitz <jschmitz@nvidia.com>
gcc/ChangeLog:

* config/aarch64/aarch64-sve.md: Annotate instructions with
attribute sve_type.
* config/aarch64/aarch64-sve2.md: Likewise.
* config/aarch64/aarch64.md (sve_type): New attribute sve_type.
* config/aarch64/iterators.md (sve_type_unspec): New int attribute.
(sve_type_int): New code attribute.
(sve_type_fp): New int attribute.

11 days agolibstdc++: Move test for __cpp_lib_not_fn to version.cc
Luc Grosheintz [Tue, 23 Sep 2025 12:34:41 +0000 (14:34 +0200)] 
libstdc++: Move test for __cpp_lib_not_fn to version.cc

When running the tests without pre-compiled headers
(--disable-libstdcxx-pch), the test fails, because the feature
testing macro (FTM) isn't defined yet.

This commit moves checking the FTM to a dedicated file (version.cc)
that's run without PCH.

libstdc++-v3/ChangeLog:

* testsuite/20_util/function_objects/not_fn/nttp.cc: Move
test of feature testing macro to version.cc
* testsuite/20_util/function_objects/not_fn/version.cc: New test.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Co-authored-by: Tomasz Kamiński <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
11 days agotree-optimization/116816 - improve VMAT_ELEMENTWISE with SLP
Richard Biener [Wed, 24 Sep 2025 10:19:17 +0000 (12:19 +0200)] 
tree-optimization/116816 - improve VMAT_ELEMENTWISE with SLP

The following implements VMAT_ELEMENTWISE for grouped loads, in
particular for being able to serve as fallback for unhandled
load permutations since it's trivial to load elements in the
correct order.

PR tree-optimization/116816
* tree-vect-stmts.cc (get_load_store_type): Allow multi-lane
single-element interleaving to fall back to VMAT_ELEMENTWISE.
Fall back to VMAT_ELEMENTWISE when we cannot handle a load
permutation.
(vectorizable_load): Do not check a load permutation
for VMAT_ELEMENTWISE.  Handle grouped loads with
VMAT_ELEMENTWISE and directly apply a load permutation.

11 days agoFix get_load_store_type wrt VMAT_ELEMENTWISE classification
Richard Biener [Wed, 24 Sep 2025 10:24:11 +0000 (12:24 +0200)] 
Fix get_load_store_type wrt VMAT_ELEMENTWISE classification

We may not classify a BB vectorization load as VMAT_ELEMENTWISE as
that will ICE.  Instead we build vectors from existing scalar loads.
Make that explicit.

* tree-vect-stmts.cc (get_load_store_type): Explicitly fail
when we end up with VMAT_ELEMENTWISE for BB vectorization.

11 days agolibstdc++: Reflect operator<< constraints in formatter for local_time.
Tomasz Kamiński [Tue, 23 Sep 2025 11:56:42 +0000 (13:56 +0200)] 
libstdc++: Reflect operator<< constraints in formatter for local_time.

The r16-3996-gdc78d691c5e5f7 commit (resolution of LWG4257) constrained the
operator<< for local_time, but didn't update the corresponding formatter. This
meant it didn't conditionally support formatting with an empty format spec ("{}"),
which is defined in terms of operator<<.

This patch addresses that by initializing __defSpec for the local_time
formatter in the same manner as it's done for sys_time. This functionality is
extracted to the _S_spec_for_tp function of __formatter_duration. As formatting
of local_time is defined and constrained in terms of operator<< for sys_time,
we can check the viability of the ostream operator for sys_time in both cases.

As default _M_chrono_spec may now be empty for local_time, the parse method
now checks if it was supplied in the format string, similarly to sys_time. The
condition for performing runtime check is expressed directly by checking if a
empty default is provided. This avoids the need to access the value of
__stream_insertable outside of the __defSpec computation.

As a note, despite their similar behavior, formatters sys_time and local_time
cannot be easily defined in terms of each other, as sys_time provides time zone
information while local_time does not.

libstdc++-v3/ChangeLog:

* include/bits/chrono_io.h (__formatter_duration::_S_spec_for_tp):
Extracted from defition of formatter<sys_time>::__defSpec.
(formatter<chrono::sys_time<_Duration>, _CharT>::parse): Simplify
condition in if contexpr.
(formatter<chrono::sys_time<_Duration>, _CharT>::__stream_insertable):
Remove.
(formatter<chrono::sys_time<_Duration>, _CharT>::__defSpec)
(formatter<chrono::local_time<_Duration>, _CharT>::__defSpec):
Compute using __formatter_duration::_S_spec_for_tp.
(forrmatter<chrono::sys_time<_Duration>, _CharT>::parse): Check if
parse _M_chrono_spec
* testsuite/std/time/format/empty_spec.cc: Extend tests for floating
point and other non-streamable durations (years).

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
11 days agolibstdc++: Use basic_format_parse_context<_CharT> in internal chrono formatters.
Tomasz Kamiński [Tue, 23 Sep 2025 09:09:08 +0000 (11:09 +0200)] 
libstdc++: Use basic_format_parse_context<_CharT> in internal chrono formatters.

libstdc++-v3/ChangeLog:

* include/bits/chrono_io.h (__formatter_chrono::_M_parse):
Replace _ParseContext with basic_format_parse_context<_CharT> and
make it non-template.
(__formatter_duration::_M_parse): Replace _ParseContext with
basic_format_parse_context<_CharT> and remove unused default
argument.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
11 days agodocs: Note that -fisolate-erroneous-paths-dereference turns division by zero into...
Xi Ruoyao [Wed, 24 Sep 2025 06:26:11 +0000 (14:26 +0800)] 
docs: Note that -fisolate-erroneous-paths-dereference turns division by zero into a trap [PR 122040]

And this behavior is not limited to -fdelete-null-pointer-checks.

gcc/

PR tree-optimization/122040
* doc/invoke.texi (-fisolate-erroneous-paths-dereference):
Mention it also turns division by zero into a trap in addition
to null dereference.

11 days agoLoongArch: Add isnan expander [PR 66462]
Xi Ruoyao [Tue, 16 Sep 2025 15:10:26 +0000 (23:10 +0800)] 
LoongArch: Add isnan expander [PR 66462]

Add an expander for isnan using fclass.  Since isnan is
just a compare, enable it only with -fsignaling-nans to avoid
generating spurious exceptions.  This fixes part of PR66462.

int isnan1 (float x) { return __builtin_isnan (x); }

With -fno-signaling-nans:

fcmp.cun.s $fcc0,$f0,$f0
movcf2fr $f0,$fcc0
movfr2gr.s $r4,$f0
jr $r1

With -fsignaling-nans:

fclass.s $f0,$f0
movfr2gr.s $r4,$f0
andi $r4,$r4,3
sltu $r4,$r0,$r4
jr $r1

PR middle-end/66462

gcc/

* config/loongarch/loongarch.md (FCLASS_MASK): Add 3.
(fclass_optab): Assign isnan for 3.
(<FCLASS_MASK:fclass_optab><ANYF:mode>2): If FCLASS_MASK is 3,
only enable when -fsignaling-nans.

gcc/testsuite:

* gcc.target/loongarch/fclass-compile.c: Update test.
* gcc.target/loongarch/fclass-run.c: Likewise.

11 days agoc++/modules: Fix language linkage handling [PR122019]
Nathaniel Shead [Mon, 22 Sep 2025 09:16:01 +0000 (19:16 +1000)] 
c++/modules: Fix language linkage handling [PR122019]

The ICE in the linked PR is caused because when current_lang_name is
lang_name_c, set_decl_linkage calls decl_linkage on the retrofitted
declaration.  This is problematic because at this point we haven't
finished streaming the declaration, and so we crash when attempting to
access these missing bits (such as the type).

The only declarations we can reach here will be things like types that
don't get a language linkage anyway, so it seems reasonable to just
hardcode a C++ language linkage here to work around the issue.

An alternative fix would be to override current_lang_name in
lazy_load_binding instead, but this is potentially confusing if we ever
deliberately implement `extern "C" import "header_unit.hpp";` to
override the language linkage of imported declarations, so I went with
this approach instead.  (Though it seems we never will do this.)

While testing this I found that we don't currently complain about
mismatching language linkages for variables, and module_may_redeclare
doesn't cope well with implementation units, so this patch also fixes
those issues.

PR c++/122019

gcc/cp/ChangeLog:

* module.cc (trees_in::install_entity): Don't be affected by
global language linkage state.
(trees_in::is_matching_decl): Check mismatching language linkage
for variables too.
(module_may_redeclare): Report the correct module name for
partitions and implementation units.

gcc/testsuite/ChangeLog:

* g++.dg/modules/lang-4_a.C: New test.
* g++.dg/modules/lang-4_b.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
11 days agoFortran: Fix ICE in check_interface [PR87908]
Paul Thomas [Wed, 24 Sep 2025 07:01:23 +0000 (08:01 +0100)] 
Fortran: Fix ICE in check_interface [PR87908]

2025-09-24  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/87908
* interface.cc (check_interface0): If a vtable is found in the
interface list, check that it is either a subroutine or a
function. Let resolve.cc do any further checking.

gcc/testsuite/
PR fortran/87908
* gfortran.dg/pr87908.f90: New test.

11 days agolibstdc++/testsuite: Unpoison 'u' on s390x in names.cc test
Patrick Palka [Wed, 24 Sep 2025 02:41:26 +0000 (22:41 -0400)] 
libstdc++/testsuite: Unpoison 'u' on s390x in names.cc test

This is the s390 counterpart to r11-7364-gd0453cf5c68b6a, and fixes the
following names.cc failure caused by a use of a poisoned identifier.
If we look at the corresponding upstream header[1] it's clear that the
problematic identifier is 'u'.

In file included from /usr/include/linux/types.h:5,
                 from /usr/include/linux/sched/types.h:5,
                 from /usr/include/bits/sched.h:61,
                 from /usr/include/sched.h:43,
                 from /usr/include/pthread.h:22,
                 from /usr/include/c++/14/s390x-redhat-linux/bits/gthr-default.h:35,
                 from /usr/include/c++/14/s390x-redhat-linux/bits/gthr.h:157,
                 from /usr/include/c++/14/ext/atomicity.h:35,
                 from /usr/include/c++/14/bits/ios_base.h:39,
                 from /usr/include/c++/14/streambuf:43,
                 from /usr/include/c++/14/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/14/iterator:66,
                 from /usr/include/c++/14/s390x-redhat-linux/bits/stdc++.h:54,
                 from /root/rpmbuild/BUILD/gcc-14.3.1-20250617/libstdc++-v3/testsuite/17_intro/names.cc:384:
/usr/include/asm/types.h:24: error: expected unqualified-id before '[' token
/usr/include/asm/types.h:24: error: expected ')' before '[' token
/root/rpmbuild/BUILD/gcc-14.3.1-20250617/libstdc++-v3/testsuite/17_intro/names.cc:101: note: to match this '('
compiler exited with status 1
FAIL: 17_intro/names.cc  -std=gnu++98 (test for excess errors)
Excess errors:
/usr/include/asm/types.h:24: error: expected unqualified-id before '[' token
/usr/include/asm/types.h:24: error: expected ')' before '[' token

[1]: https://github.com/torvalds/linux/blob/master/arch/s390/include/uapi/asm/types.h

libstdc++-v3/ChangeLog:

* testsuite/17_intro/names.cc: Undefine 'u' on s390*-linux.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
11 days agoRISC-V: Add test case of unsigned scalar SAT_MUL form 5 for mul
Pan Li [Fri, 19 Sep 2025 06:54:48 +0000 (14:54 +0800)] 
RISC-V: Add test case of unsigned scalar SAT_MUL form 5 for mul

Add test case for both the run and asm check of mul based SAT_MUL.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/sat/sat_u_mul-6-u16-from-u32.c: New test.
* gcc.target/riscv/sat/sat_u_mul-6-u16-from-u64.rv32.c: New test.
* gcc.target/riscv/sat/sat_u_mul-6-u16-from-u64.rv64.c: New test.
* gcc.target/riscv/sat/sat_u_mul-6-u32-from-u64.rv32.c: New test.
* gcc.target/riscv/sat/sat_u_mul-6-u32-from-u64.rv64.c: New test.
* gcc.target/riscv/sat/sat_u_mul-6-u8-from-u16.c: New test.
* gcc.target/riscv/sat/sat_u_mul-6-u8-from-u32.c: New test.
* gcc.target/riscv/sat/sat_u_mul-6-u8-from-u64.rv32.c: New test.
* gcc.target/riscv/sat/sat_u_mul-6-u8-from-u64.rv64.c: New test.
* gcc.target/riscv/sat/sat_u_mul-run-6-u16-from-u32.c: New test.
* gcc.target/riscv/sat/sat_u_mul-run-6-u16-from-u64.c: New test.
* gcc.target/riscv/sat/sat_u_mul-run-6-u32-from-u64.c: New test.
* gcc.target/riscv/sat/sat_u_mul-run-6-u8-from-u16.c: New test.
* gcc.target/riscv/sat/sat_u_mul-run-6-u8-from-u32.c: New test.
* gcc.target/riscv/sat/sat_u_mul-run-6-u8-from-u64.c: New test.

Signed-off-by: Pan Li <pan2.li@intel.com>