]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
5 days agoaarch64: Cache the PCS value for a function
Alfie Richards [Tue, 18 Nov 2025 10:50:04 +0000 (10:50 +0000)] 
aarch64: Cache the PCS value for a function

As aarch64_function_arg_regno_p is a very hot function called many times for a
function it should not call fndecl_abi every time as it is expensive and
unecessasary.

This caches the result and in doing so fixes a regression in compile time
introduced by r16-5076-g7197d8062fddc2.

gcc/ChangeLog:

* config/aarch64/aarch64.cc (aarch64_fndecl_abi): New function.
(aarch64_function_abi): New function.
(aarch64_function_arg_regno_p): Update to use aarch64_fndecl_abi.
(aarch64_output_mi_thunk): Likewise.
(aarch64_is_variant_pcs): Likewise.
(aarch64_set_current_function): Update to initialize pcs value.
* config/aarch64/aarch64.h (enum arm_pcs): Move location earlier in
file.
(machine_function) Add pcs value.

5 days ago[PATCH v2 1/4] openmp: Bump Version from 4.5 to 5.2 (1/4)
supers1ngular [Thu, 11 Dec 2025 14:27:09 +0000 (06:27 -0800)] 
[PATCH v2 1/4] openmp: Bump Version from 4.5 to 5.2 (1/4)

Bumps OpenMP from 4.5 (201511) to 5.2 (202111), with deprecation and
test support to 5.1 (202011). Adds new tests and a new warning.
Suppresses deprecation warnings in all relevant tests and removes
suppression pragmas visible outside of the testsuite. Additionally
implements new warning in the relevant frontends. Otherwise, cleans
up some whitespace and fixed a misspelled pragma in a testcase. Also
fixes an indentation error.

gcc/c-family/ChangeLog:

* c-cppbuiltin.cc (c_cpp_builtins): Bump _OPENMP version.
* c.opt (Wdeprecated-openmp): Add warning.
* c.opt.urls: Regenerated.

gcc/c/ChangeLog:

* c-parser.cc (c_parser_omp_clause_proc_bind): Deprecate master
affinity.
(c_parser_omp_master): Deprecate master construct.
(c_parser_transaction): Whitespace.

gcc/cp/ChangeLog:

* parser.cc (cp_parser_postfix_expression): Whitespace.
(cp_parser_builtin_c23_va_start): Ditto.
(cp_parser_omp_clause_proc_bind): Deprecate master affinity.
(cp_parser_omp_master): Deprecate master construct.

gcc/ChangeLog:

* doc/invoke.texi: Update docs for '-Wdeprecated-openmp'.

gcc/fortran/ChangeLog:

* cpp.cc (cpp_define_builtins): Bump _OPENMP version.
* invoke.texi: Update docs for '-Wdeprecated-openmp'.
* lang.opt (Wdeprecated-openmp): Add warning.
* lang.opt.urls: Regenerated.
* openmp.cc (gfc_match_omp_clauses): Deprecate master affinity
policy.
(gfc_match_omp_parallel_master): Deprecate master construct.
(gfc_match_omp_parallel_master_taskloop): Ditto.
(gfc_match_omp_parallel_master_taskloop_simd): Ditto.
(gfc_match_omp_master): Ditto.
(gfc_match_omp_master_taskloop): Ditto.
(gfc_match_omp_master_taskloop_simd): Ditto.
(resolve_omp_clauses): Warn for deprecated use of
{use,is}_device_ptr.

libgomp/ChangeLog:

* env.c (omp_display_env): Bump _OPENMP version.
* fortran.c (ialias_redirect): Remove suppression pragmas.
(omp_set_dynamic_8_): Ditto.
(omp_set_nested_8_): Ditto.
(omp_get_nested_): Ditto.
* icv.c (omp_get_dynamic): Ditto.
(omp_get_nested): Ditto.
(ialias): Ditto.
* omp_lib.f90.in: Bump openmp_version.
* omp_lib.h.in: Ditto.
* testsuite/libgomp.c++/affinity-1.C: Suppress deprecation
warnings.
* testsuite/libgomp.c++/ctor-1.C: Ditto.
* testsuite/libgomp.c++/ctor-11.C: Ditto.
* testsuite/libgomp.c++/ctor-13.C: Ditto.
* testsuite/libgomp.c++/ctor-2.C: Ditto.
* testsuite/libgomp.c++/ctor-5.C: Ditto.
* testsuite/libgomp.c++/ctor-7.C: Ditto.
* testsuite/libgomp.c++/depend-iterator-1.C: Ditto.
* testsuite/libgomp.c++/loop-13.C: Ditto.
* testsuite/libgomp.c++/master-1.C: Ditto.
* testsuite/libgomp.c++/pr26943.C: Ditto.
* testsuite/libgomp.c++/pr81130.C: Ditto.
* testsuite/libgomp.c++/pr81314.C: Ditto.
* testsuite/libgomp.c++/target-in-reduction-1.C: Ditto.
* testsuite/libgomp.c++/target-in-reduction-2.C: Ditto.
* testsuite/libgomp.c++/task-1.C: Ditto.
* testsuite/libgomp.c++/task-2.C: Ditto.
* testsuite/libgomp.c++/task-6.C: Ditto.
* testsuite/libgomp.c++/task-reduction-7.C: Ditto.
* testsuite/libgomp.c++/task-reduction-9.C: Ditto.
* testsuite/libgomp.c++/taskloop-reduction-1.C: Ditto.
* testsuite/libgomp.c-c++-common/cancel-taskgroup-4.c: Ditto.
* testsuite/libgomp.c-c++-common/depend-inoutset-1.c: Ditto.
* testsuite/libgomp.c-c++-common/depend-iterator-1.c: Ditto.
* testsuite/libgomp.c-c++-common/master-combined-1.c: Ditto.
* testsuite/libgomp.c-c++-common/target-in-reduction-1.c: Ditto.
* testsuite/libgomp.c-c++-common/target-in-reduction-2.c: Ditto.
* testsuite/libgomp.c-c++-common/task-detach-12.c: Ditto.
* testsuite/libgomp.c-c++-common/task-reduction-15.c: Ditto.
* testsuite/libgomp.c-c++-common/task-reduction-5.c: Ditto.
* testsuite/libgomp.c-c++-common/task-reduction-6.c: Ditto.
* testsuite/libgomp.c-c++-common/task-reduction-8.c: Ditto.
* testsuite/libgomp.c-c++-common/taskloop-reduction-1.c: Ditto.
* testsuite/libgomp.c-c++-common/taskloop-reduction-3.c: Ditto.
* testsuite/libgomp.c-c++-common/taskloop-reduction-4.c: Ditto.
* testsuite/libgomp.c/affinity-1.c: Remove extraneous dg
instruction and add suppression.
* testsuite/libgomp.c/critical-2.c: Suppress deprecation
warnings.
* testsuite/libgomp.c/debug-1.c: Ditto.
* testsuite/libgomp.c/lib-1.c: Ditto.
* testsuite/libgomp.c/loop-24.c: Ditto.
* testsuite/libgomp.c/nestedfn-2.c: Ditto.
* testsuite/libgomp.c/nestedfn-3.c: Ditto.
* testsuite/libgomp.c/pr104385.c: Ditto.
* testsuite/libgomp.c/target-31.c: Ditto.
* testsuite/libgomp.c/target-34.c: Ditto.
* testsuite/libgomp.c/target-critical-1.c: Ditto.
* testsuite/libgomp.c/task-1.c: Ditto.
* testsuite/libgomp.c/task-3.c: Ditto.
* testsuite/libgomp.c/task-6.c: Ditto.
* testsuite/libgomp.c/task-reduction-1.c: Ditto.
* testsuite/libgomp.c/task-reduction-2.c: Ditto.
* testsuite/libgomp.c/teams-1.c: Ditto.
* testsuite/libgomp.c/vla-1.c: Ditto.
* testsuite/libgomp.fortran/crayptr1.f90: Ditto.
* testsuite/libgomp.fortran/depend-inoutset-1.f90: Ditto.
* testsuite/libgomp.fortran/is_device_ptr-1.f90: Ditto.
* testsuite/libgomp.fortran/is_device_ptr-2.f90: Ditto.
* testsuite/libgomp.fortran/lib1.f90: Ditto.
* testsuite/libgomp.fortran/lib2.f: Ditto.
* testsuite/libgomp.fortran/lib3.f: Ditto.
* testsuite/libgomp.fortran/omp_parse2.f90: Ditto.
* testsuite/libgomp.fortran/openmp_version-1.f: Bump OMP version.
* testsuite/libgomp.fortran/openmp_version-2.f90: Ditto.
* testsuite/libgomp.fortran/parallel-master.f90: Suppress
warnings.
* testsuite/libgomp.fortran/pointer2.f90: Ditto.
* testsuite/libgomp.fortran/reduction6.f90: Ditto.
* testsuite/libgomp.fortran/target-firstprivate-1.f90: Ditto.
* testsuite/libgomp.fortran/use_device_addr-1.f90: Ditto.
* testsuite/libgomp.fortran/use_device_addr-2.f90: Ditto.
* testsuite/libgomp.fortran/use_device_addr-3.f90: Ditto.
* testsuite/libgomp.fortran/use_device_addr-4.f90: Ditto.
* testsuite/libgomp.fortran/use_device_addr-5.f90: Ditto.
* testsuite/libgomp.fortran/use_device_ptr-1.f90: Ditto.
* testsuite/libgomp.fortran/use_device_ptr-3.f90: Ditto.
* testsuite/libgomp.fortran/use_device_ptr-4.f90: Ditto.
* testsuite/libgomp.fortran/use_device_ptr-optional-1.f90: Ditto.
* testsuite/libgomp.fortran/use_device_ptr-optional-2.f90: Ditto.
* testsuite/libgomp.fortran/use_device_ptr-optional-3.f90: Ditto.
* testsuite/libgomp.c-c++-common/omp-atv-seq-dep.c: New test.
* testsuite/libgomp.c-c++-common/omp-lock-hint-contended-dep.c:
New test.
* testsuite/libgomp.c-c++-common/omp-lock-hint-none-dep.c: New test.
* testsuite/libgomp.c-c++-common/omp-lock-hint-speculative-dep.c:
New test.
* testsuite/libgomp.c-c++-common/omp-lock-hint-uncontended-dep.c:
New test.
* testsuite/libgomp.c/omp-proc-bind-master-dep.c: New test.
* testsuite/libgomp.fortran/omp-atv-seq-dep.f90: New test.
* testsuite/libgomp.fortran/omp-lock-hint-contended-dep.f90: New
test.
* testsuite/libgomp.fortran/omp-lock-hint-none-dep.f90: New test.
* testsuite/libgomp.fortran/omp-lock-hint-speculative-dep.f90: New
test.
* testsuite/libgomp.fortran/omp-lock-hint-uncontended-dep.f90: New
test.

gcc/testsuite/ChangeLog:

* c-c++-common/cpp/openmp-define-3.c: Bump OMP version.
* c-c++-common/gomp/Wparentheses-1.c: Suppress deprecation
warnings.
* c-c++-common/gomp/Wparentheses-3.c: Ditto.
* c-c++-common/gomp/affinity-3.c: Ditto.
* c-c++-common/gomp/allocate-18.c: Ditto.
* c-c++-common/gomp/cancel-1.c: Ditto.
* c-c++-common/gomp/clause-dups-1.c: Ditto.
* c-c++-common/gomp/clauses-1.c: Suppress deprecation
warnings and fix misspelled directive. Add
'-Wunknown-pragmas'.
* c-c++-common/gomp/clauses-6.c: Suppress deprecation warnings.
* c-c++-common/gomp/declare-variant-1.c: Ditto.
* c-c++-common/gomp/declare-variant-2.c: Ditto.
* c-c++-common/gomp/depend-iterator-1.c: Ditto.
* c-c++-common/gomp/lastprivate-conditional-1.c: Ditto.
* c-c++-common/gomp/loop-1.c: Ditto.
* c-c++-common/gomp/loop-2.c: Ditto.
* c-c++-common/gomp/loop-3.c: Ditto.
* c-c++-common/gomp/loop-4.c: Ditto.
* c-c++-common/gomp/master-combined-1.c: Ditto.
* c-c++-common/gomp/master-combined-2.c: Ditto.
* c-c++-common/gomp/nesting-2.c: Ditto.
* c-c++-common/gomp/pr100902-1.c: Ditto.
* c-c++-common/gomp/pr61486-2.c: Ditto.
* c-c++-common/gomp/pr85696.c: Ditto.
* c-c++-common/gomp/pr85956.c: Ditto.
* c-c++-common/gomp/pr98187.c: Ditto.
* c-c++-common/gomp/pr99928-1.c: Ditto.
* c-c++-common/gomp/pr99928-10.c: Ditto.
* c-c++-common/gomp/pr99928-11.c: Ditto.
* c-c++-common/gomp/pr99928-12.c: Ditto.
* c-c++-common/gomp/pr99928-13.c: Ditto.
* c-c++-common/gomp/pr99928-14.c: Ditto.
* c-c++-common/gomp/pr99928-2.c: Ditto.
* c-c++-common/gomp/pr99928-3.c: Ditto.
* c-c++-common/gomp/pr99928-4.c: Ditto.
* c-c++-common/gomp/pr99928-5.c: Ditto.
* c-c++-common/gomp/pr99928-6.c: Ditto.
* c-c++-common/gomp/pr99928-7.c: Ditto.
* c-c++-common/gomp/pr99928-8.c: Ditto.
* c-c++-common/gomp/pr99928-9.c: Ditto.
* c-c++-common/gomp/task-detach-1.c: Ditto.
* c-c++-common/gomp/teams-2.c: Ditto.
* g++.dg/gomp/attrs-1.C: Ditto.
* g++.dg/gomp/attrs-2.C: Ditto.
* g++.dg/gomp/attrs-4.C: Ditto.
* g++.dg/gomp/block-0.C: Ditto.
* g++.dg/gomp/block-10.C: Ditto.
* g++.dg/gomp/block-5.C: Ditto.
* g++.dg/gomp/block-9.C: Ditto.
* g++.dg/gomp/depend-iterator-1.C: Ditto.
* g++.dg/gomp/master-1.C: Ditto.
* g++.dg/gomp/master-2.C: Ditto.
* g++.dg/gomp/master-3.C: Ditto.
* g++.dg/gomp/method-1.C: Ditto.
* g++.dg/gomp/pr29965-3.C: Ditto.
* g++.dg/gomp/pr29965-9.C: Ditto.
* g++.dg/gomp/pr78363-4.C: Ditto.
* g++.dg/gomp/pr78363-6.C: Ditto.
* g++.dg/gomp/pr79664.C: Ditto.
* g++.dg/gomp/pr94477.C: Ditto.
* g++.dg/gomp/pr94512.C: Ditto.
* g++.dg/gomp/tpl-master-1.C: Ditto.
* gcc.dg/gomp/appendix-a/a.12.1.c: Ditto.
* gcc.dg/gomp/appendix-a/a.33.2.c: Ditto.
* gcc.dg/gomp/attrs-1.c: Ditto.
* gcc.dg/gomp/attrs-2.c: Ditto.
* gcc.dg/gomp/attrs-4.c: Ditto.
* gcc.dg/gomp/block-10.c: Ditto.
* gcc.dg/gomp/block-5.c: Ditto.
* gcc.dg/gomp/block-9.c: Ditto.
* gcc.dg/gomp/master-1.c: Ditto.
* gcc.dg/gomp/master-2.c: Ditto.
* gcc.dg/gomp/master-3.c: Ditto.
* gcc.dg/gomp/nesting-1.c: Ditto.
* gcc.dg/gomp/pr104517.c: Ditto.
* gcc.dg/gomp/pr29965-3.c: Ditto.
* gcc.dg/gomp/pr35818.c: Ditto.
* gcc.dg/gomp/pr91216.c: Ditto.
* gcc.dg/gomp/sharing-2.c: Ditto.
* gfortran.dg/gomp/adjust-args-10.f90: Ditto.
* gfortran.dg/gomp/affinity-1.f90: Ditto.
* gfortran.dg/gomp/allocate-clause.f90: Ditto.
* gfortran.dg/gomp/appendix-a/a.12.1.f90: Ditto.
* gfortran.dg/gomp/appendix-a/a.33.2.f90: Ditto.
* gfortran.dg/gomp/c_ptr_tests_20.f90: Ditto.
* gfortran.dg/gomp/c_ptr_tests_21.f90: Ditto.
* gfortran.dg/gomp/cancel-1.f90: Ditto.
* gfortran.dg/gomp/clauses-1.f90: Ditto.
* gfortran.dg/gomp/declare-variant-1.f90: Ditto.
* gfortran.dg/gomp/depend-iterator-1.f90: Ditto.
* gfortran.dg/gomp/depend-iterator-2.f90: Ditto.
* gfortran.dg/gomp/is_device_ptr-1.f90: Ditto.
* gfortran.dg/gomp/is_device_ptr-2.f90: Ditto.
* gfortran.dg/gomp/is_device_ptr-3.f90: Ditto.
* gfortran.dg/gomp/lastprivate-conditional-1.f90: Ditto.
* gfortran.dg/gomp/loop-4.f90: Ditto.
* gfortran.dg/gomp/loop-exit.f90: Ditto.
* gfortran.dg/gomp/map-3.f90: Ditto.
* gfortran.dg/gomp/nesting-2.f90: Ditto.
* gfortran.dg/gomp/nesting-3.f90: Ditto.
* gfortran.dg/gomp/nowait-2.f90: Ditto.
* gfortran.dg/gomp/nowait-4.f90: Ditto.
* gfortran.dg/gomp/nowait-5.f90: Ditto.
* gfortran.dg/gomp/openmp-simd-2.f90: Ditto.
* gfortran.dg/gomp/openmp-simd-3.f90: Ditto.
* gfortran.dg/gomp/parallel-master-1.f90: Ditto.
* gfortran.dg/gomp/parallel-master-2.f90: Ditto.
* gfortran.dg/gomp/pr107214-8.f90: Ditto.
* gfortran.dg/gomp/pr48117.f90: Ditto.
* gfortran.dg/gomp/pr94672.f90: Ditto.
* gfortran.dg/gomp/pr99928-1.f90: Suppression + fix whitespace.
* gfortran.dg/gomp/pr99928-11.f90: Suppression.
* gfortran.dg/gomp/pr99928-2.f90: Suppression + fix whitespace.
* gfortran.dg/gomp/pr99928-3.f90: Ditto.
* gfortran.dg/gomp/pr99928-4.f90: Ditto.
* gfortran.dg/gomp/pr99928-5.f90: Ditto.
* gfortran.dg/gomp/pr99928-6.f90: Ditto.
* gfortran.dg/gomp/pr99928-8.f90: Ditto.
* gfortran.dg/gomp/sharing-3.f90: Suppress deprecation warnings.
* gfortran.dg/gomp/strictly-structured-block-1.f90: Ditto.
* gfortran.dg/gomp/strictly-structured-block-2.f90: Ditto.
* gfortran.dg/gomp/target1.f90: Ditto.
* gfortran.dg/gomp/taskloop-1.f90: Ditto.
* gfortran.dg/gomp/taskloop-2.f90: Ditto.
* gfortran.dg/openmp-define-3.f90: Bump expected version.
* c-c++-common/gomp/master-construct-dep.c: New test.
* gfortran.dg/gomp/master-construct-dep.f90: New test.

5 days agolibstdc++: constexpr flat_set and flat_multiset
Yuao Ma [Thu, 11 Dec 2025 14:24:42 +0000 (22:24 +0800)] 
libstdc++: constexpr flat_set and flat_multiset

This patch makes flat_set and flat_multiset constexpr as part of P3372R3.

libstdc++-v3/ChangeLog:

* include/bits/version.def: Add FTM.
* include/bits/version.h: Regenerate.
* include/std/flat_set: Add constexpr.
* testsuite/23_containers/flat_multiset/1.cc: Add constexpr test.
* testsuite/23_containers/flat_set/1.cc: Add constexpr test.

5 days ago[PATCH] MAINTAINERS: add myself to write after approval
supers1ngular [Thu, 11 Dec 2025 12:22:23 +0000 (04:22 -0800)] 
[PATCH] MAINTAINERS: add myself to write after approval

ChangeLog:

* MAINTAINERS: add myself to write after approval

5 days agoAda: Fix internal error on illegal aggregate for private type
Eric Botcazou [Thu, 11 Dec 2025 09:07:15 +0000 (10:07 +0100)] 
Ada: Fix internal error on illegal aggregate for private type

This just adds a guard for illegal cases to Resolve_Record_Aggregate.

gcc/ada/
PR ada/123088
* sem_aggr.adb (Resolve_Record_Aggregate): Add missing guard.

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

5 days agoi386: Fix and rework Windows TLS support
Eric Botcazou [Thu, 11 Dec 2025 09:02:35 +0000 (10:02 +0100)] 
i386: Fix and rework Windows TLS support

The compiler can emit invalid movabs instructions at -O0 for TLS accesses in
64-bit mode on Windows, for example with the attached testcase:

eric@fomalhaut:~/build/gcc/x86_64-w64-mingw32> gcc/xgcc -Bgcc -c struct-2.c
/tmp/ccOM8wdd.s: Assembler messages:
/tmp/ccOM8wdd.s:34: Error: operand type mismatch for `movabs'

This fixes the issue by leveraging the existing pic_32bit_operand predicate,
and fixing an oversight present in it for a couple of decades.  The patch
also reworks the support to make use of the get_thread_pointer machinery as
for other platforms, of more comments and of shorter lines.

gcc/
PR target/80881
* config/i386/i386.h (DEFAULT_TLS_SEG_OFFSET): New define.
* config/mingw/mingw32.h (DEFAULT_TLS_SEG_OFFSET): Likewise.
* config/i386/i386.cc (ix86_tls_index): Fix long line.
(legitimize_tls_address): Use get_thread_pointer, add comments and
fix long lines.
* config/i386/i386.md (*load_tp_<mode>): Use DEFAULT_TLS_SEG_OFFSET
(*load_tp_x32_zext): Likewise.
(*add_tp_<mode>): Likewise.
(*add_tp_x32_zext): Likewise.
* config/i386/predicates.md (pic_32bit_operand): Fix oversight.
(symbolic_operand): Accept UNSPEC_SECREL32 with or without offset.

gcc/testsuite/
* gcc.dg/tls/struct-2.c: New test.

5 days agolibatomic: Regenerate Makefile.in
Mark Wielaard [Thu, 11 Dec 2025 10:15:46 +0000 (11:15 +0100)] 
libatomic: Regenerate Makefile.in

After regeneration in commit e5d853bbe9b0 ("Factor out thread model
detection with new `GCC_AC_THREAD_MODEL` macro") some whitespace was
removed from the Makefile.in files under libatomic. Fix this by
regenerating them again.

libatomic/ChangeLog:

* Makefile.in: Regenerate.
* testsuite/Makefile.in: Regenerate.

5 days agoUpdate my maintainer entry email
Pengxuan Zheng [Thu, 11 Dec 2025 02:58:37 +0000 (18:58 -0800)] 
Update my maintainer entry email

Just updating with my new email address.

ChangeLog:

* MAINTAINERS (Pengxuan Zheng): Update email address.

Signed-off-by: Pengxuan Zheng <pengxuan.zheng@oss.qualcomm.com>
5 days agoDaily bump.
GCC Administrator [Thu, 11 Dec 2025 00:16:27 +0000 (00:16 +0000)] 
Daily bump.

5 days agox86: improve lea peepholes
Alexandre Oliva [Wed, 10 Dec 2025 23:56:17 +0000 (20:56 -0300)] 
x86: improve lea peepholes

gcc.target/i386/lea-3.c fails on ia32 with PIE enabled by default.
There are two reasons for that:

- setting up the PIC register requires one addl instruction, and the
  testcase wants none

- the expected lea-combining peephole doesn't get applied for two
  reasons:

-- the second insn of the pair that could be turned into a single lea
   doesn't clobber CC, but the existing peephole2 requires an add with
   such a clobber

-- the first and second insns set different regs, and the existing
   peephole2 requires them to be the same

Add extra peephole2s for when the second insn doesn't clobber CC, and
for when the first set reg is different, but it dies at the second
insn.

Adjust lea-3.c to run with -fno-PIE, and add lea-4.c with -fPIE.

The last of the newly-added peephole2s, that enables lea-4.c to pass,
also hits during an i686-linux-gnu bootstrap (without PIE enabled),
while building shared libraries for the target.  I haven't been able
to exercise the other 2, but I haven't tried very hard, and I see no
why they couldn't possibly hit, so I left them in.

for  gcc/ChangeLog

* config/i386/i386.md (lea peephole2): Add 3 new variants.

for  gcc/testsuite/ChangeLog

* gcc.target/i386/lea-3.c: Add -fno-PIE.
* gcc.target/i386/lea-4.c: New, with -fPIE.

5 days ago[testsuite] [ia32] adjust testcases to cope with default-to-PIE
Alexandre Oliva [Wed, 10 Dec 2025 23:56:15 +0000 (20:56 -0300)] 
[testsuite] [ia32] adjust testcases to cope with default-to-PIE

A few testcases new in gcc-15 fail on i686-linux-gnu with PIE enabled
by default.  Add -fno-PIE so that they find the code they test for.

for  gcc/testsuite/ChangeLog

* gcc.dg/sibcall-12.c: Add -fno-PIE on ia32.
* gcc.target/i386/pr106060-2.c: Likewise.
* gcc.target/i386/pr106060-3.c: Likewise.
* gcc.target/i386/vect-shiftv4qi.c: Likewise.

6 days agovect-generic: Fix expand_vector_mult [PR123069]
Jakub Jelinek [Wed, 10 Dec 2025 17:07:02 +0000 (18:07 +0100)] 
vect-generic: Fix expand_vector_mult [PR123069]

The r16-5095 PR122065 change added build_int_cst call on vector types.
That is never correct, it ICEs already on the TYPE_PRECISION used at the
start of wide_int_to_tree_1.

Fixed by using build_zero_cst instead.

2025-12-10  Jakub Jelinek  <jakub@redhat.com>
    Andrew Pinski  <andrew.pinski@oss.qualcomm.com>

PR middle-end/123069
* tree-vect-generic.cc (expand_vector_mult): Use
build_zero_cst (vectype) instead of build_int_cst (vectype, 0).

* gcc.c-torture/compile/pr123069.c: New test.

6 days agoa68: add entry for OPT_L in algol68/lang.opt
Jose E. Marchesi [Wed, 10 Dec 2025 03:30:54 +0000 (04:30 +0100)] 
a68: add entry for OPT_L in algol68/lang.opt

We need to handle OPT_L in ga68 in order to add the specified
directories to the modules search path.  This patch adds the necessary
entry in algol68/lang.opt.

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>
gcc/algol68/ChangeLog

* lang.opt: Add entry for OPT_L.

6 days agoa68: do not try extensionless packet files in a68_get_packet_exports
Jose E. Marchesi [Wed, 10 Dec 2025 03:30:37 +0000 (04:30 +0100)] 
a68: do not try extensionless packet files in a68_get_packet_exports

This commit makes ga68 to not look to exports data in files without
extensions, i.e. to not look in a file `foo' for packet Foo. The files
to try are: first foo.m68, then libfoo.so, then libfoo.a, finally
foo.o.

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>
gcc/algol68/ChangeLog

* a68-imports.cc (a68_try_packet_in_directory): do not try
extensionless packet files.

6 days agoa68: fix a68_int_sign and a68_real_sign
Jose E. Marchesi [Tue, 9 Dec 2025 23:10:05 +0000 (00:10 +0100)] 
a68: fix a68_int_sign and a68_real_sign

This commit fixes the lowerer for `sign' operator for ints and reals
to not gimplify its operand twice.

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>
gcc/algol68/ChangeLog

* a68-low-ints.cc (a68_int_sign): Avoid gimplifying val twice.
* a68-low-reals.cc (a68_real_sign): Likewise.

gcc/testsuite/ChangeLog

* algol68/execute/sign-int-2.a68: New test.
* algol68/execute/sign-real-2.a68: Likewise.

6 days agoa68: fix `int * char' lowerer
Jose E. Marchesi [Tue, 9 Dec 2025 22:53:24 +0000 (23:53 +0100)] 
a68: fix `int * char' lowerer

This commit fixes the asserts in a68_loer_char_mult3 so it expects
either int*char or char*int.  It also expands the mult-char-1.a68
testcase to cover this case.

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>
gcc/algol68/ChangeLog

* a68-low-prelude.cc (a68_lower_char_mult3): Fix asserts.

gcc/testsuite/ChangeLog

* algol68/execute/mult-char-1.a68: Cover int*char cases.

6 days agoc++/modules: #include <vector> -> import <bits/stdc++.h>
Jason Merrill [Wed, 10 Dec 2025 15:11:26 +0000 (23:11 +0800)] 
c++/modules: #include <vector> -> import <bits/stdc++.h>

Since the standard library doesn't preclude an #include of a standard
library header from bringing in declarations from other headers, we can
translate an #include of any of the importable headers as an import of
<bits/stdc++.h>.

To reduce the amount of C++ standard knowledge encoded in libcpp, I extend
the translate_include callback to allow it to suggest an alternate header to
try translating.  It's a bit awkward to bounce back and forth, but this
seems like the right division of responsibilities.

libcpp/ChangeLog:

* include/cpplib.h (struct cpp_callbacks): Replace 'path' parameter
with file, angle_brackets, and alternate name.
(cpp_get_name): Declare.
* files.cc (cpp_get_name): New.
(_cpp_stack_include, _cpp_post_stack_file, _cpp_stack_file)
(_cpp_stack_translated_file): Refactor, try alternate file.

gcc/cp/ChangeLog:

* module.cc (maybe_translate_include): Suggest <bits/stdc++.h>
as an alternate for importable standard library headers.
(importable_headers, is_importable_header): New.

gcc/ChangeLog:

* doc/invoke.texi (C++ Modules): Remove standard library header
units from missing pieces, mention importable header redirection.

gcc/testsuite/ChangeLog:

* g++.dg/modules/compile-std1.C: Test <vector> translation.

6 days agoc++: clean up gcms from compile-std1.C
Jason Merrill [Wed, 10 Dec 2025 09:32:59 +0000 (17:32 +0800)] 
c++: clean up gcms from compile-std1.C

I noticed that the .gcms from compile-std1.C were sticking around and
confusing other tests; this patch enhances dg-module-cmi to understand
<header> and adds the appropriate directives to the test.

gcc/testsuite/ChangeLog:

* g++.dg/modules/compile-std1.C: Add dg-module-cmi lines.
* g++.dg/modules/modules.exp (host_header_path): New.
(munge_cmi): Factor out...
(dg-module-cmi): ...from here.

6 days agoRISC-V: Move pr123074.C to g++.target.
Robin Dapp [Wed, 10 Dec 2025 08:19:39 +0000 (09:19 +0100)] 
RISC-V: Move pr123074.C to g++.target.

Andrew noticed that I added a c++ file to the wrong dir.  This patch
corrects it.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/pr123074.C: Move to...
* g++.target/riscv/rvv/autovec/pr123074.C: ...here.
* gcc.target/riscv/rvv/rvv.exp: Remove 'C'.

6 days agolibsanitizer: Update LOCAL_PATCHES
Rainer Orth [Wed, 10 Dec 2025 08:33:36 +0000 (09:33 +0100)] 
libsanitizer: Update LOCAL_PATCHES

This patch updates LOCAL_PATCHES for

commit 203d4dd09ba83121e447ce93ba98175b68d955f6
Author: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Date:   Wed Dec 10 09:24:53 2025 +0100

    libsanitizer: Restore local sanitizer_redefine_builtins.h patch

2025-12-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

libsanitizer:
* LOCAL_PATCHES: Update.

6 days agolibsanitizer: Restore local sanitizer_redefine_builtins.h patch
Rainer Orth [Wed, 10 Dec 2025 08:24:53 +0000 (09:24 +0100)] 
libsanitizer: Restore local sanitizer_redefine_builtins.h patch

The recent libsanitizer update broke the Solaris/SPARC build with the
native assembler: many files don't compile any longer like

/usr/bin/as: "/var/tmp//ccYsT60a.s", line 5: error: unknown opcode ".set"
/usr/bin/as: "/var/tmp//ccYsT60a.s", line 5: error: statement syntax
/usr/bin/as: "/var/tmp//ccYsT60a.s", line 6: error: unknown opcode ".set"
/usr/bin/as: "/var/tmp//ccYsT60a.s", line 6: error: statement syntax
/usr/bin/as: "/var/tmp//ccYsT60a.s", line 7: error: unknown opcode ".set"
/usr/bin/as: "/var/tmp//ccYsT60a.s", line 7: error: statement syntax

This happens because sanitizer_common/sanitizer_redefine_builtins.h lost
a local patch that guards use of .set in asm by HAVE_AS_SYM_ASSIGN.
This patch restores that patch.

Although the Darwin assembler accepts .set (thus HAVE_AS_SYM_ASSIGN is
defined), the __APPLE__ guard is kept to guard against the link failures
that prompted its upstreadm addition in LLVM commit

commit cfdbbb8fcc62f75dcf0b251dfab63353f3921227
Author: Dan Blackwell <dan_blackwell@apple.com>
Date:   Fri Aug 15 09:13:26 2025 +0100

    [sanitizer_common] Disable sanitizer_redefine_builtins on Apple platforms (#153381)

even though they didn't happen in the GCC build.

It also keeps the _AIX guard due to LLVM commit

commit d7c6cad744bc7ed28535dc6f75629902eda559ea
Author: Jake Egan <Jake.egan@ibm.com>
Date:   Wed Jun 11 20:22:15 2025 -0400

    [sanitizer_common] Implement interception on AIX (#138606)

Bootstrapped without regressions on sparc-sun-solaris2.11 with gas and
as, i386-pc-solaris2.11, x86_64-pc-linux-gnu, and
x86_64-apple-darwin25.1.0.

6 days agoFix PID_TYPE on 32-bit Solaris
Rainer Orth [Wed, 10 Dec 2025 08:05:55 +0000 (09:05 +0100)] 
Fix PID_TYPE on 32-bit Solaris

The pid_t type on 32-bit Solaris differs from gcc's builtin.

<sys/types.h> has

typedef int pid_t; /* process id type */
typedef long pid_t; /* (historical version) */

while gcc/defaults.h uses

on all targets.

This patch fixes this by providing a Solaris definition.
g++.dg/lookup/extern-c-redecl3.C had to be adjusted accordingly.

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

2025-11-17  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc:
* config/sol2.h (PID_TYPE): Define.
* doc/tm.texi.in (Type Layout): Document PID_TYPE.
* doc/tm.texi: Regenerate.

gcc/testsuite:
* g++.dg/lookup/extern-c-redecl3.C (pid_t): Define.
Use it for fork return type.
terms of __builtin_fork.
* g++.dg/pid_t-1.C: New test.
* gcc.dg/pid_t-1.c: Likewise.

6 days agoDaily bump.
GCC Administrator [Wed, 10 Dec 2025 00:16:32 +0000 (00:16 +0000)] 
Daily bump.

6 days agolibgcc: Dont use TARGET_SYSTEM_ROOT from gcc
John Ericson [Tue, 9 Dec 2025 22:06:52 +0000 (22:06 +0000)] 
libgcc: Dont use TARGET_SYSTEM_ROOT from gcc

Following Andrew Pinski's suggestions in
https://gcc.gnu.org/pipermail/gcc-patches/2025-July/689683.html, just
use the output of:

   $(CC) -print-sysroot

It is just used in one spot, in an AIX code-path. I just made (within
make) a shell variable to use instead.

I don't have AIX on-hand to test this, however.

gcc/ChangeLog:

* Makefile.in: No longer include TARGET_SYSTEM_ROOT in
libgcc.mvars.

libgcc/ChangeLog:

* config/rs6000/t-slibgcc-aix: Instead of using a
TARGET_SYSTEM_ROOT make variable, just define a shell variable
as part of the rule and use that.

Suggested-by: Andrew Pinski <quic_apinski@quicinc.com>
Signed-off-by: John Ericson <git@JohnEricson.me>
6 days agoMove NO_PIE_CFLAGS logic from gcc to libgcc
John Ericson [Tue, 9 Dec 2025 22:06:51 +0000 (22:06 +0000)] 
Move NO_PIE_CFLAGS logic from gcc to libgcc

My goal is to be able to build libgcc cleanly in isolation --- today one
needs to figure `make ...` misc things in the gcc subdir.

Following Andrew Pinski's suggestions in
https://gcc.gnu.org/pipermail/gcc-patches/2025-July/689683.html, this
commit moves the NO_PIE_CFLAGS logic.

gcc/ChangeLog:

* Makefile.in:: Remove NO_PIE_CFLAGS logic, since it is now in
libgcc.
* configure: Regenerate.
* configure.ac: Remove the enable_default_pie substitution, since
libgcc now has its own logic.

libgcc/ChangeLog:

* Makefile.in: Define NO_PIE_CFLAGS make variable via autoconf
substitution.
* configure: Regenerate.
* configure.ac: New configure check to define NO_PIE_CFLAGS
using the algorithm Andrew asked for in the linked mail.

Suggested-by: Andrew Pinski <quic_apinski@quicinc.com>
Signed-off-by: John Ericson <git@JohnEricson.me>
6 days agoFactor out thread model detection with new `GCC_AC_THREAD_MODEL` macro
John Ericson [Tue, 9 Dec 2025 22:06:48 +0000 (22:06 +0000)] 
Factor out thread model detection with new `GCC_AC_THREAD_MODEL` macro

This macro deduplicates the

    $CC -v 2>&1 | sed -n 's/^Thread model: //p'

check that was occurring in various runtime libs.

Additionally, as a bit of an Easter egg, this also allows overriding
what the compiler would return by setting the
`gcc_cv_target_thread_file` cache variable first. I admit that it is in
fact this Easter egg that led me to write the patch. The use-case for it
is for making multilib builds where the library sets do not all share
the same thread model easier. See also `THREAD_MODEL_SPEC` for more
about the varying thread models use-case.

Arguably one could could try to define on `THREAD_MODEL_SPEC` on more
platforms (besides e.g. AIX) but the ramifications of this are a bit
unclear. Setting `gcc_cv_target_thread_file` directly is a "low tech"
solution that will work for now for sure. Of course, since setting a
cache variable like this a hacky trick, I will not expect this to be at
all stable/guaranteed to work, going forward.

Thanks to Arsen who on IRC discussed these things with me, including in
particular making it a cache var not `--with-model` flag, to not
prematurely foster expectations that this is stable.

Suggested-by: Arsen Arsenović <arsen@aarsen.me>
config/ChangeLog:

* gthr.m4: Create new GCC_AC_THREAD_MODEL macro

libatomic/ChangeLog:

* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure: Regenerate.
* configure.ac: Use GCC_AC_THREAD_MODEL instead of hand-rolled
* testsuite/Makefile.in: Regenerate.

libgcc/ChangeLog:

* configure: Regenerate.
* configure.ac: Use GCC_AC_THREAD_MODEL instead of hand-rolled

libphobos/ChangeLog:

* configure: Regenerate.
* m4/druntime/os.m4: Use AC_MSG_ERROR, not private as_fn_error

libstdc++-v3/ChangeLog:

* acinclude.m4: Use GCC_AC_THREAD_MODEL instead, via AC_REQUIRE
* configure: Regenerate.

7 days agolibstdc++: Regenerate <bits/version.h>
Jonathan Wakely [Tue, 9 Dec 2025 21:05:02 +0000 (21:05 +0000)] 
libstdc++: Regenerate <bits/version.h>

Some pre-r16-4328-g71e95e871d62e4 comments sneaked back in with some
recent commits.

libstdc++-v3/ChangeLog:

* include/bits/version.h: Regenerate.

7 days agolibstdc++: Set __cpp_lib_submdspan to 202411.
Luc Grosheintz [Mon, 8 Dec 2025 20:23:46 +0000 (21:23 +0100)] 
libstdc++: Set __cpp_lib_submdspan to 202411.

The submdspan feature is complete and this commit sets the feature
testing macros accordingly. Also makes the feature testing macro
submdspan depend on constant_wrapper.

Also changes the value of the internal feature testing macro for padded
layouts to 202403.

libstdc++-v3/ChangeLog:

* include/bits/version.def (padded_layouts): Set to 202403.
(submdspan): Set to 202411 add dependency.
* include/bits/version.h: Regenerate.

Reviewed-by: Tomasz KamiƄski <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
7 days agovect: Reset using_select_vl_p before starting over [PR123074].
Robin Dapp [Tue, 9 Dec 2025 12:07:36 +0000 (13:07 +0100)] 
vect: Reset using_select_vl_p before starting over [PR123074].

In the PR we ICE accessing the loop lens in
vect_get_loop_variant_data_ptr_increment when building 510.parest.
This function only gets called when we use SELECT_VL for the loop
control, however during initialization of the loop lens partial
vectors, a prerequisite for SELECT_VL, was false while using_select_vl
was true.  We reset using_partial_vectors when restarting the analysis
after forcing single-lane SLP but don't reset using_select_vl.

This patch resets it as well.

PR tree-optimization/123074

gcc/ChangeLog:

* tree-vect-loop.cc: Reset LOOP_VINFO_USING_SELECT_VL_P.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/rvv.exp: Include *.C.
* gcc.target/riscv/rvv/autovec/pr123074.C: New test.

7 days agoc: ICE in gimplify_expr when counted_by for pointer is added [PR122982]
Qing Zhao [Tue, 9 Dec 2025 14:21:55 +0000 (14:21 +0000)] 
c: ICE in gimplify_expr when counted_by for pointer is added [PR122982]

The first argument of the call to .ACCESS_WITH_SIZE includes
"c_maybe_const_expr" which should not be passed to gimplifier.

Before passing the expression as the first argument to the call to
.ACCESS_WITH_SIZE, c_fully_fold should be called on this expression.

PR c/122982

gcc/c/ChangeLog:

* c-typeck.cc (build_access_with_size_for_counted_by): Call
c_fully_fold on the first parameter.

gcc/testsuite/ChangeLog:

* gcc.dg/pointer-counted-by-pr122982.c: New test.

7 days agolibstdc++: Implement submdspan_mapping for layout_right_padded. [PR110352]
Luc Grosheintz [Mon, 8 Dec 2025 20:23:45 +0000 (21:23 +0100)] 
libstdc++: Implement submdspan_mapping for layout_right_padded. [PR110352]

Implements submdspan for layout_right_padded as described in P3663.

PR libstdc++/110352

libstdc++-v3/ChangeLog:

* include/std/mdspan
(__mdspan::_SubMdspanMapping<_LayoutSide::__right, true>): Define.
(layout_right_padded::submdspan_mapping): New friend function.
* testsuite/23_containers/mdspan/submdspan/selections/right_padded.cc:
Instantiate tests for layout_right_padded.
* testsuite/23_containers/mdspan/submdspan/submdspan_mapping.cc:
Ditto.

Reviewed-by: Tomasz KamiƄski <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
7 days agolibstdc++: Implement submdspan_mapping for layout_left_padded. [PR110352]
Luc Grosheintz [Mon, 8 Dec 2025 20:23:44 +0000 (21:23 +0100)] 
libstdc++: Implement submdspan_mapping for layout_left_padded. [PR110352]

Implements submdspan for layout_left_padded as described in P3663.

PR libstdc++/110352

libstdc++-v3/ChangeLog:

* include/std/mdspan (__mdspan::__is_padded_mapping): Define.
(__mdspan::_SubMdspanMapping): Add _Padded template parameter.
(__mdspan::_SubMdspanMapping<_LayoutSide::__left, true>): Define.
(__mdspan::__submdspan_mapping_impl): Updated _Trait alias.
(layout_left_padded::submdspan_mapping): New friend method.
* testsuite/23_containers/mdspan/layout_traits.h
(LayoutTraits::layout_same_padded): New template type alias.
* testsuite/23_containers/mdspan/submdspan/selections/left_padded.cc:
Instantiate tests for layout_left_padded.
* testsuite/23_containers/mdspan/submdspan/submdspan_mapping.cc:
Ditto.

Reviewed-by: Tomasz KamiƄski <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
7 days agoRISC-V: Add test for vec_duplicate + vmslt.vv combine with GR2VR cost 0, 1 and 15
Pan Li [Mon, 8 Dec 2025 12:48:29 +0000 (20:48 +0800)] 
RISC-V: Add test for vec_duplicate + vmslt.vv combine with GR2VR cost 0, 1 and 15

Add asm dump check and run test for vec_duplicate + vmslt.vv
combine to vmslt.vx, with the GR2VR cost is 0, 2 and 15.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i16.c: Add asm check
for vmslt.vx.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i32.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i64.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i8.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i16.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i32.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i64.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i8.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i16.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i32.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i64.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i8.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_binary.h: Add test
helper macros.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_binary_data.h: Add test
data for run test.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i16.c: New test.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i32.c: New test.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i64.c: New test.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i8.c: New test.

Signed-off-by: Pan Li <pan2.li@intel.com>
7 days agoRISC-V: Combine vec_duplicate + vmslt.vv to vmslt.vx on GR2VR cost
Pan Li [Mon, 8 Dec 2025 12:45:56 +0000 (20:45 +0800)] 
RISC-V: Combine vec_duplicate + vmslt.vv to vmslt.vx on GR2VR cost

This patch would like to combine the vec_duplicate + vmslt.wv to the
vmslt.vx.  From example as below code.  The related pattern will depend
on the cost of vec_duplicate from GR2VR.  Then the late-combine will
take action if the cost of GR2VR is zero, and reject the combination
if the GR2VR cost is greater than zero.

Assume we have asm code like below, GR2VR cost is 0.

Before this patch:
  11       beq a3,zero,.L8
  12       vsetvli a5,zero,e32,m1,ta,ma
  13       vmv.v.x v2,a2
  ...
  16   .L3:
  17       vsetvli a5,a3,e32,m1,ta,ma
  ...
  22       vmslt.vv v1,v2,v3
  ...
  25       bne a3,zero,.L3

After this patch:
  11       beq a3,zero,.L8
  ...
  14    .L3:
  15       vsetvli a5,a3,e32,m1,ta,ma
  ...
  20       vmslt.vx v1,a2,v3
  ...
  23       bne a3,zero,.L3

gcc/ChangeLog:

* config/riscv/predicates.md: Append operator lt to
the comparison_swappable_operator.
* config/riscv/riscv-v.cc (get_swapped_cmp_rtx_code): Add
swappable operator lt handing.

Signed-off-by: Pan Li <pan2.li@intel.com>
7 days agotarget/121230 - x86 vector CTOR cost with 387 math
Richard Biener [Mon, 8 Dec 2025 13:36:58 +0000 (14:36 +0100)] 
target/121230 - x86 vector CTOR cost with 387 math

The following adjusts costing of vector construction from scalars for
FP modes which with 387 math can reside in FP regs which need spilling
to be reloaded to XMM.  I've played on the safe side with mixed
SSE/387 math.

PR target/121230
* config/i386/i386.cc (ix86_vector_costs::add_stmt_cost):
With FP mode and 387 math cost spill/reload.

* gcc.target/i386/pr121230.c: New testcase.

7 days agotestsuite/120167 - avoid IPA messing up with test
Richard Biener [Tue, 9 Dec 2025 13:54:39 +0000 (14:54 +0100)] 
testsuite/120167 - avoid IPA messing up with test

The following avoids cloning / IPA CP to mess up dump counting.

PR testsuite/120167
libgomp/
* testsuite/libgomp.graphite/force-parallel-1.c: Make parloop
noipa.

7 days agoRISC-V: Regenerate opt urls.
Robin Dapp [Tue, 9 Dec 2025 13:22:47 +0000 (14:22 +0100)] 
RISC-V: Regenerate opt urls.

I forgot to regenerate the opt urls.  This patch makes up for it.

gcc/ChangeLog:

* config/riscv/riscv.opt.urls:  Regenerate.

7 days agolibstdc++: Implement submdspan_mapping for layout_stride. [PR110352]
Luc Grosheintz [Mon, 8 Dec 2025 20:23:43 +0000 (21:23 +0100)] 
libstdc++: Implement submdspan_mapping for layout_stride. [PR110352]

Add submdspan_mapping for layout_stride as in P3663.

PR libstdc++/110352

libstdc++-v3/ChangeLog:

* include/std/mdspan (layout_stride::mapping::submdspan_mapping): New
friend function.
* testsuite/23_containers/mdspan/submdspan/selections/stride.cc:
Instantiate tests for layout_stride.
* testsuite/23_containers/mdspan/submdspan/submdspan_neg.cc:
Ditto.
* testsuite/23_containers/mdspan/submdspan/submdspan_mapping.cc:
Add tests for layout_stride.

Reviewed-by: Tomasz KamiƄski <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
7 days agolibstdc++: Implement submdspan_mapping for layout_right. [PR110352]
Luc Grosheintz [Mon, 8 Dec 2025 20:23:42 +0000 (21:23 +0100)] 
libstdc++: Implement submdspan_mapping for layout_right. [PR110352]

Adds submdspan_mapping for layout_right as described in P3663.

PR libstdc++/110352

libstdc++-v3/ChangeLog:

* include/std/mdspan
(__mdspan::_SubMdspanMapping<_LayoutSide::__right>): Define.
(layout_right::mapping::submdspan_mapping): New friend function.
* testsuite/23_containers/mdspan/submdspan/selections/right.cc:
Instantiate tests for layout_right.
* testsuite/23_containers/mdspan/submdspan/submdspan_mapping.cc:
Ditto.
* testsuite/23_containers/mdspan/submdspan/submdspan_neg.cc:
Ditto.

Reviewed-by: Tomasz KamiƄski <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
7 days agolibstdc++: Implement submdspan and submdspan_mapping for layout_left. [PR110352]
Luc Grosheintz [Mon, 8 Dec 2025 20:23:41 +0000 (21:23 +0100)] 
libstdc++: Implement submdspan and submdspan_mapping for layout_left. [PR110352]

Implements `submdspan` and `submdspan_mapping` for layout_left as
described in P3663 (Future proofing mdspan).

When computing the offset of the submdspan, one must check that the
lower bound of the slice range isn't out-of-range. There's a few
cases when the lower bound is never out-of-range:

  - full_extent and exts.extent(k) != 0,
  - collapsing slice types.

If those conditions are known to hold, no checks are generated.

Similarly, if all slices are full_extent, there's no need to call
mapping(0,...,0) for standardized mappings.

The implementation prepares to use the symmetry between layout_left and
layout_right and introduces concepts like a "layout side", i.e. left,
right or unknown/strided.

The tests use an iterator to replace nested for-loops. Which also makes
it easier to write the core test logic in a rank-independent manner.

PR libstdc++/110352

libstdc++-v3/ChangeLog:

* include/std/mdspan (__mdspan::__is_submdspan_mapping_result)
(__mdspan::__submdspan_mapping_result, __mdspan::__fwd_prod)
(__mdspan::__acceptable_slice_type, __mdspan::__slice_begin)
(__mdspan::__suboffset, __mdspan::_LayoutSide, __mdspan::__mapping_side)
(__mdspan::_StridesTrait, __mdspan::__substrides_generic)
(__mdspan::__substrides_standardized, __mdspan::__substrides)
(__mdspan::__is_unit_stride_slice, __mdspan::_SliceKind)
(__mdspan::__make_slice_kind, __mdspan::__make_slice_kind_array)
(__mdspan::__is_block, __mdspan::__padded_block_begin_generic)
(__mdspan::__padded_block_begin, __mpdspan::_SubMdspanMapping)
(__mdspan::__submdspan_mapping_impl): Define.
(__mdspan::__dynamic_slice_extent, __mdspan::__static_slice_extent)
(__mdspan::__subextents): Move earlier in the file.
(layout_left::mapping::submdspan_mapping, __mdspan::__sliceable_mapping)
(__mdspan::__submapping, submdspan): Define.
* src/c++23/std.cc.in: Add submdspan.
* testsuite/23_containers/mdspan/submdspan/generic.cc: New test.
* testsuite/23_containers/mdspan/submdspan/selections/left.cc:
Instantiate selection tests for layout_left.
* testsuite/23_containers/mdspan/submdspan/selections/testcases.h: Generic
tests different selections.
* testsuite/23_containers/mdspan/submdspan/submdspan_mapping.cc: New test.
* testsuite/23_containers/mdspan/submdspan/submdspan_neg.cc: New test.

Reviewed-by: Tomasz KamiƄski <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
7 days agoRevert "c++: Non-inline temploid friends should still be COMDAT [PR122819]"
Nathaniel Shead [Tue, 9 Dec 2025 12:33:41 +0000 (23:33 +1100)] 
Revert "c++: Non-inline temploid friends should still be COMDAT [PR122819]"

This reverts commit cf22e30f0cfae65dd012966cab657583e2be667e.

7 days agolibstdc++: Silence warning in mdspan.
Luc Grosheintz [Mon, 8 Dec 2025 20:23:40 +0000 (21:23 +0100)] 
libstdc++: Silence warning in mdspan.

Splitting the tests for submdspan triggered a compiler warning. This
commit changes the implementation of __dynamic_extents. In particular,
how the span is created. Functionally, the two are equivalent.

libstdc++-v3/ChangeLog:

* include/std/mdspan (_ExtentsStorage::_M_dynamic_extents):
Create span from pointer + size, not begin and end iterators.

Reviewed-by: Tomasz KamiƄski <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
7 days agoamdgcn: Adjust failure mode for gfx908 USM
Andrew Stubbs [Mon, 8 Dec 2025 16:18:59 +0000 (16:18 +0000)] 
amdgcn: Adjust failure mode for gfx908 USM

Unified Shared Memory does not appear to work well on gfx908, which is why we
disabled xnack by default.  For this reason it makes sense to inform the user
as compile time, but this is causing trouble in the testsuite which assumes
that USM only fails at runtime.

This patch changes the gfx908 compile time message to a warning only (in case
some other target does this differently), and prevents the tests from
attempting to run in host-fallback mode (given that that is not what they are
trying to test).  It also changes the existing warning to only fire once.

The patch assumes that effective target "omp_usm" also implies self-maps.

gcc/ChangeLog:

* config/gcn/gcn.cc (gcn_init_cumulative_args): Only warn once.
Use "required" instead of "enabled" in the warning.
* config/gcn/mkoffload.cc (process_asm): Warn, don't error.
Use "required" instead of "on" in the warning.

libgomp/ChangeLog:

* testsuite/lib/libgomp.exp (check_effective_target_omp_usm): New.
* testsuite/libgomp.c++/target-std__array-concurrent-usm.C: Require
working Unified Shared Memory to run the test.
* testsuite/libgomp.c++/target-std__bitset-concurrent-usm.C: Likewise.
* testsuite/libgomp.c++/target-std__deque-concurrent-usm.C: Likewise.
* testsuite/libgomp.c++/target-std__forward_list-concurrent-usm.C:
Likewise.
* testsuite/libgomp.c++/target-std__list-concurrent-usm.C: Likewise.
* testsuite/libgomp.c++/target-std__map-concurrent-usm.C: Likewise.
* testsuite/libgomp.c++/target-std__multimap-concurrent-usm.C:
Likewise.
* testsuite/libgomp.c++/target-std__multiset-concurrent-usm.C:
Likewise.
* testsuite/libgomp.c++/target-std__set-concurrent-usm.C: Likewise.
* testsuite/libgomp.c++/target-std__span-concurrent-usm.C: Likewise.
* testsuite/libgomp.c++/target-std__valarray-concurrent-usm.C:
Likewise.
* testsuite/libgomp.c++/target-std__vector-concurrent-usm.C: Likewise.
* testsuite/libgomp.c-c++-common/target-implicit-map-4.c: Likewise.
* testsuite/libgomp.c-c++-common/target-link-3.c: Likewise.
* testsuite/libgomp.c-c++-common/target-link-4.c: Likewise.
* testsuite/libgomp.fortran/self_maps.f90: Likewise.

7 days agoc: Reject vector type bit-fields [PR123018]
Jakub Jelinek [Tue, 9 Dec 2025 09:22:26 +0000 (10:22 +0100)] 
c: Reject vector type bit-fields [PR123018]

The following testcase ICEs since checking has been added to TYPE_PRECISION
macro.  check_bitfield_type_and_width is called when attributes haven't
been applied to the bit-field decl yet and so it still has INTEGER_TYPE
type, while at finish_struct time it already has VECTOR_TYPE.

The following patch just repeats the check_bitfield_type_and_width
in there.

Another option would be let handle_vector_size_attribute check for
bit-fields and error out there.

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

PR c/123018
* c-decl.cc (finish_struct): Diagnose bit-fields with vector type.

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

7 days agofold: Elide MASK_LEN_LOAD/STORE with zero length [PR122635].
Robin Dapp [Tue, 25 Nov 2025 09:34:55 +0000 (10:34 +0100)] 
fold: Elide MASK_LEN_LOAD/STORE with zero length [PR122635].

This patch adds zero-length handling to gimple_fold_partial_store and
gimple_fold_partial_load and unifies them into
gimple_fold_partial_load_store.

It introduces a new function partial_load_store_mask_state that
returns
 MASK_ALL_INACTIVE,
 MASK_ALL_ACTIVE, or
 MASK_UNKNOWN.

This result is used to either replace a load with its else value and
elide a store (when all inactive), turn the load/store into a regular
mem ref (all_active), or do nothing.

PR tree-optimization/122635

gcc/ChangeLog:

* gimple-fold.cc (enum mask_load_store_state): New enum.
(gimple_fold_partial_load_store_mem_ref): Only fold
"all active" loads/stores.
(partial_load_store_mask_state): New function to compute mask
state.
(gimple_fold_partial_load): Remove.
(gimple_fold_partial_load_store): New function.
(gimple_fold_partial_store): Remove.
(gimple_fold_call): Use new function.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/sve/pfalse-store.c: Expect more elided
stores.
* gcc.target/riscv/rvv/autovec/pr122635-1.c: New test.
* gcc.target/riscv/rvv/autovec/pr122635-2.c: New test.
* gcc.target/powerpc/p9-vec-length-epil-8.c: Expect two lxvl
less.

7 days agooptabs: Add else operand to LEN_LOAD.
Robin Dapp [Fri, 28 Nov 2025 15:24:38 +0000 (16:24 +0100)] 
optabs: Add else operand to LEN_LOAD.

When adding else operands to maskload and friends we didn't bother to do
the same for len_load (as we never use the residual elements anyway).
In order to simplify handling in gimple-fold, this patch adds the else
operand now.  Both, power and s390, zero out inactive elements.

gcc/ChangeLog:

* config/rs6000/predicates.md (lxvl_else_operand): New
predicate.
* config/rs6000/vsx.md: Add else operand.
* config/s390/predicates.md (vll_else_operand): New predicate.
* config/s390/vector.md: Add else operand.
* doc/md.texi: Document else operand.
* internal-fn.cc (internal_fn_len_index): Adjust IFN_LEN_LOAD.
(internal_fn_else_index): Add IFN_LEN_LOAD.
* optabs-tree.cc (target_supports_len_load_store_p): Get else
value for len_load.
* tree-vect-stmts.cc (vectorizable_load): Pun the else value
type.

7 days agoRISC-V: -mmax-vectorization.
Robin Dapp [Fri, 14 Nov 2025 14:50:05 +0000 (15:50 +0100)] 
RISC-V: -mmax-vectorization.

This adds an -mmax-vectorization option to riscv, a verbatim copy from
aarch64.  It is an option for vector code analysis.  Internally it increases
scalar costs by a large factor so every vector approach will be
profitable.  As opposed to -fno-vect-cost-model, we will still compare
the vector approaches amongst each other, though.

In order to handle this argument without an '=' I needed to change the
parsing flow slightly.

gcc/ChangeLog:

* config/riscv/riscv-target-attr.cc (riscv_target_attr_parser::handle_max_vect):
New parser entry.
(riscv_target_attr_parser::update_settings): Set max-vect
option.
(riscv_process_one_target_attr): Change null-arg handling.
* config/riscv/riscv.cc (riscv_override_options_internal): Set
max-vect option.
* config/riscv/riscv.opt: Add -mmax-vectorization option.
* doc/extend.texi: Document new option.
* doc/invoke.texi: Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/max-vect-1.c: New test.
* gcc.target/riscv/rvv/autovec/max-vect-2.c: New test.

7 days agoRISC-V: Add more mode_idx attributes [PR123022].
Robin Dapp [Mon, 8 Dec 2025 09:22:51 +0000 (10:22 +0100)] 
RISC-V: Add more mode_idx attributes [PR123022].

Similar to 116149 we use the mode size of operand MODE_IDX but that
one could refer to a broadcast scalar.  Use operand 3 for scalar
broadcast patterns instead.

PR target/123022

gcc/ChangeLog:

* config/riscv/vector.md: Add mode_idx attribute.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/pr123022-2.c: New test.
* gcc.target/riscv/rvv/autovec/pr123022.c: New test.

7 days agoRISC-V: Pragma target [PR115325].
Robin Dapp [Fri, 5 Dec 2025 09:55:18 +0000 (10:55 +0100)] 
RISC-V: Pragma target [PR115325].

This implements #pragma GCC target () for riscv.

All the functionality was already there so we only need to wrap existing
functions.

PR target/115325

gcc/ChangeLog:

* config/riscv/riscv-c.cc (riscv_pragma_target_parse): New
function.
(riscv_register_pragmas): Register riscv_pragma_target_parse.
* config/riscv/riscv-protos.h (riscv_process_target_attr_for_pragma):
Declare.
(riscv_reset_previous_fndecl): Ditto.
* config/riscv/riscv-target-attr.cc (riscv_process_target_attr_for_pragma):
New function.
* config/riscv/riscv.cc (riscv_reset_previous_fndecl): Reset.
(riscv_option_save): New function.
(riscv_option_print): Ditto.
(riscv_get_interrupt_type): Adjust docs.
(TARGET_OPTION_SAVE): Implement.
(TARGET_OPTION_PRINT): Ditto.
* doc/extend.texi: Document that riscv can do target pragams.

gcc/testsuite/ChangeLog:

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

7 days agoRISC-V: Implement mask reduction.
Robin Dapp [Mon, 20 Oct 2025 08:47:45 +0000 (10:47 +0200)] 
RISC-V: Implement mask reduction.

This implements mask reductions by first counting the bits in the mask
(vcpop.m) and then comparing the resulting scalar against 0 or len.

gcc/ChangeLog:

* config/riscv/autovec.md (reduc_sbool_and_scal_<mode>): New
expander.
(reduc_sbool_ior_scal_<mode>): Ditto.
(reduc_sbool_xor_scal_<mode>): Ditto.
* config/riscv/riscv-protos.h (expand_mask_reduction): Declare.
* config/riscv/riscv-v.cc (expand_mask_reduction): New function.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-1-run.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-1.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-2-run.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-2.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-3-run.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-3.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-4-run.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-4.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-5-run.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-5.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-6-run.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-6.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-7-run.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-7.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-8-run.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-8.c: New test.

7 days agotarget/123027 - handle min/max expansion when -ffinite-math-only
Richard Biener [Mon, 8 Dec 2025 09:14:19 +0000 (10:14 +0100)] 
target/123027 - handle min/max expansion when -ffinite-math-only

When we get a <= b ? b : a into ix86_expand_sse_fp_minmax we can
swap and invert this with -ffinite-math-only to get a < b ? a : b.

PR target/123027
* config/i386/i386-expand.cc (ix86_expand_sse_fp_minmax):
With !HONOR_NANS we can handle LE by swapping and inverting.

* gcc.target/i386/pr123027.c: New testcase.
* gcc.dg/torture/pr123027.c: Likewise.

7 days agoc++: Non-inline temploid friends should still be COMDAT [PR122819]
Nathaniel Shead [Sun, 7 Dec 2025 12:17:15 +0000 (23:17 +1100)] 
c++: Non-inline temploid friends should still be COMDAT [PR122819]

Modules allow temploid friends to no longer be implicitly inline, as
functions defined in a class body will not be implicitly inline if
attached to a named module.

This requires us to clean up linkage handling a little bit, mostly by
replacing usages of 'DECL_TEMPLATE_INSTANTIATION' with
'DECL_TEMPLOID_INSTANTIATION' when determining if an entity has vague
linkage.

PR c++/122819

gcc/cp/ChangeLog:

* decl.cc (start_preparsed_function): Use
DECL_TEMPLOID_INSTANTIATION instead of
DECL_TEMPLATE_INSTANTIATION to check vague linkage.
* decl2.cc (vague_linkage_p): Likewise.
(c_parse_final_cleanups): Simplify condition.
* semantics.cc (expand_or_defer_fn_1): Also check for temploid
friend functions.

gcc/testsuite/ChangeLog:

* g++.dg/modules/tpl-friend-22.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
7 days agoDaily bump.
GCC Administrator [Tue, 9 Dec 2025 00:16:30 +0000 (00:16 +0000)] 
Daily bump.

7 days agofinal_cleanup: Call make_forwarders_with_degenerate_phis [PR46555]
Andrew Pinski [Sat, 6 Dec 2025 09:11:29 +0000 (01:11 -0800)] 
final_cleanup: Call make_forwarders_with_degenerate_phis [PR46555]

This fixes a regression introduced with r16-5258-g1d8e2d51e5c5cb.
With GCC 12+, we would not merge forwarders (with phis, vops included),
this meant that after the last cddce, degenerate phis would stay not
merged which allowed for better expansion. Now after my patch, the forwarder
block would be removed and get worse expansion. This fixes the problem
by creating the forwarder blocks in "optimized" and no other cleanupcfg
is called afterwards.

Oh this also fixes the problem at -O1 which was missed because the agressive
version of dce was not done at -O1.

Bootstrapped and tested on x86_64-linux-gnu.

PR tree-optimization/46555
gcc/ChangeLog:

* tree-cfgcleanup.cc (execute_cleanup_cfg_post_optimizing):
Don't set todo to include cleanupcfg; do it manually.
Call make_forwarders_with_degenerate_phis if optimizing.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/pr46555.c: New test.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
7 days agocfg: add debug dump to make_forwarders_with_degenerate_phis.
Andrew Pinski [Sat, 6 Dec 2025 09:10:07 +0000 (01:10 -0800)] 
cfg: add debug dump to make_forwarders_with_degenerate_phis.

To understand what this function does, add a debug dump.

Bootstrapped and tested on x86_64-linux-gnu.

gcc/ChangeLog:

* tree-cfg.cc (make_forwarders_with_degenerate_phis): Add debug
dump.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
7 days agocfg: Move make_forwarders_with_degenerate_phis to tree-cfg
Andrew Pinski [Sat, 6 Dec 2025 09:05:47 +0000 (01:05 -0800)] 
cfg: Move make_forwarders_with_degenerate_phis to tree-cfg

This moves make_forwarders_with_degenerate_phis to tree-cfg.cc
from tree-ssa-dce.cc to be able to use in a different pass.

Bootstrapped and tested on x86_64-linux-gnu.

gcc/ChangeLog:

* tree-ssa-dce.cc (sort_phi_args): Move to tree-cfg.cc.
(make_forwarders_with_degenerate_phis): Move to tree-cfg.cc.
(perform_tree_ssa_dce): Update for the updated return type
of make_forwarders_with_degenerate_phis.
* tree-cfg.cc (sort_phi_args): Moved from tree-ssa-dce.cc.
(make_forwarders_with_degenerate_phis): Moved from tree-ssa-dce.cc.
Update return type to bool and return true if an edge was split.
* tree-cfg.h (make_forwarders_with_degenerate_phis): New decl.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
7 days agoAda: Add missing #include for MinGW
Eric Botcazou [Mon, 8 Dec 2025 21:34:20 +0000 (22:34 +0100)] 
Ada: Add missing #include for MinGW

This adds a missing #include for <stdlib.h> and removes redundant ones.

gcc/ada/
PR ada/123037
* rtinit.c [__MINGW32__]: Include <stdlib.h> and not <windows.h>.
* rtfinal.c [__MINGW32__]: Do not include <windows.h>.

8 days agoFortran: [PR123025] Catch Old-style character declarations.
Harald Anlauf [Mon, 8 Dec 2025 19:48:29 +0000 (11:48 -0800)] 
Fortran: [PR123025] Catch Old-style character declarations.

Before this patch we missed the two cases here:

character*5 string5         ! Gives obsolescent message
character*(5) string5const  ! Silent with constant
character*(2+3) string5expr ! Silent with expression

PR fortran/123025

gcc/fortran/ChangeLog:

* decl.cc (match_char_length): Add a check for the
obsolete '*' style of character declarations in the
alternate branch of checking so we dont miss two
use cases:

gcc/testsuite/ChangeLog:

* gfortran.dg/assumed_charlen_dummy.f90: These tests failed
with the change because of the default -pedantic option
used by the dg.exp mechanisms. Overide this default.
* gfortran.dg/automatic_char_len_1.f90: Ditto.
* gfortran.dg/entry_23.f: Ditto.
* gfortran.dg/finalize_59.f90: Dito.
* gfortran.dg/g77/f90-intrinsic-bit.f: Ditto.
* gfortran.dg/g77/f90-intrinsic-mathematical.f: Ditto.
* gfortran.dg/g77/f90-intrinsic-numeric.f: Ditto.
* gfortran.dg/g77/intrinsic-unix-bessel.f: Ditto.
* gfortran.dg/g77/intrinsic-unix-erf.f: Ditto.
* gfortran.dg/initialization_9.f90: Ditto.
* gfortran.dg/intrinsic_actual_4.f90: Ditto.
* gfortran.dg/namelist_assumed_char.f90: Ditto.
* gfortran.dg/pr15140.f90: Ditto.

Co-authored-by: Steven G. Kargl <kargl@gcc.gnu.org>
8 days agoc++: Document why TARGET_EXPR is not handled in tsubst_expr
Egas Ribeiro [Mon, 8 Dec 2025 18:04:42 +0000 (18:04 +0000)] 
c++: Document why TARGET_EXPR is not handled in tsubst_expr

TARGET_EXPR represents semantic temporary objects and is deliberately
not handled by tsubst routines, which expect syntactic templated trees.
Add a comment and gcc_unreachable to make this explicit.

gcc/cp/ChangeLog:

* pt.cc (tsubst_expr): Add TARGET_EXPR case with explanatory
comment and gcc_unreachable.

Signed-off-by: Egas Ribeiro <egas.g.ribeiro@tecnico.ulisboa.pt>
Reviewed-by: Patrick Palka <ppalka@redhat.com>
8 days agolibstdc++: Implement P2404R3 relaxations to comparable_with concepts [PR122946]
Jonathan Wakely [Thu, 4 Dec 2025 14:45:53 +0000 (14:45 +0000)] 
libstdc++: Implement P2404R3 relaxations to comparable_with concepts [PR122946]

This implements the C++23 proposal P2404R3 "Move-only types for
equality_comparable_with, totally_ordered_with, and
three_way_comparable_with". As agreed with the maintainers of libc++ and
MSVC STL, we treat this as a DR for C++20. It allows reasonable code to
compile which wasn't originally allowed in C++20, and only affects some
obscure subsumption cases for valid C++20 code.

libstdc++-v3/ChangeLog:

PR libstdc++/122946
* include/bits/version.def (concepts): Set value to 202207.
* include/bits/version.h: Regenerate.
* include/std/concepts (__comparison_common_type_with_impl)
(__comparison_common_type_with): New helper concepts.
(equality_comparable_with): Use __comparison_common_type_with.
* libsupc++/compare (three_way_comparable_with): Likewise.
(__glibcxx_want_concepts): Define to get __cpp_lib_concepts
here.
* testsuite/std/concepts/concepts.compare/move_only.cc: New
test.

Reviewed-by: Tomasz KamiƄski <tkaminsk@redhat.com>
8 days agolibstdc++: Extend __is_standard_integer to cover extended integer types
Jonathan Wakely [Fri, 5 Dec 2025 20:54:32 +0000 (20:54 +0000)] 
libstdc++: Extend __is_standard_integer to cover extended integer types

We have __is_signed_integer and __is_unsigned_integer traits which
should have been updated by r16-2190-g4faa42ac0dee2c when making
__int128 an extended integer type (for PR libstdc++/96710). Currently
they check whether the type is a signed integer type or an unsigned
integer type, or a cv-qualified version of one of those. This doesn't
match the standard's definition, which does not include cv-qualified
types. This change ensures that signed __int128 and unsigned __int128
are included in those traits in strict -std modes, and it removes the
use of remove_cv_t so that they are not true for cv-qualified types.
This makes the traits match the meaning of "signed integer type" and
"unsigned integer type" in the standard ([basic.fundamental]).

We also have an __is_standard_integer trait, which is true if either
__is_signed_integer or __is_unsigned_integer is true, but that's also
not a match for the definition in the standard. The definitions of
"signed integer type" and "unsigned integer type" include both standard
and extended integer types, so only saying "standard" in the trait name
is misleading (even before this change, because in non-strict -std modes
the __GLIBCXX_TYPE_INT_N_0 .. __GLIBCXX_TYPE_INT_N_3 types were always
included in the trait, and they aren't standard integer types).

This change renames __is_standard_integer to the more accurate
__is_signed_or_unsigned_integer. Because the set of signed and
unsigned integer types is the same as the set of standard and extended
integer types, the trait could instead have been renamed to
__is_standard_or_extended_integer. I think it's clearer and more
self-explanatory to avoid "standard and extended" and name it for the
signed and unsigned integer types.

N.B. we don't want to call it just __is_integer_type because the integer
types includes cv-qualified types and also bool and the character types
char, wchar_t, char16_t etc.

The consequences of redefining and renaming these traits are small, and
only positive.

Apart from the uses in the __is_standard_integer trait, the only other
uses of __is_signed_integer and __is_unsigned_integer are in <format>
and those uses are unaffected by this change to add 128-bit integers to
the traits. In both uses the type argument is already cv-unqualified,
and there is already explicit handling for 128-bit integers where that
is required.

The existing uses of __is_standard_integer can simply be changed to use
the new name. This does change the behaviour of those uses of the trait,
because the __is_signed_or_unsigned_integer trait now includes
128-bit integers in strict modes. However, that is a desirable change
that fixes some bugs. Specifically, the [utility.intcmp] functions such
as std::cmp_less and the [numeric.sat.arith] functions such as
std::add_sat did not support 128-bit integers in strict modes. Since the
standard says they should be enabled for all signed and unsigned integer
types (or equivalently, for all standard and extended integer types),
those functions should all support __int128 and unsigned __int128. That
is fixed by this change.  Additionally, the same changes in <charconv>,
<mdspan>, and <stdckdint.h> enable the use of 128-bit integers for those
APIs in strict modes.

Finally, this also make a drive-by fix to the enable_if constraints for
the integer overloads of std::from_chars. That used remove_cv_t and so
enabled the overload for lvalue arguments of type const char, which
won't work and should not be enabled.

libstdc++-v3/ChangeLog:

* include/bits/intcmp.h: Replace all uses of
__is_standard_integer with __is_signed_or_unsigned_integer.
* include/bits/max_size_type.h: Fix outdated comment.
* include/bits/sat_arith.h: Replace all uses of
__is_standard_integer with __is_signed_or_unsigned_integer.
* include/c_compatibility/stdckdint.h: Replace all uses of the
__cv_unqual_signed_or_unsigned_integer_type concept with
__is_signed_or_unsigned_integer.
(__cv_unqual_signed_or_unsigned_integer_type): Remove.
* include/ext/numeric_traits.h: Fix outdated comment.
* include/std/charconv (from_chars): Replace use of
__is_standard_integer with __is_signed_or_unsigned_integer.
Do not enable for cv-qualified char.
* include/std/mdspan: Likewise.
* include/std/type_traits (__is_unsigned_integer): Include
unsigned __int128 in type list.
(__is_signed_integer): Include signed __int128 in type list.
(__is_standard_integer): Rename to ...
(__is_signed_or_unsigned_integer): ... this.
* testsuite/23_containers/mdspan/extents/ctor_ints.cc: Test
with 128-bit integers.
* testsuite/23_containers/mdspan/submdspan/strided_slice.cc:
Likewise.
* testsuite/20_util/integer_comparisons/extended.cc: New test.
* testsuite/26_numerics/saturation/extended.cc: New test.
* testsuite/26_numerics/stdckdint/extended.cc: New test.

Reviewed-by: Patrick Palka <ppalka@redhat.com>
8 days agoc++: Fix SFINAE for deleted explicit specializations [PR119343]
Egas Ribeiro [Sun, 7 Dec 2025 23:35:00 +0000 (23:35 +0000)] 
c++: Fix SFINAE for deleted explicit specializations [PR119343]

When checking a deleted explicit specialization in a SFINAE context,
we were incorrectly selecting a partial specialization because
resolve_nondeduced_context was calling mark_used.  But resolving an
overload to a single function (per DR 115) does not constitute ODR-use,
so mark_used shouldn't be called there.  Instead callers should call
mark_used or mark_single_function on the result to uniformly handle all
resolvable overloads (even non-template-id ones).

This turns out to fix the below testcase because it causes convert_to_void
for void(X::template g<0>) to properly propagate ODR-use failure (due to
deleted g<0>) and return error_mark_node instead of returning void_node.

PR c++/119343

gcc/cp/ChangeLog:

* pt.cc (resolve_nondeduced_context): Remove mark_used call.

gcc/testsuite/ChangeLog:

* g++.dg/template/sfinae-deleted-pr119343.C: New test.

Signed-off-by: Egas Ribeiro <egas.g.ribeiro@tecnico.ulisboa.pt>
Reviewed-by: Patrick Palka <ppalka@redhat.com>
8 days agocontrib: Set more site.exp variables in test_installed
Joseph Myers [Mon, 8 Dec 2025 17:02:22 +0000 (17:02 +0000)] 
contrib: Set more site.exp variables in test_installed

Add support in contrib/test_installed for more variables (via
associated command-line options to the script) that gcc/Makefile.in
can set:

* ALT_CC_UNDER_TEST, ALT_CXX_UNDER_TEST and COMPAT_OPTIONS are used in
  compat testing (against the same or a different compiler).

* The libiconv variable is used for testing iconv support for
  particular character sets, and defaults to -liconv if not set in
  site.exp, which is wrong on systems with iconv in libc; keep the
  default, but add an option to override this.

  Note that the dg-require-iconv testing is currently bogus in a cross
  environment, and this patch does nothing to address that.  The tests
  using dg-require-iconv actually care about character set support on
  the *host*, for character conversions carried out in the compiler,
  and the libiconv setting put in site.exp by gcc/Makefile.in is a
  *host* library setting.  But dg-require-iconv /
  check_iconv_available tests availability when compiling, linking and
  executing for the *target*.  If the host and target have close
  enough to the same OS, this may work by accident, but otherwise it
  will incorrectly enable / disable these tests based on target
  information (but using a libiconv setting designed for the host)
  when it should be based on host information.

* test_installed (--with-alt-cc=, --with-alt-cxx=)
(--with-compat-options=, --with-libiconv=): New options.

8 days agoMinGW: Fix native TLS bug with -fdata-sections
Eric Botcazou [Mon, 8 Dec 2025 16:47:56 +0000 (17:47 +0100)] 
MinGW: Fix native TLS bug with -fdata-sections

The problem comes from a quirk of the GNU PE-COFF linker, which wants
to make sure that .tls$ZZZ is laid out last among the TLS sections,
but first globs all .tls$* sections together.  The solution matches
Clang's output.

gcc/
PR target/80881
* config/mingw/winnt.cc (mingw_pe_unique_section): Put two dollar
signs for TLS sections after the prefix.
(mingw_pe_asm_named_section): Deal with all TLS sections uniformly.

gcc/testsuite/
* gcc.dg/tls/data-sections-1.c: New test.

8 days agoAdd ncm to MAINTAINERS
Nathan Myers [Mon, 8 Dec 2025 15:30:09 +0000 (10:30 -0500)] 
Add ncm to MAINTAINERS

gcc/Changelog:

* MAINTAINERS: add ncm

8 days agoaarch64: Add support for C1 cores
Ezra Sitorus [Mon, 8 Dec 2025 14:45:00 +0000 (14:45 +0000)] 
aarch64: Add support for C1 cores

Add support for C1-Nano, C1-Pro, C1-Premium and C1-Ultra.

gcc/ChangeLog:

* config/aarch64/aarch64-cores.def (AARCH64_CORE): Add C1-Nano,
C1-Pro, C1-Premium and C1-Ultra.
* config/aarch64/aarch64-tune.md: Regenerate.
* doc/invoke.texi: Document C1 cores.

8 days agotree-optimization/123040 - handle nary -> ifn simplification in VN
Richard Biener [Mon, 8 Dec 2025 10:06:54 +0000 (11:06 +0100)] 
tree-optimization/123040 - handle nary -> ifn simplification in VN

The following handles (by rejecting) simplifications that end up
turning a VN NARY operation into a call which would be a VN REFERENCE
and is unexpected and not handled.

PR tree-optimization/123040
* tree-ssa-sccvn.cc (vn_nary_build_or_lookup_1): Only insert
nary results.

* g++.dg/torture/pr123040.C: New testcase.

8 days agolibstdc++: Refactor _Variadic_union so _Unitialized<T, false> is not needed [PR112591].
Tomasz KamiƄski [Mon, 8 Dec 2025 07:49:45 +0000 (08:49 +0100)] 
libstdc++: Refactor _Variadic_union so _Unitialized<T, false> is not needed [PR112591].

The changes the _Variadic_union implementation, in a way that the
_Unitialized<T, false> partial specialization for non-trivial types is not
necessary.

This is simply done by separating the specialization for __trivially_destructible
being true and false, and for the later defining an empty destructor (similarly
as it was done using concepts).

We also reduce the number of specialization of _Variadic_union, so specialization
(int, int) is reused by (string, int, int) and (int, int). This is done by
initialization __trivially_destructible with conjunction of
is_trivially_destructible_v for remaining components. This is only necessary
for non-trivial (false) specialization, as if both _First and _Rest... are
trivially destructible, then _Rest must also be.

The above change does not regress the fix r14-7259-g2d55d94e5df389 for
template depth, and both before and after the change template depth is 266.
I have added dg-options to the 87619.cc to catch future regressions.

This also add test for PR112591.

PR libstdc++/112591

libstdc++-v3/ChangeLog:

* include/std/variant (_Variadic_union): Separate specializations for
for union of only trivially destructible types (true as first template
argument). Unconditionally define destructor for _Variadic_union<false,
_First, _Rest...>.
* testsuite/20_util/variant/87619.cc: Add limit for the template depth.
* testsuite/20_util/variant/112591.cc: New test.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz KamiƄski <tkaminsk@redhat.com>
8 days agocontrib: Skip libstdc++ files in check_GNU_style.py
Jonathan Wakely [Thu, 4 Dec 2025 09:42:50 +0000 (09:42 +0000)] 
contrib: Skip libstdc++ files in check_GNU_style.py

The libstdc++ style is different from the rest of GCC, so do not apply
the checks to libstdc++ files in a patch.

contrib/ChangeLog:

* check_GNU_style_lib.py (check_GNU_style_file): Do not check
libstdc++ files.

Reviewed-by: Christophe Lyon <christophe.lyon@linaro.org>
8 days agoipa/122798: Adjust local and address_taken flags for callback clones.
Josef Melcr [Mon, 8 Dec 2025 08:21:38 +0000 (09:21 +0100)] 
ipa/122798: Adjust local and address_taken flags for callback clones.

Hi,
previously, clones of callback functions had their local flag set.
Because callback edges are direct rather than indirect, GCC falsely
assumes that their callsites are available and that it can change their
ABI, leading to segfaults.  This patch fixes that.  Additionally, this
patch fixes a check in redirect_callee for clearing the address_taken
flag.

PR ipa/122798

gcc/ChangeLog:

* cgraph.cc (cgraph_edge::redirect_callee): Use
iterate_referring instead of referred_to_p.
* cgraphclones.cc (set_new_clone_decl_and_node_flags): Set local
to true iff the node does not have its address taken.

Signed-off-by: Josef Melcr <josef.melcr@suse.com>
8 days agolibstdc++: Remove redundant diagnostic pragmas from <bits/iterator_concepts.h>
Jonathan Wakely [Fri, 5 Dec 2025 15:59:23 +0000 (15:59 +0000)] 
libstdc++: Remove redundant diagnostic pragmas from <bits/iterator_concepts.h>

Since r16-2190-g4faa42ac0dee2c this header no longer mentions __int128
explicitly, because it's just handled like other integer types now. So
we don't need the diagnostic pragmas to disables pedwarns for referring
to __int128.

libstdc++-v3/ChangeLog:

* include/bits/iterator_concepts.h: Remove diagnostic pragmas.

8 days agotree-optimization/123038 - FFS/CTZ pattern incompatible with reductions
Richard Biener [Sun, 7 Dec 2025 10:30:48 +0000 (11:30 +0100)] 
tree-optimization/123038 - FFS/CTZ pattern incompatible with reductions

The pattern ends up using the argument more than one time which
isn't supported.  When FFS directly maps to CTZ + 1 it works though.

PR tree-optimization/123038
* tree-vect-patterns.cc (vect_recog_ctz_ffs_pattern): Reject
pattern for reductions when the call argument is used multiple
times.

* gcc.dg/vect/pr123038.c: New testcase.

8 days agolibstdc++: Move std::cmp_equal, std::cmp_less etc. to new file
Jonathan Wakely [Fri, 5 Dec 2025 15:32:17 +0000 (15:32 +0000)] 
libstdc++: Move std::cmp_equal, std::cmp_less etc. to new file

This allows the [utility.intcmp] functions to be used without including
all of <utility>.

libstdc++-v3/ChangeLog:

* include/Makefile.am: Add new header.
* include/Makefile.in: Regenerate.
* include/std/latch: Include <bits/intcmp.h> instead of
<utility>.
* include/std/utility: Include <bits/intcmp.h>.
(cmp_equal, cmp_not_equal, cmp_less, cmp_greater)
(cmp_less_equal, cmp_greater_equal, in_range): Move to ...
* include/bits/intcmp.h: New file.

Reviewed-by: Tomasz KamiƄski <tkaminsk@redhat.com>
8 days agoAArch64: fix subregs in boolean reductions [PR123026]
Tamar Christina [Mon, 8 Dec 2025 09:12:01 +0000 (09:12 +0000)] 
AArch64: fix subregs in boolean reductions [PR123026]

The Adv. SIMD boolean reduction patterns were accidentally
overriding one of the input arguments.  This fixes it and
removes unneeded intermediate moves around the subreg type
castings.

gcc/ChangeLog:

PR target/123026
* config/aarch64/aarch64-simd.md (reduc_sbool_ior_scal_<mode>,
reduc_sbool_and_scal_<mode>): Fix tmp operands[1] override.

gcc/testsuite/ChangeLog:

PR target/123026
* gcc.target/aarch64/pr123026.c: New test.

8 days agovect: move the condition down into the loop checking every scalar load [PR122868]
Tamar Christina [Mon, 8 Dec 2025 09:10:58 +0000 (09:10 +0000)] 
vect: move the condition down into the loop checking every scalar load [PR122868]

As Richi suggested this moves the check into the loop so we check every load.

I had initially not done this because I figured the loads would be treated as a
group anyway and the group would be valid or not as a whole.  But for invariants
they could be a group, but not all the loads within range of a known bounds.

gcc/ChangeLog:

PR tree-optimization/122868
* tree-vect-stmts.cc (vectorizable_load): Move check for invariant loads
down into the loop.

8 days agox86: Compile avx2-vpcmpgtq-1.c with -fno-fuse-ops-with-volatile-access
H.J. Lu [Mon, 8 Dec 2025 05:32:55 +0000 (13:32 +0800)] 
x86: Compile avx2-vpcmpgtq-1.c with -fno-fuse-ops-with-volatile-access

When -march=cascadelake is added, we generate

vmovdqa x(%rip), %ymm0
vpcmpq $1, x(%rip), %ymm0, %k0
vpmovm2q %k0, %ymm0
vmovdqa %ymm0, x(%rip)

instead of

vmovdqa x(%rip), %ymm1
vmovdqa x(%rip), %ymm0
vpcmpgtq %ymm1, %ymm0, %ymm0
vmovdqa %ymm0, x(%rip)

Compile avx2-vpcmpgtq-1.c with -fno-fuse-ops-with-volatile-access to
generate vpcmpgtq instead of vpcmpq.

PR target/122343
* gcc.target/i386/avx2-vpcmpgtq-1.c: Compile with
-fno-fuse-ops-with-volatile-access.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
8 days agox86: Don't allow 2 volatile memory references
H.J. Lu [Mon, 8 Dec 2025 05:29:59 +0000 (13:29 +0800)] 
x86: Don't allow 2 volatile memory references

Don't allow 2 volatile memory references in *<avx512>_cmp<mode>3_dup_op
so that gcc.target/i386/avx2-vpcmpeqq-1.c will generate 2 loads when
-march=cascadelake is used.

PR target/122343
* config/i386/sse.md (*<avx512>_cmp<mode>3_dup_op): Don't allow
2 volatile memory references.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
8 days agoDaily bump.
GCC Administrator [Mon, 8 Dec 2025 00:16:25 +0000 (00:16 +0000)] 
Daily bump.

8 days agoAda: Fix wrong Accum_Type inferred for a reduction expression
Eric Botcazou [Sun, 7 Dec 2025 22:40:25 +0000 (23:40 +0100)] 
Ada: Fix wrong Accum_Type inferred for a reduction expression

This was reported as a regression in GCC 14: the compiler resolves
Accum_Type to Positive for a reduction expression whose "expected
subtype" is Positive, which means that 0 cannot be used as initial
value in the expression:

  Sum : Positive := V'Reduce ("+", 0);

without always raising Constraint_Error as run time.  That's not the
intent according to T. Taft in
  https://forum.ada-lang.io/t/regression-in-gnat-14/890
so this changes the resolution to use the base type (Integer) instead.

gcc/ada/
PR ada/115349
* sem_attr.adb (Resolve_Attribute) <Attribute_Reduce>: Use the base
type as Accum_Type if the reducer is an operator from Standard and
the type is numeric.  Use the type of the first operand for other
operators.  Streamline the error message given for limited types.

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

9 days agoanalyzer: remove duplicated registration of builtins
David Malcolm [Sun, 7 Dec 2025 15:15:34 +0000 (10:15 -0500)] 
analyzer: remove duplicated registration of builtins

gcc/analyzer/ChangeLog:
* kf.cc (register_known_functions): Remove duplicate calls to
register_atomic_builtins and register_varargs_builtins.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
9 days agolibcpp: adjust _cpp_file accessors
Jason Merrill [Sun, 7 Dec 2025 07:34:15 +0000 (15:34 +0800)] 
libcpp: adjust _cpp_file accessors

Back in r78875 mrs added cpp_get_path/dir accessors for _cpp_file in order
to interface with the darwin framework system.  But now I notice that the
latter duplicates the better-named _cpp_get_file_dir, and I'm inclined to
rename the former to match.

Perhaps we should drop the initial underscore since these are no
longer internal interfaces; OTOH, _cpp_hashnode_value and
_cpp_backup_tokens still have the initial underscore in cpplib.h.

libcpp/ChangeLog:

* include/cpplib.h (cpp_get_path, cpp_get_dir): Remove.
(_cpp_get_file_path, _cpp_get_file_name, _cpp_get_file_stat)
(_cpp_get_file_dir): Move prototypes from...
* internal.h: ...here.
* files.cc (_cpp_get_file_path): Rename from...
(cpp_get_path): ...this.
(cpp_get_dir): Remove.

gcc/ChangeLog:

* config/darwin-c.cc (find_subframework_header): Use
_cpp_get_file_*.

9 days agoAdd -ffuse-ops-with-volatile-access
H.J. Lu [Fri, 24 Oct 2025 01:00:59 +0000 (09:00 +0800)] 
Add -ffuse-ops-with-volatile-access

Volatile memory can be used as source operand for any operations.  Add
-ffuse-ops-with-volatile-access to fuse operations with volatile memory
reference and update simplify_binary_operation_1 to keep PLUS for 2
volatile memory references.  On x86, this optimizes

extern volatile int bar;

int
foo (int z)
{
  z *= 123;
  return bar + z;
}

into

foo:
imull $123, %edi, %eax
addl bar(%rip), %eax
ret

and compile

extern volatile unsigned char u8;

void
test (void)
{
  u8 = u8 + u8;
  u8 = u8 - u8;
}

into

test:
movzbl u8(%rip), %eax
addb %al, u8(%rip)
movzbl u8(%rip), %eax
subb u8(%rip), %al
movb %al, u8(%rip)
ret

Tested with Linux kernel 6.17.9 on Intel Core i7-1195G7.

gcc/

PR target/122343
* common.opt: Add -ffuse-ops-with-volatile-access.
* common.opt.urls: Regenerated.
* recog.cc (general_operand): Allow volatile memory reference if
-ffuse-ops-with-volatile-access is enabled.
* simplify-rtx.cc (simplify_binary_operation_1): Keep PLUS for 2
volatile memory references.
* doc/invoke.texi: Document -ffuse-ops-with-volatile-access.

gcc/testsuite/

PR target/122343
* gcc.target/i386/20040112-1.c: Add -fomit-frame-pointer and use
check-function-bodies to check for loop.
* gcc.target/i386/avx-ne-convert-1.c: Compile with
-fno-fuse-ops-with-volatile-access.
* gcc.target/i386/avx10_2-bf16-1.c: Likewise.
* gcc.target/i386/avx10_2-convert-1.c: Likewise.
* gcc.target/i386/avx10_2-satcvt-1.c: Likewise.
* gcc.target/i386/avx512bf16-vcvtneps2bf16-1.c: Likewise.
* gcc.target/i386/avx512bf16vl-vcvtneps2bf16-1a.c: Likewise.
* gcc.target/i386/avx512bf16vl-vcvtneps2bf16-1b.c: Likewise.
* gcc.target/i386/avx512bitalg-vpshufbitqmb.c: Likewise.
* gcc.target/i386/avx512bw-vpcmpb-1.c: Likewise.
* gcc.target/i386/avx512bw-vpcmpub-1.c: Likewise.
* gcc.target/i386/avx512bw-vpcmpuw-1.c: Likewise.
* gcc.target/i386/avx512bw-vpcmpw-1.c: Likewise.
* gcc.target/i386/avx512dq-vcvtps2qq-1.c: Likewise.
* gcc.target/i386/avx512dq-vcvtps2uqq-1.c: Likewise.
* gcc.target/i386/avx512dq-vcvtqq2pd-1.c: Likewise.
* gcc.target/i386/avx512dq-vcvtqq2ps-1.c: Likewise.
* gcc.target/i386/avx512dq-vcvttps2qq-1.c: Likewise.
* gcc.target/i386/avx512dq-vcvttps2uqq-1.c: Likewise.
* gcc.target/i386/avx512dq-vcvtuqq2pd-1.c: Likewise.
* gcc.target/i386/avx512dq-vcvtuqq2ps-1.c: Likewise.
* gcc.target/i386/avx512dq-vextractf32x8-1.c: Likewise.
* gcc.target/i386/avx512dq-vextractf64x2-1.c: Likewise.
* gcc.target/i386/avx512dq-vextracti64x2-1.c: Likewise.
* gcc.target/i386/avx512dq-vfpclasspd-1.c: Likewise.
* gcc.target/i386/avx512dq-vfpclassps-1.c: Likewise.
* gcc.target/i386/avx512dq-vfpclasssd-1.c: Likewise.
* gcc.target/i386/avx512dq-vfpclassss-1.c: Likewise.
* gcc.target/i386/avx512dq-vpmullq-1.c: Likewise.
* gcc.target/i386/avx512dq-vpmullq-3.c: Likewise.
* gcc.target/i386/avx512f-pr100267-1.c: Likewise.
* gcc.target/i386/avx512f-vcmppd-1.c: Likewise.
* gcc.target/i386/avx512f-vcmpps-1.c: Likewise.
* gcc.target/i386/avx512f-vcvtps2pd-1.c: Likewise.
* gcc.target/i386/avx512f-vcvtsd2si-1.c: Likewise.
* gcc.target/i386/avx512f-vcvtsd2si64-1.c: Likewise.
* gcc.target/i386/avx512f-vcvtsd2usi-1.c: Likewise.
* gcc.target/i386/avx512f-vcvtsd2usi64-1.c: Likewise.
* gcc.target/i386/avx512f-vcvtsi2ss-1.c: Likewise.
* gcc.target/i386/avx512f-vcvtss2si-1.c: Likewise.
* gcc.target/i386/avx512f-vcvtss2si64-1.c: Likewise.
* gcc.target/i386/avx512f-vcvtss2usi-1.c: Likewise.
* gcc.target/i386/avx512f-vcvtss2usi64-1.c: Likewise.
* gcc.target/i386/avx512f-vcvttsd2si-1.c: Likewise.
* gcc.target/i386/avx512f-vcvttsd2si64-1.c: Likewise.
* gcc.target/i386/avx512f-vcvttsd2usi-1.c: Likewise.
* gcc.target/i386/avx512f-vcvttsd2usi64-1.c: Likewise.
* gcc.target/i386/avx512f-vcvttss2si-1.c: Likewise.
* gcc.target/i386/avx512f-vcvttss2si64-1.c: Likewise.
* gcc.target/i386/avx512f-vcvttss2usi-1.c: Likewise.
* gcc.target/i386/avx512f-vcvttss2usi64-1.c: Likewise.
* gcc.target/i386/avx512f-vextractf32x4-1.c: Likewise.
* gcc.target/i386/avx512f-vextractf64x4-1.c: Likewise.
* gcc.target/i386/avx512f-vextracti64x4-1.c: Likewise.
* gcc.target/i386/avx512f-vmovapd-1.c: Likewise.
* gcc.target/i386/avx512f-vmovaps-1.c: Likewise.
* gcc.target/i386/avx512f-vmovdqa64-1.c: Likewise.
* gcc.target/i386/avx512f-vpandnq-1.c: Likewise.
* gcc.target/i386/avx512f-vpbroadcastd-1.c: Likewise.
* gcc.target/i386/avx512f-vpbroadcastq-1.c: Likewise.
* gcc.target/i386/avx512f-vpcmpd-1.c: Likewise.
* gcc.target/i386/avx512f-vpcmpeqq-1.c: Likewise.
* gcc.target/i386/avx512f-vpcmpequq-1.c: Likewise.
* gcc.target/i386/avx512f-vpcmpged-1.c: Likewise.
* gcc.target/i386/avx512f-vpcmpgeq-1.c: Likewise.
* gcc.target/i386/avx512f-vpcmpgeud-1.c: Likewise.
* gcc.target/i386/avx512f-vpcmpgeuq-1.c: Likewise.
* gcc.target/i386/avx512f-vpcmpled-1.c: Likewise.
* gcc.target/i386/avx512f-vpcmpleq-1.c: Likewise.
* gcc.target/i386/avx512f-vpcmpleud-1.c: Likewise.
* gcc.target/i386/avx512f-vpcmpleuq-1.c: Likewise.
* gcc.target/i386/avx512f-vpcmpltd-1.c: Likewise.
* gcc.target/i386/avx512f-vpcmpltq-1.c: Likewise.
* gcc.target/i386/avx512f-vpcmpltud-1.c: Likewise.
* gcc.target/i386/avx512f-vpcmpltuq-1.c: Likewise.
* gcc.target/i386/avx512f-vpcmpneqd-1.c: Likewise.
* gcc.target/i386/avx512f-vpcmpneqq-1.c: Likewise.
* gcc.target/i386/avx512f-vpcmpnequd-1.c: Likewise.
* gcc.target/i386/avx512f-vpcmpnequq-1.c: Likewise.
* gcc.target/i386/avx512f-vpcmpq-1.c: Likewise.
* gcc.target/i386/avx512f-vpcmpud-1.c: Likewise.
* gcc.target/i386/avx512f-vpcmpuq-1.c: Likewise.
* gcc.target/i386/avx512f-vrndscalepd-1.c: Likewise.
* gcc.target/i386/avx512f-vrndscaleps-1.c: Likewise.
* gcc.target/i386/avx512fp16-complex-fma.c: Likewise.
* gcc.target/i386/avx512fp16-vaddph-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vcvtpd2ph-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vcvtph2dq-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vcvtph2pd-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vcvtph2psx-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vcvtph2qq-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vcvtph2udq-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vcvtph2uqq-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vcvtph2uw-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vcvtph2w-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vcvtps2ph-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vcvtqq2ph-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vcvttph2dq-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vcvttph2qq-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vcvttph2udq-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vcvttph2uqq-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vcvttph2uw-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vcvttph2w-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vcvtuqq2ph-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vfcmaddcph-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vfcmulcph-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vfmaddcph-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vfmulcph-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vfpclassph-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vfpclasssh-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vmulph-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vrcpph-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vrsqrtph-1a.c: Likewise.
* gcc.target/i386/avx512fp16-vsqrtph-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-vaddph-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-vcvtpd2ph-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-vcvtph2dq-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-vcvtph2psx-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-vcvtph2qq-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-vcvtph2udq-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-vcvtph2uqq-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-vcvtph2uw-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-vcvtph2w-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-vcvtps2ph-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-vcvtqq2ph-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-vcvttph2dq-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-vcvttph2udq-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-vcvttph2uw-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-vcvttph2w-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-vcvtuqq2ph-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-vfcmaddcph-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-vfcmulcph-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-vfmaddcph-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-vfmulcph-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-vfpclassph-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-vmulph-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-vrcpph-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-vrsqrtph-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-vsqrtph-1a.c: Likewise.
* gcc.target/i386/avx512vl-pr100267-1.c: Likewise.
* gcc.target/i386/avx512vl-vcmppd-1.c: Likewise.
* gcc.target/i386/avx512vl-vcmpps-1.c: Likewise.
* gcc.target/i386/avx512vl-vcvtpd2ps-1.c: Likewise.
* gcc.target/i386/avx512vl-vcvtpd2udq-1.c: Likewise.
* gcc.target/i386/avx512vl-vcvttpd2udq-1.c: Likewise.
* gcc.target/i386/avx512vl-vcvttps2udq-1.c: Likewise.
* gcc.target/i386/avx512vl-vextractf32x4-1.c: Likewise.
* gcc.target/i386/avx512vl-vmovapd-1.c: Likewise.
* gcc.target/i386/avx512vl-vmovaps-1.c: Likewise.
* gcc.target/i386/avx512vl-vmovdqa64-1.c: Likewise.
* gcc.target/i386/avx512vl-vpcmpd-1.c: Likewise.
* gcc.target/i386/avx512vl-vpcmpeqq-1.c: Likewise.
* gcc.target/i386/avx512vl-vpcmpequq-1.c: Likewise.
* gcc.target/i386/avx512vl-vpcmpq-1.c: Likewise.
* gcc.target/i386/avx512vl-vpcmpud-1.c: Likewise.
* gcc.target/i386/avx512vl-vpcmpuq-1.c: Likewise.
* gcc.target/i386/pr122343-1a.c: New test.
* gcc.target/i386/pr122343-1b.c: Likewise.
* gcc.target/i386/pr122343-2a.c: Likewise.
* gcc.target/i386/pr122343-2b.c: Likewise.
* gcc.target/i386/pr122343-3.c: Likewise.
* gcc.target/i386/pr122343-4a.c: Likewise.
* gcc.target/i386/pr122343-4b.c: Likewise.
* gcc.target/i386/pr122343-5a.c: Likewise.
* gcc.target/i386/pr122343-5b.c: Likewise.
* gcc.target/i386/pr122343-6a.c: Likewise.
* gcc.target/i386/pr122343-6b.c: Likewise.
* gcc.target/i386/pr122343-7.c: Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
9 days agocselib: dump_cselib_* fixes
Alexandre Oliva [Sun, 7 Dec 2025 01:08:04 +0000 (22:08 -0300)] 
cselib: dump_cselib_* fixes

Rework dump_cselib_table to not crash when cselib_preserved_hash_table
is not allocated, and to remove the extraneous indirection from
dump_cselib_val that made it inconvenient to call from a debugger.

for  gcc/ChangeLog

* cselib.cc (dump_cselib_val): Split out of and rename to...
(dump_cselib_val_ptr): ... this.
(dump_cselib_table): Adjust.  Skip cselib_preserved_hash_table
when not allocated.

9 days agoDaily bump.
GCC Administrator [Sun, 7 Dec 2025 00:16:26 +0000 (00:16 +0000)] 
Daily bump.

9 days agoadd fusage for non-ACCUMULATE_OUTGOING_ARGS calls [PR122947]
Alexandre Oliva [Sat, 6 Dec 2025 23:11:46 +0000 (20:11 -0300)] 
add fusage for non-ACCUMULATE_OUTGOING_ARGS calls [PR122947]

Since we may delete stores that are found to be redundant in
postreload cse, we need cselib to invalidate argument stores at calls,
and to that end we need CALL_INSN_FUNCTION_USAGE to mention all MEM
stack space that may be legitimately modified by a const/pure callee,
i.e., all arguments passed to it on the stack.

When ACCUMULATE_OUTGOING_ARGS, each on-stack argument gets its own
usage information, but when it's not, each argument is pushed
incrementally, without precomputed stack slots.

Since we only mentioned such precomputed stack slots in
CALL_INSN_FUNCTION_USAGE, non-ACCUMULATE_OUTGOING_ARGS configurations
miss the stack usage data, and cselib fails to invalidate the stores.

Stores in such slots are anonymous, and they often invalidate other
anonymous slots, even part of the same object, but as the testcase
demonstrates, we may occasionally be unlucky that consecutive calls
have the stores to multi-word objects reordered by scheduling in such
a way that the last store for the first call survives the call in the
cselib tables, and then it is found to be redundant with the first
store for the subsequent call, as in the testcase.

So, if we haven't preallocated outgoing arguments for a call (which
would give us preassigned stack slots), and we have used any stack
space, add function call usage covering the entire stack range where
arguments were stored.

for  gcc/ChangeLog

PR rtl-optimization/122947
* calls.cc (expand_call): Add stack function usage in
non-ACCUMULATE_OUTGOING_ARGS configurations.

for  gcc/testsuite/ChangeLog

PR rtl-optimization/122947
* gcc.dg/pr122947.c: New.

9 days ago[riscv] avoid auipc overflow with large offsets [PR91420]
Alexandre Oliva [Sat, 6 Dec 2025 23:11:42 +0000 (20:11 -0300)] 
[riscv] avoid auipc overflow with large offsets [PR91420]

When computing an address plus a large offset on riscv64 with a
PC-relative sequence, we may hit the range limit for auipc and get a
relocation overflow, where on riscv32 the computation wraps around.

Since -mcmodel=medany requires the entire program to fit in a 2GiB
address range, a +/-1GiB+ offset added to an in-range symbol in a
barely-fitting program is more likely than not to be out-of-range.
Since such large constants are unlikely to come up by chance, separate
them from the symbol so as to avoid the relocation overflow.

for  gcc/ChangeLog

PR target/91420
* config/riscv/riscv.cc (riscv_symbolic_constant_p): Require
offsets smaller than +/- 1GiB for PCREL symbols.

for  gcc/testsuite/ChangeLog

PR target/91420
* gcc.target/riscv/pr91420.c: New.

10 days agoAda: Fix spurious warning if the reducer subprogram is a procedure
Denis Mazzucato [Sat, 6 Dec 2025 18:13:26 +0000 (19:13 +0100)] 
Ada: Fix spurious warning if the reducer subprogram is a procedure

If the reducer is a function and the accumulator type isn't constrained,
at runtime the reduction will likely raise a Constraint_Error since the
reducer is repeatedly assigned to the accumulator variable (likely changing
its length). However, if the reducer is a procedure, no such assignment
occurs, and thus the runtime error only depends on the reducer logic.
This patch prevents the spurious warning in that case.

gcc/ada/
* sem_attr.adb (Resolve_Attribute): Check if the reducer is a
procedure before giving the warning.

10 days agoAdjust expected output of new risc-v test
Jeff Law [Sat, 6 Dec 2025 16:01:11 +0000 (09:01 -0700)] 
Adjust expected output of new risc-v test

Just a minor update to Dimitar's patch for the RISC-V testcase.

The cfi directives are not emitted for the -elf configurations causing the new
test to fail.  The cfi directives (and associated labels) don't seem relevant
to the test at hand, so this just drops them.

Pushing to the trunk.

PR rtl-optimization/122675

gcc/testsuite
* gcc.target/riscv/pr122675-1.c: Adjust expected output.

10 days agoFortran: [PDT] Verify problems with error recovery have gone [PR103414]
Paul Thomas [Sat, 6 Dec 2025 12:58:30 +0000 (12:58 +0000)] 
Fortran: [PDT] Verify problems with error recovery have gone [PR103414]

2025-12-06  Paul Thomas  <pault@gcc.gnu.org>

gcc/testsuite
PR fortran/103414
* gfortran.dg/pdt_76.f03: New test.

10 days agolibstdc++: add more #if to std.cc
Jason Merrill [Sat, 6 Dec 2025 10:31:44 +0000 (18:31 +0800)] 
libstdc++: add more #if to std.cc

compile-std1.C was breaking on arm-eabi because these interfaces aren't
declared.  So for exporting let's check the same macros that control
declaring them.

libstdc++-v3/ChangeLog:

* src/c++23/std.cc.in: Add more #if.

10 days agoattribs: Use attribute_value_equal in decl_attributes
Jakub Jelinek [Sat, 6 Dec 2025 10:08:05 +0000 (11:08 +0100)] 
attribs: Use attribute_value_equal in decl_attributes

This is another thing discussed in the 1/9 Reflection thread,
also not dependent on reflection.

decl_attributes calls simple_cst_equal on TREE_VALUEs of the
current and preexisting attributes, but that is just a small
part of how attribute values should be compared.

The following patch fixes that.

2025-12-06  Jakub Jelinek  <jakub@redhat.com>

* attribs.cc (decl_attributes): Use attribute_value_equal to
compare attribute values instead of simple_cst_equal.

10 days agoc++: is_late_template_attribute and tsubst_attribute fixes
Jakub Jelinek [Sat, 6 Dec 2025 10:07:18 +0000 (11:07 +0100)] 
c++: is_late_template_attribute and tsubst_attribute fixes

This has been discussed in the 1/9 Reflection thread, but doesn't depend on
reglection in any way.
cp_parser_std_attribute calls lookup_attribute_spec as:
    const attribute_spec *as
      = lookup_attribute_spec (TREE_PURPOSE (attribute));
so with TREE_LIST where TREE_VALUE is attribute name and TREE_PURPOSE
attribute ns.  Similarly c_parser_std_attribute.  And for
attribute_takes_identifier_p those do:
    else if (attr_ns == gnu_identifier
             && attribute_takes_identifier_p (attr_id))
and
        bool takes_identifier
          = (ns != NULL_TREE
             && strcmp (IDENTIFIER_POINTER (ns), "gnu") == 0
             && attribute_takes_identifier_p (name));
when handling std attributes (for GNU attributes they just call those
with the IDENTIFIER_NODE name.
is_late_template_attribute and tsubst_attribute pass to these functions
just get_attribute_name though, so handle attributes in all namespaces
as GNU attributes only, which means that lookup_attribute_spec can
return NULL or find a different attribute if it is not from gnu:: or
say standard attribute mapped to gnu::, or attribute_takes_identifier_p
can return true even for attributes for which it shouldn't.

I thought about changing attribute_takes_identifier_p to take optionally
TREE_LIST, but that would mean handling it in the target hooks too and
they only care about GNU attributes right now, so given the above
parser.cc/c-parser.cc snippets, the following patch just follow
what they do.

2025-12-06  Jakub Jelinek  <jakub@redhat.com>

* decl2.cc (is_late_template_attribute): Call lookup_attribute_spec
on TREE_PURPOSE (attr) rather than name.  Only call
attribute_takes_identifier_p if get_attribute_namespace (attr) is
gnu_identifier.
* pt.cc (tsubst_attribute): Only call attribute_takes_identifier_p
if get_attribute_namespace (t) is gnu_identifier.

10 days agoFortran: [PDT] Failure with local allocatable PDT array [PR122693]
Paul Thomas [Sat, 6 Dec 2025 08:05:41 +0000 (08:05 +0000)] 
Fortran:  [PDT] Failure with local allocatable PDT array [PR122693]

2025-12-06  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/122693
* array.cc (gfc_match_array_constructor): Stash and restore
gfc_current_ns after the call to 'gfc_match_type_spec'.

gcc/testsuite
PR fortran/122693
* gfortran.dg/pdt_75.f03: New test.

10 days agoFortran: [PDT] Mismatched types with same name in assignment [PR122670]
Paul Thomas [Sat, 6 Dec 2025 08:00:21 +0000 (08:00 +0000)] 
Fortran: [PDT] Mismatched types with same name in assignment [PR122670]

2025-12-06  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/122670
* decl.cc (gfc_get_pdt_instance): Ensure that, in an interface
body, PDT instances imported implicitly if the template has
been explicitly imported.
* module.cc (read_module): If a PDT template appears in a use
only statement, implicitly add the instances as well.

gcc/testsuite
PR fortran/122670
* gfortran.dg/pdt_74.f03: New test.

10 days agoFortran: ALLOCATE with array-valued MOLD expression fails [PR122669]
Paul Thomas [Sat, 6 Dec 2025 07:54:39 +0000 (07:54 +0000)] 
Fortran: ALLOCATE with array-valued MOLD expression fails [PR122669]

2025-12-06  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/122669
* resolve.cc (resolve_allocate_deallocate): Mold expressions
with an array reference and a constant size must be resolved
for each allocate object.

gcc/testsuite
PR fortran/122669
* gfortran.dg/pdt_73.f03: New test.

10 days agoFortran: [PDT] Unresolved component and generic binding [PR122578]
Paul Thomas [Sat, 6 Dec 2025 07:51:21 +0000 (07:51 +0000)] 
Fortran: [PDT] Unresolved component and generic binding [PR122578]

2025-12-06  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/122578
* primary.cc (gfc_match_varspec): Try to resolve a typebound
generic procedure selector expression to provide the associate
name with a type. Also, resolve component calls. In both cases,
make a copy of the selector expression to guard against changes
made by gfc_resolve_expr.

gcc/testsuite
PR fortran/122578
* gfortran.dg/pdt_72.f03: New test.

10 days ago[PATCH] prepare-commit-msg: Add compatibility check for --default-prefix option
Mark Zhuang [Sat, 6 Dec 2025 05:16:25 +0000 (22:16 -0700)] 
[PATCH] prepare-commit-msg: Add compatibility check for --default-prefix option

From: Mark Zhuang <mark.zhuang@spacemit.com>

The previous commit added --default-prefix to handle non-default git
prefix configurations, but this option is not available in older git
versions. This patch adds a compatibility check.

contrib/ChangeLog:

* prepare-commit-msg: check --default-prefix

10 days ago[PATCH v3] rtl-optimization: Fix BB edge ordering [PR122675]
Dimitar Dimitrov [Sat, 6 Dec 2025 04:57:58 +0000 (21:57 -0700)] 
[PATCH v3] rtl-optimization: Fix BB edge ordering [PR122675]

Starting with r16-4438-ga93f80feeef744, the edge sorting order was
switched to lowest execution frequency first.  But the "bbro"
optimization pass chooses the first edge as a fallthrough.  Thus the
most unlikely branches were optimized to fallthroughs.

Fix by restoring the sorting order prior to r16-4438-ga93f80feeef744.
Now the branches most likely to be executed are picked as fallthroughs.

There are no regressions for C and C++ on x86_64-pc-linux-gnu.

The new tests fail for the respective targets without this patch, and
pass with it.

PR rtl-optimization/122675

gcc/ChangeLog:

* bb-reorder.cc (edge_order): Fix BB edge ordering to be
descending.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/pr122675-1.c: New test.
* gcc.target/i386/pr122675-1.c: New test.
* gcc.target/riscv/pr122675-1.c: New test.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
10 days agolibstdc++: Use deducing this in std::bind when available [PR80564]
Patrick Palka [Sat, 6 Dec 2025 02:09:34 +0000 (21:09 -0500)] 
libstdc++: Use deducing this in std::bind when available [PR80564]

Implement the forwarding performed by std::bind via deducing this when
available, instead of needing 4 operator() overloads.  Using deducing
this here is more complicated than in other standard call wrappers
because std::bind is not really "perfect forwarding": it doesn't
consider value category, and along with const-ness it also forwards
volatile-ness (until C++20).

The old implementation suffers from the same problem that other
pre-C++23 SFINAE-friendly call wrappers have which is solved by using
deducing this (see p5.5 of the deducing this paper P0847R7).

PR libstdc++/80564

libstdc++-v3/ChangeLog:

* include/std/functional (__cv_like): New.
(_Bind::_Res_type): Don't define when not needed.
(_Bind::__dependent): Likewise.
(_Bind::_Res_type_cv): Likewise.
(_Bind::operator()) [_GLIBCXX_EXPLICIT_THIS_PARAMETER]:
Define as two instead of four overloads using deducing
this.
* testsuite/20_util/bind/cv_quals_2.cc: Ignore SFINAE
diagnostics inside headers.
* testsuite/20_util/bind/ref_neg.cc: Likewise.
* testsuite/20_util/bind/80564.cc: New test.

Reviewed-by: Tomasz KamiƄski <tkaminsk@redhat.com>
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
10 days agoa68: handle intTI_type_node in a68_type_for_size
Jose E. Marchesi [Sat, 6 Dec 2025 01:47:37 +0000 (02:47 +0100)] 
a68: handle intTI_type_node in a68_type_for_size

gcc/algol68/ChangeLog

PR algol68/123007
* a68-lang.cc (a68_type_for_size): Handle intTI_type_node.